[ARM][gas] Use as_tsktsk instead of as_warn for deprecation messages.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
dddcc5b9
AM
12015-02-09 Alan Modra <amodra@gmail.com>
2
3 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
4 plugin_test_thin.a and defsym_test.
5 * testsuite/Makefile.in: Regenerate.
6
b39b8b9d
RÁE
72015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
8
9 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
10 body.
11
b66d1c52
CC
122015-02-04 Peter Collingbourne <pcc@google.com>
13
14 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
15 forwarding symbols when computing symbol resolution info for plugins.
16 * plugin.h (Plugin_manager::symtab): New method.
17 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
18
23081de0
CC
192015-02-03 Cary Coutant <ccoutant@google.com>
20 Peter Collingbourne <pcc@google.com>
21
22 PR gold/15660
23 * archive.cc (Thin_archive_object_unlocker): New class.
24 (Archive::include_member): Unlock external members of thin archives.
25 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
26 (plugin_test_2): Likewise.
27 (plugin_test_3): Likewise.
28 (plugin_test_4): Likewise.
29 (plugin_test_5): Likewise.
30 (plugin_test_6): Likewise.
31 (plugin_test_7): Likewise.
32 (plugin_test_8): Likewise.
33 (plugin_test_9): Likewise.
34 (plugin_test_10): Likewise.
35 (plugin_test_11): New test case.
36 * testsuite/Makefile.in: Regenerate.
37 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
38 file to decide whether to claim file.
39 (all_symbols_read_hook): Likewise.
40 * testsuite/plugin_test_1.sh: Adjust expected output.
41 * testsuite/plugin_test_2.sh: Likewise.
42 * testsuite/plugin_test_3.sh: Likewise.
43 * testsuite/plugin_test_6.sh: Likewise.
44 * testsuite/plugin_test_tls.sh: Likewise.
45 * testsuite/plugin_test_11.sh: New testcase.
46
472015-02-03 Cary Coutant <ccoutant@google.com>
48
49 * descriptors.cc (Descriptors::open): Set artificially-low limit for
50 file descriptors when debugging enabled. Add debug output.
51 (Descriptors::release): Add debug output.
52 (Descriptors::close_some_descriptor): Likewise.
53 (Descriptors::close_all): Likewise.
54 * fileread.cc (File_read::lock): Likewise.
55 (File_read::unlock): Likewise.
56
24dd5808
CC
572015-02-02 Cary Coutant <ccoutant@google.com>
58
59 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
60 executable output file.
61
fa89cc82
HS
622015-01-22 Han Shen <shenhan@google.com>
63
64 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
65 (Target_arm::do_plt_address_for_global): New method.
66 (Target_arm::do_plt_address_for_local): New method.
67 (Target_arm::rel_irelative_section): New method.
68 (Target_arm::make_data_plt): Add more parameters for plt ctor.
69 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
70 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
71 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
72 (Target_arm::Scan::check_non_pic): Add ifunc support.
73 (Target_arm::Scan::local): Add ifunc support.
74 (Target_arm::Scan::global): Add ifunc support.
75 (Target_arm::make_plt_section): New method.
76 (Target_arm::make_plt_entry): Change to call to make_plt_section.
77 (Target_arm::make_local_ifunc_plt_entry): New method.
78 (Target_arm::got_irelative_): New member.
79 (Target_arm::rel_irelative_): New member.
80 (Target_arm::got_section): Add creation for got_irelative_.
81 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
82 (Target_arm::Relocate::relocate): Properly set local ifunc address.
83 (Target_arm::do_dynsym_value): Properly set global ifunc address.
84 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
85 (Output_data_plt_arm::IRelative_data): New type.
86 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
87 (Output_data_plt_arm::add_entry): Add more parameters.
88 (Output_data_plt_arm::add_relocation): New method.
89 (Output_data_plt_arm::add_local_ifunc_entry): New method.
90 (Output_data_plt_arm::rel_irelative): New method.
91 (Output_data_plt_arm::entry_count): Modified.
92 (Output_data_plt_arm::address_for_global): New method.
93 (Output_data_plt_arm::address_for_local): New method.
23081de0 94gold/
fa89cc82
HS
95 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
96 (Output_data_plt_arm::insert_irelative_data): New method.
97 (Output_data_plt_arm::irelative_rel_): New member.
98 (Output_data_plt_arm::got_): New member.
99 (Output_data_plt_arm::got_irelative_): New member.
100 (Output_data_plt_arm::irelative_count_): New member.
101 (Output_data_plt_arm::IRelative_data_vec): New typedef.
102 (Output_data_plt_arm::irelative_data_vec_): New member.
103 (Output_data_plt_arm::do_write): Write out irelative entries.
104 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
105 more parameters to ctor.
106 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
107 more parameters to ctor.
108 * output.h (Output_data_reloc::add_local_relative): New method.
109 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
110
0f81d3f0
AM
1112015-01-29 Alan Modra <amodra@gmail.com>
112
113 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
114 and GOT_TLSGD to LE optimization.
115
65d92137
CC
1162015-01-28 Cary Coutant <ccoutant@google.com>
117
118 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
119 for undef TLS symbols.
120 (Target_x86_64::Relocate::relocate_tls): Likewise.
121 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
122
5485698a
CC
1232015-01-25 Cary Coutant <ccoutant@google.com>
124
125 * output.cc (Output_segment::set_section_addresses): Fix calculation
126 of size of relro segment.
127
b01a4b04
AM
1282015-01-22 Alan Modra <amodra@gmail.com>
129
130 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
131 condition for need of ifunc plt entry.
132 (Target_powerpc::Scan::global <got relocs>): Likewise.
133
3d0064a9
CC
1342015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
135
136 * mips.cc (reloc_high): Add r_sym.
137 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
138 reloc_high constructor.
139 (Mips_relocate_functions::relgot16_local): Likewise.
140 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
141 r_type to decide whether LO16 matches HI16.
142 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
143 rello16 and relgot16_local.
144
a5cd8f05
CC
1452015-01-09 Cary Coutant <ccoutant@google.com>
146
147 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
148 unless alignment is larger than page size.
149
4fc1b9d4
L
1502015-01-06 H.J. Lu <hongjiu.lu@intel.com>
151 Cary Coutant <ccoutant@google.com>
152
153 PR gold/17729
154 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
155 (DEFAULT_TARGET_X32): Set for x32.
156 * x86_64.cc (cmp_insn_32): New.
157 (lea_r10_insn_32): Likewise.
158 (lea_r11_insn_32): Likewise.
159 (cmp_insn_64): Likewise.
160 (lea_r10_insn_64): Likewise.
161 (lea_r11_insn_64): Likewise.
162 (Target_x86_64<size>::do_calls_non_split): Handle x32.
163 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
164 (check_DATA): Add split_x32 files.
165 (split_x32_[1234n].o): New targets.
166 (split_x32_[124]): New targets.
167 (split_x32_[1234r].stdout): New targets.
168 * testsuite/split_x32.sh: New file.
169 * testsuite/split_x32_1.s: Likewise.
170 * testsuite/split_x32_2.s: Likewise.
171 * testsuite/split_x32_3.s: Likewise.
172 * testsuite/split_x32_4.s: Likewise.
173 * testsuite/split_x32_n.s: Likewise.
174 * configure: Regenerated.
175 * testsuite/Makefile.in: Likewise.
176
e749cab8
L
1772015-01-06 H.J. Lu <hongjiu.lu@intel.com>
178
179 PR gold/17809
180 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
181 x32.
182
af759df0
AM
1832015-01-02 Alan Modra <amodra@gmail.com>
184
185 * version.cc (print_version): Just print current year.
186 * dwp.cc (print_version): Likewise.
187
b90efa5b
AM
1882015-01-01 Alan Modra <amodra@gmail.com>
189
190 Update year range in copyright notice of all files.
191
f12d1e8a
AM
1922014-12-25 Alan Modra <amodra@gmail.com>
193
194 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
195 new enums.
196 (Target_arm::merge_object_attributes, ): Likewise.
197
5c294fee
TG
1982014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
199
200 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
201 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
202 AEABI_VFP_args_vfp to check that.
203 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
204 value and replace hardcoded values by enum values.
205
e30880c2
CC
2062014-12-22 Cary Coutant <ccoutant@google.com>
207
208 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
209
bd040da1
L
2102014-12-20 H.J. Lu <hongjiu.lu@intel.com>
211
212 PR gold/14608
213 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
214 to "return i * i * 3;".
215
e02a4046
CC
2162014-12-16 Cary Coutant <ccoutant@google.com>
217
218 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
219 (Mapfile::print_output_data): Use current_data_size() to avoid
220 assert for sections requiring postprocessing; if address is not valid,
221 print 0.
222 (Mapfile::print_output_section): Use current_data_size(); print note
223 that addresses and sizes are before compression.
224
add6016b
L
2252014-12-14 H.J. Lu <hongjiu.lu@intel.com>
226
227 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
228 Cast current_group_size to unsigned long when reporting error.
229
0bf32ea9
JY
2302014-12-10 Jing Yu <jingyu@google.com>
231
232 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
233 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
234 Update error message.
235 (Target_aarch64::do_relax): Use absolute value of option
236 stub_group_size. Replace local variable with class member
237 stub_group_size_.
238
cbcb23fa
AM
2392014-12-04 Alan Modra <amodra@gmail.com>
240
241 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
242 addend of PLTREL24 reloc when not generating a plt stub. Make
243 max_branch_offset an "Address".
fbad6518 244 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
245 (Target_powerpc::Relocate::relocate): Likewise.
246
1611bc4a
AM
2472014-12-04 Alan Modra <amodra@gmail.com>
248
249 PR 17670
250 * symtab.cc (Symbol::set_undefined): Remove assertion.
251 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
252 on symbols defined in discarded sections, instead return false.
253 Rearrange params, update all callers.
254 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
255 branches to syms in discarded sections.
256 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
257 undefined and flag as discarded.
258 (Target_powerpc::Relocate::relocate): Localize variable.
259
4759c34e
L
2602014-12-03 H.J. Lu <hongjiu.lu@intel.com>
261
262 PR gold/17675
263 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
264 * testsuite/Makefile.in: Regenerated.
265
1f98a074
AM
2662014-12-03 Alan Modra <amodra@gmail.com>
267
268 PR 17566
269 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
270 when adding dynamic relocations against section symbols.
271
fb257835
DI
2722014-12-01 Dimitry Ivanov <dimitry@google.com>
273
274 * layout.cc (Layout::finish_dynamic_section): When '-z global'
275 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
276 * options.h (General_options): New -z option (global).
277
d8e60314
CC
2782014-12-01 Cary Coutant <ccoutant@google.com>
279
280 PR gold/17578
281 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
282 is given.
283 (Layout::create_executable_stack_info): Warn when -z noexecstack is
284 given but some inputs require executable stack.
285
982bbd97
CC
2862014-11-26 Cary Coutant <ccoutant@google.com>
287
288 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
289 .debug_str_offsets; strip .debug_gnu_pubnames and
290 .debug_gnu_pubtypes.
291 (lines_only_debug_sections): Strip all four new sections.
292
bb779192
HS
2932014-11-26 Jing Yu <jingyu@google.com>
294
295 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
296 register to be x0 when to relax TLSDESC_LD64_LO12.
297
a3e60ddb
AM
2982014-11-26 Alan Modra <amodra@gmail.com>
299
300 * powerpc.cc (struct Stub_table_owner): New.
301 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
302 unsigned int vector. Update all references.
303 (powerpc_relobj::set_stub_table): Take an unsigned int param
304 rather than a Stub_table. Update callers.
305 (Powerpc_relobj::clear_stub_table): New function.
306 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
307 stub_group_size_ vars.
308 (Target_powerpc::new_stub_table): Delete.
309 (max_branch_delta): New function, extracted from..
310 (Target_powerpc::Relocate::relocate): ..here..
311 (Target_powerpc::Branch_info::make_stub): ..and here. Return
312 status on whether stub created successfully.
313 (Stub_control::Stub_control): Add "no_size_errors" param. Move
314 default sizing to..
315 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
316 reduce on relax failure.
317 (Target_powerpc::group_sections): Add "no_size_errors" param.
318 Use stub_group_size_. Set up group info in a temp vector,
319 before building Stub_table vector. Account for input sections
320 possibly already converted to relaxed sections.
321 (Stub_table::init): Delete. Merge into..
322 (Stub_table::Stub_table): ..here.
323 (Stub_table::can_reach_stub): New function.
324 (Stub_table::add_plt_call_entry): Add "from" parameter and
325 return true iff stub could be reached.
326 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
327 param too.
328 (Stub_table::clear_stubs): Add "all" param.
329
a20605cf
AM
3302014-11-26 Alan Modra <amodra@gmail.com>
331
332 * powerpc.cc (Stub_control::set_output_and_owner): New function.
333 (Target_powerpc::group_sections): Use it.
334
43b64deb
CC
3352014-11-25 Cary Coutant <ccoutant@google.com>
336
337 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
338 (Binary_to_elf::write_symbol): Add st_size parameter.
339 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
340
c924eb67
CC
3412014-11-25 Cary Coutant <ccoutant@google.com>
342
343 PR gold/17639
344 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
345 (Sized_relobj_file::do_layout): Handle deferred sections properly
346 during GC pass 1. Don't add reloc sections to deferred list twice.
347 * object.h (Sized_relobj_file::is_deferred_layout): New function.
348 (Sized_relobj_file::is_deferred_layout_): New data member.
349
9d585188
L
3502014-11-21 H.J. Lu <hongjiu.lu@intel.com>
351
352 PR gold/17619
353 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
354 Check PC-relative offset overflow in PLT entry.
355
3ffaac20
AM
3562014-11-21 Alan Modra <amodra@gmail.com>
357
358 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
359 for undefined weaks.
360
0cfb0717
AM
3612014-11-20 Alan Modra <amodra@gmail.com>
362
363 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
364 from --stub-group-size parameter divided by 1024.
365 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
366 template parameter. Update all uses.
367 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
368 has_stub_value. Set for long branches. Don't report overflow for
369 branch to undefined weak symbols. Print info message on
370 overflowing branch to stub.
371
f9dffbf0
AM
3722014-11-20 Alan Modra <amodra@gmail.com>
373
374 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
375
e88ba8d5
L
3762014-11-13 H.J. Lu <hongjiu.lu@intel.com>
377
378 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
379 entry for R_X86_64_GOTPLT64.
380 (Target_x86_64<size>::Relocate::relocate): Update comments for
381 R_X86_64_GOTPLT64.
382
d37ffe25
ED
3832014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
384
385 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
386 * plugin.h: add lock definition
387
9726c3c1
HS
3882014-10-29 Han Shen <shenhan@google.com>
389 Jing Yu <jingyu@google.com>
390
391 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
392 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
393 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
394 Symbol::TLS_REF.
395 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
396 method.
397 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
398 (Target_aarch64::tls_ld_to_le): New method.
399 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
400 for 64bit targets.
401 (Output_data_plt_aarch64::irelative_rel_): New data member.
402 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
403 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
404 (Output_data_plt_aarch64::add_relocation): New method.
405 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
406 offset. Add got_irelative size to got size.
407 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
408 type string with the new typename.
409 (AArch64_relocate_functions::update_adr): Replace parameter x with
410 immed.
411 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
412 (AArch64_relocate_functions::reloc_common): New method.
413 (AArch64_relocate_funcsions::rela_general): Extract common part out
414 into reloc_common method.
415 (AArch64_relocate_functions::rela_general): Likewise.
416 (AArch64_relocate_functions::pcrela_general): Likewise.
417 (AArch64_relocate_functions::adr): New method.
418 (AArch64_relocate_functions::adrp): Calculate immed before calling
419 update_adr.
420 (AArch64_relocate_functions::adrp): Likewise.
421 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
422 comparing x to 0. Calculate immed from ~x when x < 0.
423 (Target_aarch64::optimize_tls_reloc): Add new cases for
424 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
425 TLSLD_MOVW_DTPREL_G0_NC.
426 (Target_aarch64::possible_function_pointer_reloc): Implement this
427 method.
428 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
429 comment.
430 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
431 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
432 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
433 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
434 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
435 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
436 (Target_aarch64::make_plt_entry): Call add_entry with two more
437 parameters.
438 (Target_aarch64::make_local_ifunc_plt_entry): New method.
439 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
440 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
441 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
442 (Target_aarch64::Relocate::relocate_tls): Add cases for
443 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
444 TLSLD_MOVW_DTPREL_G0_NC.
445 * testsuite/icf_safe_so_test.cc: Correct test comment.
446 * testsuite/icf_safe_test.sh: Add AArch64 arch.
447
80272b8c
AM
4482014-10-22 Alan Modra <amodra@gmail.com>
449
450 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
451 thread_starter.
452
998a69f4
AS
4532014-10-18 Andreas Schwab <schwab@linux-m68k.org>
454
455 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
456
aed56ec5
CC
4572014-10-17 Cary Coutant <ccoutant@google.com>
458
459 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
460 Add "typename" keyword.
461
bb779192 4622014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
463 Jing Yu <jingyu@google.com>
464
465 Patch for gold aarch64 backend to support relaxation.
466 * aarch64-reloc.def: Change format.
467 * aarch64.cc (class Reloc_stub): New class.
468 (class Stub_table): New class.
469 (class AArch64_relobj): New class.
470 (class AArch64_input_section): New class.
471 (class AArch64_output_section): New class.
472 (Target_aarch64::new_stub_table): New method.
473 (Target_aarch64::new_aarch64_input_section): New method.
474 (Target_aarch64::find_aarch64_input_section): New method.
475 (Target_aarch64::scan_section_for_stubs): New method.
476 (Target_aarch64::scan_reloc_section_for_stubs): New method.
477 (Target_aarch64::relocate_stub): New method.
478 (Target_aarch64::current_target): New method.
479 (Target_aarch64::do_make_elf_object): New method.
480 (Target_aarch64::do_may_relax): New method.
481 (Target_aarch64::do_relax): New method.
482 (Target_aarch64::group_sections): New method.
483 (Target_aarch64::scan_reloc_for_stub): New method.
484 (Target_aarch64::do_make_output_section): New method.
485 (Target_aarch64::stub_tables_): New data member.
486 (Target_aarch64::aarch64_input_section_map_): New data member.
487 (AArch64_relocate_functions::maybe_apply_stub): New method.
488
db4c9594
CC
4892014-09-30 Cary Coutant <ccoutant@google.com>
490
491 PR gold/17432
492 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
493
cd6da036
KC
4942014-09-30 Kito Cheng <kito@0xlab.org>
495
496 PR gold/13597
497 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
498 hash table before sysv-style hash table.
499
5f772412
ST
5002014-09-29 Sriraman Tallam <tmsriram@google.com>
501
502 * options.h (--pic-executable): Add negative to alias to -no-pie.
503
5efeedf6
CC
5042014-09-26 Cary Coutant <ccoutant@google.com>
505
506 PR gold/16773
507 * object.cc (Sized_relobj_file): Compute value of section symbols
508 for TLS sections the same as TLS symbols.
509
1707f183
CC
5102014-09-25 Cary Coutant <ccoutant@google.com>
511
512 PR gold/17432
513 * resolve.cc (Symbol_table::resolve): Override common placeholder
514 symbols, but adjust sizes.
515 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
516 symbols to common lists.
517
00cac886
AM
5182014-09-24 Alan Modra <amodra@gmail.com>
519
520 * po/POTFILES.in: Regenerate.
521
635aa30e
CC
5222014-09-23 Taiju Tsuiki <tzik@google.com>
523 Cary Coutant <ccoutant@google.com>
524
71b9b91b 525 PR gold/14860
635aa30e
CC
526 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
527 on input_sections_blocker.
528 * layout.cc (Write_sections_task::locks): Unblock
529 input_sections_blocker_.
530 * layout.h (Write_sections_task::Write_sections_task): Add
531 input_sections_blocker.
532 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
533 to DEPENDENCIES.
534 * testsuite/Makefile.in: Regenerate.
535
c0c71592
RÁE
5362014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
537
538 * testsuite/Makefile.am (plugin_test_10): New test.
539 * testsuite/Makefile.in: Regenerate
540 * testsuite/plugin_common_test_2.c (c1): Align to 8.
541 * testsuite/plugin_test_10.sh: New file.
542
6168c2a1
RÁE
5432014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
544
545 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
546 * resolve.cc (Symbol_table::resolve): Don't override common symbols
547 during the replacement phase.
548
3a531937
JY
5492014-09-17 Han Shen <shenhan@google.com>
550 Jing Yu <jingyu@google.com>
551
552 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
553 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
554 * aarch64.cc (Target_aarch64): Add data members
555 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
556 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
557 constructor.
558 (Target_aarch64::do_reloc_symbol_index): New method.
559 (Target_aarch64::do_reloc_addend): New method.
560 (Target_aarch64::add_tlsdesc_info): New method.
561 (Target_aarch64::do_dynsym_value): New method.
562 (Target_aarch64::do_make_data_plt): Add new parameters: got,
563 got_irelative. Pass them to Output_data_plt_aarch64_standard.
564 (Target_aarch64::make_data_plt): Add new parameters: got,
565 got_irelative. Pass them to do_make_data_plt.
566 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
567 (Target_aarch64::Relocate:tls_gd_to_le): New method.
568 (Target_aarch64::Relocate:tls_ie_to_le): New method.
569 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
570 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
571 (Target_aarch64::got_tlsdesc_section): New method.
572 (Target_aarch64::make_local_ifunc_plt_entry): New method.
573 (Target_aarch64::define_tls_base_symbol): New method.
574 (Target_aarch64::reserve_tlsdesc_entries): New method.
575 (Target_aarch64::got_mod_index_entry): New method.
576 (Target_aarch64::rela_tlsdesc_section): New method.
577 (Target_aarch64::rela_irelative_section): New method.
578 (Target_aarch64::Tlsdesc_info): New struct.
579 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
580 relocations and tlsdesc relocations.
581 (Target_aarch64::optimize_tls_reloc): Implement method.
582 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
583 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
584 in constructor.
585 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
586 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
587 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
588 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
589 (Output_data_plt_aarch64::rela_tlsdesc): New method.
590 (Output_data_plt_aarch64::rela_irelative): New method.
591 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
592 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
593 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
594 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
595 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
596 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
597 (Output_data_plt_aarch64_standard): New member variables:
598 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
599 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
600 New parameter: got, got_irelative.
601 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
602 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
603 (Output_data_plt_aarch64::do_write): Replace got_address with
604 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
605 (AArch64_relocate_functions::update_movnz): New method.
606 (AArch64_relocate_functions): Correct format.
607 (AArch64_relocate_functions::movnz): New method.
608 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
609 before the switch. Add new cases to switch.
00cac886 610 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
611 tlsgd tlsdesc cases.
612 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
613 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
614 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
615 Call reloc_name_in_error_message to print unsupported reloc.
616 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
617 make_data_plt.
618 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
619 relocs. Fill in some more dynamic tags.
620 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
621 Skip call tls_get_addr when tlsgd is relaxed.
622 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
623 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
624 tlsdesc->ie relaxation.
625
62661c93
SS
6262014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
627
628 * mips.cc (Target_mips_nacl): New class.
629 (Target_selector_mips_nacl): New class.
630 (target_selector_mips32): Rename from target_selector_mips32be and use
631 Target_selector_mips_nacl instead of Target_selector_mips.
632 (target_selector_mips32el): Rename from target_selector_mips32 and use
633 Target_selector_mips_nacl instead of Target_selector_mips.
634 (target_selector_mips64): Rename from target_selector_mips64be and use
635 Target_selector_mips_nacl instead of Target_selector_mips.
636 (target_selector_mips64el): Rename from target_selector_mips64 and use
637 Target_selector_mips_nacl instead of Target_selector_mips.
638 (Target_mips::mips_info): Add const attribute.
639
54674d38
CC
6402014-09-02 Cary Coutant <ccoutant@google.com>
641
642 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
643 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
644 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
645 (Sized_incr_dynobj::do_section_name): Likewise.
646 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
647 (Sized_incr_dynobj::do_section_name): Likewise.
648 * object.h (Object::section_name): Likewise.
649 (Object::do_section_name): Likewise.
650 (Sized_relobj_file::do_section_name): Likewise.
651 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
652 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
653
9860cbcf
CC
6542014-09-02 Cary Coutant <ccoutant@google.com>
655
656 PR gold/17005
657 * ehframe.cc (Fde::write): Add output_offset parameter.
658 (Cie::write): Likewise.
659 (Eh_frame::set_final_data_size): Account for offset within output
660 section.
661 (Eh_frame::do_sized_write): Likewise.
662 * ehframe.h (Fde::write): Add output_offset parameter.
663 (Cie::write): Likewise.
664 * output.cc (Output_section::Input_section_sort_entry): Remove
665 section_has_name_; add output_section_name parameter. Use
666 output section name for non-input sections.
667 (Output_section::Input_section_sort_entry::section_has_name): Remove.
668 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
669 (Output_section::Input_section_sort_compare): Remove logic for
670 sections without names.
671 (Output_section::Input_section_sort_init_fini_compare): Likewise.
672 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
673 Likewise.
674 (Output_section::Input_section_sort_section_name_compare): Likewise.
675
8e33481e
HS
6762014-08-29 Han Shen <shenhan@google.com>
677 Jing Yu <jingyu@google.com>
678
679 * aarch64-reloc-property.cc
680 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
681 reference reloc property in the table.
682 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
683 3 other entries.
684 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
685 2 new overloaded methods.
686 (Output_data_got_aarch64::do_write): Add code to write out
687 static relocs.
688 (class Output_data_got_aarch64::Static_reloc): New class to wrap
689 static relocs.
690 (Output_data_got_aarch64::static_relocs): New vector to
691 hold static relocs.
692 (Target_aarch64::TCB_SIZE): New const static memeber.
693 (Target_aarch64::tcb_size): New method.
694 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
695 (Target_aarch64::Relocate::relocate_tls): New method.
696 (Target_aarch64::Scan::local): Add code handling new reloc types.
697 (Target_aarch64::Scan::global): Add code handling new reloc types.
698
81233653
ST
6992014-08-13 Sriraman Tallam <tmsriram@google.com>
700
701 * options.h (-no-pie): Add option.
702
9363c7c3
JY
7032014-08-08 Jing Yu <jingyu@google.com>
704 Han Shen <shenhan@google.com>
705
706 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
707 (DEFFILES): add aarch64-reloc.def.
708 (TARGETSOURCES): Add aarch64-reloc-property.cc.
709 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
710 * Makefile.in: Regenerate.
711 * aarch64-reloc-property.cc: New file.
712 * aarch64-reloc-property.h: New file.
713 * aarch64-reloc.def: New file.
714 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
715 with tab to make the format consistent.
716 (Output_data_got_aarch64::symbol_table_): New method.
717 (Target_aarch64::do_plt_address_for_global): New method.
718 (Target_aarch64::do_plt_address_for_local): New method.
719 (Target_aarch64::do_select_as_default_target): New method.
720 (Target_aarch64::do_make_data_plt): New method.
721 (Target_aarch64::make_data_plt): New method.
722 (Output_data_plt_aarch64::has_irelative_section): New method.
723 (Output_data_plt_aarch64::address_for_global): New method.
724 (Output_data_plt_aarch64::address_for_local): New method.
725 (Output_data_plt_aarch64::irelative_rel_): New parameter.
726 (Output_data_plt_aarch64::add_entry): Implement contents.
727 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
728 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
729 the got_pov entry to plt0.
730 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
731 Implement contents.
732 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
733 (AArch64_howto): New struct.
734 (aarch64_howto[]): New static const array.
735 (AArch64_relocate_functions): New class.
736 (Target_aarch64::Scan::get_reference_flags): Remove method.
737 (Target_aarch64::Scan::local): Implement to support a few relocations.
738 (Target_aarch64::Scan::global): Implement to support a few relocations.
739 (Target_aarch64::make_plt_section): Implement contents.
740 (Target_aarch64::make_plt_entry): Implement contents.
741 (Target_aarch64::do_finalize_sections): Implement contents.
742 (Target_aarch64::Relocate::relocate): Implement a few relocations.
743 (Target_aarch64::relocate_section): Implement contents.
744
ad9fe6c1
AM
7452014-08-06 Alan Modra <amodra@gmail.com>
746
747 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
748
7cd4e5b7
AM
7492014-08-06 Alan Modra <amodra@gmail.com>
750
751 PR 13227
752 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
753
5ad9b0a7
ST
7542014-07-21 Sriraman Tallam <tmsriram@google.com>
755
756 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 757 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 758
e051745c
CC
7592014-07-08 Cary Coutant <ccoutant@google.com>
760
761 * expression.cc (struct Expression::Expression_eval_info): Add
762 new fields type_pointer, vis_pointer, and nonvis_pointer.
763 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
764 nonvis_pointer parameters. Adjust all calls.
765 (Symbol_expression::value): Update type, visibility, and nonvis bits
766 in caller.
767 * script.cc (Symbol_assignment::sized_finalize): Update type,
768 visibility, and remaining st_other bits for new symbol.
769 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
770 vis_pointer, and nonvis_pointer parameters.
771 * symtab.h (Symbol::set_type): New method.
772
773 * testsuite/Makefile.am (defsym_test): New test.
774 * testsuite/Makefile.in: Regenerate.
775 * testsuite/defsym_test.c: New file.
776 * testsuite/defsym_test.sh: New file.
777
f35c4853
CC
7782014-07-08 Cary Coutant <ccoutant@google.com>
779
780 PR gold/15639
781 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
782 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
783 (Sized_dynobj::base_read_symbols): ...new method.
784 * object.h (Sized_relobj_file::base_read_symbols): New method.
785 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
786 (Sized_relobj_file::base_read_symbols): ...new method.
787 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
788 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
789 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
790
2900af2d
AM
7912014-07-04 Alan Modra <amodra@gmail.com>
792
793 * po/POTFILES.in: Regenerate.
794
053a4d68
JY
7952014-07-02 Jing Yu <jingyu@google.com>
796
797 * aarch64.cc: New file
798 * Makefile.am (TARGETSOURCES): Add aarch64.cc
799 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
800 * Makefile.in: Regenerate.
801 * configure.tgt: Add entries for aarch64*.
802 * configure.ac: Likewise.
803 * configure: Likewise.
804
7b549045
AM
8052014-06-27 Alan Modra <amodra@gmail.com>
806
807 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
808
cb818dbf
CC
8092014-06-24 Cary Coutant <ccoutant@google.com>
810
811 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
812 sections.
813 (Dwo_file::sized_read_unit_index): Likewise.
814
9810d34d
SS
8152014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
816
817 * mips.cc: New file.
818 * Makefile.am (TARGETSOURCES): Add mips.cc
819 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
820 * configure.tgt: Add entries for mips*.
821 * configure.ac: Likewise.
822 * Makefile.in: Regenerate.
823 * configure: Likewise.
824
9baa787b
CC
8252014-06-09 Cary Coutant <ccoutant@google.com>
826
827 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
828 unit_length is within section bounds.
829
8f89af0a
CC
8302014-06-09 Cary Coutant <ccoutant@google.com>
831
832 PR gold/16980
833 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
834 map.
835
a47622ac
AM
8362014-06-07 Alan Modra <amodra@gmail.com>
837
838 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
839
4320c691
CC
8402014-06-06 Cary Coutant <ccoutant@google.com>
841
842 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
843 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
844 (Dwarf_pubnames_table::read_header): Likewise.
845 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
846 .debug_gnu_pubtypes.
847
270c9937
JB
8482014-06-05 Joel Brobecker <brobecker@adacore.com>
849
850 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
851 * Makefile.in, configure: Regenerate.
852
397998fc
AM
8532014-06-03 Alan Modra <amodra@gmail.com>
854
855 * powerpc.cc (addis_12_2): Define.
856 (Stub_table::do_write): Support fusion on ELFv2 stubs.
857
61f5c66f
AM
8582014-06-03 Alan Modra <amodra@gmail.com>
859
860 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
861 st_other output.
862
f6971787
AM
8632014-06-02 Alan Modra <amodra@gmail.com>
864
865 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
866 Only ignore relocs on ELFv1.
867 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
868
f6fb8322
CC
8692014-05-30 Cary Coutant <ccoutant@google.com>
870
871 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
872 * testsuite/Makefile.in: Regenerate.
873 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
874
c23dd342
L
8752014-05-27 H.J. Lu <hongjiu.lu@intel.com>
876
877 PR gold/16945
878 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
879 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
880
5fe7ffdc
AM
8812014-05-15 Alan Modra <amodra@gmail.com>
882
883 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
884 Compare FDE contents with DW_CFA_nop rather than 0.
885
a82bef93
ST
8862014-05-13 Sriraman Tallam <tmsriram@google.com>
887
888 * symtab.h (may_need_copy_reloc): Remove check for position independent
889 code.
890 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
891 position independence before pc absolute may_need_copy_reloc call.
892 Add check for executable output befor pc relative may_need_copy_reloc
893 call.
894 * i386.cc: Ditto.
895 * arm.cc: Ditto.
896 * sparc.cc: Ditto.
897 * tilegx.cc: Ditto.
898 * powerpc.cc: Add check for no position independence before
899 may_need_copy_reloc calls.
900 * testsuite/pie_copyrelocs_test.cc: New file.
901 * testsuite/pie_copyrelocs_shared_test.cc: New file.
902 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 903 * Makefile.in: Regenerate.
a82bef93 904
53c66605
ML
9052014-05-08 Martin Liška <mliska@suse.cz>
906
907 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
908
57b2284c
CC
9092014-05-06 Cary Coutant <ccoutant@google.com>
910
911 PR gold/16900
912 * i386.cc (Output_data_got_plt_i386): New class.
913 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
914 parameter. Change all callers.
915 (Output_data_plt_i386::layout_): Remove.
916 (Output_data_plt_i386::got_plt_): Change type.
917 (Target_i386::got_plt_): Change type. Change all references.
918 (Target_i386::got_section): Create instance of new class.
919 (Output_data_got_plt_i386::do_write): New function.
920 * x86_64.cc (Output_data_got_plt_x86_64): New class.
921 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
922 parameter. Change all callers.
923 (Output_data_plt_x86_64::layout_): Remove.
924 (Output_data_plt_x86_64::got_plt_): Change type.
925 (Target_x86_64::got_plt_): Change type. Change all references.
926 (Target_x86_64::got_section): Create instance of new class.
927 (Output_data_got_plt_x86_64::do_write): New function.
928 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
929 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
930 class.
931
6b97515d 9322014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 933
6b97515d
CC
934 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
935 if we have pubnames/pubtypes.
936
d1bddd3c
CC
9372014-05-02 Cary Coutant <ccoutant@google.com>
938
5fe7ffdc
AM
939 * defstd.cc (in_segment): Define __ehdr_start here...
940 * layout.cc (Layout::finalize): ...Instead of here. Set the
941 output segment when known.
942 * resolve.cc (Symbol::override_base_with_special): Remember
943 the original binding.
944 * symtab.cc (Symbol::set_output_segment): New function.
945 (Symbol::set_undefined): New function.
946 * symtab.h (Symbol::is_weak_undefined): Check original undef
947 binding.
948 (Symbol::is_strong_undefined): New function.
949 (Symbol::set_output_segment): New function.
950 (Symbol::set_undefined): New function.
951 * target-reloc.h (is_strong_undefined): Remove.
952 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
953 Check for hidden undefs.
954 (relocate_section): Call Symbol::is_strong_undefined.
955
956 * testsuite/Makefile.am (ehdr_start_test_1)
957 (ehdr_start_test_2, ehdr_start_test_3)
958 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
959 * testsuite/Makefile.in: Regenerate.
960 * testsuite/ehdr_start_def.cc: New source file.
961 * testsuite/ehdr_start_test.cc: New source file.
962 * testsuite/ehdr_start_test.t: New linker script.
963 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 964
7849f6d8
CC
9652014-04-23 Cary Coutant <ccoutant@google.com>
966
bf2cc635 967 PR gold/16870
7849f6d8
CC
968 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
969
99fd8cff
CC
9702014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
971
972 * layout.cc (Layout::include_section): Allow a target to decide
973 whether to include a section.
974 * target.h (Target::should_include_section): New function.
975 (Target::do_should_include_section): New function.
976
91f43acd
CC
9772014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
978
979 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
980 inline into ...
981 (Copy_relocs::emit): ... here.
982 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
983 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
984 (Copy_reloc_entry::entries_): Change from private to protected.
985
c4eb27e1
ST
9862014-04-02 Sriraman Tallam <tmsriram@google.com>
987
988 * icf.cc (get_section_contents): Replace copies of reloc
989 vectors with const references.
990
ae447ddd
CC
9912014-04-02 Cary Coutant <ccoutant@google.com>
992
993 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
994 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
995 * configure: Regenerate.
996 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
997 -fno-use-linker-plugin.
998 (LINK1, CXXLINK1): Add it to the link command.
999 * testsuite/Makefile.in: Regenerate.
1000
fa47fa92
AM
10012014-03-12 Alan Modra <amodra@gmail.com>
1002
1003 * Makefile.in: Regenerate.
1004
9b12c500
CC
10052014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1006
1007 * symtab.h (Symbol::set_nonvis): New function.
1008
beacaa96
CC
10092014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1010
1011 * symtab.cc (Sized_symbol<32>::init_output_data):
1012 Instantiate the template.
1013 (Sized_symbol<64>::init_output_data): Likewise.
1014
800d9823
CC
10152014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1016
1017 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1018 adjust dynamic symbol value.
1019 * target.h (Target::adjust_dyn_symbol): New function.
1020 (Target::do_adjust_dyn_symbol): New function.
1021
918fc1f8 10222014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 1023
918fc1f8
CC
1024 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1025 Get the value of DYNAMIC_CUSTOM dynamic entry.
1026 * output.h (Output_data_dynamic::add_custom): New function.
1027 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1028 dynamic entry.
1029 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1030 * target.h (Target::dynamic_tag_custom_value): New function.
1031 (Target::do_dynamic_tag_custom_value): New function.
1032
98ff9231
CC
10332014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1034
1035 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1036 dynsym indexes.
1037 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1038 (Target::do_has_custom_set_dynsym_indexes): New function.
1039 (Target::set_dynsym_indexes): New function.
1040 (Target::do_set_dynsym_indexes): New function.
1041
b80eed39
AM
10422014-03-07 Alan Modra <amodra@gmail.com>
1043
1044 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1045 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1046 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1047 (Powerpc_relocate_functions::has_overflow_bitfield,
1048 overflowed): Use the above.
1049 (Target_powerpc::Relocate::relocate): Correct overflow checking
1050 for a number of relocations. Modify overflow test for 16-bit
1051 fields in instructions to signed/unsigned according to whether
1052 the field takes a signed or unsigned value.
1053
4b95cf5c
AM
10542014-03-05 Alan Modra <amodra@gmail.com>
1055
1056 Update copyright years.
1057
45965137
AM
10582014-03-05 Alan Modra <amodra@gmail.com>
1059
1060 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1061 R_PPC64_ADDR64_LOCAL.
1062 (Target_powerpc::Relocate::relocate): Likewise.
1063
2c80b753
AM
10642014-03-03 Alan Modra <amodra@gmail.com>
1065
1066 * dwp.cc (print_version): Update copyright year to current.
1067
c1c69e83
AM
10682014-02-10 Alan Modra <amodra@gmail.com>
1069
1070 * po/gold.pot: Regenerate.
1071
dd0c4e70
CC
10722014-02-06 Cary Coutant <ccoutant@google.com>
1073
1074 Fix problem where -u is ignored when a weak undef is seen.
1075
1076 * archive.cc (Library_base::should_include_member): Reorder
1077 code to check for -u option if a weak undef has already been seen.
1078 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1079 * testsuite/Makefile.in: Regenerate.
1080 * testsuite/weak_undef_file3.cc: New file.
1081 * testsuite/weak_undef_file4.cc: New file.
1082 * testsuite/weak_undef_test_2.cc: New file.
1083
1a221d3d
CC
10842014-02-05 Cary Coutant <ccoutant@google.com>
1085
1086 Fix issues with gold undefined symbol diagnostics.
1087
1088 PR binutils/15435
1089 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1090 check to here.
1091 * target-reloc.h (is_strong_undefined): New function.
1092 (relocate_section): Move undef vtable symbol check from here.
1093 Check for is_strong_undefined.
1094
e889f0a4 10952014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1096
e889f0a4
CC
1097 Fix problems with the --dynamic-list option.
1098
1099 PR gold/13577
1100 * options.cc (General_options::parse_dynamic_list):
1101 Set have_dynamic_list_.
1102 (General_options::General_options): Initialize have_dynamic_list_.
1103 (General_options::finalize): Turn off -Bsymbolic and
1104 -Bsymbolic-functions if --dynamic-list provided.
1105 * options.h (General_options::have_dynamic_list): New function.
1106 (General_options::have_dynamic_list_): New data member.
1107 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
1108 correctly.
5fe7ffdc 1109
e889f0a4
CC
1110 PR gold/16530
1111 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
1112 in --dynamic-list, mark it.
5fe7ffdc 1113
e889f0a4
CC
1114 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
1115 (dynamic_list_2): New test case.
1116 * testsuite/Makefile.in: Regenerate.
1117 * testsuite/dynamic_list_2.cc: New file.
1118 * testsuite/dynamic_list_2.t: New file.
1119 * testsuite/dynamic_list_lib1.cc: New file.
1120 * testsuite/dynamic_list_lib2.cc: New file.
1121 * testsuite/gc_dynamic_list_test.c: New file.
1122 * testsuite/gc_dynamic_list_test.sh: New file.
1123 * testsuite/gc_dynamic_list_test.t: New file.
1124
ec673e64
CC
11252014-01-28 Cary Coutant <ccoutant@google.com>
1126
1127 Add .gdb_index version 7 support.
1128
1129 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1130 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1131 debug sections.
1132 (Dwarf_ranges_table::read_ranges_table): Likewise.
1133 (Dwarf_pubnames_table::read_section): Check for GNU-style
1134 sections, and for compressed debug sections.
1135 (Dwarf_pubnames_table::read_header): Compute end address of table.
1136 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1137 for end of list by offset, not by offset == 0.
1138 (Dwarf_info_reader::do_read_string_table): Check for compressed
1139 debug sections.
1140 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1141 Initialize new data members.
1142 (Dwarf_pubnames_table::next_name): return flag_byte.
1143 (Dwarf_pubnames_table::end_of_table_): New data member.
1144 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1145 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1146 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1147 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1148 read skeleton type unit DIEs.
1149 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1150 (Gdb_index::do_write): Write flag_byte.
1151 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1152 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1153 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1154 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1155
221fd5d5
L
11562014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1157
1158 * version.cc (print_version): Update copyright year to 2014.
1159
6c09fb0b
ILT
11602013-12-19 Dimitry Andric <dimitry@andric.com>
1161
1162 * stringpool.cc (Stringpool_template::reserve): Add
1163 HAVE_UNORDERED_MAP case.
1164 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1165
8356f2d0
CC
11662013-12-18 Cary Coutant <ccoutant@google.com>
1167
1168 * configure.ac: Check for <unordered_set> and <unordered_map>.
1169 * config.in: Regenerate.
1170 * configure: Regenerate.
1171 * system.h: Use <unordered_set> and <unordered_map> if available.
1172
f2c7d7ee
RM
11732013-12-10 Roland McGrath <mcgrathr@google.com>
1174
1175 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1176 with $(INSTALL_PROGRAM_ENV).
1177 * Makefile.in: Regenerate.
1178
6632e8cc
CC
11792013-11-22 Cary Coutant <ccoutant@google.com>
1180
1181 * configure.ac: Add check for which library is needed for
1182 dlopen.
1183 * configure: Regenerate.
1184
0c075858
CC
11852013-11-22 Cary Coutant <ccoutant@google.com>
1186
1187 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1188 assembler.
1189 * testsuite/Makefile.in: Regenerate.
1190
f49fe902
L
11912013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1192
1193 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1194 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1195 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1196 (Target_x86_64<size>::Scan::local): Likewise.
1197 (Target_x86_64<size>::Scan::global): Likewise.
1198 (Target_x86_64<size>::Relocate::relocate): Likewise.
1199 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1200 Likewise.
1201 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1202 R_X86_64_PC32_BND.
1203
1204 * testsuite/Makefile.am (check_PROGRAMS): Add
1205 exception_x86_64_bnd_test.
1206 (exception_x86_64_bnd_test_SOURCES): New macro.
1207 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1208 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1209 (exception_x86_64_bnd_test_LDADD): Likewise.
1210 (exception_x86_64_bnd_1.o): New rule.
1211 (exception_x86_64_bnd_2.o): Likewise.
1212 * testsuite/Makefile.in: Regenerated.
1213
9055360d
AM
12142013-11-15 Alan Modra <amodra@gmail.com>
1215
1216 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1217 accessor.
1218 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1219 Only call ppc64_local_entry_offset for 64-bit. Restrict
1220 symval_for_branch lookup to ELFv1.
1221 (Stub_table::add_plt_call_entry): Use unsigned int off.
1222 (Output_data_glink::Address, invalid_address): New.
1223 (Output_data_glink::add_eh_frame): Move out of line. Add
1224 support for ELFv2.
1225 (Output_data_glink::add_global_entry, find_global_entry,
1226 global_entry_address): New functions.
1227 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1228 ge_size): New variables.
1229 (Output_data_glink::set_final_data_size): Add global entry
1230 stub sizing.
1231 (Output_data_glink::do_write): Write global entry stubs.
1232 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1233 parameter. Return true for ELFv2. Adjust callers.
1234 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1235 ELFv1. Similarly for ifunc and dynamic relocation processing
1236 specific to ELFv1. Recognize that symbols are defined on
1237 their plt entries for ELFv2.
1238 (Target_powerpc::symval_for_branch): Assert if called for
1239 ELFv2 or ppc32.
1240 (Target_powerpc::Relocate::relocate): Use global entry plt
1241 stub for symbol value if such exists on ELFv2.
1242 (Target_powerpc::Relocate::relocate): Don't call
1243 symval_for_branch when ELFv2. Do adjust for local entry
1244 offset when ELFv2.
1245 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1246 plt stub for ELFv2.
1247 (Target_powerpc::do_plt_address_for_global): Similarly.
1248
cafdd569
CC
12492013-11-14 Cary Coutant <ccoutant@google.com>
1250
1251 Revert patch -- this did not fix the problem, and there is
1252 no race there.
1253
1254 2013-11-14 Cary Coutant <ccoutant@google.com>
1255
1256 PR gold/14860
1257 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1258 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1259 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1260 updating fde_offsets_.
1261 (Eh_frame_hdr::lock_): New data member.
1262
94e49e16
CC
12632013-11-14 Cary Coutant <ccoutant@google.com>
1264
1265 * dwp.cc (Dwo_file_entry): New type.
1266 (File_list): Use Dwo_file_entry.
1267 (Dwo_file::verify): New function.
1268 (Dwo_file::verify_dwo_list): New function.
1269 (Dwo_file::sized_verify_dwo_list): New function.
1270 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1271 list.
1272 (Dwp_options): New enum type.
1273 (dwp_options): Add --verify-only.
1274 (usage): Likewise.
1275 (main): Likewise.
1276 * dwp.h (gold_info): Add declaration.
1277
7cdd7d57
CC
12782013-11-14 Cary Coutant <ccoutant@google.com>
1279
1280 PR gold/14860
1281 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1282 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1283 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1284 updating fde_offsets_.
1285 (Eh_frame_hdr::lock_): New data member.
1286
1d946cb3
CC
12872013-11-06 Cary Coutant <ccoutant@google.com>
1288
1289 PR gold/15758
1290 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1291 before reloc sections.
1292
4f65b40e
AM
12932013-11-04 Alan Modra <amodra@gmail.com>
1294
1295 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1296 (Symbol::needs_dynamic_reloc): Test new flag.
1297 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1298 (Target_powerpc::Scan::get_reference_flags): Add target param.
1299 Return FUNC_DESC_ABI for 64-bit ELFv1.
1300 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1301 call.
1302 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1303 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1304
908794a9
CC
13052013-10-31 Cary Coutant <ccoutant@google.com>
1306
1307 Restore support for dwp v2 DWARF package file format.
1308
1309 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1310 tu_length parameter. Adjust all callers.
1311 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1312 * dwp.cc: Include dwarf.h.
1313 (Section_bounds): New struct type.
1314 (Unit_set): New struct type.
1315 (Dwo_file::Dwo_file): Initialize new data member.
1316 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1317 Combine and rename to...
1318 (Dwo_file::read_unit_index): ...this.
1319 (Dwo_file::sized_read_compunit_index)
1320 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1321 (Dwo_file::sized_read_unit_index): ...this.
1322 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1323 parameters; add section_id parameter.
1324 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1325 (Dwo_file::add_unit_set): ...this.
1326 (Dwo_file::shndx_map_): Remove.
1327 (Dwo_file::sect_offsets_): New data member.
1328 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1329 (Dwp_output_file::add_section): Rename to...
1330 (Dwp_output_file::add_contribution): ...this.
1331 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1332 (Dwp_output_file::add_tu_set): Likewise.
1333 (Dwp_output_file::Contribution): New type.
1334 (Dwp_output_file::Section::contributions): New data member.
1335 (Dwp_output_file::Cu_or_tu_set): Remove.
1336 (Dwp_output_file::Section::Section): New ctor.
1337 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1338 (Dwp_output_file::Dwp_index::Section_table): New type.
1339 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1340 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1341 parameter.
1342 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1343 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1344 (Dwp_output_file::Dwp_index::section_table): New member function.
1345 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1346 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1347 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1348 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1349 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1350 (Dwp_output_file::Dwp_index::section_table_): New data member.
1351 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1352 (Dwp_output_file::add_output_section): New member function.
1353 (Dwp_output_file::write_new_section): New member function.
1354 (Dwp_output_file::write_contributions): New member function.
1355 (Dwp_output_file::section_id_map_): New data member.
1356 (class Dwo_id_info_reader): Remove.
1357 (class Unit_reader): New class.
1358 (get_dwarf_section_name): New function.
1359 (Dwo_file::read_executable): Adjust initializations of class data.
1360 (Dwo_file::read): Add support for v2 package file format.
1361 (Dwo_file::read_unit_index): Likewise.
1362 (Dwo_file::sized_read_unit_index): Likewise.
1363 (Dwo_file::copy_section): Likewise.
1364 (Dwo_file::add_unit_set): Likewise.
1365 (Dwp_output_file::add_output_section): Likewise.
1366 (Dwp_output_file::add_contribution): Likewise.
1367 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1368 for empty slot.
1369 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1370 file format.
1371 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1372 slot.
1373 (Dwp_output_file::initialize): Remove unused function.
1374 (Dwp_output_file::finalize): Add support for v2 package file format.
1375 (Dwp_output_file::write_index): Likewise.
1376 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1377 function prototype.
1378
2500c017
CC
13792013-10-31 Cary Coutant <ccoutant@google.com>
1380
1381 * configure.ac: Fix check for -fmerge-constants.
1382 * configure.ac: Regenerate.
1383
dd0845d7
RM
13842013-10-30 Roland McGrath <mcgrathr@google.com>
1385
1386 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1387 Correct 9-byte nop sequence to match what the assembler generates.
1388
b4f7960d
AM
13892013-10-30 Alan Modra <amodra@gmail.com>
1390
1391 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1392 ppc64_local_entry_offset, ppc64_local_entry_offset,
1393 do_read_symbols): New functions.
1394 (Powerpc_relobj::e_flags_, st_other_): New vars.
1395 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1396 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1397 (Powerpc_relobj::e_flags_): New var.
1398 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1399 and adjust for ELFv2.
1400 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1401 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1402 (Powerpc_dynobj::do_find_special_sections): Likewise.
1403 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1404 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1405 to ELFv2 local entry.
1406 (Target_powerpc::do_relax): No thread safe barriers needed for
1407 ELFv2.
1408 (Output_data_plt_powerpc::initial_plt_entry_size_,
1409 plt_entry_size): Delete. Replace all uses with
1410 first_plt_entry_offset() and plt_entry_size().
1411 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1412 reserved_size parm. Update callers.
1413 (Output_data_plt_powerpc::entry_count): Update.
1414 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1415 and use Target_powerpc::first_plt_entry_offset().
1416 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1417 rename to plt_entry_size.
1418 (Output_data_plt_powerpc::add_ifunc_entry,
1419 add_local_ifunc_entry): Adjust reloc for ELFv2.
1420 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1421 (glink_eh_frame_fde_64v2): New.
1422 (Stub_table::plt_call_size): Support ELFv2 sizing.
1423 (Output_data_glink::add_eh_frame): Use the new FDE.
1424 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1425 (Stub_table::do_write): Write ELFv2 stubs and glink.
1426 (Target_powerpc::Relocate::relocate): Replaces nop after call
1427 with ld 2,24(1) and adjust local offset destination for ELFv2.
1428
f9c6b907
AM
14292013-10-30 Alan Modra <amodra@gmail.com>
1430
1431 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1432 (Target_powerpc::Scan::global, local): Likewise.
1433 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1434 on all ppc64 @h and @ha relocs.
1435
e84fe78f
AM
14362013-10-14 Alan Modra <amodra@gmail.com>
1437
1438 * output.h (Output_data_got::add_constant): Tidy.
1439 (Output_data_got::add_constant_pair): New function.
1440 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1441 methods used so as to first call reserve_ent().
1442
679e4abf
RM
14432013-10-11 Roland McGrath <mcgrathr@google.com>
1444
44dcb735
RM
1445 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1446 add_got_entry and add_got_entry_pair.
1447
13323c49
RM
1448 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1449 (HAVE_PUBNAMES): Likewise.
1450 * configure: Regenerate.
1451
1496b446
RM
1452 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1453 * testsuite/Makefile.in: Regenerate.
1454
cc84c10b
RM
1455 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1456 Remove const from declaration.
1457 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1458 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1459 * output.h (Output_file_header): Remove const from member target_
1460 and corresponding constructor argument.
1461 * output.cc (Output_file_header::Output_file_header): Update prototype.
1462 (Output_file_header::do_sized_write): Use this->target_ in place
1463 of parameters()->target().
1464
52f66a2c
RM
1465 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1466
2b64b551
RM
1467 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1468 * configure: Regenerate.
1469 * Makefile.in: Regenerate.
1470 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1471 * testsuite/merge_string_literals_2.c: Likewise.
1472 * testsuite/Makefile.am
1473 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1474 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1475 literal -fmerge-constants.
1476 * testsuite/Makefile.in: Regenerate.
1477
43819297
RM
1478 * i386.cc (Target_i386): Remove unused member dynbss_.
1479 * arm.cc (Target_arm): Likewise.
1480 * powerpc.cc (Target_powerpc): Likewise.
1481 * sparc.cc (Target_sparc): Likewise.
1482 * tilegx.cc (Target_tilegx): Likewise.
1483 * x86_64.cc (Target_x86_64): Likewise.
1484 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1485 type_signature_, type_offset_.
1486 * plugin.h (Plugin_hook): Remove unused member layout_.
1487 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1488 mapfile_.
1489 (Read_member): Remove unused members input_objects_, symtab_,
1490 mapfile_, layout_.
1491 (Check_library): Remove unused member symtab_.
1492 * archive.h (Lib_group): Remove unused member lib_.
1493 * archive.cc (Lib_group::Lib_group): Update initializer.
1494 * incremental.h (Incremental_binary): Remove unused member target_.
1495 (Incremental_script_entry): Removed unused member script_.
1496 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1497 * icf.h (Icf): Remove unused member num_tracked_relocs.
1498
39d9ead7
RM
1499 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1500 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1501 its only use.
1502 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1503
679e4abf
RM
1504 * archive.h: Use struct rather than class for forward declaration
1505 of Read_symbols_data.
1506
54de2ea6
CC
15072013-10-07 Cary Coutant <ccoutant@google.com>
1508
1509 PR gold/16010
1510 * testsuite/Makefile.am (icf_test): Fix dependencies.
1511 (icf_safe_test): Likewise.
1512 (icf_safe_so_test): Likewise.
1513 (large_symbol_alignment): Add empty _LDADD rule.
1514 * testsuite/Makefile.in: Regenerate.
1515
b14016f0
L
15162013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1517
1518 PR gold/15927
1519 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1520 relocation for R_X86_64_32 on x32.
1521
eb426534
RM
15222013-08-27 Roland McGrath <mcgrathr@google.com>
1523
1524 * output.cc (Output_segment::set_section_addresses): Take new
1525 Target* argument. If target->isolate_execinstr() and the segment
1526 is executable and starts at a target->abi_pagesize() boundary,
1527 pad its end out to a target->abi_pagesize() boundary with code fill.
1528 * output.h (Output_segment::set_section_addresses): Update decl.
1529 * layout.h (Layout::check_output_data_for_reset_values): Take new
1530 argument RELAX_OUTPUTS.
1531 (Layout): New member relax_output_list_.
1532 (Layout::add_relax_output): New method.
1533 * layout.cc (Layout::Layout): Update constructor.
1534 (Layout::reset_relax_output): New method.
1535 (Layout::clean_up_after_relaxation): Call it.
1536 (Layout::prepare_for_relaxation): Update caller.
1537 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1538 Call reset_relax_output before re-processing segments for
1539 isolate_execinstr case.
1540 (Layout::write_data): Handle relax_output_list_.
1541 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1542 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1543
9aff4b7a
NC
15442013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1545
1546 PR binutils/15834
1547 * object.h: Fix typos.
1548
93f8221c
RM
15492013-08-16 Roland McGrath <mcgrathr@google.com>
1550
1551 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1552 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1553
e44c3715
CC
15542013-08-07 Cary Coutant <ccoutant@google.com>
1555
1556 Revert support for v2 DWP files:
1557
1558 2013-03-01 Cary Coutant <ccoutant@google.com>
1559
1560 Add dwp support for v2 DWARF package file format.
1561 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1562 tu_length parameter. Adjust all callers.
1563 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1564 * dwp.cc: Include dwarf.h.
1565 (Section_bounds): New struct type.
1566 (Unit_set): New struct type.
1567 (Dwo_file::Dwo_file): Initialize new data member.
1568 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1569 Combine and rename to...
1570 (Dwo_file::read_unit_index): ...this.
1571 (Dwo_file::sized_read_compunit_index)
1572 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1573 (Dwo_file::sized_read_unit_index): ...this.
1574 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1575 parameters; add section_id parameter.
1576 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1577 (Dwo_file::add_unit_set): ...this.
1578 (Dwo_file::shndx_map_): Remove.
1579 (Dwo_file::sect_offsets_): New data member.
1580 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1581 (Dwp_output_file::add_section): Rename to...
1582 (Dwp_output_file::add_contribution): ...this.
1583 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1584 (Dwp_output_file::add_tu_set): Likewise.
1585 (Dwp_output_file::Contribution): New type.
1586 (Dwp_output_file::Section::contributions): New data member.
1587 (Dwp_output_file::Cu_or_tu_set): Remove.
1588 (Dwp_output_file::Section::Section): New ctor.
1589 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1590 (Dwp_output_file::Dwp_index::Section_table): New type.
1591 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1592 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1593 parameter.
1594 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1595 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1596 (Dwp_output_file::Dwp_index::section_table): New member function.
1597 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1598 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1599 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1600 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1601 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1602 (Dwp_output_file::Dwp_index::section_table_): New data member.
1603 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1604 (Dwp_output_file::add_output_section): New member function.
1605 (Dwp_output_file::write_new_section): New member function.
1606 (Dwp_output_file::write_contributions): New member function.
1607 (Dwp_output_file::section_id_map_): New data member.
1608 (class Dwo_id_info_reader): Remove.
1609 (class Unit_reader): New class.
1610 (get_dwarf_section_name): New function.
1611 (Dwo_file::read_executable): Adjust initializations of class data.
1612 (Dwo_file::read): Add support for v2 package file format.
1613 (Dwo_file::read_unit_index): Likewise.
1614 (Dwo_file::sized_read_unit_index): Likewise.
1615 (Dwo_file::copy_section): Likewise.
1616 (Dwo_file::add_unit_set): Likewise.
1617 (Dwp_output_file::add_output_section): Likewise.
1618 (Dwp_output_file::add_contribution): Likewise.
1619 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1620 for empty slot.
1621 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1622 file format.
1623 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1624 slot.
1625 (Dwp_output_file::initialize): Remove unused function.
1626 (Dwp_output_file::finalize): Add support for v2 package file format.
1627 (Dwp_output_file::write_index): Likewise.
1628 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1629 function prototype.
1630
c6905c28
CC
16312013-07-31 Cary Coutant <ccoutant@google.com>
1632
1633 * object.cc (Sized_relobj::do_output_section_address): New function.
1634 (Sized_relobj): Instantiate explicitly.
1635 * object.h (Object::output_section_address): New function.
1636 (Object::do_output_section_address): New function.
1637 (Sized_relobj::do_output_section_address): New function.
1638 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1639
16402013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 1641 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
1642
1643 * parameters.cc (Parameters::entry): Return target-specific entry
1644 symbol name.
1645 * target.h (Target::entry_symbol_name): New function.
1646 (Target_info::entry_symbol_name): New data member.
1647
1648 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1649 * i386.cc (Target_i386::i386_info): Likewise.
1650 (Target_i386_nacl::i386_nacl_info): Likewise.
1651 * sparc.cc (Target_sparc::sparc_info): Likewise.
1652 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1653 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1654 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1655 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1656
234d4ab8
SA
16572013-07-22 Sterling Augustine <saugustine@google.com>
1658
1659 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1660 Convert parameter shndx to local variable. Add parameters symtab
1661 and symtab_size. Scan over section names. Find relocation
1662 section corresponding to current section. Create and initialize
1663 reloc_mapper_ and reloc_type_.
1664 (Dwarf_pubnames_table::read_header): Add assertion. Change
1665 unit_length to off_t. Initialize member unit_length_. Fill in field
1666 cu_offset_.
1667 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1668 Initialize new fields unit_length_ and cu_offset_.
1669 (Dwarf_pubnames_table::read_section): Update prototype.
1670 (Dwarf_pubnames_table::cu_offset): New member function.
1671 (Dwarf_pubnames_table::subsection_size): Likewise.
1672 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1673 New fields.
1674 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1675 member functions public.
1676 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1677 Update comment. Rework logic. Move repeated parts to...
1678 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1679 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1680 pubtypes_table_, and stmt_list_offset.
1681 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1682 Gdb_index::find_pubtype_offset,
1683 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1684 (Gdb_index::pubnames_read): Update prototype and rework logic.
1685 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1686 Forward declare.
1687 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1688 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1689 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1690 Gdb_index::map_pubtable_to_dies):
1691 Declare functions.
1692 (Gdb_index::pubnames_read): Update declaration.
1693 (Gdb_index::Pubname_offset_map): New type.
1694 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1695 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1696 Gdb_index::stmt_list_offset): Declare.
1697 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1698 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1699 Gdb_index::pubtypes_offset_): Remove.
1700
a3ed37d8
RM
17012013-07-19 Roland McGrath <mcgrathr@google.com>
1702
1703 * options.h (General_options): Add -Trodata-segment option.
1704 * parameters.cc (Parameters::check_rodata_segment): New function.
1705 (Parameters::set_target_once): Call it.
1706 * parameters.h (Parameters): Declare it (private member function).
1707 * layout.cc (load_seg_unusable_for_headers): New function, broken
1708 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1709 then validate rodata segment rather than text segment.
1710 (relaxation_loop_body): Call that.
1711 (is_text_segment): New function. Don't admit a non-executable
1712 segment if TARGET->isolate_execinstr().
1713 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1714
eb5b4ded
CC
17152013-07-15 Shawn Landden <shawnlandden@gmail.com>
1716
1717 PR gold/15070
1718 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1719 * nacl.h (Sniff_file::View::View): Request aligned view.
1720
4d5effb9
CC
17212013-07-11 Cary Coutant <ccoutant@google.com>
1722
1723 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1724 correct BRLT entry size.
1725
ba8ca3e7
AM
17262013-07-03 Alan Modra <amodra@gmail.com>
1727
1728 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1729 comment.
1730
267257d2
CC
17312013-07-01 Cary Coutant <ccoutant@google.com>
1732
1733 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1734 reloc_type_.
1735 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1736 (Dwarf_ranges_table::lookup_reloc): New function.
1737 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1738 reloc_type_.
1739 (Dwarf_ranges_table::lookup_reloc): New function.
1740 (Dwarf_ranges_table::reloc_type_): New data member.
1741
06f30c9d
CC
17422013-06-27 Jing Yu <jingyu@google.com>
1743
1744 PR gold/15662
1745 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1746 function.
1747 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1748 (Target_powerpc::do_relax): Call the above.
1749
a2d7bf59
AM
17502013-06-27 Cary Coutant <ccoutant@google.com>
1751
1752 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1753 on garbage collected .opd section.
1754
17552013-06-27 Alan Modra <amodra@gmail.com>
1756
1757 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1758 is non-zero.
1759 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1760 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1761
32364e50
CC
17622013-06-14 Cary Coutant <ccoutant@google.com>
1763
1764 * resolve.cc (Symbol::override_base): Don't override st_type
1765 from plugin placeholder symbols.
1766 (Symbol_table::resolve): Likewise.
1767 (Symbol_table::should_override): Don't complain about TLS mismatch
1768 if the TO symbol is a plugin placeholder.
1769 * testsuite/Makefile.am (plugin_test_tls): New test.
1770 * testsuite/Makefile.in: Regenerate.
1771 * testsuite/plugin_test_tls.sh: New test script.
1772 * testsuite/two_file_test_2_tls.cc: New test source.
1773 * testsuite/two_file_test_tls.cc: New test source.
1774
7fb47cc9
CC
17752013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1776
1777 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1778 the maximum segment alignment is larger than the page size.
1779 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1780 correctly aligns the symbols with large alignemnt.
1781 * testsuite/Makefile.in: Regenerate.
1782 * testsuite/large_symbol_alignment.cc: New file.
1783
6934001a
CC
17842013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1785 Sriraman Tallam <tmsriram@google.com>
1786
1787 * options.h (sort_section): New option.
1788 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1789 Rename from Input_section_sort_section_name_special_ordering_compare.
1790 (Input_section_sort_section_name_compare): New struct.
1791 * output.cc (Output_section::Input_section_sort_section_name_compare::
1792 operator()): New function.
1793 (Output_section::sort_attached_input_sections): Use new sort function
1794 for .text if --sort-section=name is specified.
1795 * layout.cc (Layout::make_output_section):
1796 Add sorting by name when --sort-section=name is specified.
1797 * testsuite/Makefile.am (text_section_grouping): Test option
1798 --sort-section=name.
1799 * testsuite/Makefile.in: Regenerate.
1800 * testsuite/section_sorting_name.cc: New file.
1801 * testsuite/section_sorting_name.sh: New file.
1802
93acabad
CC
18032013-05-21 Cary Coutant <ccoutant@google.com>
1804
1805 * symtab.h (Symbol::is_cxx_vtable): New function.
1806 * target-reloc.h (relocate_section): Check for vtable symbol.
1807 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1808 * testsuite/Makefile.in: Regenerate.
1809 * testsuite/missing_key_func.cc: New test source.
1810 * testsuite/missing_key_func.sh: New test script.
1811
60e8b3fc
CC
18122013-05-21 Cary Coutant <ccoutant@google.com>
1813
2b64b551
RM
1814 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1815 type of enclosing symbol.
1816 (Relocate_info::location): Check symbol type when describing symbol.
1817 * object.h (Symbol_location_info): Remove unused line_number;
1818 add enclosing_symbol_type.
1819 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 1820
9df9de2c
CC
18212013-05-13 Cary Coutant <ccoutant@google.com>
1822
2b64b551
RM
1823 * configure.ac: Export DEFAULT_TARGET.
1824 * configure: Regenerate.
1825 * Makefile.in: Regenerate.
1826 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1827 * testsuite/Makefile.in: Regenerate.
1828 * testsuite/debug_msg.sh: Delete duplicate tests.
1829 Don't check undef_int error message match for powerpc where the
1830 source file and line number aren't available.
9df9de2c 1831
bbc5ae17
RM
18322013-05-10 Roland McGrath <mcgrathr@google.com>
1833
1834 * options.h (General_options): Add --rosegment-gap option.
1835 * options.cc (finalize): --rosegment-gap implies --rosegment.
1836 * layout.cc (set_segment_offsets): Let user option override
1837 target->rosegment_gap().
1838
0c6e6c39
RM
18392013-05-10 Roland McGrath <mcgrathr@google.com>
1840
1841 * options.h (General_options): Remove leading space from help
1842 messages for -nostdlib and --rosegment.
1843
cde7cb01
MR
18442013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1845
1846 PR ld/15365
1847 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1848
f31ae5b8
AM
18492013-05-03 Alan Modra <amodra@gmail.com>
1850
1851 * merge.cc (Output_merge_string::do_add_input_section): Correct
1852 scan for number of strings. Rename vars to avoid shadowing.
1853 Include missing terminator in input_size_.
1854
d3a7cd45
L
18552013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1856
1857 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1858 Restore empty string handling.
1859
6ad3daba
CC
18602013-05-01 Cary Coutant <ccoutant@google.com>
1861
1862 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1863 uninitialized warning.
1864
e31908b6
CC
18652013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1866
1867 * output.cc (Output_section::add_merge_input_section): Allow
1868 to merge sections if the alignment is more than character size.
1869 * merge.h (Output_merge_string::Output_merge_string): Remove
1870 assert.
1871 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1872 only not-null strings. Check the alignment of strings.
1873 * stringpool.h
1874 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1875 alignment as the argument.
1876 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1877 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1878 Align non-zero length strings according to the addralign_.
1879 (Stringpool_template<Stringpool_char>::set_string_offsets):
1880 Updating offsets according to the given alignment.
1881 * testsuite/Makefile.am (text_section_grouping): Test if string
1882 literals are getting merged.
1883 * testsuite/Makefile.in: Regenerate.
1884 * testsuite/merge_string_literals_1.c: New file.
1885 * testsuite/merge_string_literals_2.c: Ditto.
1886 * testsuite/merge_string_literals.sh: Ditto.
1887
0e804863
ILT
18882013-04-26 Ian Lance Taylor <iant@google.com>
1889
1890 * target-reloc.h (relocate_section): If the reloc offset is out of
1891 range, pass VIEW as NULL to relocate.relocate.
1892 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1893 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1894 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1895 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1896 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1897 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1898
e7c5ea40
CC
18992013-04-26 Geoff Pike <gpike@chromium.org>
1900
1901 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1902 * layout.cc (Hash_task): New class.
1903 (Layout::queue_build_id_tasks): New function.
1904 (Layout::write_build_id): Handle single-thread portion of build ID
1905 computation. (In some cases, all of it is single-threaded.) Replace
1906 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1907 functionality in fewer lines of code.
1908 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1909 * options.h (General_options): make "--build-id" default to tree
1910 rather than sha1. Add two new options related to --build-id=tree:
1911 --build-id-chunk-size-for-treehash and
1912 --build-id-min-file-size-for-treehash.
1913 * Makefile.am: add testing of --build-id=tree and related new options
1914 (these tests will be invoked by "make check").
1915 * Makefile.in: Regenerate.
1916
49926cd0
AM
19172013-04-25 Alan Modra <amodra@gmail.com>
1918
1919 * configure.tgt: Add powerpcle and powerpc64le.
1920
a4034750
AM
19212013-04-22 Alan Modra <amodra@gmail.com>
1922
1923 PR gold/15355
1924 * layout.cc (Layout::segment_precedes): Allow more than one
1925 segment with the same type and flags.
1926
e79c84aa
CC
19272013-04-15 Cary Coutant <ccoutant@google.com>
1928
1929 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1930 allocate space in file for BSS sections.
1931
2199fbe7
CC
19322013-04-15 Cary Coutant <ccoutant@google.com>
1933
1934 * script-sections.cc (Orphan_output_section): Reset address
1935 to zero after each orphaned section for relocatable links.
1936
502e8a84
CC
19372013-04-15 Cary Coutant <ccoutant@google.com>
1938
a4034750
AM
1939 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1940 section starting address for relocatable link.
1941 * testsuite/Makefile.am (script_test_11): New test.
1942 * testsuite/Makefile.in: Regenerate.
1943 * testsuite/script_test_11.c: New source file.
1944 * testsuite/script_test_11.t: New linker script.
502e8a84 1945
0cfdc767
AM
19462013-04-13 Alan Modra <amodra@gmail.com>
1947
1948 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1949 owner when sections are not adjacent and exceed group size.
1950 (Target_powerpc::group_sections): Handle corner case.
1951 (Target_powerpc::Branch_info::make_stub): Handle case where
1952 stub table doesn't exist due to branches in non-exec sections.
1953 (Target_powerpc::Relocate::relocate): Likewise.
1954
6830ee24
AM
19552013-04-11 Alan Modra <amodra@gmail.com>
1956
1957 PR gold/15354
1958 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1959 .branch_lt to match bfd ld. Adjust comments throughout file.
1960
54a3d865
ILT
19612013-04-04 Ian Lance Taylor <iant@google.com>
1962
1963 GCC PR c++/56840
1964 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1965 sections before checking whether they are included in the link.
1966
9993ba11
ST
19672013-03-29 Sriraman Tallam <tmsriram@google.com>
1968
1969 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1970 object before calling the plugin claim_file handler. Pass the elf
1971 object of the archive to the plugin. Delete the elf object if the
1972 plugin claims the file.
1973
ebacd51e
AM
19742013-03-21 Alan Modra <amodra@gmail.com>
1975
1976 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1977 segment when omagic.
1978
117be58f
AM
19792013-03-21 Alan Modra <amodra@gmail.com>
1980
1981 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1982 comparison warning.
1983 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1984 uninitialized" warning.
1985
32e2b61d
AM
19862013-03-20 Alan Modra <amodra@gmail.com>
1987
1988 * symtab.h (Symbol::clear_version): New function.
1989 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1990 is_needed by weak references. Clear version for symbols defined
1991 in as-needed objects that are not needed.
1992
b3ccdeb5
AM
19932013-03-15 Alan Modra <amodra@gmail.com>
1994
1995 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1996 static and public. Add report_err param. Return false for data refs.
1997 (Target_powerpc::rela_dyn_section): New overloaded function.
1998 (Target_powerpc::plt_, iplt_): Elucidate.
1999 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2000 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2001 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2002 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2003 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2004 push_branch and make_plt_entry for ifunc syms when
2005 reloc_needs_plt_for_ifunc.
2006 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2007 for ifunc unless reloc_needs_plt_for_ifunc.
2008
ad3d8a2f
AM
20092013-03-15 Alan Modra <amodra@gmail.com>
2010
2011 * gc.h (gc_process_relocs): Don't look through function descriptors.
2012 * icf.cc (get_section_contents): Do so here instead.
2013
4d9aa155
AM
20142013-03-13 Alan Modra <amodra@gmail.com>
2015
2016 * powerpc.cc (is_branch_reloc): Forward declare.
2017 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2018 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2019 false for 64-bit, true for 32-bit non-branch relocs.
2020 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2021 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2022 nm output.
2023 (icf_safe_test): Generate linker map file as well as nm output.
2024 (icf_safe_so_test): Likewise.
2025 * testsuite/Makefile.in: Regenerate.
2026 * testsuite/icf_test.sh: Parse linker map file to determine
2027 section folding.
2028 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2029 * testsuite/icf_safe_so_test.sh: Likewise.
2030 (X86_32_or_ARM_specific_safe_fold): Merge into..
2031 (arch_specific_safe_fold): ..this.
2032 (X86_64_specific_safe_fold): Delete unused function.
2033
57420c20
AM
20342013-03-12 Alan Modra <amodra@gmail.com>
2035
2036 * gc.h (gc_process_relocs): Look through function descriptors
2037 to determine shndx, symvalue and addend used by ICF. Tidy
2038 variable duplication.
2039
dc3714f3
AM
20402013-03-11 Alan Modra <amodra@gmail.com>
2041
2042 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2043 * layout.cc (Layout_task_runner::run): ..to here.
2044 * symtab.h (struct Symbol_location): Extract from..
2045 (class Symbol_table): ..here.
2046 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2047 * target.h (class Target): Add function_location and
2048 do_function_location functions.
2049 (class Sized_target): Add do_function_location.
2050 * object.h (class Sized_relobj_file): Move find_shdr..
2051 (class Object): ..to here.
2052 * object.cc: Likewise. Update to suit. Instantiate.
2053 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
2054 * powerpc.cc (class Powerpc_dynobj): New.
2055 (Target_powerpc::do_function_location): New function.
2056 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2057 (Powerpc_dynobj::do_read_symbols): New function.
2058 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2059
956b03bb
ILT
20602013-03-08 Ian Lance Taylor <iant@google.com>
2061
2062 * options.cc (General_options::string_to_object_format): Accept
2063 "default".
2064
4bead2d5
AM
20652013-03-08 Alan Modra <amodra@gmail.com>
2066
2067 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2068 pointer to Post_fde.
2069 (struct Post_fde): Move definition to here..
2070 * ehframe.cc (struct Post_fde): ..from here.
2071 (Cie::write): Don't alloc Post_fde.
2072 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2073
02e60bf7
AM
20742013-03-07 Alan Modra <amodra@gmail.com>
2075
2076 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2077 relocation referencing .LC0.
2078 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2079
8343f03a
AM
20802013-03-07 Alan Modra <amodra@gmail.com>
2081
2082 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2083 always_inline. Add assembly for powerpc to avoid GOT.
2084
3366d57c
AM
20852013-03-07 Alan Modra <amodra@gmail.com>
2086
2087 * testsuite/script_test_10.sh: Don't test .bss section
2088 header number.
2089
6c77229c
AM
20902013-03-06 Alan Modra <amodra@gmail.com>
2091
2092 * powerpc.cc (class Powerpc_relobj): Move some member functions.
2093 (Target_powerpc::symval_for_branch): Add symtab param. Update
2094 all callers. Handle folded sections.
2095 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
2096 to Powerpc_relobj.
2097 (Global_symbol_visitor_opd::operator()): Likewise.
2098
a39e4af6
AM
20992013-03-04 Alan Modra <amodra@gmail.com>
2100
2101 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
2102 * testsuite/Makefile.in: Regenerate.
2103
d5834edb
CC
21042013-03-01 Cary Coutant <ccoutant@google.com>
2105
2106 Add dwp support for v2 DWARF package file format.
2107 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2108 tu_length parameter. Adjust all callers.
2109 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2110 * dwp.cc: Include dwarf.h.
2111 (Section_bounds): New struct type.
2112 (Unit_set): New struct type.
2113 (Dwo_file::Dwo_file): Initialize new data member.
2114 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2115 Combine and rename to...
2116 (Dwo_file::read_unit_index): ...this.
2117 (Dwo_file::sized_read_compunit_index)
2118 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2119 (Dwo_file::sized_read_unit_index): ...this.
2120 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2121 parameters; add section_id parameter.
2122 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2123 (Dwo_file::add_unit_set): ...this.
2124 (Dwo_file::shndx_map_): Remove.
2125 (Dwo_file::sect_offsets_): New data member.
2126 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2127 (Dwp_output_file::add_section): Rename to...
2128 (Dwp_output_file::add_contribution): ...this.
2129 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2130 (Dwp_output_file::add_tu_set): Likewise.
2131 (Dwp_output_file::Contribution): New type.
2132 (Dwp_output_file::Section::contributions): New data member.
2133 (Dwp_output_file::Cu_or_tu_set): Remove.
2134 (Dwp_output_file::Section::Section): New ctor.
2135 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2136 (Dwp_output_file::Dwp_index::Section_table): New type.
2137 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2138 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2139 parameter.
2140 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2141 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2142 (Dwp_output_file::Dwp_index::section_table): New member function.
2143 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2144 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2145 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2146 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2147 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2148 (Dwp_output_file::Dwp_index::section_table_): New data member.
2149 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2150 (Dwp_output_file::add_output_section): New member function.
2151 (Dwp_output_file::write_new_section): New member function.
2152 (Dwp_output_file::write_contributions): New member function.
2153 (Dwp_output_file::section_id_map_): New data member.
2154 (class Dwo_id_info_reader): Remove.
2155 (class Unit_reader): New class.
2156 (get_dwarf_section_name): New function.
2157 (Dwo_file::read_executable): Adjust initializations of class data.
2158 (Dwo_file::read): Add support for v2 package file format.
2159 (Dwo_file::read_unit_index): Likewise.
2160 (Dwo_file::sized_read_unit_index): Likewise.
2161 (Dwo_file::copy_section): Likewise.
2162 (Dwo_file::add_unit_set): Likewise.
2163 (Dwp_output_file::add_output_section): Likewise.
2164 (Dwp_output_file::add_contribution): Likewise.
2165 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2166 for empty slot.
2167 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2168 file format.
2169 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2170 slot.
2171 (Dwp_output_file::initialize): Remove unused function.
2172 (Dwp_output_file::finalize): Add support for v2 package file format.
2173 (Dwp_output_file::write_index): Likewise.
2174 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2175 function prototype.
2176
a68a081d
CC
21772013-03-01 Cary Coutant <ccoutant@google.com>
2178
2179 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2180 function into class definition in header file.
2181 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2182 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2183 New function.
2184 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2185
9d5781f8
AM
21862013-02-28 Alan Modra <amodra@gmail.com>
2187
2188 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2189 * target.cc (Target::do_plt_fde_location): New function.
2190 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2191 accessor function, and constructor param.
2192 (struct Post_fde, Post_fdes): Declare.
2193 (Cie::write): Add post_fdes param.
2194 * ehframe.cc (Fde::write): Use plt_fde_location.
2195 (struct Post_fde): Define.
2196 (Cie::write): Stash FDEs added post merge mapping.
2197 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2198 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2199 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2200 other FDEs.
2201 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2202 (Target_powerpc::has_glink): New function.
2203 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2204 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2205 glink_eh_frame_fde_32, default_fde): New data.
2206 (Stub_table::eh_frame_added_): New var.
2207 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2208 Make const.
2209 (Stub_table::add_eh_frame): New function.
2210 (Output_data_glink::add_eh_frame): New function.
2211 (Target_powerpc::make_glink_section): Call add_eh_frame.
2212
214383dd
ILT
22132013-02-15 Ian Lance Taylor <iant@google.com>
2214
2215 * options.h (DEFINE_uint64_alias): Define.
2216 (class General_options): Add -Ttext-segment as an alias for
2217 -Ttext.
2218
91c2b899
AM
22192013-02-15 Alan Modra <amodra@gmail.com>
2220
2221 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2222 (Stub_table::do_write): ..here, two places.
2223 (Stub_table::plt_call_size): Use it here too.
2224
20e2a8aa
ILT
22252013-02-11 Ian Lance Taylor <iant@google.com>
2226
2227 * descriptors.cc (Descriptors::close_all): New function.
2228 * descriptors.h (class Descriptors): Declare close_all.
2229 (close_all_descriptors): New inline function.
2230 * plugin.cc: Include "descriptors.h".
2231 (Plugin_manager::cleanup): Call close_all_descriptors.
2232
8952bc69
AM
22332013-02-06 Alan Modra <amodra@gmail.com>
2234
2235 * README: Update coding style link.
2236
29bd8b6b
CC
22372013-01-28 Cary Coutant <ccoutant@google.com>
2238
a4034750
AM
2239 * dwp.cc (File_list): New typedef.
2240 (Dwo_name_info_reader): New class.
2241 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2242 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2243 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2244 (Dwo_file::read_executable): New function.
2245 (Dwo_file::read): Move common setup code to ...
2246 (Dwo_file::make_object): ... here.
2247 (dwp_options): Add --exec/-e.
2248 (usage): Likewise.
2249 (main): Likewise.
29bd8b6b 2250
c6ac678d
ST
22512013-01-24 Sriraman Tallam <tmsriram@google.com>
2252
2253 * layout.cc (Layout::layout): Check for option text_reorder.
2254 (Layout::make_output_section): Ditto.
2255 * options.h (text_reorder): New option.
2256 * output.cc (Input_section_sort_compare): Remove special ordering
2257 of section names.
2258 (Output_section::
2259 Input_section_sort_section_name_special_ordering_compare::
2260 operator()): New function.
2261 (Output_section::sort_attached_input_sections): Use new sort function
2262 for .text.
2263 * output.h (Input_section_sort_section_name_special_ordering_compare):
2264 New struct.
2265 * testsuite/Makefile.am (text_section_grouping): Test option
2266 --no-text-reorder
2267 * testsuite/Makefile.in: Regenerate.
2268 * testsuite/text_section_grouping.sh: Check order of functions without
2269 default text reordering.
2270
50701cc1
MF
22712013-01-18 Mike Frysinger <vapier@gentoo.org>
2272
2273 * options.h (General_options): Change default to true for new_dtags.
2274
b1b00fcc
MF
22752013-01-18 Mike Frysinger <vapier@gentoo.org>
2276
2277 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2278 when enable_new_dtags is false. Only add DT_RUNPATH when
2279 enable_new_dtags is true.
2280
ec5b8187
AM
22812013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2282
2283 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2284 used in declaration and definition consistent.
2285 (Target_powerpc::symval_for_branch): Ditto.
2286
a880d4c4
ST
22872013-01-16 Sriraman Tallam <tmsriram@google.com>
2288
2289 * testsuite/plugin_final_layout.cc: Fix comment.
2290
7c381248
ST
22912013-01-16 Sriraman Tallam <tmsriram@google.com>
2292
2293 * layout.cc (Layout::layout): Do not do default sorting for
2294 text sections when section ordering is specified.
2295 (make_output_section): Ditto.
2296 * testsuite/plugin_final_layout.cc: Name the function sections
2297 to catch reordering issues.
2298
e2458743
AM
22992013-01-15 Alan Modra <amodra@gmail.com>
2300
2301 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2302 plt-thread-safe.
2303
431ed302
AM
23042013-01-15 Alan Modra <amodra@gmail.com>
2305
2306 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2307 * testsuite/Makefile.in: Regenerate.
2308
0ec6429b
AM
23092013-01-14 Alan Modra <amodra@gmail.com>
2310
2311 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2312 * testsuite/Makefile.in: Regenerate.
2313
0bf402d5
ILT
23142013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2315
36af3926 2316 PR bfd/14430
0bf402d5
ILT
2317 Fix mingw gold build with plugins enabled
2318 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2319 * configure.ac: Export DLOPEN_LIBS and add headers check.
2320 * plugin.cc: Handle non-dlfcn case.
2321 * Makefile.in: Regenerate.
2322 * config.in: Regenerate.
2323 * configure: Regenerate.
2324 * testsuite/Makefile.in: Regenerate.
2325
9e9143bc
ST
23262013-01-09 Sriraman Tallam <tmsriram@google.com>
2327
2328 * output.h (sort_attached_input_sections): Change to be public.
2329 * script-sections.cc
2330 (Output_section_definition::set_section_addresses): Sort
2331 attached input sections according to section order before linker
2332 script assigns section addresses.
2333 (Orphan_output_section::set_section_addresses): Sort
2334 attached input sections according to section order before linker
2335 script assigns section addresses.
2336 * Makefile.am (final_layout.sh): Use a simple linker script to
2337 check if section ordering still works.
2338 * Makefile.in: Regenerate.
2339
679af368
ILT
23402013-01-09 Ben Cheng <bccheng@google.com>
2341
2342 * arm.cc (Target_arm::attributes_accept_div): New function.
2343 (Target_arm::attributes_forbid_div): New function.
2344 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2345 attribute using the same new functions as what bfd/elf32_arm.c
2346 does.
2347
3136a00e
CC
23482013-01-07 Cary Coutant <ccoutant@google.com>
2349
2350 PR gold/14993
2351 * output.cc (Output_section::add_input_section): For incremental
2352 updates, don't track input sections that are allocated from patch
2353 space.
2354
f2a6224b
L
23552013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2356 Ian Lance Taylor <iant@google.com>
2357
2358 PR gold/14897
2359 * configure.ac (--enable-ld): Removed.
2360 (install_as_default): Set to yes only for --enable-gold=default
2361 or --disable-ld.
2362 * configure: Regenerated.
2363
4f46f626
L
23642013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2365
2366 * options.h (General_options): Add -fuse-ld= for GCC linker
2367 option compatibility.
2368
26e4ef59
CC
23692013-01-04 Cary Coutant <ccoutant@google.com>
2370
2371 * configure.ac: Fix typo restoring CXXFLAGS.
2372 * configure: Regenerate.
2373
3d587466
CC
23742013-01-04 Cary Coutant <ccoutant@google.com>
2375
4f46f626
L
2376 * testsuite/Makefile.am (CXXLINK_S): New macro.
2377 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2378 * testsuite/Makefile.in: Regenerate.
3d587466 2379
44db6695
L
23802013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2381
2382 * version.cc (print_version): Update copyright year to 2013.
2383
edcac0c1
ILT
23842012-12-20 Ian Lance Taylor <iant@google.com>
2385
2386 * layout.cc (Layout::special_ordering_of_input_section): New
2387 function.
2388 (Layout::layout): If input section requires special ordering, must
2389 sort input sections.
2390 (Layout::make_output_section): May sort .text input sections.
2391 (Layout::is_section_name_prefix_grouped): Remove.
2392 * layout.h (class Layout): Declare
2393 special_ordering_of_input_section. Don't declare
2394 is_section_name_prefix_grouped.
2395 * output.cc (Output_section::add_input_section): Revert last
2396 change.
2397 (Output_section::Input_section_sort::match_file_name): Don't crash
2398 if called on output section data.
2399 (Output_section::Input_section_sort_compare): Sort based on
2400 special ordering.
2401 (Output_section::Input_section_sort_section_order_index_compare):
2402 Revert last patch.
2403 (Output_section::sort_attached_input_sections): Likewise.
2404
28f2a4ac
ST
24052012-12-18 Sriraman Tallam <tmsriram@google.com>
2406
edcac0c1 2407 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2408 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2409 * output.cc (Output_section::add_input_section): Check if section
2410 name contains special prefix. Keep input sections to sort such
2411 sections.
2412 (Output_section::Input_section_sort_section_order_index_compare
2413 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2414 (Output_section::sort_attached_input_sections): Add condition to
2415 Input_section_entry constructor call.
28f2a4ac
ST
2416 * testsuite/Makefile.am (text_section_grouping): New test.
2417 * testsuite/Makefile.in: Regenerate.
2418 * testsuite/text_section_grouping.cc: New file.
2419 * testsuite/text_section_grouping.sh: New file.
2420
5bf135a7
NC
24212012-12-17 Nick Clifton <nickc@redhat.com>
2422
2423 * Makefile.am: Add copyright notice.
2424 * NEWS: Likewise.
2425 * README: Likewise.
2426 * configure.ac: Likewise.
2427 * ftruncate.c: Likewise.
2428 * Makefile.in: Regenerate.
2429
59965708
CC
24302012-12-14 Cary Coutant <ccoutant@google.com>
2431
a4034750
AM
2432 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2433 --no-as-needed flag.
2434 (exception_separate_shared_12_test): Likewise.
2435 (incremental_copy_test): Likewise.
2436 * testsuite/Makefile.in: Regenerate.
59965708 2437
2a77e2ab
CC
24382012-12-14 Cary Coutant <ccoutant@google.com>
2439
2440 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2441 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2442
e3deeb9c
AM
24432012-12-12 Alan Modra <amodra@gmail.com>
2444
2445 * powerpc.cc (class Track_tls): New.
2446 (class Relocate, class Scan): Inherit Track_tls.
2447 (Target_powerpc::Scan::local, global): Track tls optimization
2448 and avoid creating plt entry for __tls_get_addr if all uses
2449 are optimized away.
2450 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2451
d8f5a274
AM
24522012-12-12 Alan Modra <amodra@gmail.com>
2453
2454 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2455 Replace no_toc_optimize with toc_optimize.
2456 * output.h (Output_section::input_sections): Provide non-const variant.
2457 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2458 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2459 accessors.
2460 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2461 (class Sort_toc_sections): New.
2462 (Target_powerpc::do_finalize_sections): Sort toc sections.
2463 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2464
4c8a1de1
RM
24652012-12-10 Roland McGrath <mcgrathr@google.com>
2466
2467 * testsuite/binary_unittest.cc (read_all): New function.
2468 (Sized_binary_test): Use it instead of ::read.
2469 * fileread.cc (do_read): Don't assume pread always reads the whole
2470 amount in a single call.
2471
edc27beb
AM
24722012-12-10 Alan Modra <amodra@gmail.com>
2473
2474 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2475 Set EM_PPC64 or EM_PPC here.
2476 (Target_selector_powerpc::do_recognize): Delete.
2477
906b9150
AM
24782012-12-10 Alan Modra <amodra@gmail.com>
2479
2480 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2481 stub_table_.
2482 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2483
418c15ae
RM
24842012-12-07 Roland McGrath <mcgrathr@google.com>
2485
2486 * testsuite/binary_unittest.cc (Sized_binary_test):
2487 Use open_descriptor rather than ::open.
2488
decdd3bc
AM
24892012-12-07 Alan Modra <amodra@gmail.com>
2490
2491 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2492 typedef and invalid_address constant.
2493 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2494 instantiate constants.
2495
db399005
ILT
24962012-12-06 Roland McGrath <mcgrathr@google.com>
2497
2498 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2499 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2500 * aclocal.m4: Regenerate.
2501 * configure: Regenerate.
2502 * Makefile.in: Regenerate.
2503 * testsuite/Makefile.in: Regenerate.
2504
aba6bc71
AM
25052012-12-07 Alan Modra <amodra@gmail.com>
2506
2507 * options.h (General_options): Add no_toc_optimize.
2508 * powerpc.cc (ok_lo_toc_insn): New function.
2509 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2510
9e69ed50
AM
25112012-12-06 Alan Modra <amodra@gmail.com>
2512
2513 * options.h (General_options): Add plt_align, plt_static_chain,
2514 plt_thread_safe. Update stub_group_size help text.
2515 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2516 for new plt_thread_safe_ var.
2517 (use_plt_offset): Correct comments.
2518 (Target_powerpc::do_relax): Look for thread creation symbols to
2519 determine default plt_thread_safe value. Clear plt call stubs
2520 as well as branch stubs each iteration.
2521 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2522 insn constants.
2523 (l, hi, ha, write_insn): Move earlier.
2524 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2525 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2526 plt stubs too.
2527 (Stub_table::update_size): Adjust.
2528 (Stub_table::prev_size, set_prev_size): Delete.
2529 (Stub_table::stub_align): Let --plt-align affect result.
2530 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2531 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2532 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2533 (Stub_table::do_write): Support more stub variants.
2534
f43ba157
AM
25352012-12-04 Alan Modra <amodra@gmail.com>
2536
2537 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2538 (Target_powerpc::do_define_standard_symbols): New function.
2539
34171bc5
AM
25402012-12-03 Alan Modra <amodra@gmail.com>
2541
2542 * output.h: Formatting, whitespace.
2543
dc9589e9 25442012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2545
2546 * layout.h (Layout::get_executable_sections): Declare.
2547 * layout.cc (Layout::get_executable_sections): New function.
2548 * arm.cc (Target_arm::group_sections): Use it.
2549 (Arm_output_section::group_sections): Delete now redundant test.
2550 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2551 param to handle relative relocs.
2552 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2553 (Output_data_reloc::add_absolute): Adjust.
2554 (Output_data_reloc::add_relative): New function.
2555 (Output_data::reset_data_size): New function.
2556 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2557 (Output_section::set_addralign): New function.
2558 (Output_section::checkpoint_set_addralign): New function.
2559 (Output_section::clear_section_offsets_need_adjustment): New function.
2560 (Output_section::input_sections): Make public.
2561 * powerpc.cc (class Output_data_brlt_powerpc): New.
2562 (class Stub_table, class Stub_control): New.
2563 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2564 stub_table_, set_stub_table, stub_table): New vectors and accessor
2565 functions.
2566 (Target_powerpc::do_may_relax, do_relax, push_branch,
2567 new_stub_table, stub_tables, brlt_section, group_sections,
2568 add_branch_lookup_table, find_branch_lookup_table,
2569 write_branch_lookup_table, make_brlt_section): New functions.
2570 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2571 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2572 branch_info_): New vars.
2573 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2574 make call stubs here.
2575 (Output_data_glink): Remove all call stub handling from this class.
2576 (Target_powerpc::Scan::local, global): Save interesting branch
2577 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2578 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2579 functions on final link.
2580 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2581 Handle long branch destinations too.
2582 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2583 do_plt_address_for_local): Adjust lookup of plt call stubs.
2584
627b30b7
AM
25852012-11-30 Alan Modra <amodra@gmail.com>
2586
2587 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2588 relocs against protected symbols when building 32-bit shared libs.
2589
40b469d7
AM
25902012-11-30 Alan Modra <amodra@gmail.com>
2591
2592 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2593 param. Call got_section() to make .got. Update all callers
2594 and their callers and so on.
2595
bb66a627
AM
25962012-11-30 Alan Modra <amodra@gmail.com>
2597
2598 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2599 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2600 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2601 value if it already exists.
2602
d2cf1c6c
L
26032012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2604
2605 PR gold/14858
2606 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2607
edccdf7c
RM
26082012-11-14 Roland McGrath <mcgrathr@google.com>
2609
2610 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2611 than bfc instruction for data sandboxing.
2612
6febeb74
AM
26132012-11-08 Alan Modra <amodra@gmail.com>
2614
2615 * po/POTFILES.in: Regenerate.
2616
0a6f1bf2
AM
26172012-11-05 Alan Modra <amodra@gmail.com>
2618
2619 * configure.ac: Apply 2012-09-10 change to config.in here.
2620 * configure: Regenerate.
2621
26a4e9cb
AM
26222012-11-05 Alan Modra <amodra@gmail.com>
2623
2624 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2625 (struct Opd_ent): Use "Address" rather than "Offset".
2626 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2627 (Target_powerpc::got_section): Make public.
2628 (Target_powerpc::scan_relocs): Move code setting symbols..
2629 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2630 Create _SDA_BASE_ only when referenced.
2631
cc928013
RM
26322012-11-02 Roland McGrath <mcgrathr@google.com>
2633
2634 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2635 from last change.
2636
50ed5eb1
RM
26372012-11-01 Roland McGrath <mcgrathr@google.com>
2638
62fe925a
RM
2639 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2640 for offset_in_output_section parameter.
2641 (Sized_target::relocate_special_relocatable): Likewise.
2642 * arm.cc (Target_arm::relocate_relocs): Likewise.
2643 (Target_arm::relocate_special_relocatable): Likewise.
2644 * i386.cc (Target_i386::relocate_relocs): Likewise.
2645 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2646 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2647 * target-reloc.h (relocate_relocs): Likewise.
2648 * testsuite/testfile.cc (Target_test): Likewise.
2649 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2650 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2651
2652 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2653 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2654
2655 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2656 parameter, which is unused in the [!F_SETFD] case.
2657
50ed5eb1
RM
2658 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2659 SYMNDX to off_t before comparing it to this->data_size().
2660 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2661 * incremental.cc (Output_section_incremental_inputs::do_write):
2662 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2663
2cadc0bf
RM
2664 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2665
3bfcb652
NC
26662012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2667
2668 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2669 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2670 in EABI_VER5.
2671
c1a8d56e
CC
26722012-10-29 Cary Coutant <ccoutant@google.com>
2673
2674 * dwp.cc (usage): Add file and exit status parameters;
2675 add --help and --version options.
2676 (print_version): New function.
2677 (main): Add --help and --version options.
2678
b2490a7b
L
26792012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2680
2681 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2682 final_layout_sequence.txt.
2683 * testsuite/Makefile.in: Regenerated.
2684
aa543512
L
26852012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2686
2687 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2688 COMPILE generated by automake.
2689 (LINK1): Likewise.
2690 (CXXCOMPILE1): Likewise.
2691 (CXXLINK1): Likewise.
2692 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2693 (LINK): Likewise.
2694 (CXXCOMPILE): Likewise.
2695 (CXXLINK): Likewise.
2696 * testsuite/Makefile.in: Regenerated.
2697
d361fafb
L
26982012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2699
2700 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2701 on bad fwrite return.
2702
598c7410
L
27032012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2704
2705 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2706 on val.
2707
35c813e2
CC
27082012-10-23 Cary Coutant <ccoutant@google.com>
2709
2710 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2711 * testsuite/Makefile.in: Regenerate.
2712 * testsuite/dwp_test.h: New source file.
2713 * testsuite/dwp_test_1.cc: New source file.
2714 * testsuite/dwp_test_1.s: New source file.
2715 * testsuite/dwp_test_1.sh: New source file.
2716 * testsuite/dwp_test_1b.cc: New source file.
2717 * testsuite/dwp_test_1b.s: New source file.
2718 * testsuite/dwp_test_2.cc: New source file.
2719 * testsuite/dwp_test_2.s: New source file.
2720 * testsuite/dwp_test_2.sh: New source file.
2721 * testsuite/dwp_test_main.cc: New source file.
2722 * testsuite/dwp_test_main.s: New source file.
2723
77429909
CC
27242012-10-23 Cary Coutant <ccoutant@google.com>
2725
2726 * dwp.h: New header file.
2727 * dwp.cc: New source file.
2728 * gold.h: Move shared declarations to system.h.
2729 * system.h: New header file.
2730 * Makefile.am: Add dwp.
2731 * Makefile.in: Regenerate.
2732
ed5d6712
CC
27332012-10-23 Cary Coutant <ccoutant@google.com>
2734
2735 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2736 Dwarf_info_reader::read_from_pointer.
2737 (Dwarf_pubnames_table::read_header): Likewise.
2738 (Dwarf_pubnames_table::next_name): Likewise.
2739 (Dwarf_die::read_attributes): Likewise.
2740 (Dwarf_die::skip_attributes): Likewise.
2741 (Dwarf_info_reader::read_from_pointer): New function template.
2742 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2743 (Dwarf_pubnames_table): Likewise.
2744 (Dwarf_info_reader::read_from_pointer): New function template.
2745 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2746 Dwarf_pubnames_table ctor.
2747
8787852d
CC
27482012-10-23 Cary Coutant <ccoutant@google.com>
2749
2750 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2751 abbrev_shndx.
2752 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2753 abbrev_shndx_.
2754 (Dwarf_info_reader::set_abbrev_shndx): New method.
2755 (Dwarf_info_reader::abbrev_shndx_): New data member.
2756
9fc236f3
CC
27572012-10-23 Cary Coutant <ccoutant@google.com>
2758
2759 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2760 from object, not parameters.
2761 (Dwarf_info_reader::parse): Likewise.
2762 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2763 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2764 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2765 methods.
2766
effe8365
CC
27672012-10-23 Cary Coutant <ccoutant@google.com>
2768
2769 * fileread.cc (Input_file::Input_file): New constructor.
2770 * fileread.h (class Input_file): Add new constructor.
2771
1698990d
AM
27722012-10-18 Alan Modra <amodra@gmail.com>
2773
2774 PR gold/14727
2775 * object.cc (Relobj::is_section_name_included): Also match
2776 .sdata personality section.
2777
168a4726
AM
27782012-10-18 Alan Modra <amodra@gmail.com>
2779
2780 * target-reloc.h (class Default_comdat_behavior): New, package up..
2781 (get_comdat_behaviour): ..this.
2782 (relocate_section): Add Relocate_comdat_behavior template arg,
2783 adjust code to suit.
2784 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2785 (Target_arm::scan_reloc_section): Likewise.
2786 * i386.cc (Target_i386::relocate_section): Likewise.
2787 * sparc.cc (Target_sparc::relocate_section): Likewise.
2788 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2789 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2790 * powerpc.cc (class Relocate_comdat_behavior): New.
2791 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2792 gold::relocate_section with new template arg.
2793
acc276d8
AM
27942012-10-18 Alan Modra <amodra@gmail.com>
2795
2796 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2797 dynamic relocs for GOT_TPREL got entries, without symbol if
2798 resolving locally.
2799 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2800 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2801 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2802
e10f9870
AM
28032012-10-17 Alan Modra <amodra@gmail.com>
2804
2805 PR gold/14726
2806 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2807
ae034989
ST
28082012-10-16 Sriraman Tallam <tmsriram@google.com>
2809
2810 * layout.cc (Layout::include_section): Keep sections marked
2811 SHF_EXCLUDE when doing relocatable links.
2812
f3a0ed29
AM
28132012-10-16 Alan Modra <amodra@gmail.com>
2814
2815 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2816 (Target_powerpc::do_finalize_sections): Call it.
2817 (Output_data_save_res): New class and supporting functions.
2818 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2819 normal symbols defined in object files.
2820
c6de8ed4
AM
28212012-10-12 Alan Modra <amodra@gmail.com>
2822
2823 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2824 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2825 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2826 section if scan_opd_relocs not yet called.
2827 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2828
03e25981
AM
28292012-10-12 Alan Modra <amodra@gmail.com>
2830
2831 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2832 add_local_ifunc_entry): Revert last change.
2833 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2834
c9824451
AM
28352012-10-05 Alan Modra <amodra@gmail.com>
2836
2837 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2838 do_plt_address_for_global): New functions.
2839 (Output_data_got_powerpc::do_write): Don't segfault when linking
2840 statically.
2841 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2842 add_local_ifunc_entry): Return true on adding entry..
2843 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2844 glink->add_entry call. Remove unused symtab param. Adjust calls.
2845 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2846 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2847 set up symbols here.
2848 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2849 syms here. Do so even when no .iplt. Don't segfault when linking
2850 statically.
2851 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2852 new variants without reloc param.
2853 (Glink_sym_ent::Glink_sym_ent): Likewise.
2854 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2855 reloc when refs will resolve to plt call stub.
2856 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2857 R_PPC_PLTREL24 to resolve locally.
2858 (Target_powerpc::Scan::global): Correct ifunc handling.
2859 (Target_powerpc::Relocate::relocate): Correct local sym glink
2860 lookup. Don't destroy "value" when we have a plt call stub,
2861 and when checking plt call validity.
2862 (Target_powerpc::do_dynsym_value): Simplify.
2863
19fec8c1
AM
28642012-10-05 Alan Modra <amodra@gmail.com>
2865
2866 * i386.cc (Output_data_plt_i386::address_for_global,
2867 address_for_local): Add plt offset to returned value. Adjust uses.
2868 * sparc.cc (Output_data_plt_sparc::address_for_global,
2869 address_for_local): Likewise.
2870 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2871 address_for_local): Likewise.
2872 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2873 address_for_local): Likewise.
2874 * target.h (Target::plt_address_for_global, plt_address_for_local):
2875 Update comment.
2876 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2877 (Output_data_got::Got_entry::write): Nor here.
2878 * output.h: Comment fix.
2879
e867b647
WL
28802012-10-02 Jiong Wang <jiwang@tilera.com>
2881
2882 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2883 global_offset_table_ value for larget got.
2884 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2885
e5d5f5ed
AM
28862012-09-29 Alan Modra <amodra@gmail.com>
2887
2888 * powerpc.cc (Target_powerpc::iplt_): New output section.
2889 (Target_powerpc::iplt_section, make_iplt_section,
2890 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2891 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2892 Target_powerpc::plt_entry_count): Count iplt entries too.
2893 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2894 reloc section in constructor. New params.
2895 (Target_powerpc::make_plt_section): Create reloc section here instead.
2896 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2897 functions.
2898 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2899 (Output_data_glink::add_entry, find_entry): New functions to
2900 deal with local syms.
2901 (Glink_sym_ent): Add support for local syms.
2902 (Output_data_glink::do_write): Handle ifunc plt entries.
2903 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2904 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2905 (Target_powerpc::Relocate::relocate): Likewise.
2906 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2907
ec4dbad3
AM
29082012-09-25 Alan Modra <amodra@gmail.com>
2909
2910 * object.h (Sized_relobj_file::adjust_local_symbol,
2911 do_adjust_local_symbol): New functions.
2912 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2913 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2914 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2915 and irregular opd entry spacing.
2916 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2917 (Global_symbol_visitor_opd): New functor.
2918 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2919 on deleted opd entries.
2920
5c0b3823
WL
29212012-09-15 Jiong Wang <jiwang@tilera.com>
2922
2923 * tilegx.cc: New file.
2924 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2925 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2926 * configure.tgt: Add entries for tilegx*.
2927 * configure.ac: Likewise.
2928 * Makefile.in: Rebuild.
2929 * configure: Likewise.
2930 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2931 tilegx.
2932
bfdfa4cd
AM
29332012-09-13 Alan Modra <amodra@gmail.com>
2934
2935 * target-reloc.h (scan_relocs): Call scan.local for relocs
2936 against symbols in discarded sections. Pass is_discarded
2937 param.
2938 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2939 Add is_discarded param.
2940 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2941 is_discarded to flag opd entry as discarded. Don't emit dyn
2942 relocs on such entries.
2943 (Target_powerpc::Scan::global): Similarly detect and handle
2944 such opd entries.
2945 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2946 opd_ent_. Update all uses.
2947 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2948 (Target_powerpc::relocate_section): Zero out discarded opd
2949 entry relocs.
2950
d77a0555
ILT
29512012-09-12 Ian Lance Taylor <iant@google.com>
2952
2953 PR gold/14570
2954 * output.cc: Rename Output_data_got template parameter from size
2955 to got_size for all functions. Compile all variants of
2956 Output_data_got.
2957 (Output_data_got::Got_entry::write): Correct use of size for
2958 symbol value. Use local_is_tls rather than casting to
2959 Sized_relobj_file.
2960 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2961 (class Sized_relobj_file): Add do_local_is_tls.
2962 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2963
815a1205
AM
29642012-09-11 Alan Modra <amodra@gmail.com>
2965
2966 PR gold/14566
2967 * layout.cc (Layout::set_segment_offsets): When using
2968 common-page-size alignment, ensure we are on a new max-page-size
2969 page.
2970 * output.cc (Output_segment::set_section_addresses): Use
2971 abi_pagesize, not common_pagesize for relro boundary.
2972 (Output_segment::set_offset): Likewise.
2973
bd73a62d
AM
29742012-09-11 Alan Modra <amodra@gmail.com>
2975
2976 * output.h (Output_data_got::add_global_tls, add_local_tls,
2977 add_local_tls_pair): New functions.
2978 (Output_data_got::add_local_pair_with_rel): Remove second
2979 reloc param. Expand comment.
2980 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2981 use_plt_or_tls_offset_, similarly for constructor param.
2982 (Output_data_got::Got_entry::write): Add got_index param.
2983 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2984 add_local_tls_pair): New functions.
2985 (Output_data_got::Got_entry::write): Handle tls symbols
2986 with use_plt_or_tls_offset_ set specially.
2987 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2988 (Output_data_got::do_write): Replace iterator with index, pass
2989 index to entry write function.
2990 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2991 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2992 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2993 call.
2994 * i386.cc (Target_i386::Scan::local): Likewise.
2995 * sparc.cc (Target_sparc::Scan::local): Likewise.
2996 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2997 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2998 do_tls_offset_for_global): New functions.
2999 (Target_powerpc::Scan::local): Correct TLS relocations and got
3000 entry values.
3001 (Target_powerpc::Scan::global): Don't emit unnecessary
3002 dynamic relocations on TLS GOT entries.
3003
00716ab1
AM
30042012-09-10 Matthias Klose <doko@ubuntu.com>
3005
3006 * config.in: Disable sanity check for kfreebsd.
3007
c891b3f9
SA
30082012-09-10 Sterling Augustine <saugustine@google.com>
3009
3010 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3011 (Gdb_index::pubtypes_read): New parameter.
3012 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3013 to calls.
3014 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3015 pubtypes_object_.
3016
e81fea4d
AM
30172012-09-09 Alan Modra <amodra@gmail.com>
3018
3019 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3020 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3021 * gc.h (gc_process_relocs): Call target gc_add_reference.
3022 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3023 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3024 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3025 unnecessary cast.
3026 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3027 to cater for when we don't need code offset. Update use.
3028 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3029 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3030 set_opd_valid): New functions.
3031 (Target_powerpc::do_gc_add_reference): New function.
3032 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3033 stashed refs.
3034 (Target_powerpc::do_gc_mark_symbol): New function.
3035
d2d60eef
CC
30362012-09-06 Cary Coutant <ccoutant@google.com>
3037
3038 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3039 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3040 (Dwarf_die::skip_attributes): Likewise.
3041 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3042 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3043 (main): Call it.
3044 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3045
32ed4573
L
30462012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3047
3048 * testsuite/script_test_3.t: Add .got.plt output section
3049 statement.
3050 * testsuite/script_test_4.t: Likewise.
3051
f4baf0d4
AM
30522012-09-05 Alan Modra <amodra@gmail.com>
3053
3054 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
3055 update all uses and lose "enum" when using type.
3056
864a1b56
AM
30572012-09-05 Alan Modra <amodra@gmail.com>
3058
3059 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3060 * configure: Regenerate.
3061 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3062 (plugin_final_layout.stdout): Likewise.
3063 (memory_test): Set page sizes to 0x1000.
3064 * testsuite/Makefile.in: Regenerate.
3065 * testsuite/discard_locals_test.sh: Add FIXME comment.
3066 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3067 * testsuite/pr14265.t: Add .got output section statement.
3068 * testsuite/script_test_2.t: Likewise.
3069 * testsuite/script_test_3.t: Likewise.
3070 * testsuite/script_test_4.t: Likewise.
3071 * testsuite/script_test_5.t: Likewise.
3072 * testsuite/script_test_6.t: Likewise.
3073 * testsuite/script_test_7.t: Likewise.
3074 * testsuite/script_test_9.t: Likewise.
3075
3ea0a085
AM
30762012-09-05 Alan Modra <amodra@gmail.com>
3077
3078 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3079 (Powerpc_relocate_functions::Status): New typedef.
3080 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3081 (Target_powerpc::Scan::local): Handle REL64.
3082 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3083 for REL32 and REL64.
3084 (Target_powerpc::symval_for_branch): New function, extracted from..
3085 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3086 checks. Report overflow errors.
3087
7404fe1b
AM
30882012-09-05 Alan Modra <amodra@gmail.com>
3089
3090 * object.h (Sized_relobj_file::emit_relocs): Delete.
3091 (Sized_relobj_file::emit_relocs_reltype): Delete.
3092 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
3093 relocate_relocs for --emit-relocs.
3094 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
3095 * output.h: Update comment.
3096 (Output_segment::first_section): New function.
3097 (Output_segment::first_section_load_address): Use first_section.
3098 * output.cc (Output_segment::first_section): New function extracted..
3099 (Output_segment::first_section_load_address): ..from here. Delete.
3100 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
3101 * target.h (Sized_target::relocate_for_relocatable): Likewise.
3102 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
3103 adjust call to target.h function.
3104 * i386.cc (Target_i386): Likewise.
3105 * sparc.cc (Target_sparc): Likewise.
3106 * x86_64.cc (Target_x86_64): Likewise.
3107 * powerpc.cc (Target_powerpc): Likewise.
3108 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
3109 first tls section has section symbol for optimised local dynamic
3110 output relocs.
3111 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
3112 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
3113 optimised tls code.
3114 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
3115 Rename to relocate_relocs. Update error message.
3116
957564c9
AS
31172012-09-04 Andreas Schwab <schwab@linux-m68k.org>
3118
3119 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
3120 --just-symbols.
3121
dd93cd0a
AM
31222012-08-31 Alan Modra <amodra@gmail.com>
3123
3124 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3125 (Powerpc_relobj::toc_base_offset): New stub function.
3126 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3127 got_mod_index_offset to tlsld_got_offset. Update all refs.
3128 (Target_powerpc::Relocate::enum skip_tls): New.
3129 (Target_powerpc::call_tls_get_addr_): New var.
3130 (Target_powerpc::is_branch_reloc): Move to file scope.
3131 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3132 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3133 New functions.
3134 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3135 (powerpc_info): Correct common_pagesize for ppc64.
3136 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3137 (Powerpc_relocate_functions): Add overflow check enums and functions.
3138 Add non-shift version of rela, rela_ua. Delete all rel public
3139 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3140 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3141 addr16_ha3, addr14 functions.
3142 (Output_data_got_powerpc::add_constant_pair): New function.
3143 (Output_data_got_powerpc::got_base_offset): Likewise.
3144 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3145 (instruction constants): Sort, add some more.
3146 (Output_data_glink::do_write): Add and use Address typedef. Use
3147 object->toc_base_offset() stub for 64-bit.
3148 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3149 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3150 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3151 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3152 Always treat .opd relocs as against locally defined symbol.
3153 Correct condition for RELATIVE relocs.
3154 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3155 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3156 for 32-bit syms with a plt entry. Correct ppc64 toc base
3157 calculations. Handle TLS relocs, and more. Add overflow
3158 checking and adjust for Powerpc_relocate_functions changes.
3159 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3160 Reinstate --emit-relocs code with FIXME.
3161
a1373b60
AM
31622012-08-30 Alan Modra <amodra@gmail.com>
3163
3164 * layout.cc (Layout::set_segment_offsets): Set p_align to
3165 abi_pagesize, not common_pagesize.
3166 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3167 to determine whether file header can go in segment.
3168
703d02da
AM
31692012-08-30 Alan Modra <amodra@gmail.com>
3170
3171 * output.h (Output_reloc::Output_reloc <output section>): Add
3172 is_relative param. Adjust calls.
3173 (Output_reloc::add_output_section_relative): New functions.
3174 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3175 is_relative.
3176 (Output_reloc::symbol_value): Handle SECTION_CODE.
3177
16164a6b
ST
31782012-08-24 Sriraman Tallam <tmsriram@google.com>
3179
3180 * gold.cc (queue_middle_tasks): Call layout again when unique
3181 segments for sections is desired.
3182 * layout.cc (Layout::Layout): Initialize new members.
3183 (Layout::get_output_section_flags): New function.
3184 (Layout::choose_output_section): Call get_output_section_flags.
3185 (Layout::layout): Make output section for mapping to a unique segment.
3186 (Layout::insert_section_segment_map): New function.
3187 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 3188 output sections marked so.
16164a6b
ST
3189 (Layout::segment_precedes): Check for unique segments when sorting.
3190 * layout.h (Layout::Unique_segment_info): New struct.
3191 (Layout::Section_segment_map): New typedef.
3192 (Layout::insert_section_segment_map): New function.
3193 (Layout::get_output_section_flags): New function.
3194 (Layout::is_unique_segment_for_sections_specified): New function.
3195 (Layout::set_unique_segment_for_sections_specified): New function.
3196 (Layout::unique_segment_for_sections_specified_): New member.
3197 (Layout::section_segment_map_): New member.
3198 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3199 Rename is_gc_pass_one to is_pass_one.
3200 Rename is_gc_pass_two to is_pass_two.
3201 Rename is_gc_or_icf to is_two_pass.
3202 Check for which pass based on whether symbols data is present.
3203 Make it two pass when unique segments for sections is desired.
3204 * output.cc (Output_section::Output_section): Initialize new
3205 members.
3206 * output.h (Output_section::is_unique_segment): New function.
3207 (Output_section::set_is_unique_segment): New function.
3208 (Output_section::is_unique_segment_): New member.
3209 (Output_section::extra_segment_flags): New function.
3210 (Output_section::set_extra_segment_flags): New function.
3211 (Output_section::extra_segment_flags_): New member.
3212 (Output_section::segment_alignment): New function.
3213 (Output_section::set_segment_alignment): New function.
3214 (Output_section::segment_alignment_): New member.
3215 (Output_segment::Output_segment): Initialize is_unique_segment_.
3216 (Output_segment::is_unique_segment): New function.
3217 (Output_segment::set_is_unique_segment): New function.
3218 (Output_segment::is_unique_segment_): New member.
3219 * plugin.cc (allow_unique_segment_for_sections): New function.
3220 (unique_segment_for_sections): New function.
3221 (Plugin::load): Add new functions to transfer vector.
3222 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3223 * Makefile.in: Regenerate.
3224 * testsuite/plugin_final_layout.sh: Check if unique segment
3225 functionality works.
3226 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3227 are available.
3228 (allow_unique_segment_for_sections): New global.
3229 (unique_segment_for_sections): New global.
3230 (claim_file_hook): Call allow_unique_segment_for_sections.
3231 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 3232
1e2bee4f
CC
32332012-08-22 Cary Coutant <ccoutant@google.com>
3234
3235 * layout.cc (Layout::include_section): Don't assert on GROUP
3236 sections with --emit-relocs.
3237
1d5dfe78
CC
32382012-08-21 Cary Coutant <ccoutant@google.com>
3239
3240 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3241 if --export-dynamic-symbol names an undef symbol.
3242
c9269dff
AM
32432012-08-18 Alan Modra <amodra@gmail.com>
3244
3245 * powerpc.cc: Formatting and white space.
3246 (Powerpc_relobj): Rename got2_section_ to special_.
3247 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3248 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3249 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3250 (Target_powerpc): Add Address typedef and invalid_address. Use
3251 throughout.
3252 (Target_powerpc::is_branch_reloc): New function.
3253 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3254 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3255 for dst_mask, value and addend.
3256 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3257 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3258 (Output_data_glink::do_write): Correct toc base. Don't try to use
3259 uint16_t for 24-bit offset. Use get_output_section_offset and
3260 check return.
3261 (Target_powerpc::Scan::local): Handle more relocs.
3262 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3263 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3264 Plug in toc restoring insn after plt calls. Translate branches
3265 to function descriptor symbols to corresponding entry point.
3266 (Target_powerpc::relocate_for_relocatable): Check return from
3267 get_output_section_offset.
3268 * symtab.h: Comment typo.
3269
b1759dce
ILT
32702012-08-14 Ian Lance Taylor <iant@google.com>
3271
3272 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3273 unsupported_relocal_local to call unsupported_reloc_global.
3274
b9b2ae8b
NC
32752012-08-14 Nick Clifton <nickc@redhat.com>
3276
3277 PR ld/14265
3278 * script-sections.cc (Sections_element::output_section_name): Add
3279 keep return parameter.
3280 (Output_section_element::match_name): Add keep return parameter.
3281 Return the value of the keep_ member.
3282 * script-sections.h (class Output_section): Update
3283 output_section_name prototype.
3284 * layout.cc (Layout::keep_input_section): New public member
3285 function.
3286 (Layout::choose_output_section): Pass keep parameter to
3287 output_section_name.
3288 * layout.h (class Layout): Add keep_input_section.
3289 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3290 sections.
3291 * testsuite/Makefile.am: Add a test.
3292 * testsuite/Makefile.in: Regenerate.
3293 * testsuite/pr14265.c: Source file for the test.
3294 * testsuite/pr14265.t: Linker script for the test.
3295 * testsuite/pr14265.sh: Shell script for the test.
3296
921b5322
AM
32972012-08-14 Alan Modra <amodra@gmail.com>
3298
3299 * target.h (Target::output_section_name): New function.
3300 (Target::do_output_section_name): New function.
3301 * layout.cc (Layout::choose_output_section): Call the above.
3302 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3303
6ce78956
AM
33042012-08-14 Alan Modra <amodra@gmail.com>
3305
3306 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3307 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3308 for replace_constant call.
3309 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3310 (Output_data_glink::do_print_to_mapfile): New function.
3311 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3312 (Target_powerpc::Relocate::relocate): Likewise.
3313
d1a8cabd
AM
33142012-08-14 Alan Modra <amodra@gmail.com>
3315
3316 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3317 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3318 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3319 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3320 all references to shndx_. Handle special case for R_PPC_PLTREL24
3321 here.
3322 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3323 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3324 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3325 here.
3326 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3327 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3328
d83ce4e3
AM
33292012-08-12 Alan Modra <amodra@gmail.com>
3330
3331 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3332 (glink insn constants): Use uint32_t.
3333 (Output_data_glink::add_entry): Use insert, not [] operator.
3334
cf43a2fe
AM
33352012-08-11 Alan Modra <amodra@gmail.com>
3336
3337 * object.h (Sized_relobj_file::find_shdr): New function.
3338 (Sized_relobj_file::find_special_sections): New function.
3339 * object.cc (Sized_relobj_file::find_shdr): New function.
3340 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3341 (Sized_relobj_file::find_special_sections): New function, split out..
3342 (Sized_relobj_file::do_read_symbols): ..from here.
3343 * output.h (Output_data_got::replace_constant): New function.
3344 (Output_data_got::num_entries): New function.
3345 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3346 (Output_data_got::got_offset): Protected rather than private.
3347 (Output_data_got::replace_got_entry): New function.
3348 * output.cc (Output_data_got::replace_got_entry): New function.
3349 * powerpc.cc (class Powerpc_relobj): New.
3350 (class Powerpc_relocate_functions): Delete all psymval variants or
3351 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3352 Implement _ha functions using corresponding _hi function.
3353 (Powerpc_relobj::find_special_sections): New function.
3354 (Target_powerpc::do_make_elf_object): New function.
3355 (class Output_data_got_powerpc): New.
3356 (class Output_data_glink): New.
3357 (class Powerpc_scan_relocatable_reloc): New.
3358 Many more changes througout file.
3359
3c892704
NC
33602012-08-09 Nick Clifton <nickc@redhat.com>
3361
3362 * po/vi.po: Updated Vietnamese translation.
3363
82435b3b
ILT
33642012-08-07 Ian Lance Taylor <iant@google.com>
3365
3366 * layout.cc (Layout::add_target_dynamic_tags): If
3367 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3368 plt_rel.
3369
a6dc81d2
NC
33702012-07-30 Nick Clifton <nickc@redhat.com>
3371
3372 * po/gold.pot: Updated template.
3373 * po/es.po: Updated Spanish translation.
3374
f1415016
CC
33752012-07-18 Cary Coutant <ccoutant@google.com>
3376
3377 PR gold/14344
3378 * configure.ac: Add check for -gpubnames support.
3379 * configure: Regenerate.
3380 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3381 support; force -gno-pubnames.
3382 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3383 support.
3384 (gdb_index_test_4): New test.
3385 * testsuite/Makefile.in: Regenerate.
3386 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3387 * testsuite/gdb_index_test_2.sh: Likewise.
3388 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3389 * testsuite/gdb_index_test_4.sh: New script.
3390 * testsuite/gdb_index_test_comm.sh: New script with common code;
3391 don't look for space after colon.
3392
b7fd7c37
ST
33932012-07-16 Sriraman Tallam <tmsriram@google.com>
3394
3395 * gold.cc (queue_middle_tasks): Update function order only after
3396 deferred objects due to plugins are processed.
3397
1f3212db
ILT
33982012-07-11 Ian Lance Taylor <iant@google.com>
3399
3400 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3401 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3402 (Target_arm::scan_reloc_for_stub): Likewise.
3403 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3404 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3405 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3406 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3407 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3408
81c82a68
ILT
34092012-07-10 Dodji Seketeli <dodji@redhat.com>
3410 Ian Lance Taylor <iant@google.com>
3411
3412 PR gold/14309
3413 * configure.ac: Test whether std::tr1::hash<off_t> works.
3414 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3415 needed.
3416 * output.h (class Output_fill): Add virtual destructor.
3417 * configure, config.in: Rebuild.
3418
eabc84f4
RM
34192012-06-22 Roland McGrath <mcgrathr@google.com>
3420
3421 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3422
370e30b6
RÁE
34232012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3424
3425 * plugin.cc (Plugin::load): Handle position independent executables.
3426
fb1b895d
CC
34272012-06-06 Cary Coutant <ccoutant@google.com>
3428
3429 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3430 add .debug_macro.
3431 (lines_only_debug_sections): Likewise.
3432 (gdb_fast_lookup_sections): New static array.
3433 (is_gdb_debug_section): Rename formal parameter.
3434 (is_lines_only_debug_section): Likewise.
3435 (is_gdb_fast_lookup_section): New function.
3436 (Layout::include_section): Check for ".zdebug_" prefix; pass
3437 section name suffix to is_gdb_debug_section, et al.; check for
3438 fast-lookup sections when building .gdb_index.
3439 * options.h (--strip-debug-gdb): Update GDB version number.
3440
7c0640fa
CC
34412012-06-06 Cary Coutant <ccoutant@google.com>
3442
3443 * configure.ac: Add check for fallocate.
3444 * configure: Regenerate.
3445 * config.in: Regenerate.
3446
3447 * options.h (class General_options): Add --mmap-output-file and
3448 --posix-fallocate options.
3449 * output.cc: (posix_fallocate): Remove; replace with...
3450 (gold_fallocate): New function.
3451 (Output_file::map_no_anonymous): Call gold_fallocate.
3452 (Output_file::map): Check --mmap-output-file option.
3453
2a49eb69
DK
34542012-06-05 Jing Yu <jingyu@google.com>
3455
3456 * gold.h (textdomain): Add do {} to empty while(0).
3457 (bindtextdomain): Likewise.
3458
fad072ac
CC
34592012-06-04 Cary Coutant <ccoutant@google.com>
3460
3461 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3462 has_dynsym_index.
3463
8cc69fb6
ST
34642012-05-25 Sriraman Tallam <tmsriram@google.com>
3465
3466 * symtab.cc (Symbol_table::define_special_symbol):
3467 Initialize *poldsym to prevent uninitialized variable errors.
3468
1be75daa
CC
34692012-05-23 Cary Coutant <ccoutant@google.com>
3470
3471 * layout.cc (Layout::section_name_mapping): Add rules to handle
3472 exact match on .data.rel.ro.local or .data.rel.ro.
3473 (Layout::output_section_name): Check for exact matches.
3474
9b689de0
CC
34752012-05-23 Cary Coutant <ccoutant@google.com>
3476
3477 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3478 more carefully.
3479
b24fdbf5
CC
34802012-05-22 Cary Coutant <ccoutant@google.com>
3481
3482 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3483 object before exporting symbol.
3484
e550e1a2
L
34852012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3486
3487 * testsuite/tls_test.cc: Include "config.h" first.
3488 * testsuite/tls_test_c.c: Likewise.
3489
df7b86aa
NC
34902012-05-17 Daniel Richard G. <skunk@iskunk.org>
3491 Nick Clifton <nickc@redhat.com>
3492
3493 PR 14072
3494 * configure.in: Add check that sysdep.h has been included before
3495 any system header files.
3496 * configure: Regenerate.
3497 * config.in: Regenerate.
3498
1007b503
CC
34992012-05-14 Cary Coutant <ccoutant@google.com>
3500
3501 * layout.cc (Layout::make_output_section): Mark .tdata section
3502 as RELRO.
3503 * testsuite/relro_test.cc: Add a TLS variable.
3504
fd885f3a
L
35052012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3506
3507 PR gold/14091
3508 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3509 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3510 R_X86_64_64.
3511
80f5885c
CC
35122012-05-08 Cary Coutant <ccoutant@google.com>
3513
3514 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3515 (lines_only_debug_sections): Likewise.
3516
2e702c99
RM
35172012-05-02 Roland McGrath <mcgrathr@google.com>
3518
3519 * nacl.cc: New file.
3520 * nacl.h: New file.
3521 * Makefile.am (CCFILES, HFILES): Add them.
3522 * Makefile.in: Regenerate.
3523 * i386.cc (Output_data_plt_i386_nacl): New class.
3524 (Output_data_plt_i386_nacl_exec): New class.
3525 (Output_data_plt_i386_nacl_dyn): New class.
3526 (Target_i386_nacl): New class.
3527 (Target_selector_i386_nacl): New class.
3528 (target_selector_i386): Use it instead of Target_selector_i386.
3529 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3530 (Target_x86_64_nacl): New class.
3531 (Target_selector_x86_64_nacl): New class.
3532 (target_selector_x86_64, target_selector_x32): Use it instead of
3533 Target_selector_x86_64.
3534 * arm.cc (Output_data_plt_arm_nacl): New class.
3535 (Target_arm_nacl): New class.
3536 (Target_selector_arm_nacl): New class.
3537 (target_selector_arm, target_selector_armbe): Use it instead of
3538 Target_selector_arm.
3539
3540 * target-select.cc (select_target): Take new Input_file* and off_t
3541 arguments, pass them on to recognize method of selector.
3542 * object.cc (make_elf_sized_object): Update caller.
3543 * parameters.cc (parameters_force_valid_target): Likewise.
3544 * incremental.cc (make_sized_incremental_binary): Likewise.
3545 * target-select.h: Update decl.
3546 (Target_selector::recognize): Take new Input_file* argument,
3547 pass it on to do_recognize.
3548 (Target_selector::do_recognize): Take new Input_file* argument.
3549 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3550 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3551 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3552 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3553
3554 * target.h (Target::Target_info): New members isolate_execinstr
3555 and rosegment_gap.
3556 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3557 * arm.cc (Target_arm::arm_info): Update initializer.
3558 * i386.cc (Target_i386::i386_info): Likewise.
3559 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3560 * sparc.cc (Target_sparc::sparc_info): Likewise.
3561 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3562 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3563 * layout.cc (Layout::attach_allocated_section_to_segment):
3564 Take new const Target* argument. If target->isolate_execinstr(), act
3565 like --rosegment.
3566 (Layout::find_first_load_seg): Take new const Target* argument;
3567 if target->isolate_execinstr(), reject PF_X segments.
3568 (Layout::relaxation_loop_body): Update caller.
3569 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3570 reset file offset to zero when we hit LOAD_SEG, and then do a second
3571 loop over the segments before LOAD_SEG to reassign offsets after
3572 addresses have been determined. Handle target->rosegment_gap().
3573 (Layout::attach_section_to_segment): Take new const Target* argument;
3574 pass it to attach_allocated_section_to_segment.
3575 (Layout::make_output_section): Update caller.
3576 (Layout::attach_sections_to_segments): Take new const Target* argument;
3577 pass it to attach_section_to_segment.
3578 * gold.cc (queue_middle_tasks): Update caller.
3579 * layout.h (Layout): Update method decls with new arguments.
3580
3581 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3582 Target_info pointer to use.
3583 (Target_arm::do_make_data_plt): New virtual method.
3584 (Target_arm::make_data_plt): New method that calls it.
3585 (Target_arm::make_plt_entry): Use it.
3586 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3587 for the section alignment.
3588 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3589 method.
3590 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3591 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3592 method.
3593 (Output_data_plt_arm::get_plt_entry_size): Call it.
3594 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3595 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3596 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3597 method.
3598 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3599 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3600 method instead of sizeof(plt_entry).
3601 (Output_data_plt_arm::add_entry): Likewise.
3602 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3603 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3604 than static method.
3605 (Target_arm::plt_entry_size): Likewise.
3606 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3607 Move to ...
3608 (Output_data_plt_arm_standard): ... here, new class.
3609 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3610 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3611 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3612
3613 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3614 Take additional argument for the PLT entry size.
3615 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3616 Use get_plt_entry_size method rather than plt_entry_size variable.
3617 (Output_data_plt_x86_64::reserve_slot): Likewise.
3618 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3619 (Output_data_plt_x86_64::add_entry): Likewise.
3620 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3621 (Output_data_plt_x86_64::address_for_global): Likewise.
3622 (Output_data_plt_x86_64::address_for_local): Likewise.
3623 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3624 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3625 Make method non-static.
3626 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3627 method.
3628 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3629 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3630 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3631 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3632 virtual method.
3633 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3634 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3635 virtual method.
3636 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3637 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3638 virtual method.
3639 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3640 (Output_data_plt_x86_64::plt_entry_size)
3641 (Output_data_plt_x86_64::first_plt_entry)
3642 (Output_data_plt_x86_64::plt_entry)
3643 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3644 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3645 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3646 (Output_data_plt_x86_64_standard): ... here, new class.
3647 (Target_x86_64::Target_x86_64): Take optional argument for the
3648 Target_info pointer to use.
3649 (Target_x86_64::do_make_data_plt): New virtual method.
3650 (Target_x86_64::make_data_plt): New method to call it.
3651 (Target_x86_64::init_got_plt_for_update): Use that.
3652 Call this->plt_->add_eh_frame method here.
3653 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3654 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3655 rather than static method.
3656 (Target_x86_64::plt_entry_size): Likewise.
3657 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3658 rather than plt_entry_size variable. Move guts of PLT filling to...
3659 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3660 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3661 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3662
3663 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3664 additional argument for the section alignment.
3665 Don't do add_eh_frame_for_plt here.
3666 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3667 non-static. Use get_plt_entry_size method rather than plt_entry_size
3668 variable.
3669 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3670 method.
3671 (Output_data_plt_i386::get_plt_entry_size): Call it.
3672 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3673 (Output_data_plt_i386::add_eh_frame): New method to call it.
3674 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3675 method.
3676 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3677 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3678 method.
3679 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3680 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3681 method instead of plt_entry_size.
3682 (Output_data_plt_i386::plt_entry_size)
3683 (Output_data_plt_i386::plt_eh_frame_fde_size)
3684 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3685 (Output_data_plt_i386_standard): ... here, new class.
3686 (Output_data_plt_i386_exec): New class.
3687 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3688 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3689 (Output_data_plt_i386::exec_plt_entry): Move to ...
3690 (Output_data_plt_i386_exec::plt_entry): ... here.
3691 (Output_data_plt_i386_dyn): New class.
3692 (Output_data_plt_i386::first_plt_entry): Move to ...
3693 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3694 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3695 (Output_data_plt_i386_dyn::plt_entry): ... here.
3696 (Target_i386::Target_i386): Take optional argument for the Target_info
3697 pointer to use.
3698 (Target_i386::do_make_data_plt): New virtual method.
3699 (Target_i386::make_data_plt): New method to call it.
3700 (Target_i386::make_plt_section): Use that.
3701 Call this->plt_->add_eh_frame method here.
3702 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3703 rather than plt_entry_size variable.
3704 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3705 (Output_data_plt_i386::address_for_local): Likewise.
3706 (Output_data_plt_i386::do_write): Likewise.
3707 Move guts of PLT filling to...
3708 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3709 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3710 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3711 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3712
b9b9f2ee
CC
37132012-05-01 Cary Coutant <ccoutant@google.com>
3714
3715 * dwarf_reader.cc (Dwarf_die::read_attributes)
3716 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3717 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3718 * reduced_debug_output.cc
3719 (Output_reduced_debug_info_section::get_die_end): Remove
3720 DW_FORM_GNU_ref_index. Add default case.
3721
57923f48
MW
37222012-04-26 Mark Wielaard <mjw@redhat.com>
3723
3724 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3725 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3726 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3727 DW_AT_high_pc as offset from DW_AT_low_pc.
3728
3729 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3730 * testsuite/Makefile.in: Regenerate.
3731 * testsuite/gdb_index_test_3.c: New test source file.
3732 * testsuite/gdb_index_test_3.sh: New test source file.
3733
2c54b4f4
ILT
37342012-04-25 Ian Lance Taylor <iant@google.com>
3735
3736 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3737 pointer.
3738 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3739 as a class, not a struct.
3740 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3741 (Target_arm::apply_cortex_a8_workaround): Likewise.
3742 * gc.h: Declare Reloc_types as a struct, not a class.
3743 * object.h: Declare Symbols_data as a struct.
3744 * reloc.h: Declare Read_relocs_data as a struct.
3745 * target.h: Declare Relocate_info as a struct.
3746
a5a5f7a3
DM
37472012-04-24 David S. Miller <davem@davemloft.net>
3748
3749 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3750 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3751 and R_SPARC_WPLT30.
3752
f038d496
CC
37532012-04-24 Cary Coutant <ccoutant@google.com>
3754
3755 * incremental-dump.cc (find_input_containing_global): Replace
3756 magic number with symbolic constant.
3757 (dump_incremental_inputs): Update version number.
3758 * incremental.cc (Output_section_incremental_inputs): Update version
3759 number; import symbolic constants from Incremental_inputs_reader.
3760 (Incremental_inputs::create_data_sections): Align relocations
3761 section correctly for 64-bit targets.
3762 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3763 constants; add padding.
3764 (Output_section_incremental_inputs::write_header): Add assert for
3765 header_size.
3766 (Output_section_incremental_inputs::write_input_files): Add assert
3767 for input_entry_size.
3768 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3769 add assert for object_info_size, input_section_entry_size,
3770 global_sym_entry_size.
3771 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3772 for data structure sizes; use them.
3773 (Incremental_input_entry_reader): Import symbolic constants from
3774 Incremental_inputs_reader; use them.
3775
a4d85145
DM
37762012-04-23 David S. Miller <davem@davemloft.net>
3777
3778 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3779 and elf_flags_set_.
3780 (Target_sparc::Target_sparc): Initialize new fields.
3781 (Target_sparc::do_make_elf_object): New function.
3782 (Target_sparc::do_adjust_elf_header): New function.
3783
1d509098
CC
37842012-04-23 Cary Coutant <ccoutant@google.com>
3785
3786 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3787 CU range table of gdb index.
3788
7ebeff7f
DM
37892012-04-20 David S. Miller <davem@davemloft.net>
3790
3791 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3792 instead of false.
3793
13cf9988
DM
37942012-04-16 David S. Miller <davem@davemloft.net>
3795
2a1079e8
DM
3796 * sparc.cc (Target_sparc::got_address): New function.
3797 (Sparc_relocate_functions::gdop_hix22): New function.
3798 (Sparc_relocate_functions::gdop_lox10): New function.
3799 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3800 relocs.
3801 (Target_sparc::Scan::local): Likewise if the global symbol is not
3802 preemptible and is not IFUNC.
3803 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3804 transformations for local and non-preemptible non-IFUNC global
3805 symbols.
3806
0bc964fc
DM
3807 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3808 writing out 64-bit part of ranges.
3809
661d7a80
DM
3810 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3811 -fpic and -fpie respectively.
3812 * Makefile.in: Regenerate.
3813
8c2bf391
DM
3814 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3815 (Target_sparc::Target_sparc): Initialize new field.
3816 (Target_sparc::do_plt_section_for_global): New function.
3817 (Target_sparc::do_plt_section_for_local): New function.
3818 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3819 (Target_sparc::make_plt_section): New function, broken out of
3820 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3821 (Target_sparc::make_plt_entry): Call make_plt_section.
3822 (Target_sparc::make_local_ifunc_plt_entry): New function.
3823 (Target_sparc::rela_ifunc_section): New function.
3824 (Target_sparc::plt_section): Remove const.
3825 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3826 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3827 and ifunc_count_ fields.
3828 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3829 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3830 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3831 (Output_data_plt_sparc::rela_ifunc): New function.
3832 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3833 (Output_data_plt_sparc::has_ifunc_section): New function.
3834 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3835 (Output_data_plt_sparc::address_for_global): New function.
3836 (Output_data_plt_sparc::address_for_local): New function.
3837 (Output_data_plt_sparc::plt_index_to_offset): New function.
3838 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3839 and entry_count.
3840 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3841 entry_count.
3842 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3843 R_SPARC_JMP_IREL to switch.
3844 (Target_sparc::Scan::check_non_pic): Likewise.
3845 (Target_sparc::Scan::local): Handle IFUNC symbols.
3846 (Target_sparc::Scan::local): Likewise.
3847 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3848 and plt_address_for_local.
3849 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3850 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3851
13cf9988
DM
3852 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3853 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3854 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3855 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3856 global relocs too.
3857 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3858 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3859 calls.
3860 * sparc.cc (Target_sparc::Scan::global): Likewise.
3861 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3862
31821be0
CC
38632012-04-16 Cary Coutant <ccoutant@google.com>
3864
3865 * archive.cc (Library_base::should_include_member): Check for
3866 --export-dynamic-symbol.
3867 * options.h (class General_options): Add --export-dynamic-symbol.
3868 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3869 --export-dynamic-symbol.
3870 (Symbol_table::gc_mark_undef_symbols): Likewise.
3871 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3872
2615994e
DM
38732012-04-12 David S. Miller <davem@davemloft.net>
3874
3875 * sparc.cc (Reloc::wdisp10): New relocation method.
3876 (Reloc::h34): Likewise.
3877 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3878 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3879 R_SPARC_WDISP10.
3880 (Target_sparc::Scan::local): Likewise.
3881 (Target_sparc::Scan::global): Likewise.
3882 (Target_sparc::Relocate::relocate): Likewise.
3883
6782735d
CC
38842012-04-09 Cary Coutant <ccoutant@google.com>
3885
3886 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3887 low_pc == 0.
3888
8c7a0b00
ILT
38892012-04-06 Ian Lance Taylor <iant@google.com>
3890
3891 * timer.cc: #include <unistd.h>.
3892
58797674
RM
38932012-04-06 Roland McGrath <mcgrathr@google.com>
3894
3895 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3896 * config.in: Regenerate.
3897 * configure: Regenerate.
3898
44350750
NC
38992012-04-05 Nick Clifton <nickc@redhat.com>
3900
3901 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3902 (AM_LC_MESSAGES): Add.
3903 * aclocal.m4: Regenerate.
3904 * config.in: Regenerate.
3905 * configure: Regenerate.
3906
c1027032
CC
39072012-03-21 Cary Coutant <ccoutant@google.com>
3908
3909 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3910 * Makefile.in: Regenerate.
3911 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3912 (Sized_elf_reloc_mapper::symbol_section): New function.
3913 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3914 (make_elf_reloc_mapper): New function.
3915 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3916 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3917 (Dwarf_abbrev_table::do_get_abbrev): New function.
3918 (Dwarf_ranges_table::read_ranges_table): New function.
3919 (Dwarf_ranges_table::read_range_list): New function.
3920 (Dwarf_pubnames_table::read_section): New function.
3921 (Dwarf_pubnames_table::read_header): New function.
3922 (Dwarf_pubnames_table::next_name): New function.
3923 (Dwarf_die::Dwarf_die): New function.
3924 (Dwarf_die::read_attributes): New function.
3925 (Dwarf_die::skip_attributes): New function.
3926 (Dwarf_die::set_name): New function.
3927 (Dwarf_die::set_linkage_name): New function.
3928 (Dwarf_die::attribute): New function.
3929 (Dwarf_die::string_attribute): New function.
3930 (Dwarf_die::int_attribute): New function.
3931 (Dwarf_die::uint_attribute): New function.
3932 (Dwarf_die::ref_attribute): New function.
3933 (Dwarf_die::child_offset): New function.
3934 (Dwarf_die::sibling_offset): New function.
3935 (Dwarf_info_reader::check_buffer): New function.
3936 (Dwarf_info_reader::parse): New function.
3937 (Dwarf_info_reader::do_parse): New function.
3938 (Dwarf_info_reader::do_read_string_table): New function.
3939 (Dwarf_info_reader::lookup_reloc): New function.
3940 (Dwarf_info_reader::get_string): New function.
3941 (Dwarf_info_reader::visit_compilation_unit): New function.
3942 (Dwarf_info_reader::visit_type_unit): New function.
3943 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3944 Sized_elf_reloc_mapper.
3945 (Sized_dwarf_line_info::symbol_section): Remove function.
3946 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3947 (Sized_dwarf_line_info::read_line_mappings): Remove object
3948 parameter, adjust callers.
3949 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3950 * dwarf_reader.h: Include <sys/types.h>.
3951 (class Track_relocs): Remove forward declaration.
3952 (class Elf_reloc_mapper): New class.
3953 (class Sized_elf_reloc_mapper): New class.
3954 (class Dwarf_abbrev_table): New class.
3955 (class Dwarf_range_list): New class.
3956 (class Dwarf_ranges_table): New class.
3957 (class Dwarf_pubnames_table): New class.
3958 (class Dwarf_die): New class.
3959 (class Dwarf_info_reader): New class.
3960 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3961 (Sized_dwarf_line_info::symbol_section): Remove member function.
3962 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3963 base class.
3964 * gdb-index.cc: New source file.
3965 * gdb-index.h: New source file.
3966 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3967 and .debug_types sections, call Layout::add_to_gdb_index.
3968 (Sized_relobj_incr::do_section_name): Implement.
3969 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3970 return type; Implement.
3971 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3972 return type.
3973 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3974 parameter list and return type.
3975 (Sized_incr_dynobj::do_section_contents): Likewise.
3976 * layout.cc: Include gdb-index.h.
3977 (Layout::Layout): Initialize gdb_index_data_.
3978 (Layout::init_fixed_output_section): Check for .gdb_index section.
3979 (Layout::add_to_gdb_index): New function. Instantiate.
3980 * layout.h: Add forward declaration for class Gdb_index.
3981 (Layout::add_to_gdb_index): New member function.
3982 (Layout::gdb_index_data_): New data member.
3983 * main.cc: Include gdb-index.h.
3984 (main): Print statistics for gdb index.
3985 * object.cc (Object::section_contents): Move code into
3986 do_section_contents.
3987 (need_decompressed_section): Check for sections needed when building
3988 gdb index.
3989 (build_compressed_section_map): Likewise.
3990 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3991 gdb index.
3992 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3993 sections; call Layout::add_to_gdb_index.
3994 (Sized_relobj_file::do_decompressed_section_contents): Call
3995 do_section_contents directly.
3996 * object.h (Object::do_section_contents): Adjust parameter list and
3997 return type.
3998 (Object::do_decompressed_section_contents): Call do_section_contents
3999 directly.
4000 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4001 return type.
4002 * options.h (class General_options): Add --gdb-index option.
4003 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4004 list and return type.
4005 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4006 * reloc.h (Track_relocs::checkpoint): New function.
4007 (Track_relocs::reset): New function.
4008
4009 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4010 New test cases.
4011 * testsuite/Makefile.in: Regenerate.
4012 * testsuite/gdb_index_test.cc: New test source file.
4013 * testsuite/gdb_index_test_1.sh: New test source file.
4014 * testsuite/gdb_index_test_2.sh: New test source file.
4015
647f1574
DK
40162012-03-19 Doug Kwan <dougkwan@google.com>
4017
4018 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 4019 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
4020 __exidx_start and __exidx_end. Make symbol table parameter
4021 anonymous as it is not used.
4022 * gold.cc (queue_middle_tasks): Call target hook to define any
4023 target-specific symbols.
4024 * target.h (Target::define_standard_symbols): New method.
4025 (Target::do_define_standard_symbols): Same.
4026 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4027 * testsuite/Makefile.in: Regenerate.
4028 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4029 and __exidx_end.
4030 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4031 relocations are generated for __exidx_start and __exidx_end.
4032
7c6109da
DK
40332012-03-16 Doug Kwan <dougkwan@google.com>
4034
4035 * testsuite/Makefile.am: Disable test initpri3b.
4036 * testsuite/Makefile.in: Regenerate.
4037
7b8957f8
DK
40382012-03-15 Doug Kwan <dougkwan@google.com>
4039
4040 * arm.cc (Target_arm::got_section): Make .got section read-only
4041 if -z now is given.
4042
14dc9ef7
ILT
40432012-03-15 Ian Lance Taylor <iant@google.com>
4044
4045 PR gold/13850
4046 * layout.cc (Layout::make_output_section): Correctly mark
4047 SHT_INIT_ARRAY, et. al., as relro.
4048
fa40b62a
DK
40492012-03-14 Doug Kwan <dougkwan@google.com>
4050
4051 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
4052 dynamic relocations for protected symbols in shared objects.
4053
fd325007
ILT
40542012-03-13 Ian Lance Taylor <iant@google.com>
4055
4056 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4057 keep the larger alignment.
4058
e8dd54e1
CC
40592012-03-12 Cary Coutant <ccoutant@google.com>
4060
4061 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4062 handling of DW_LNE_define_file.
4063
feb5f3b0
CC
40642012-03-12 Cary Coutant <ccoutant@google.com>
4065
4066 * reduced_debug_output.cc
4067 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4068 codes to switch.
4069
a1fb4256
CC
40702012-02-29 Cary Coutant <ccoutant@google.com>
4071
4072 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4073
5dd8762a
CC
40742012-02-29 Cary Coutant <ccoutant@google.com>
4075
4076 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4077 Call Object::decompressed_section_contents.
4078 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4079 New dtor.
4080 (Sized_dwarf_line_info::buffer_start_): New data member.
4081 * merge.cc (Output_merge_data::do_add_input_section): Call
4082 Object::decompressed_section_contents.
4083 (Output_merge_string::do_add_input_section): Likewise.
4084 * object.cc (need_decompressed_section): New function.
4085 (build_compressed_section_map): Decompress sections needed later.
4086 (Sized_relobj_file::do_decompressed_section_contents): New function.
4087 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4088 * object.h (Object::decompressed_section_contents): New function.
4089 (Object::discard_decompressed_sections): New function.
4090 (Object::do_decompressed_section_contents): New function.
4091 (Object::do_discard_decompressed_sections): New function.
4092 (Compressed_section_info): New type.
4093 (Compressed_section_map): Include decompressed section contents.
4094 (Sized_relobj_file::do_decompressed_section_contents): New function.
4095 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4096
7b5de7ee
CC
40972012-02-16 Cary Coutant <ccoutant@google.com>
4098
4099 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
4100 * testsuite/Makefile.in: Regenerate.
4101
f9fa4a63
CC
41022012-02-14 Cary Coutant <ccoutant@google.com>
4103
4104 * options.cc (General_options::finalize): Disallow -pie and -static.
4105
2c175ebc
DK
41062012-02-03 Doug Kwan <dougkwan@google.com>
4107
4108 * arm.cc (Arm_relocate_functions::abs8,
4109 Arm_relocate_functions::abs16): Use
4110 Bits::has_signed_unsigned_overflow32.
4111 (Arm_relocate_functions::thm_abs8): Correct range of
4112 overflow check.
4113 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
4114 in assertions.
4115
90cff06f
DK
41162012-02-02 Doug Kwan <dougkwan@google.com>
4117
4118 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
4119 position independent outputs, not just shared objects.
4120
63887f3d
L
41212012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4122
4123 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4124 * configure: Regenerated.
4125
bef2b434
ILT
41262012-01-27 Ian Lance Taylor <iant@google.com>
4127
4128 * reloc.h (Bits): New class with static functions, copied from
4129 namespace utils in arm.cc.
4130 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4131 instead.
4132
c335b55d
L
41332012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4134
4135 * incremental.cc (write_info_blocks): Correct relocation offset.
4136
41194d9f
L
41372012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4138
4139 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4140 (Relocate::tls_gd_to_le): Likewise.
4141
1bae613c
L
41422012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4143
4144 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4145
24482ca0
L
41462012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4147
4148 * configure.ac: Check if -mcmodel=medium works.
4149 * configure: Regenerated.
4150
c2c7840a
CC
41512012-01-24 Cary Coutant <ccoutant@google.com>
4152
4153 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4154 definition and ...
4155 (read_unsigned_LEB_128_x): ... this new function.
4156 (read_signed_LEB_128): Replaced with inline definition and ...
4157 (read_signed_LEB_128_x): ... this new function.
4158 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4159 (read_unsigned_LEB_128): Add inline definition.
4160 (read_signed_LEB_128_x): New function.
4161 (read_signed_LEB_128): Add inline definition.
4162 * testsuite/Makefile.am (leb128_unittest): New unit test.
4163 * testsuite/Makefile.in: Regenerate.
4164 * testsuite/leb128_unittest.cc: New unit test.
4165
833de760 41662012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
4167
4168 PR gold/13617
4169 * i386.cc (Target_i386::do_code_fill): When using a jmp
4170 instruction, pad with nop instructions.
4171 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4172
618d6666
L
41732012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4174
4175 * x86_64.cc (gc_process_relocs): Add typename on types used in
4176 template.
4177 (scan_relocs): Likewise.
4178 (relocate_section): Likewise.
4179 (apply_relocation): Likewise.
4180
3660ff06
L
41812012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4182
4183 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4184 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4185 under x32.
4186
fc51264f
L
41872012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4188
4189 * x86_64.cc: Initial support for x32.
4190
dd74ae06
CC
41912012-01-03 Cary Coutant <ccoutant@google.com>
4192
4193 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4194 Use abstract base class for GOT.
4195 * gold/output.h (class Output_data_got_base): New abstract base class.
4196 (class Output_data_got): Derive from new base class, adjust ctors.
4197 (Output_data_got::reserve_slot): Make virtual; rename to
4198 do_reserve_slot; Adjust callers.
4199 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4200 pointer to abstract base class.
4201 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4202
83896202
ILT
42032011-12-18 Ian Lance Taylor <iant@google.com>
4204
4205 * object.h (Relobj::local_symbol_value): New function.
4206 (Relobj::local_plt_offset): New function.
4207 (Relobj::local_has_got_offset): New function.
4208 (Relobj::local_got_offset): New function.
4209 (Relobj::set_local_got_offset): New function.
4210 (Relobj::do_local_symbol_value): New pure virtual function.
4211 (Relobj::do_local_plt_offset): Likewise.
4212 (Relobj::do_local_has_got_offset): Likewise.
4213 (Relobj::do_local_got_offset): Likewise.
4214 (Relobj::do_set_local_got_offset): Likewise.
4215 (Sized_relobj::do_local_has_got_offset): Rename from
4216 local_has_got_offset.
4217 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4218 (Sized_relobj::do_set_local_got_offset): Rename from
4219 set_local_got_offset.
4220 (Sized_relobj_file::do_local_plt_offset): Rename from
4221 local_plt_offset.
4222 (Sized_relobj_file::do_local_symbol_value): New function.
4223 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4224 local_plt_offset.
4225 * output.cc (Output_data_got::Got_entry::write): Change object to
4226 Relobj. Use local_symbol_value.
4227 (Output_data_got::add_global_with_rel): Change rel_dyn to
4228 Output_data_reloc_generic*. Use add_global_generic.
4229 (Output_data_got::add_global_with_rela): Remove. Change all
4230 callers to use add_global_with_rel.
4231 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4232 Output_data_reloc_generic*. Use add_global_generic.
4233 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4234 callers to use add_global_pair_with_rel.
4235 (Output_data_got::add_local): Change object to Relobj*.
4236 (Output_data_got::add_local_plt): Likewise.
4237 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4238 change rel_dyn to Output_data_reloc_generic*. Use
4239 add_local_generic.
4240 (Output_data_got::add_local_with_rela): Remove. Change all
4241 callers to use all_local_with_rel.
4242 (Output_data_got::add_local_pair_with_rel): Change object to
4243 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4244 add_output_section_generic.
4245 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4246 callers to use add_local_pair_with_rel.
4247 (Output_data_got::reserve_local): Change object to Relobj*.
4248 * output.h: (class Output_data_reloc_generic): Add pure virtual
4249 declarations for add_global_generic, add_local_generic,
4250 add_output_section_generic.
4251 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4252 functions for Output_data_reloc_generic. Update declarations for
4253 changes listed in output.cc.
4254 (class Output_data_got): Change template parameter to got_size.
4255 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4256 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4257 function.
4258 (Sized_relobj_incr::do_local_plt_offset): New function.
4259 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4260 add_global_generic.
4261
76677ad0
CC
42622011-12-17 Cary Coutant <ccoutant@google.com>
4263
4264 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4265 * resolve.cc (Symbol_table::resolve): Likewise.
4266 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4267 arrays.
4268 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4269
8b8dd8d5
ILT
42702011-12-16 Ian Lance Taylor <iant@google.com>
4271
4272 * output.h (Output_data_reloc_generic::add): Only call
4273 add_dynamic_reloc if this is a dynamic reloc section.
4274
d55525b9
L
42752011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4276
4277 PR gold/13505
4278 * target-reloc.h (apply_relocation): Replace <64, false> with
4279 <size, big_endian>.
4280
ff81c7c1
NC
42812011-11-25 Nick Clifton <nickc@redhat.com>
4282
4283 * po/it.po: New Italian translation.
4284
628f39be
SA
42852011-11-17 Sterling Augustine <saugustine@google.com>
4286
4287 * script.cc (script_include_directive): Implement.
4288 (read_script_file): New local variables name and search_path. Update
4289 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4290 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4291 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4292
98ef3ea4
SA
42932011-11-11 Sterling Augustine <saugustine@google.com>
4294
4295 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4296 (file_or_sections_cmd): Likewise.
4297
f4a8b6d7
DK
42982011-11-11 Doug Kwan <dougkwan@google.com>
4299
4300 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4301 if --just-symbols is given.
4302
29ab395d
DK
43032011-11-10 Doug Kwan <dougkwan@google.com>
4304
4305 PR gold/13362
4306 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4307 when processing data relocs.
4308 * reloc.h (Relocate_functions::rel_unaligned): New method.
4309 (Relocate_functions::pcrel_unaligned): Ditto.
4310 (Relocate_functions::rel32_unaligned): Ditto.
4311 (Relocate_functions::pcrel32_unaligned): Ditto.
4312
2c339f71
DK
43132011-11-09 Doug Kwan <dougkwan@google.com>
4314
4315 PR gold/13362
4316 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4317 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4318 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4319 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4320 (Relocate_functions::rel_unaligned): New.
4321 (Relocate_functions::rel32_unaligned): New.
4322 * target-reloc.h (relocate_for_relocatable): Add code to handle
4323 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4324 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4325 arm_unaligned_reloc_r): New targets.
4326 * testsuite/Makefile.in: Regenerate.
4327 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4328 linking.
4329
3f3cddf1
ILT
43302011-11-02 Ian Lance Taylor <iant@google.com>
4331
4332 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4333 NATIVE_LINKER.
4334 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4335 * options.cc (General_options::finalize): Use library search path
4336 from configure script if specified. If not native and no sysroot,
4337 only search TOOLLIBDIR.
4338 * options.h (Search_directory::Search_directory): Change name to
4339 const std::string&.
4340 (General_options::add_to_library_path_with_sysroot): Change arg to
4341 const std::string&.
4342 * configure, Makefile.in, config.in: Rebuild.
4343
a8e2273b
ILT
43442011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4345
4346 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4347 we are working around the ARM1176 Erratum.
4348 * options.h (General_options::fix_arm1176): Add option.
4349 * testsuite/Makefile.am: Add testcases, and keep current ones
4350 working.
4351 * testsuite/Makefile.in: Regenerate.
4352 * testsuite/arm_fix_1176.s: New file.
4353 * testsuite/arm_fix_1176.sh: Likewise.
4354
cd6eab1c
ILT
43552011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4356
4357 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4358 may_use_blx_.
4359 (Target_arm::may_use_blx): Remove method.
4360 (Target_arm::set_may_use_blx): Likewise.
4361 (Target_arm::may_use_v4t_interworking): New method.
4362 (Target_arm::may_use_v5t_interworking): Likewise.
4363 (Target_arm::may_use_blx_): Remove member variable.
4364 (Arm_relocate_functions::arm_branch_common): Check for v5T
4365 interworking.
4366 (Arm_relocate_functions::thumb_branch_common): Likewise.
4367 (Reloc_stub::stub_type_for_reloc): Likewise.
4368 (Target_arm::do_finalize_sections): Correct interworking checks.
4369 * testsuite/Makefile.am: Add new tests.
4370 * testsuite/Makefile.in: Regenerate.
4371 * testsuite/arm_farcall_arm_arm.s: New test.
4372 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4373 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4374 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4375 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4376 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4377 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4378 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4379
286adcf4
CC
43802011-10-31 Cary Coutant <ccoutant@google.com>
4381
4382 PR gold/13023
4383 * expression.cc (Expression::eval_with_dot): Add
4384 is_section_dot_assignment parameter.
4385 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4386 absolute and assigning to dot within a section.
4387 * script-sections.cc
4388 (Output_section_element_assignment::set_section_addresses): Pass
4389 dot_section to set_if_absolute.
4390 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4391 as is_section_dot_assignment flag to eval_with_dot.
4392 (Output_section_element_dot_assignment::set_section_addresses):
4393 Likewise.
4394 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4395 parameter. Also set value if relative to dot_section; set the
4396 symbol's output_section.
4397 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4398 parameter. Adjust all callers.
4399 (Expression::eval_maybe_dot): Likewise.
4400 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4401 Adjust all callers.
4402 * testsuite/script_test_2.t: Test assignment of an absolute value
4403 to dot within an output section element.
4404
9634ed06
CC
44052011-10-31 Cary Coutant <ccoutant@google.com>
4406
4407 * options.h (class General_options): Add --[no-]gnu-unique options.
4408 * symtab.cc (Symbol_table::sized_write_globals): Convert
4409 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4410
de4101c7
CC
44112011-10-31 Cary Coutant <ccoutant@google.com>
4412
4413 PR gold/13359
4414 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4415 unnecessary assertion.
4416 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4417
7257cc92
ST
44182011-10-31 Sriraman Tallam <tmsriram@google.com>
4419
4420 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4421 gc_mark_symbol.
4422 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4423 gc_mark_symbol.
4424 Change to just keep the section associated with symbol.
4425 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4426 they are externally visible and --export-dynamic is turned on.
4427 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4428
bfc34b3f
ILT
44292011-10-19 Ian Lance Taylor <iant@google.com>
4430
4431 PR gold/13163
4432 * script-sections.cc
4433 (Output_section_element_dot_assignment::needs_output_section): New
4434 function.
4435
ea0d8c47
ILT
44362011-10-19 Ian Lance Taylor <iant@google.com>
4437
4438 PR gold/13204
4439 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4440 --section-start option was seen.
4441 * options.h (General_options::any_section_start): New function.
4442
abd242a9
DM
44432011-10-18 David S. Miller <davem@davemloft.net>
4444
4445 PR binutils/13301
4446 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4447 member to track relocation locations that have moved during TLS
4448 reloc optimizations.
4449 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4450 (Target_sparc::Relocate::relocate): Adjust view down by 4
4451 bytes if it matches reloc_adjust_addr_.
4452 (Target_sparc::Relocate::relocate_tls): Always move the
4453 __tls_get_addr call delay slot instruction forward 4 bytes when
4454 performing relaxation.
4455
bab9090f
CC
44562011-10-18 Cary Coutant <ccoutant@google.com>
4457
4458 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4459 (Output_file::map_no_anonymous): Check for non-zero
4460 return code from posix_fallocate.
4461
f7c5b166
CC
44622011-10-17 Cary Coutant <ccoutant@google.com>
4463
4464 PR gold/13245
4465 * plugin.cc (is_visible_from_outside): Check for symbols
4466 referenced from dynamic objects.
4467 * resolve.cc (Symbol_table::resolve): Don't count references
4468 from dynamic objects as references from real ELF files.
4469 * testsuite/plugin_test_2.sh: Adjust expected result.
4470
b490c0bb
CC
44712011-10-17 Cary Coutant <ccoutant@google.com>
4472
4473 * gold.cc: Include timer.h.
4474 (queue_middle_tasks): Stamp time.
4475 (queue_final_tasks): Likewise.
4476 * main.cc (main): Store timer in parameters. Print timers
4477 for each pass.
4478 * parameters.cc (Parameters::Parameters): Initialize timer_.
4479 (Parameters::set_timer): New function.
4480 (set_parameters_timer): New function.
4481 * parameters.h (Parameters::set_timer): New function.
4482 (Parameters::timer): New function.
4483 (Parameters::timer_): New data member.
4484 (set_parameters_timer): New function.
4485 * timer.cc (Timer::stamp): New function.
4486 (Timer::get_pass_time): New function.
4487 * timer.h (Timer::stamp): New function.
4488 (Timer::get_pass_time): New function.
4489 (Timer::pass_times_): New data member.
4490
f475cf7b
CC
44912011-10-17 Cary Coutant <ccoutant@google.com>
4492
4493 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4494 task for members of lib groups.
4495
cdd7e244
CC
44962011-10-17 Cary Coutant <ccoutant@google.com>
4497
4498 PR gold/13288
4f95c8b4 4499 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
4500 (File_read::make_view): Move bounds check (replace with assert)...
4501 (File_read::find_or_make_view): ... to here.
4502
dfb45471
CC
45032011-10-12 Cary Coutant <ccoutant@google.com>
4504
4f95c8b4 4505 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
4506 ::read returns less than requested size.
4507
53bbcc1b
CC
45082011-10-10 Cary Coutant <ccoutant@google.com>
4509
4f95c8b4 4510 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
4511 Initialize defined_count_.
4512 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4513 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4514 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4515 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4516 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4517 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4518 member.
4519 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4520 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4521 Return zeroes instead of internal error.
4522
397b129b
CC
45232011-10-10 Cary Coutant <ccoutant@google.com>
4524
4525 PR gold/13249
4f95c8b4 4526 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4527 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4528 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4529 (Output_reloc::type_): Adjust size of bit field.
4530 (Output_reloc::use_plt_offset_): New bit field.
4531 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4532 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4533 flag. Adjust all callers.
4f95c8b4 4534 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4535 creating RELATIVE relocations.
4536
d5698657
NC
45372011-10-10 Nick Clifton <nickc@redhat.com>
4538
4539 * po/es.po: Updated Spanish translation.
4540 * po/fi.po: Updated Finnish translation.
4541
6a59a5c2
DN
45422011-10-03 Diego Novillo <dnovillo@google.com>
4543
4544 * options.cc (parse_uint): Fix dereference of RETVAL.
4545
f0558624
ST
45462011-09-29 Sriraman Tallam <tmsriram@google.com>
4547
4548 * layout.h (section_order_map_): New member.
4549 (get_section_order_map): New member function.
4550 * output.cc (Output_section::add_input_section): Check for patterns
4551 only when --section-ordering-file is specified.
4552 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4553 output_sections have been formed.
4554 * layout.cc (Layout_Layout): Initialize section_order_map_.
4555 * plugin.cc (update_section_order): Store order in order_map. Do not
4556 update the order.
4557 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4558 * testsuite/Makefile.in: Regenerate.
4559 * testsuite/plugin_section_order.c: New file.
4560 * testsuite/plugin_final_layout.cc: New file.
4561 * testsuite/plugin_final_layout.sh: New file.
4562
a7dac153
CC
45632011-09-29 Cary Coutant <ccoutant@google.com>
4564
4f95c8b4 4565 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4566 Check for NULL.
4f95c8b4 4567 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4568 symbols during incremental update.
4569 (Symbol_table::add_from_dynobj): Likewise.
4570
eebd87a5
ILT
45712011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4572 Ian Lance Taylor <iant@google.com>
4573
4574 * symtab.cc (Symbol_table::define_special_symbol): Always
4575 canonicalize version string.
4576
403a3331
CC
45772011-09-26 Cary Coutant <ccoutant@google.com>
4578
4f95c8b4
CC
4579 * gold.cc (queue_initial_tasks): Move option checks ...
4580 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
4581 some options; make others fatal.
4582
235061c2
CC
45832011-09-26 Cary Coutant <ccoutant@google.com>
4584
4585 gcc PR lto/47247
4586 * plugin.cc (get_symbols_v2): New function.
4587 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4588 (is_referenced_from_outside): New function.
4589 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4590 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4591 (get_symbols): Pass version parameter.
4592 (get_symbols_v2): New function.
4593 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4594 parameter.
4595 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4596 (onload): Add LDPT_GET_SYMBOLS_V2.
4597 (all_symbols_read_hook): Use get_symbols_v2; check for
4598 LDPR_PREVAILING_DEF_IRONLY_EXP.
4599 * testsuite/plugin_test_3.sh: Update expected results.
4600
dc87f620
ILT
46012011-09-23 Simon Baldwin <simonb@google.com>
4602
4603 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4604 configuration options.
4605 * configure: Regenerate.
4606 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4607 * Makefile.in: Regenerate.
4608 * testsuite/Makefile.in: Regenerate.
4609
a8279f82
ST
46102011-09-19 Sriraman Tallam <tmsriram@google.com>
4611
4612 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4613
0c9350c8
CC
46142011-09-19 Cary Coutant <ccoutant@google.com>
4615
4616 * incremental.cc (can_incremental_update): Fix typo in comment.
4617 * incremental.h (can_incremental_update): Likewise.
4618
aa06ae28
CC
46192011-09-18 Cary Coutant <ccoutant@google.com>
4620
4621 * incremental.cc (can_incremental_update): New function.
4622 * incremental.h (can_incremental_update): New function.
4623 * layout.cc (Layout::init_fixed_output_section): Call it.
4624 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4625 * object.cc (Sized_relobj_file::do_layout): Call
4626 can_incremental_update.
4627
ebb300b2
CC
46282011-09-13 Cary Coutant <ccoutant@google.com>
4629
4630 * configure.ac: Check for glibc support for gnu_indirect_function
4631 support with static linking, setting automake conditional
4632 IFUNC_STATIC.
4633 * Makefile.in: Regenerate.
4634 * configure: Regenerate.
4635
4636 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4637 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4638 for IFUNC_STATIC.
4639 * testsuite/Makefile.in: Regenerate.
4640
1206d0d5
CC
46412011-09-13 Cary Coutant <ccoutant@google.com>
4642
4643 * incremental.cc (Sized_relobj_incr::do_layout): Call
4644 report_comdat_group for kept comdat sections.
4645 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4646 * testsuite/Makefile.in: Regenerate.
4647 * testsuite/incr_comdat_test_1.cc: New source file.
4648 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4649 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4650 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4651
40b29874
ILT
46522011-09-13 Ian Lance Taylor <iant@google.com>
4653
4654 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4655 variable external_symbols_offset.
4656
1b045aac
ILT
46572011-09-12 Ian Lance Taylor <iant@google.com>
4658
4659 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4660 triggered if object has no symbols.
4661
24c6c55a
DM
46622011-09-09 David S. Miller <davem@davemloft.net>
4663
4664 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4665 (Output_fill_debug_line::do_write): Likewise.
4666
66570254
CC
46672011-08-29 Cary Coutant <ccoutant@google.com>
4668
4669 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4670 casts to match formatting specs.
4671 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4672
8ea8cd50
CC
46732011-08-26 Cary Coutant <ccoutant@google.com>
4674
4675 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4676 remaining hole size when allocating.
4677 (Layout::make_output_section): Set fill methods for debug sections.
4678 * layout.h (Free_list::Free_list_node): Move from private to
4679 public.
4680 (Free_list::set_min_hole_size): New function.
4681 (Free_list::begin, Free_list::end): New functions.
4682 (Free_list::min_hole_): New data member.
4683 * output.cc: Include dwarf.h.
4684 (Output_fill_debug_info::do_minimum_hole_size): New function.
4685 (Output_fill_debug_info::do_write): New function.
4686 (Output_fill_debug_line::do_minimum_hole_size): New function.
4687 (Output_fill_debug_line::do_write): New function.
4688 (Output_section::Output_section): Initialize new data member.
4689 (Output_section::set_final_data_size): Ensure patch space is larger
4690 than minimum hole size.
4691 (Output_section::do_write): Fill holes in debug sections.
4692 * output.h (Output_fill): New class.
4693 (Output_fill_debug_info): New class.
4694 (Output_fill_debug_line): New class.
4695 (Output_section::set_free_space_fill): New function.
4696 (Output_section::free_space_fill_): New data member.
4697 * testsuite/Makefile.am (incremental_test_3): Add
4698 --incremental-patch option.
4699 (incremental_test_4): Likewise.
4700 (incremental_test_5): Likewise.
4701 (incremental_test_6): Likewise.
4702 (incremental_copy_test): Likewise.
4703 (incremental_common_test_1): Likewise.
4704 * testsuite/Makefile.in: Regenerate.
4705
7cf80422
NC
47062011-08-26 Nick Clifton <nickc@redhat.com>
4707
4708 * po/es.po: Updated Spanish translation.
4709
c3f7b0e5
CC
47102011-08-01 Cary Coutant <ccoutant@google.com>
4711
4712 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4713 * gold/testsuite/Makefile.in: Regenerate.
4714 * gold/testsuite/justsyms_exec.c: New source file.
4715 * gold/testsuite/justsyms_lib.c: New source file.
4716
9590bf25
CC
47172011-08-01 Cary Coutant <ccoutant@google.com>
4718
4719 * layout.cc (Layout::set_segment_offsets): Don't realign text
4720 segment if -Ttext was specified.
4721 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4722 file type.
4723 * object.h (Sized_relobj_file::e_type): New function.
4724 (Sized_relobj_file::e_type_): New data member.
4725 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4726 base address for ET_EXEC files.
4727 * target.cc (Target::do_make_elf_object_implementation): Allow
4728 ET_EXEC files with --just-symbols option.
4729
dcd8d12e
CC
47302011-07-28 Cary Coutant <ccoutant@google.com>
4731
4732 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4733 Add thread_number parameter.
4734 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4735 * workqueue-threads.cc
4736 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4737 current thread if its thread number is greater than desired thread
4738 count.
4739 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4740 Add thread_number parameter.
4741 (Workqueue::should_cancel_thread): Likewise.
4742 (Workqueue::find_runnable_or_wait): Pass thread_number to
4743 should_cancel_thread.
4744 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4745 parameter.
4746
804eb480
ST
47472011-07-22 Sriraman Tallam <tmsriram@google.com>
4748
4749 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4750 only after checking if it cannot be forced local.
4751 * symtab.h (is_externally_visible): Check if the symbol is not forced
4752 local.
4753
f1ddb600
ILT
47542011-07-15 Ian Lance Taylor <iant@google.com>
4755
4756 * options.h (class General_options): Add --print-output-format.
4757 Move -EL next to -EB, for better --help output.
4758 * target-select.cc: Include <cstdio>, "options.h", and
4759 "parameters.h".
4760 (Target_selector::do_target_bfd_name): New function.
4761 (print_output_format): New function.
4762 * target-select.h (class Target_selector): Update declarations.
4763 (Target_selector::target_bfd_name): New function.
4764 (print_output_format): Declare.
4765 * main.cc: Include "target-select.h".
4766 (main): Handle --print-output-format.
4767 * gold.cc: Include "target-select.h".
4768 (queue_initial_tasks): Handle --print-output-format when there are
4769 no input files.
4770 * parameters.cc (parameters_force_valid_target): Give a better
4771 error message if -EB/-EL does not match target.
4772 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4773 function.
4774
7d172687
ILT
47752011-07-15 Ian Lance Taylor <iant@google.com>
4776
4777 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4778 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4779 (Output_data_plt_i386::do_write): Write address of .dynamic
4780 section to first entry in .got.plt section.
4781 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4782 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4783 Initialize layout_.
4784 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4785 section to first entry in .got.plt section.
4786 * layout.h (Layout::dynamic_section): New function.
4787
e9552f7e
ST
47882011-07-13 Sriraman Tallam <tmsriram@google.com>
4789
4790 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4791 to claim_file call.
4792 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4793 input_section_position_, and input_section_glob_.
4794 (read_layout_from_file): Call function section_ordering_specified.
4795 * layout.h (is_section_ordering_specified): New function.
4796 (section_ordering_specified): New function.
4797 (section_ordering_specified_): New boolean member.
4798 * main.cc(main): Call load_plugins after layout object is defined.
4799 * output.cc (Output_section::add_input_section): Use
4800 function section_ordering_specified to check if section ordering is
4801 needed.
4802 * output.cc (Output_section::add_relaxed_input_section): Use
4803 function section_ordering_specified to check if section ordering is
4804 needed.
4805 (Output_section::update_section_layout): New function.
4806 (Output_section::sort_attached_input_sections): Check if input section
4807 must be reordered.
4808 * output.h (Output_section::update_section_layout): New function.
4809 * plugin.cc (get_section_count): New function.
4810 (get_section_type): New function.
4811 (get_section_name): New function.
4812 (get_section_contents): New function.
4813 (update_section_order): New function.
58797674 4814 (allow_section_ordering): New function.
e9552f7e
ST
4815 (Plugin::load): Add the new interfaces to the transfer vector.
4816 (Plugin_manager::load_plugins): New parameter.
4817 (Plugin_manager::all_symbols_read): New parameter.
4818 (Plugin_manager::claim_file): New parameter. Save the elf object for
4819 unclaimed objects.
4820 (Plugin_manager::get_elf_object): New function.
4821 (Plugin_manager::get_view): Change to directly use the bool to check
4822 if get_view is called from claim_file_hook.
4823 * plugin.h (input_objects): New function
4824 (Plugin__manager::load_plugins): New parameter.
4825 (Plugin_manager::claim_file): New parameter.
4826 (Plugin_manager::get_elf_object): New function.
4827 (Plugin_manager::in_claim_file_handler): New function.
4828 (Plugin_manager::in_claim_file_handler_): New member.
4829 (layout): New function.
4830 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4831 handler with an extra parameter. Make the elf object before calling
4832 claim_file handler.
4833 * testsuite/plugin_test.c (get_section_count): New function pointer.
4834 (get_section_type): New function pointer.
4835 (get_section_name): New function pointer.
4836 (get_section_contents): New function pointer.
4837 (update_section_order): New function pointer.
4838 (allow_section_ordering): New function pointer.
4839 (onload): Check if the new interfaces exist.
4840
9446efde
ILT
48412011-07-13 Ian Lance Taylor <iant@google.com>
4842
4843 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4844 relro section.
4845 * x86_64.cc (Target_x86_64::got_section): Likewise.
4846 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4847 (relro_now_test_SOURCES): New variable.
4848 (relro_now_test_DEPENDENCIES): New variable.
4849 (relro_now_test_LDFLAGS): New variable.
4850 (relro_now_test_LDADD): New variable.
4851 (relro_now_test.so): New target.
4852 * testsuite/Makefile.in: Rebuild.
4853
07aa62f2
ILT
48542011-07-12 Ian Lance Taylor <iant@google.com>
4855
4856 PR gold/12980
4857 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4858 GLOB_DAT relocation rather than a RELATIVE relocation for a
4859 protected symbol when creating a shared library.
4860 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4861 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4862 * testsuite/protected_main_1.cc (main): Test that protected
4863 function has same address.
4864
e2153196
ILT
48652011-07-11 Ian Lance Taylor <iant@google.com>
4866
4867 PR gold/12979
4868 * options.h (class General_options): Add -Bgroup.
4869 * options.cc (General_options::finalize): If -Bgroup is set,
4870 default to --unresolved-symbols=report-all.
4871 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4872 * target-reloc.h (issue_undefined_symbol_error): Handle
4873 --unresolved-symbols=report-all.
4874
6daf5215
ILT
48752011-07-08 Ian Lance Taylor <iant@google.com>
4876
4877 PR gold/11985
4878 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4879 if linker script discards key sections.
4880 (Layout::create_dynamic_symtab): Likewise.
4881 (Layout::assign_local_dynsym_offsets): Likewise.
4882 (Layout::sized_create_version_sections): Likewise.
4883 (Layout::create_interp): Likewise.
4884 (Layout::finish_dynamic_section): Likewise.
4885 (Layout::set_dynamic_symbol_size): Likewise.
4886
beabb2c6
ILT
48872011-07-08 Ian Lance Taylor <iant@google.com>
4888
4889 PR gold/12386
4890 * options.h (class General_options): Add --unresolved-symbols.
4891 * target-reloc.h (issue_undefined_symbol_error): Check
4892 --unresolved-symbols. Add comments.
4893
9c16daf1
ILT
48942011-07-08 Ian Lance Taylor <iant@google.com>
4895
4896 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4897 expression more complex.
4898
191f1a2d
ILT
48992011-07-08 Ian Lance Taylor <iant@google.com>
4900
4901 PR gold/11317
4902 * target-reloc.h (issue_undefined_symbol_error): New inline
4903 function, broken out of relocate_section.
4904 (relocate_section): Call issue_undefined_symbol_error.
4905 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4906 there is no TLS segment if we are about to issue an undefined
4907 symbol error.
4908 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4909
62855347
ILT
49102011-07-08 Ian Lance Taylor <iant@google.com>
4911
4912 PR gold/12279
4913 * resolve.cc (Symbol_table::should_override): Add fromtype
4914 parameter. Change all callers. Give error when linking together
4915 TLS and non-TLS symbol.
4916 (Symbol_table::should_override_with_special): Add fromtype
4917 parameter. Change all callers.
4918 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4919 there is no TLS segment if we have reported some errors.
4920 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4921
67181c72
ILT
49222011-07-08 Ian Lance Taylor <iant@google.com>
4923
4924 PR gold/12372
4925 * target.h (Target::plt_address_for_global): New function.
4926 (Target::plt_address_for_local): New function.
4927 (Target::plt_section_for_global): Remove.
4928 (Target::plt_section_for_local): Remove.
4929 (Target::do_plt_address_for_global): New virtual function.
4930 (Target::do_plt_address_for_local): New virtual function.
4931 (Target::do_plt_section_for_global): Remove.
4932 (Target::do_plt_section_for_local): Remove.
4933 (Target::register_global_plt_entry): Add Symbol_table and Layout
4934 parameters.
4935 * output.cc (Output_data_got::Got_entry::write): Use
4936 plt_address_for_global and plt_address_for_local.
4937 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4938 address of output section.
4939 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4940 got_irelative_, and irelative_count_ fields. Update
4941 declarations.
4942 (Output_data_plt_i386::has_irelative_section): New function.
4943 (Output_data_plt_i386::entry_count): Add irelative_count_.
4944 (Output_data_plt_i386::set_final_data_size): Likewise.
4945 (class Target_i386): Add got_irelative_ and rel_irelative_
4946 fields. Update declarations.
4947 (Target_i386::Target_i386): Initialize new fields.
4948 (Target_i386::do_plt_address_for_global): New function replacing
4949 do_plt_section_for_global.
4950 (Target_i386::do_plt_address_for_local): New function replacing
4951 do_plt_section_for_local.
4952 (Target_i386::got_section): Create got_irelative_.
4953 (Target_i386::rel_irelative_section): New function.
4954 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4955 fields. Don't define __rel_iplt_{start,end}.
4956 (Output_data_plt_i386::add_entry): Add symtab and layout
4957 parameters. Change all callers. Use different PLT and GOT for
4958 IFUNC symbols.
4959 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4960 layout parameters. Change all callers. Use different PLT and
4961 GOT.
4962 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4963 (Output_data_plt_i386::rel_irelative): New function.
4964 (Output_data_plt_i386::address_for_global): New function.
4965 (Output_data_plt_i386::address_for_local): New function.
4966 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4967 IRELATIVE GOT when changing IFUNC GOT entries.
4968 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4969 reloc.
4970 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4971 if we didn't create an IRELATIVE GOT.
4972 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4973 plt_address_for_local.
4974 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4975 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4976 got_irelative_, and irelative_count_ fields. Update
4977 declarations.
4978 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4979 Initialize new fields. Remove symtab parameter. Change all
4980 callers.
4981 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4982 irelative_count_.
4983 (Output_data_plt_x86_64::has_irelative_section): New function.
4984 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4985 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4986 fields. Update declarations.
4987 (Target_x86_64::Target_x86_64): Initialize new fields.
4988 (Target_x86_64::do_plt_address_for_global): New function replacing
4989 do_plt_section_for_global.
4990 (Target_x86_64::do_plt_address_for_local): New function replacing
4991 do_plt_section_for_local.
4992 (Target_x86_64::got_section): Create got_irelative_.
4993 (Target_x86_64::rela_irelative_section): New function.
4994 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4995 all callers. Don't create __rel_iplt_{start,end}.
4996 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4997 parameters. Change all callers. Use different PLT and GOT for
4998 IFUNC symbols.
4999 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5000 layout parameters. Change all callers. Use different PLT and
5001 GOT.
5002 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5003 parameters. Change all callers. Use different PLT and GOT for
5004 IFUNC symbols.
5005 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5006 (Output_data_plt_x86_64::rela_irelative): New function.
5007 (Output_data_plt_x86_64::address_for_global): New function.
5008 (Output_data_plt_x86_64::address_for_local): New function.
5009 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5010 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5011 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5012 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5013 parameters.
5014 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5015 reloc.
5016 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5017 symbols if we didn't create an IRELATIVE GOT.
5018 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5019 plt_address_for_local.
5020 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5021 * testsuite/ifuncvar1.c: New test file.
5022 * testsuite/ifuncvar2.c: New test file.
5023 * testsuite/ifuncvar3.c: New test file.
5024 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5025 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5026 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5027 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5028 * testsuite/Makefile.in: Rebuild.
5029
33c15b45
CC
50302011-07-07 Cary Coutant <ccoutant@google.com>
5031
5032 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5033 (two_file_test_1_ndebug.o): Likewise.
5034 (two_file_test_1b_ndebug.o): Likewise.
5035 (two_file_test_2_ndebug.o): Likewise.
5036 (two_file_test_main_ndebug.o): Likewise.
5037 (incremental_test_2): Link with no-debug versions.
5038
f48b5fb7
CC
50392011-07-06 Cary Coutant <ccoutant@google.com>
5040
5041 * gold/incremental.cc
5042 (Output_section_incremental_inputs::write_info_blocks): Check for
5043 hidden and internal symbols.
5044
221597a5
CC
50452011-07-06 Cary Coutant <ccoutant@google.com>
5046
5047 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5048 Check disposition for startup file.
5049 (Incremental_inputs::report_command_line): Ignore
5050 --incremental-startup-unchanged option.
5051 * options.cc (General_options::parse_incremental_startup_unchanged):
5052 New function.
5053 (General_options::General_options): Initialize new data member.
5054 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
5055 (General_options): Add --incremental-startup-unchanged option.
5056 (General_options::incremental_startup_disposition): New function.
5057 (General_options::incremental_startup_disposition_): New data member.
5058
e24719f6
CC
50592011-07-06 Cary Coutant <ccoutant@google.com>
5060
5061 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5062 input file index to Script_info ctor.
5063 (Sized_incremental_binary::do_file_has_changed): Find the
5064 command-line argument for files named in scripts.
5065 * incremental.h (Script_info::Script_info): New ctor
5066 with input file index.
5067 (Script_info::input_file_index): New function.
5068 (Script_info::input_file_index_): New data member.
5069 (Incremental_binary::get_library): Add const.
5070 (Incremental_binary::get_script_info): Add const.
5071 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5072 * testsuite/Makefile.am (incremental_test_5): New test case.
5073 (incremental_test_6): New test case.
5074 * testsuite/Makefile.in: Regenerate.
5075
8f7c81e8
CC
50762011-07-06 Cary Coutant <ccoutant@google.com>
5077
5078 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5079 debug output when command lines differ.
5080
9fbd3822
CC
50812011-07-06 Cary Coutant <ccoutant@google.com>
5082
5083 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5084 --incremental-patch option.
5085 * layout.cc (Free_list::allocate): Extend allocation beyond original
5086 end if enabled.
5087 (Layout::make_output_section): Mark sections that should get
5088 patch space.
5089 * options.cc (parse_percent): New function.
5090 * options.h (parse_percent): New function.
5091 (DEFINE_percent): New macro.
5092 (General_options): Add --incremental-patch option.
5093 * output.cc (Output_section::Output_section): Initialize new data
5094 members.
5095 (Output_section::add_input_section): Print section name when out
5096 of patch space.
5097 (Output_section::add_output_section_data): Likewise.
5098 (Output_section::set_final_data_size): Add patch space when
5099 doing --incremental-full.
5100 (Output_section::do_reset_address_and_file_offset): Remove patch
5101 space.
5102 (Output_segment::set_section_list_addresses): Print debug output
5103 only if --incremental-update.
5104 * output.h (Output_section::set_is_patch_space_allowed): New function.
5105 (Output_section::is_patch_space_allowed_): New data member.
5106 (Output_section::patch_space_): New data member.
5107 * parameters.cc (Parameters::incremental_full): New function.
5108 * parameters.h (Parameters::incremental_full): New function
5109 * testsuite/Makefile.am (incremental_test_2): Add test for
5110 --incremental-patch option.
5111 * testsuite/Makefile.in: Regenerate.
5112 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
5113 (t18): Remove function body.
5114
f6cccc2c
DK
51152011-07-05 Doug Kwan <dougkwan@google.com>
5116
5117 PR gold/12771
5118 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
5119 Arm_Address type for relocation result.
5120 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
5121 overflow check.
5122 (Arm_relocate_functions::abs32): Use unaligned access.
5123 (Arm_relocate_functions::rel32): Ditto.
5124 (Arm_relocate_functions::prel31): Ditto.
5125 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5126 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5127 static data relocations.
5128 * testsuite/Makefile.in: Regnerate.
5129 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5130
28a13fec
ILT
51312011-07-05 Ian Lance Taylor <iant@google.com>
5132
5133 PR gold/12392
5134 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5135 symbols if necessary.
5136 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5137
24d47b34
ILT
51382011-07-05 Ian Lance Taylor <iant@google.com>
5139
5140 PR gold/12952
5141 * resolve.cc (Symbol::override_base_with_special): Simply override
5142 version with special symbol version, ignoring previous version.
5143
41f9cbbe
ILT
51442011-07-05 Ian Lance Taylor <iant@google.com>
5145
5146 * object.cc (Sized_relobj_file::include_section_group): Add
5147 information to comment about signature location.
5148
886288f1
ILT
51492011-07-02 Ian Lance Taylor <iant@google.com>
5150
5151 PR gold/12957
5152 * options.h (class General_options): Add -f and -F.
5153 * options.cc (General_options::finalize): Fatal error if -f/-F
5154 are used without -shared.
5155 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5156
ae3a6d4f
ILT
51572011-07-02 Ian Lance Taylor <iant@google.com>
5158
5159 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5160
21131061
ILT
51612011-07-01 Ian Lance Taylor <iant@google.com>
5162
5163 PR gold/12525
5164 PR gold/12952
5165 * resolve.cc (Symbol::override_base_with_special): Don't override
5166 the version if the overriding symbol has a different name.
5167 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5168 all callers. If we give an error about an undefined version,
5169 define the base version if necessary.
5170 * dynobj.h (class Versions): Update declaration.
5171 * testsuite/weak_alias_test_5.cc: New file.
5172 * testsuite/weak_alias_test.script: New file.
5173 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5174 and versioned_alias have the right value, and call t2.
5175 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5176 weak_alias_test_5.so.
5177 (weak_alias_test_LDADD): Likewise.
5178 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5179 * testsuite/Makefile.in: Rebuild.
5180
611062c0
ILT
51812011-07-01 Ian Lance Taylor <iant@google.com>
5182
5183 PR gold/12525
5184 * options.h (class General_options): Support -z notext.
5185 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5186 -Wl,-z,notext.
5187 (two_file_shared_nonpic.so): Likewise.
5188 (two_file_shared_mixed.so): Likewise.
5189 (two_file_shared_mixed_1.so): Likewise.
5190 (weak_undef_lib_nonpic.so): Likewise.
5191 (alt/weak_undef_lib_nonpic.so): Likewise.
5192 (tls_test_shared_nonpic.so): Likewise.
5193 * testsuite/Makefile.in: Rebuild.
5194
328c7c2f
ILT
51952011-07-01 Ian Lance Taylor <iant@google.com>
5196
5197 PR gold/12525
5198 * configure.ac: Test whether static linking works, setting
5199 the automake conditional HAVE_STATIC.
5200 * testsuite/Makefile.am: Disable tests using -static if
5201 HAVE_STATIC is not true.
5202 * configure, testsuite/Makefile.in: Rebuild.
5203
02d7cd44
ILT
52042011-07-01 Ian Lance Taylor <iant@google.com>
5205
5206 PR gold/12525
5207 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5208 Assert if we see DW_EH_PE_indirect.
5209 * target.h (Target::ehframe_datarel_base): New function.
5210 (Target::do_ehframe_datarel_base): New target function.
5211 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5212 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5213 function.
5214
07a60597
ILT
52152011-07-01 Ian Lance Taylor <iant@google.com>
5216
5217 PR gold/12571
5218 * options.h (class General_options): Add
5219 --ld-generated-unwind-info.
5220 * ehframe.cc (Fde::write): Add address parameter. Change all
5221 callers. If associated with PLT, fill in address and size.
5222 (Cie::set_output_offset): Only add merge mapping if there is an
5223 object.
5224 (Cie::write): Add address parameter. Change all callers.
5225 (Eh_frame::add_ehframe_for_plt): New function.
5226 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5227 input_offset_ fields into union u_, with new plt field.
5228 (Fde::Fde): Adjust for new union field.
5229 (Fde::Fde) [Output_data version]: New constructor.
5230 (Fde::add_mapping): Only add merge mapping if there is an object.
5231 (class Cie): Update declarations.
5232 (class Eh_frame): Declare add_ehframe_for_plt.
5233 * layout.cc (Layout::layout_eh_frame): Break out code into
5234 make_eh_frame_section, and call it.
5235 (Layout::make_eh_frame_section): New function.
5236 (Layout::add_eh_frame_for_plt): New function.
5237 * layout.h (class Layout): Update declarations.
5238 * merge.cc (Merge_map::add_mapping): Add assertion.
5239 * i386.cc: Include "dwarf.h".
5240 (class Output_data_plt_i386): Make first_plt_entry,
5241 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5242 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5243 and plt_eh_frame_fde.
5244 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5245 boundary. Call add_eh_frame_for_plt if appropriate.
5246 * x86_64.cc: Include "dwarf.h".
5247 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5248 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5249 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5250 and plt_eh_frame_fde.
5251 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5252 appropriate.
5253
14788a3f
ILT
52542011-06-29 Ian Lance Taylor <iant@google.com>
5255
5256 PR gold/12629
5257 * object.cc (Sized_relobj_file::layout_section): Change shdr
5258 parameter to be const.
5259 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5260 out of do_layout.
5261 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5262 appropriate. Call layout_eh_frame_section.
5263 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5264 sections.
5265 * object.h (class Sized_relobj_file): Update declarations.
5266
6c21fce1
ILT
52672011-06-29 Ian Lance Taylor <iant@google.com>
5268
37e41b03 5269 PR gold/12652
6c21fce1
ILT
5270 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5271 modifier.
5272 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5273
4d5e4e62
ILT
52742011-06-29 Ian Lance Taylor <iant@google.com>
5275
5276 PR gold/12675
5277 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5278 SHT_X86_64_UNWIND.
5279 * layout.cc (Layout::layout_eh_frame): Likewise.
5280
886f533a
ILT
52812011-06-29 Ian Lance Taylor <iant@google.com>
5282
5283 PR gold/12695
5284 * layout.cc (Layout::symtab_section_shndx): New function.
5285 * layout.h (class Layout): Declare symtab_section_shndx.
5286 * output.cc (Output_section::write_header): Call it.
5287
f3ae1b28
ILT
52882011-06-29 Ian Lance Taylor <iant@google.com>
5289
5290 PR gold/12818
5291 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5292 symbols which are not used in a relocation.
5293
aecf301f
ILT
52942011-06-28 Ian Lance Taylor <iant@google.com>
5295
5296 PR gold/12898
5297 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5298 script create indistinguishable segments.
5299 (Layout::set_segment_offsets): Use stable_sort when sorting
5300 segments. Pass this to Compare_segments constructor.
5301 * layout.h (class Layout): Make segment_precedes non-static.
5302 (class Compare_segments): Change from struct to class. Add
5303 layout_ field. Add constructor.
5304 * script-sections.cc
5305 (Script_sections::attach_sections_using_phdrs_clause): Rename
5306 local orphan to is_orphan. Don't report failure to put empty
5307 section in segment. On attachment failure, report name of
5308 section, and attach to first PT_LOAD segment.
5309
03ef7571
ILT
53102011-06-28 Ian Lance Taylor <iant@google.com>
5311
5312 PR gold/12934
5313 * target-select.cc (Target_selector::Target_selector): Add
5314 emulation parameter. Change all callers.
5315 (select_target_by_bfd_name): Rename from select_target_by_name.
5316 Change all callers.
5317 (select_target_by_emulation): New function.
5318 (supported_emulation_names): New function.
5319 * target-select.h (class Target_selector): Add emulation_ field.
5320 Update declarations.
5321 (Target_selector::recognize_by_bfd_name): Rename from
5322 recognize_by_name. Change all callers.
5323 (Target_selector::supported_bfd_names): Rename from
5324 supported_names. Change all callers.
5325 (Target_selector::recognize_by_emulation): New function.
5326 (Target_selector::supported_emulations): New function.
5327 (Target_selector::emulation): New function.
5328 (Target_selector::do_recognize_by_bfd_name): Rename from
5329 do_recognize_by_name. Change all callers.
5330 (Target_selector::do_supported_bfd_names): Rename from
5331 do_supported_names. Change all callers.
5332 (Target_selector::do_recognize_by_emulation): New function.
5333 (Target_selector::do_supported_emulations): New function.
5334 (select_target_by_bfd_name): Change name in declaration.
5335 (select_target_by_emulation): Declare.
5336 (supported_emulation_names): Declare.
5337 * parameters.cc (parameters_force_valid_target): Try to find
5338 target based on emulation from -m option.
5339 * options.h (class General_options): Change doc string for -m.
5340 * options.cc (help): Print emulations.
5341 (General_options::parse_V): Likewise.
5342 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5343 Add emulation parameter. Change all callers.
5344
200b2bb9
ILT
53452011-06-28 Ian Lance Taylor <iant@google.com>
5346
5347 * target.h (class Target): Add osabi_ field.
5348 (Target::osabi): New function.
5349 (Target::set_osabi): New function.
5350 (Target::Target): Initialize osabi_.
5351 (Target::do_adjust_elf_header): Make pure virtual.
5352 (Sized_target::do_adjust_elf_header): Declare.
5353 * target.cc (Sized_target::do_adjust_elf_header): New function.
5354 (class Sized_target): Instantiate all versions.
5355 * freebsd.h (class Target_freebsd): Remove.
5356 (Target_selector_freebsd::do_recognize): Call set_osabi on
5357 Target.
5358 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5359 (Target_selector_freebsd::set_osabi): Remove.
5360 * i386.cc (class Target_i386): Inherit from Sized_target rather
5361 than Target_freebsd.
5362 * x86_64.cc (class Target_x86_64): Likewise.
5363
b3ce541e
ILT
53642011-06-28 Ian Lance Taylor <iant@google.com>
5365
5366 * target.h (Target::can_check_for_function_pointers): Rewrite.
5367 Make non-virtual.
5368 (Target::can_icf_inline_merge_sections): Likewise.
5369 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5370 (Target::Target_info): Add can_icf_inline_merge_sections field.
5371 (Target::do_can_check_for_function_pointers): New virtual
5372 function.
5373 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5374 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5375 from can_check_for_function_pointers, move in file.
5376 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5377 section_may_have_icf_unsafe_poineters, move in file.
5378 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5379 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5380 Rename from can_check_for_function_pointers, move in file.
5381 (Target_i386::can_icf_inline_merge_sections): Remove.
5382 (Target_i386::i386_info): Initialize
5383 can_icf_inline_merge_sections.
5384 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5385 Initialize can_icf_inline_merge_sections.
5386 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5387 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5388 Rename from can_check_for_function_pointers, move in file.
5389 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5390 (Target_x86_64::x86_64_info): Initialize
5391 can_icf_inline_merge_sections.
5392 * testsuite/testfile.cc (Target_test::test_target_info):
5393 Likewise.
5394 * icf.cc (get_section_contents): Correct formatting.
5395
6d1c4efb
ILT
53962011-06-27 Ian Lance Taylor <iant@google.com>
5397
5398 * symtab.cc (Symbol::versioned_name): New function.
5399 (Symbol_table::add_to_final_symtab): Use versioned_name when
5400 appropriate.
5401 (Symbol_table::sized_write_symbol): Likewise.
5402 * symtab.h (class Symbol): Declare versioned_name.
5403 * stringpool.h (class Stringpool_template): Add variant of add
5404 which takes a std::basic_string.
5405 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5406 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5407 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5408 (ver_test_12.o): New target.
5409 * testsuite/Makefile.in: Rebuild.
5410
57eb9b50
DK
54112011-06-27 Doug Kwan <dougkwan@google.com>
5412
5413 * arm.cc (Arm_relocate_functions::thm_jump8,
5414 Arm_relocate_functions::thm_jump11): Use a wider signed
5415 type to compute offset.
5416 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5417 arm_thm_jump8.
5418 * testsuite/Makefile.in: Regenerate.
5419 * testsuite/arm_branch_in_range.sh: Check test results of
5420 arm_thm_jump11 and arm_thm_jump8.
5421 * testsuite/arm_thm_jump11.s: New test source file.
5422 * testsuite/arm_thm_jump11.t: New linker script.
5423 * testsuite/arm_thm_jump8.s: New test source file.
5424 * testsuite/arm_thm_jump8.t: New linker script.
5425
487b39df
ILT
54262011-06-24 Ian Lance Taylor <iant@google.com>
5427
5428 * layout.cc: Include "object.h".
5429 (ctors_sections_in_init_array): New static variable.
5430 (Layout::is_ctors_in_init_array): New function.
5431 (Layout::layout): Add entry to ctors_sections_in_init_array if
5432 appropriate.
5433 * layout.h (class Layout): Declare is_ctors_in_init_array.
5434 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5435 is_ctors_reverse_view is set.
5436 (Sized_relobj_file::write_sections): Add layout parameter. Change
5437 all callers. Set is_ctors_reverse_view field of View_size.
5438 (Sized_relobj_file::reverse_words): New function.
5439 * object.h (Sized_relobj_file::View_size): Add
5440 is_ctors_reverse_view field.
5441 (class Sized_relobj_file): Update declarations.
5442 * testsuite/initpri3.c: New test.
5443 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5444 initpri3b.
5445 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5446 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5447 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5448 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5449 * testsuite/Makefile.in: Rebuild.
5450
472076e4
CC
54512011-06-24 Cary Coutant <ccoutant@google.com>
5452
5453 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5454 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5455 (debug_msg_cdebug.err): New targets.
5456 * testsuite/Makefile.in: Regenerate.
5457 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5458 Fix checks for link with shared library.
5459
a60af0db
DK
54602011-06-24 Doug Kwan <dougkwan@google.com>
5461
5462 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5463 skip empty text sections.
5464 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5465
5393d741
ILT
54662011-06-22 Ian Lance Taylor <iant@google.com>
5467
5468 PR gold/12910
5469 * options.h (class General_options): Add --ctors-in-init-array.
5470 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5471 friends as SHT_PROGBITS for merging sections.
5472 (Layout::layout): Remove special handling of .init_array and
5473 friends. Don't sort if doing relocatable link. Sort for .ctors
5474 and .dtors if ctors_in_init_array.
5475 (Layout::make_output_section): Force correct section types for
5476 .init_array and friends. Don't sort if doing relocatable link,
5477 Don't sort .ctors and .dtors if ctors_in_init_array.
5478 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5479 (Layout::output_section_name): Add relobj parameter. Change all
5480 callers. Handle .ctors. and .dtors. in code rather than table.
5481 Handle .ctors and .dtors if ctors_in_init_array.
5482 (Layout::match_file_name): New function, moved from output.cc.
5483 * layout.h (class Layout): Update declarations.
5484 * output.cc: Include "layout.h".
5485 (Input_section_sort_entry::get_priority): New function.
5486 (Input_section_sort_entry::match_file_name): Just call
5487 Layout::match_file_name.
5488 (Output_section::Input_section_sort_init_fini_compare::operator()):
5489 Handle .ctors and .dtors. Sort by explicit priority rather than
5490 by name.
5491 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5492 * testsuite/initpri2.c: New test.
5493 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5494 (check_PROGRAMS): Add initpri2.
5495 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5496 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5497 * configure, testsuite/Makefile.in: Rebuild.
5498
e1f74f98
ILT
54992011-06-19 Ian Lance Taylor <iant@google.com>
5500
5501 PR gold/12880
5502 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5503 .interp section to a PT_INTERP segment even if we have seen a
5504 --dynamic-linker option. Don't do it if we have seen a PHDRS
5505 clause in a linker script.
5506 (Layout::finalize): Don't create a .interp section if we've
5507 already create a PT_INTERP segment.
5508 (Layout::create_interp): Always call choose_output_section (revert
5509 patch of 2011-06-17). Don't create PT_INTERP segment.
5510 * script-sections.cc
5511 (Script_sections::create_note_and_tls_segments): Add a .interp
5512 section to a PT_INTERP segment even if we have seen a
5513 --dynamic-linker option.
5514
766f91bb
ILT
55152011-06-18 Ian Lance Taylor <iant@google.com>
5516
5517 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5518 merely because a non-PT_LOAD segment has a dynamic reloc.
5519
0d212c3a
ILT
55202011-06-18 Ian Lance Taylor <iant@google.com>
5521
5522 * layout.cc (Layout::finish_dynamic_section): Don't create
5523 DT_FLAGS entry if not needed.
5524
911a5072
ILT
55252011-06-18 Ian Lance Taylor <iant@google.com>
5526
5527 PR gold/12745
5528 * layout.cc (Layout::layout_eh_frame): Correct handling of
5529 writable .eh_frame section.
5530
534b4e5f
ILT
55312011-06-17 Ian Lance Taylor <iant@google.com>
5532
5533 PR gold/12893
5534 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5535 symbol is redefined with the exact same object and value.
5536
10b4f102
ILT
55372011-06-17 Ian Lance Taylor <iant@google.com>
5538
5539 PR gold/12880
5540 * layout.h (class Layout): Add interp_segment_ field.
5541 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5542 (Layout::attach_allocated_section_to_segment): If making shared
5543 library, put .interp section in PT_INTERP segment.
5544 (Layout::finalize): Also call create_interp if -dynamic-linker
5545 option was used.
5546 (Layout::create_interp): Assert that there is no PT_INTERP
5547 segment. If not using a SECTIONS clause, use make_output_section.
5548 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5549 * script-sections.cc
5550 (Script_sections::create_note_and_tls_segments): If making shared
5551 library, put .interp section in PT_INTERP segment.
5552
a29b0dad
ILT
55532011-06-17 Ian Lance Taylor <iant@google.com>
5554
e588ea8d
ILT
5555 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5556 when making a shared library.
5557
55582011-06-17 Ian Lance Taylor <iant@google.com>
5559
5560 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5561 parameter. Change all callers. Don't issue warning about PC32
5562 against locally defined symbol.
a29b0dad 5563
9d3b0698
ILT
55642011-06-16 Ian Lance Taylor <iant@google.com>
5565
5566 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5567 occurs in same object.
5568
85b0f90c
AM
55692011-06-14 Alan Modra <amodra@gmail.com>
5570
5571 * po/POTFILES.in: Regenerate.
5572
a94907d9
ILT
55732011-06-09 Ian Lance Taylor <iant@google.com>
5574
5575 * script-sections.cc
5576 (Orphan_output_section::set_section_addresses): For a relocatable
5577 link set address to 0.
5578
4fb3a1c3
CC
55792011-06-09 Cary Coutant <ccoutant@google.com>
5580
5581 PR gold/12804
5582 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5583 used with --compress-debug-sections.
5584 * gold/object.cc (Sized_relobj_file::do_layout): Report
5585 uncompressed size of compressed input sections.
5586
61220854
CC
55872011-06-08 Cary Coutant <ccoutant@google.com>
5588
5589 PR gold/12804
5590 * testsuite/two_file_test_2_v1.cc: Change initialization of
5591 v2 to keep it in .data.
5592
e6455dfb
CC
55932011-06-07 Cary Coutant <ccoutant@google.com>
5594
5595 * common.cc (Symbol_table::do_allocate_commons_list): Call
5596 gold_fallback.
5597 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5598 (Errors::fallback): New function.
5599 (gold_fallback): New function.
5600 * errors.h (Errors::fallback): New function.
5601 * gold.cc (gold_exit): Change status parameter to enum; adjust
5602 all callers.
5603 (queue_initial_tasks): Call gold_fallback.
5604 * gold.h: Include cstdlib.
5605 (Exit_status): New enum type.
5606 (gold_exit): Change status parameter to enum.
5607 (gold_fallback): New function.
5608 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5609 (Layout::create_symtab_sections): Likewise.
5610 (Layout::create_shdrs): Likewise.
5611 * main.cc (main): Adjust call to gold_exit.
5612 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5613 (Output_data_got::add_got_entry_pair): Likewise.
5614 (Output_section::add_input_section): Likewise.
5615 (Output_section::add_output_section_data): Likewise.
5616 (Output_segment::set_section_list_addresses): Likewise.
5617 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5618
fb0e076f
CC
56192011-06-07 Cary Coutant <ccoutant@google.com>
5620
5621 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5622 for incremental links.
5623 * output.cc (Output_segment::set_section_list_addresses): Remove
5624 FIXME and test for TLS or BSS.
5625
a5ee4d5d
CC
56262011-06-07 Cary Coutant <ccoutant@google.com>
5627
5628 * testsuite/Makefile.am: Add incremental_copy_test,
5629 incremental_common_test_1.
5630 * testsuite/Makefile.in: Regenerate.
5631 * testsuite/common_test_1_v1.c: New source file.
5632 * testsuite/common_test_1_v2.c: New source file.
5633 * testsuite/copy_test_v1.cc: New source file.
5634
5146f448
CC
56352011-06-07 Cary Coutant <ccoutant@google.com>
5636
5637 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5638 update, allocate common from bss section's free list.
5639 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5640 linker-defined symbols.
5641 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5642 Skip GOT and PLT entries that are no longer referenced.
5643 (Output_section_incremental_inputs::write_info_blocks): Mark
5644 linker-defined symbols.
5645 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5646 * output.cc (Output_section::allocate): New function.
5647 * output.h (Output_section::allocate): New function.
5648 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5649 linker-defined symbols.
5650 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5651 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5652 (Symbol::init_base_output_data): Likewise.
5653 (Symbol::init_base_output_segment): Likewise.
5654 (Symbol::init_base_constant): Likewise.
5655 (Sized_symbol::init_output_data): Likewise.
5656 (Sized_symbol::init_output_segment): Likewise.
5657 (Sized_symbol::init_constant): Likewise.
5658 (Symbol_table::do_define_in_output_data): Likewise.
5659 (Symbol_table::do_define_in_output_segment): Likewise.
5660 (Symbol_table::do_define_as_constant): Likewise.
5661 * symtab.h (Symbol::is_predefined): New function.
5662 (Symbol::init_base_output_data): Add is_predefined parameter.
5663 (Symbol::init_base_output_segment): Likewise.
5664 (Symbol::init_base_constant): Likewise.
5665 (Symbol::is_predefined_): New data member.
5666 (Sized_symbol::init_output_data): Add is_predefined parameter.
5667 (Sized_symbol::init_output_segment): Likewise.
5668 (Sized_symbol::init_constant): Likewise.
5669 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5670
26d3c67d
CC
56712011-06-07 Cary Coutant <ccoutant@google.com>
5672
5673 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5674 instead of emit_copy_reloc.
5675 (Copy_relocs::emit_copy_reloc): Refactor.
5676 (Copy_relocs::make_copy_reloc): New function.
5677 (Copy_relocs::add_copy_reloc): Remove.
5678 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5679 section.
5680 (Copy_relocs::make_copy_reloc): New function.
5681 (Copy_relocs::add_copy_reloc): Remove.
5682 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5683 unchanged input files.
5684 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5685 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5686 Reserve BSS space for COPY relocations.
5687 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5688 (Output_section_incremental_inputs::write_info_blocks): Record
5689 whether a symbol is copied from a shared object.
5690 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5691 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5692 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5693 (Incremental_input_entry_reader::get_output_symbol_index): Add
5694 is_copy parameter.
5695 (Incremental_binary::emit_copy_relocs): New function.
5696 (Incremental_binary::do_emit_copy_relocs): New function.
5697 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5698 new data member.
5699 (Sized_incremental_binary::add_copy_reloc): New function.
5700 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5701 (Sized_incremental_binary::Copy_reloc): New struct.
5702 (Sized_incremental_binary::Copy_relocs): New typedef.
5703 (Sized_incremental_binary::copy_relocs_): New data member.
5704 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5705 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5706 * target.h (Sized_target::emit_copy_reloc): New function.
5707 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5708
7cdb37d9
CC
57092011-06-02 Cary Coutant <ccoutant@google.com>
5710
5711 PR gold/12163
5712 * gold/archive.cc (Archive::Archive): Initialize new data member.
5713 (Archive::include_all_members): Return if archive has already been
5714 included.
5715 * gold/archive.h (Archive::include_all_members_): New data member.
5716
cc643b88
NC
57172011-06-02 Nick Clifton <nickc@redhat.com>
5718
5719 * dynobj.h: Fix spelling mistake in comment.
5720 * output.cc: Likewise.
5721
f62a3ca7 57222011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 5723 Asier Llano
f62a3ca7
DK
5724
5725 PR gold/12826
cc643b88 5726 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
5727 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5728 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5729 redundant arm_exidx_test.so.
5730 * testsuite/Makefile.in: Regenerate.
5731 (check_SCRIPTS): Add pr12826.sh
5732 (check_DATA): Add pr12826.stdout
5733 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5734 * testsuite/pr12826.sh: New file.
5735 * testsuite/pr12826_1.s: Ditto.
5736 * testsuite/pr12826_1.s: Ditto.
5737
8dbe1edc
ILT
57382011-05-30 Ian Lance Taylor <iant@google.com>
5739
5740 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5741 sections.
5742
c49875be
ILT
57432011-05-29 Ian Lance Taylor <iant@google.com>
5744
5745 PR gold/12804
5746 * testsuite/Makefile.am: Use different file name for two_file_test
5747 temporary file for each incremental test.
5748 * testsuite/Makefile.in: Rebuild.
5749
69d53f7a
ILT
57502011-05-29 Ian Lance Taylor <iant@google.com>
5751
5752 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5753 binary input file is empty.
5754
41d0ab5f
ILT
57552011-05-27 Ian Lance Taylor <iant@google.com>
5756
5757 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5758 (ver_test_9.so): Likewise.
5759 * testsuite/Makefile.in: Rebuild.
5760
89d8a36b
CC
57612011-05-26 Cary Coutant <ccoutant@google.com>
5762
5763 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5764 * incremental.cc (Incremental_inputs::report_input_section): Fix
5765 comment, indentation.
5766 (Incremental_inputs::report_comdat_group): New function.
5767 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5768 of data for incremental input file entry.
5769 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5770 group count, COMDAT group signatures.
5771 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5772 an unchanged input file.
5773 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5774 Initialize new data member.
5775 (Incremental_object_entry::add_comdat_group): New function.
5776 (Incremental_object_entry::get_comdat_group_count): New function.
5777 (Incremental_object_entry::get_comdat_signature_key): New function.
5778 (Incremental_object_entry::groups_): New data member.
5779 (Incremental_inputs::report_comdat_group): New function.
5780 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5781 data for incremental input file entry.
5782 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5783 (Incremental_input_entry_reader::get_input_section): Adjust size of
5784 data for incremental input file entry.
5785 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5786 (Incremental_input_entry_reader::get_comdat_group_signature): New
5787 function.
5788 * object.cc (Sized_relobj::include_section_group): Report kept
5789 COMDAT groups for incremental links.
5790
1706a06f
ILT
57912011-05-24 David Meyer <pdox@google.com>
5792
5793 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5794 with name parameter. Add found_name parameter.
5795 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5796 * dirsearch.h (class Dirsearch): Update declaration.
5797
a10ae760
ILT
57982011-05-24 Ian Lance Taylor <iant@google.com>
5799
5800 * archive.cc (Library_base::should_include_member): Pull in object
5801 from archive if it defines the entry symbol.
5802 * parameters.cc (Parameters::entry): New function.
5803 * parameters.h (class Parameters): Declare entry.
5804 * output.h (class Output_file_header): Remove entry_ field.
5805 * output.cc (Output_file_header::Output_file_header): Remove entry
5806 parameter. Change all callers.
5807 (Output_file_header::entry): Use parameters->entry.
5808 * gold.cc (queue_middle_tasks): Likewise.
5809 * plugin.cc (Plugin_hook::run): Likewise.
5810
aa92d6ed
CC
58112011-05-24 Cary Coutant <ccoutant@google.com>
5812
5813 * gold.cc (queue_initial_tasks): Pass incremental base filename
5814 to Output_file::open_base_file; don't print error message.
5815 * incremental-dump.cc (main): Adjust call to
5816 Output_file::open_for_modification.
5817 * incremental-dump.cc (main): Likewise.
5818 * incremental.cc (Incremental_inputs::report_command_line):
5819 Ignore --incremental-base option when comparing command lines.
5820 Ignore parameter when given as separate argument.
5821 * options.h (class General_options): Add --incremental-base.
5822 * output.cc (Output_file::Output_file):
5823 (Output_file::open_base_file): Add base_name and writable parameters;
5824 read base file into new file; print error message here.
5825 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5826 callers.
5827 * output.h (Output_file::open_for_modification): Rename to...
5828 (Output_file::open_base_file): ...this; add base_name and
5829 writable parameters; adjust all callers.
5830 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5831 callers.
5832 * testsuite/Makefile.am (incremental_test_4): Test
5833 --incremental-base.
5834 * testsuite/Makefile.in: Regenerate.
5835
2eedd706
CC
58362011-05-24 Cary Coutant <ccoutant@google.com>
5837
5838 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5839 incremental_test_4.
5840 * testsuite/Makefile.in: Regenerate.
5841 * testsuite/two_file_test_1_v1.cc: New test source file.
5842 * testsuite/two_file_test_1b_v1.cc: New test source file.
5843 * testsuite/two_file_test_2_v1.cc: New test source file.
5844
0f1c85a6
CC
58452011-05-24 Cary Coutant <ccoutant@google.com>
5846
5847 * dynobj.h (Dynobj::do_dynobj): New function.
5848 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5849 flag and soname for shared objects.
5850 * incremental.cc (Incremental_inputs::report_object): Make
5851 either Incremental_object_entry or Incremental_dynobj_entry; add
5852 soname to string table.
5853 (Incremental_inputs::report_input_section): Add assertion.
5854 (Output_section_incremental_inputs::set_final_data_size): Adjust
5855 type of input file entry for shared libraries; adjust size of
5856 shared library info entry.
5857 (Output_section_incremental_inputs::write_input_files): Write
5858 as_needed flag for shared libraries.
5859 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5860 of input file entry for shared libraries; write soname.
5861 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5862 soname from incremental info.
5863 * incremental.h (enum Incremental_input_flags): Add
5864 INCREMENTAL_INPUT_AS_NEEDED.
5865 (Incremental_input_entry::Incremental_input_entry): Initialize new
5866 data member.
5867 (Incremental_input_entry::set_as_needed): New function.
5868 (Incremental_input_entry::as_needed): New function.
5869 (Incremental_input_entry::do_dynobj_entry): New function.
5870 (Incremental_input_entry::as_needed_): New data member.
5871 (Incremental_object_entry::Incremental_object_entry): Don't check
5872 for shared library.
5873 (Incremental_object_entry::do_type): Likewise.
5874 (class Incremental_dynobj_entry): New class.
5875 (Incremental_input_entry_reader::as_needed): New function.
5876 (Incremental_input_entry_reader::get_soname): New function.
5877 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5878 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5879 size of shared library info entry.
58797674 5880 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
5881 incremental link when adding DT_NEEDED entries.
5882 * object.h (Object::Object): Initialize new data member.
5883 (Object::dynobj): New function.
5884 (Object::set_as_needed): New function.
5885 (Object::as_needed): New function.
5886 (Object::do_dynobj): New function.
5887 (Object::as_needed_): New data member.
5888
6fa2a40b
CC
58892011-05-24 Cary Coutant <ccoutant@google.com>
5890
5891 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5892 info; adjust display of GOT entries.
5893 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5894 vector of input objects; remove file_status_.
5895 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5896 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5897 got_plt reader; call target hooks to reserve GOT entries.
5898 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5899 of input file info header and GOT info entry.
5900 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5901 relocation info.
5902 (Got_plt_view_info::got_descriptor): Remove.
5903 (Got_plt_view_info::sym_index): New data member.
5904 (Got_plt_view_info::input_index): New data member.
5905 (Local_got_offset_visitor::visit): Write input file index.
5906 (Global_got_offset_visitor::visit): Write 0 for input file index.
5907 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5908 with sym_index and input_index.
5909 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5910 incremental info GOT entry; replace got_descriptor with input_index.
5911 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5912 map from input file index to object.
5913 (Sized_relobj_incr::do_layout): Replace direct data member reference
5914 with accessor function.
5915 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5916 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5917 Adjust size of input file info header.
5918 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5919 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5920 (Incremental_input_entry_reader::get_input_section): Adjust size of
5921 input file info header.
5922 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5923 of incremental info GOT entry.
5924 (Incremental_got_plt_reader::get_got_desc): Remove.
5925 (Incremental_got_plt_reader::get_got_symndx): New function.
5926 (Incremental_got_plt_reader::get_got_input_index): New function.
5927 (Sized_incremental_binary::Sized_incremental_binary): Remove
5928 file_status_; add input_objects_.
5929 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5930 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5931 (Sized_incremental_binary::file_is_unchanged): Remove.
5932 (Sized_incremental_binary::set_input_object): New function.
5933 (Sized_incremental_binary::input_object): New function.
5934 (Sized_incremental_binary::file_status_): Remove.
5935 (Sized_incremental_binary::input_objects_): New data member.
5936 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5937 references.
5938 (Sized_relobj_incr::invalid_address): Move to base class.
5939 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5940 class.
5941 (Sized_relobj_incr::do_output_section_offset): Likewise.
5942 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5943 (Sized_relobj_incr::section_offsets_): Likewise.
5944 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5945 function.
5946 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5947 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5948 with accessor function.
5949 (Sized_relobj_file::do_layout): Likewise.
5950 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5951 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5952 (Sized_relobj_file::compute_final_local_value): Replace refs to
5953 section_offsets_ with accessor function.
5954 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5955 * object.h (Relobj::Relobj): Initialize new data members.
5956 (Relobj::add_dyn_reloc): New function.
5957 (Relobj::first_dyn_reloc): New function.
5958 (Relobj::dyn_reloc_count): New function.
5959 (Relobj::first_dyn_reloc_): New data member.
5960 (Relobj::dyn_reloc_count_): New data member.
5961 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5962 references.
5963 (Sized_relobj::Address): New typedef.
5964 (Sized_relobj::invalid_address): Move here from child class.
5965 (Sized_relobj::Sized_relobj): Initialize new data members.
5966 (Sized_relobj::sized_relobj): New function.
5967 (Sized_relobj::is_output_section_offset_invalid): Move here from
5968 child class.
5969 (Sized_relobj::get_output_section_offset): Likewise.
5970 (Sized_relobj::local_has_got_offset): Likewise.
5971 (Sized_relobj::local_got_offset): Likewise.
5972 (Sized_relobj::set_local_got_offset): Likewise.
5973 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5974 (Sized_relobj::clear_got_offsets): New function.
5975 (Sized_relobj::section_offsets): Move here from child class.
5976 (Sized_relobj::do_output_section_offset): Likewise.
5977 (Sized_relobj::do_set_section_offset): Likewise.
5978 (Sized_relobj::Local_got_offsets): Likewise.
5979 (Sized_relobj::local_got_offsets_): Likewise.
5980 (Sized_relobj::section_offsets_): Likewise.
5981 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5982 references.
5983 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5984 class.
5985 (Sized_relobj_file::sized_relobj): New function
5986 (Sized_relobj_file::local_has_got_offset): Move to base class.
5987 (Sized_relobj_file::local_got_offset): Likewise.
5988 (Sized_relobj_file::set_local_got_offset): Likewise.
5989 (Sized_relobj_file::get_output_section_offset): Likewise.
5990 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5991 (Sized_relobj_file::do_output_section_offset): Likewise.
5992 (Sized_relobj_file::do_set_section_offset): Likewise.
5993 (Sized_relobj_file::Local_got_offsets): Likewise.
5994 (Sized_relobj_file::local_got_offsets_): Likewise.
5995 (Sized_relobj_file::section_offsets_): Likewise.
5996 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5997 (all constructors).
5998 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5999 (Output_reloc::get_symbol_index): Likewise.
6000 (Output_reloc::local_section_offset): Likewise.
6001 (Output_reloc::get_address): Likewise.
6002 (Output_reloc::symbol_value): Likewise.
6003 (Output_data_got::reserve_slot): Move to class definition.
6004 (Output_data_got::reserve_local): New function.
6005 (Output_data_got::reserve_slot_for_global): Remove.
6006 (Output_data_got::reserve_global): New function.
6007 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6008 (all constructors, two instantiations).
6009 (Output_reloc::get_relobj): New function (two instantiations).
6010 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6011 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6012 (Output_data_reloc::add_global): Adjust type of relobj.
6013 (Output_data_reloc::add_global_relative): Likewise.
6014 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6015 (Output_data_reloc::add_local): Likewise.
6016 (Output_data_reloc::add_local_relative): Likewise.
6017 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6018 (Output_data_reloc::add_local_section): Likewise.
6019 (Output_data_reloc::add_output_section): Likewise.
6020 (Output_data_reloc::add_absolute): Likewise.
6021 (Output_data_reloc::add_target_specific): Likewise.
6022 (Output_data_got::reserve_slot): Move definition here.
6023 (Output_data_got::reserve_local): New function.
6024 (Output_data_got::reserve_global): New function.
6025 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6026 section_offsets_ with accessor function.
6027 (Sized_relobj_file::write_sections): Likewise.
6028 (Sized_relobj_file::do_relocate_sections): Likewise.
6029 * target.h (Sized_target::reserve_local_got_entry): New function.
6030 (Sized_target::reserve_global_got_entry): New function.
6031 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6032 (Target_x86_64::reserve_global_got_entry): New function.
6033 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6034
4829d394
CC
60352011-05-23 Cary Coutant <ccoutant@google.com>
6036
6037 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6038 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6039 bit when checking got_type.
6040 * incremental.cc (Sized_incremental_binary::setup_readers):
6041 Store symbol table and string table locations; initialize bit vector
6042 of file status flags.
6043 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6044 unchanged files.
6045 (Sized_incremental_binary::do_process_got_plt): New function.
6046 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6047 (Output_section_incremental_inputs::set_final_data_size): Record
6048 file index for each input file.
6049 (Output_section_incremental_inputs::write_got_plt): Store file index
6050 instead of input entry offset for each GOT entry.
6051 * incremental.h
6052 (Incremental_input_entry::Incremental_input_entry): Initialize new
6053 data member.
6054 (Incremental_input_entry::set_offset): Store file index.
6055 (Incremental_input_entry::get_file_index): New function.
6056 (Incremental_input_entry::file_index_): New data member.
6057 (Incremental_binary::process_got_plt): New function.
6058 (Incremental_binary::do_process_got_plt): New function.
6059 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6060 data members.
6061 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6062 (Sized_incremental_binary::set_file_is_unchanged): New function.
6063 (Sized_incremental_binary::file_is_unchanged): New function.
6064 (Sized_incremental_binary::do_process_got_plt): New function.
6065 (Sized_incremental_binary::file_status_): New data member.
6066 (Sized_incremental_binary::main_symtab_loc_): New data member.
6067 (Sized_incremental_binary::main_strtab_loc_): New data member.
6068 * output.cc (Output_data_got::Got_entry::write): Add case
6069 RESERVED_CODE.
6070 (Output_data_got::add_global): Call add_got_entry.
6071 (Output_data_got::add_global_plt): Likewise.
6072 (Output_data_got::add_global_with_rel): Likewise.
6073 (Output_data_got::add_global_with_rela): Likewise.
6074 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6075 (Output_data_got::add_global_pair_with_rela): Likewise.
6076 (Output_data_got::add_local): Call add_got_entry.
6077 (Output_data_got::add_local_plt): Likewise.
6078 (Output_data_got::add_local_with_rel): Likewise.
6079 (Output_data_got::add_local_with_rela): Likewise.
6080 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6081 (Output_data_got::add_local_pair_with_rela): Likewise.
6082 (Output_data_got::reserve_slot): New function.
6083 (Output_data_got::reserve_slot_for_global): New function.
6084 (Output_data_got::add_got_entry): New function.
6085 (Output_data_got::add_got_entry_pair): New function.
6086 (Output_section::add_output_section_data): Edit FIXME.
6087 * output.h
6088 (Output_section_data_build::Output_section_data_build): New
6089 constructor with size parameter.
6090 (Output_data_space::Output_data_space): Likewise.
6091 (Output_data_got::Output_data_got): Initialize new data member; new
6092 constructor with size parameter.
6093 (Output_data_got::add_constant): Call add_got_entry.
6094 (Output_data_got::reserve_slot): New function.
6095 (Output_data_got::reserve_slot_for_global): New function.
6096 (class Output_data_got::Got_entry): Add RESERVED_CODE.
6097 (Output_data_got::add_got_entry): New function.
6098 (Output_data_got::add_got_entry_pair): New function.
6099 (Output_data_got::free_list_): New data member.
6100 * target.h (Sized_target::init_got_plt_for_update): New function.
6101 (Sized_target::register_global_plt_entry): New function.
6102 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
6103 Initialize new data member; call init; add constructor with PLT count.
6104 (Output_data_plt_x86_64::init): New function.
6105 (Output_data_plt_x86_64::add_relocation): New function.
6106 (Output_data_plt_x86_64::reserve_slot): New function.
6107 (Output_data_plt_x86_64::free_list_): New data member.
6108 (Target_x86_64::init_got_plt_for_update): New function.
6109 (Target_x86_64::register_global_plt_entry): New function.
6110 (Output_data_plt_x86_64::add_entry): Allocate from free list for
6111 incremental updates.
6112 (Output_data_plt_x86_64::add_relocation): New function.
6113 * testsuite/object_unittest.cc (Object_test): Set default options.
6114
ec69d6da
ILT
61152011-05-16 Ian Lance Taylor <iant@google.com>
6116
6117 * options.h (class General_options): Make -i a synonym for -r.
6118
732e31de
ILT
61192011-05-16 Ian Lance Taylor <iant@google.com>
6120
6121 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6122
403676b5
CC
61232011-05-10 Cary Coutant <ccoutant@google.com>
6124
6125 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6126 strip_all (-s).
6127
5b7b7d6e
ILT
61282011-05-06 Ian Lance Taylor <iant@google.com>
6129
6130 * layout.cc (Layout::layout): If the output section flags change,
6131 update the ordering.
6132
f0f9babf
CC
61332011-04-25 Cary Coutant <ccoutant@google.com>
6134
6135 * incremental-dump.cc (dump_incremental_inputs): Print local
6136 symbol info for each input file.
6137 * incremental.cc
6138 (Output_section_incremental_inputs::set_final_data_size): Add local
6139 symbol info to input file entries in incremental info.
6140 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6141 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6142 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6143 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6144 implementation.
6145 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6146 (Sized_incr_relobj::do_relocate): Write the local symbols.
6147 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6148 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6149 Adjust size of input file header.
6150 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6151 (Incremental_inputs_reader::get_local_symbol_count): New function.
6152 (Incremental_inputs_reader::get_input_section): Adjust size of input
6153 file header.
6154 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6155 (Sized_incr_relobj::This): New typedef.
6156 (Sized_incr_relobj::sym_size): New const data member.
6157 (Sized_incr_relobj::Local_symbol): New struct.
6158 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6159 (Sized_incr_relobj::do_local_symbol_offset): New function.
6160 (Sized_incr_relobj::local_symbol_count_): New data member.
6161 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6162 (Sized_incr_relobj::local_symbol_index_): New data member.
6163 (Sized_incr_relobj::local_symbol_offset_): New data member.
6164 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6165 (Sized_incr_relobj::local_symbols_): New data member.
6166 * object.h (Relobj::output_local_symbol_count): New function.
6167 (Relobj::local_symbol_offset): New function.
6168 (Relobj::do_output_local_symbol_count): New function.
6169 (Relobj::do_local_symbol_offset): New function.
6170 (Sized_relobj::do_output_local_symbol_count): New function.
6171 (Sized_relobj::do_local_symbol_offset): New function.
6172
d0a9ace3
ILT
61732011-04-22 Vladimir Simonov <sv@sw.ru>
6174
6175 * descriptors.cc (set_close_on_exec): New function.
6176 (Descriptors::open): Use set_close_on_exec.
6177 * output.cc (S_ISLNK): Define if not defined.
6178
94a3fc8b
CC
61792011-04-22 Cary Coutant <ccoutant@google.com>
6180
6181 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6182 global symbol map.
6183 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6184 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6185 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6186 relocations.
6187 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6188 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6189 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6190 * incremental.h
6191 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6192 function.
6193 (Incremental_binary::apply_incremental_relocs): New function.
6194 (Incremental_binary::do_apply_incremental_relocs): New function.
6195 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6196 data member.
6197 (Sized_incremental_binary::add_global_symbol): New function.
6198 (Sized_incremental_binary::global_symbol): New function.
6199 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6200 (Sized_incremental_binary::symbol_map_): New data member.
6201 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6202 * target.h (Sized_target::apply_relocation): New function.
6203 * target-reloc.h (apply_relocation): New function.
6204 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6205
c87e4302
DK
62062011-04-22 Doug Kwan <dougkwan@google.com>
6207
6208 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6209 flag of a SHT_ARM_EXIDX section.
2e702c99 6210 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
6211 * testsuite/Makefile.in: Regenerate.
6212 * testsuite/arm_exidx_test.s: New file.
6213 * testsuite/arm_exidx_test.sh: Same.
6214
e7782cf6
CC
62152011-04-20 Cary Coutant <ccoutant@google.com>
6216
6217 PR gold/12689
6218 * archive.h (Incremental_archive_entry::Archive_member):
6219 Initialize arg_serial_ (second constructor).
6220
308ecdc7
ILT
62212011-04-17 Ian Lance Taylor <iant@google.com>
6222
6223 * object.cc (Relocate_info::location): Simplify location string.
6224 * errors.cc (Errors::error_at_location): Don't print program
6225 name.
6226 (Errors::warning_at_location): Likewise.
6227 (Errors::undefined_symbol): Likewise.
6228 * testsuite/debug_msg.sh: Update accordingly.
6229
bec5b579
CC
62302011-04-14 Cary Coutant <ccoutant@google.com>
6231
6232 * gold/layout.cc (Layout::symtab_section_offset): New function.
6233 * gold/layout.h (Layout::symtab_section_offset): New function.
6234 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6235
88597d34
ILT
62362011-04-12 Ian Lance Taylor <iant@google.com>
6237
6238 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6239 with MREMAP_MAYMOVE.
6240 * output.h (class Output_file): Add map_is_allocated_ field.
6241 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6242 not available, provide stubs. If mremap is not available, #define
6243 it to gold_mremap.
6244 (MREMAP_MAYMOVE): Define if not defined.
6245 (Output_file::Output_file): Initialize map_is_allocated_.
6246 (Output_file::resize): Check map_is_allocated_.
6247 (Output_file::map_anonymous): If mmap fails, use malloc.
6248 (Output_file::unmap): Don't do anything for an anonymous map.
6249 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6250 is not available, provide stubs.
6251 (File_read::View::~View): Use free rather than delete[].
6252 (File_read::make_view): Use malloc rather than new[]. If mmap
6253 fails, use malloc.
6254 (File_read::find_or_make_view): Use malloc rather than new[].
6255 * gold.h: Remove HAVE_REMAP code.
6256 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6257 exists. Rename mremap to gold_mremap. If mmap is not available
6258 don't do anything.
6259 * configure, config.in: Rebuild.
6260
11e361bc
ILT
62612011-04-11 Ian Lance Taylor <iant@google.com>
6262
6263 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6264 initialize local variable v.
6265
cdc29364
CC
62662011-04-11 Cary Coutant <ccoutant@google.com>
6267
6268 * archive.cc (Archive::include_member): Adjust call to
6269 report_object.
6270 (Add_archive_symbols::run): Track argument serial numbers.
6271 (Lib_group::include_member): Likewise.
6272 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6273 * archive.h (Incremental_archive_entry::Archive_member):
6274 Initialize arg_serial_.
6275 (Archive_member::arg_serial_): New data member.
6276 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6277 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6278 incremental link.
6279 (Sized_dynobj::do_for_all_local_got_entries): New function.
6280 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6281 function.
6282 * fileread.cc (get_mtime): New function.
6283 * fileread.h (get_mtime): New function.
6284 * gold.cc (queue_initial_tasks): Check for incremental update.
6285 (process_incremental_input): New function.
6286 (queue_middle_tasks): Don't force valid target for incremental
6287 update.
6288 * incremental-dump.cc (find_input_containing_global): Adjust
6289 size of symbol info entry.
6290 (dump_incremental_inputs): Dump argument serial number and
6291 in_system_directory flag; bias shndx by 1; print symbol names
6292 when dumping per-file symbol lists; use new symbol info readers.
6293 * incremental.cc
6294 (Output_section_incremental_inputs:update_data_size): New function.
6295 (Sized_incremental_binary::setup_readers): Setup input readers
6296 for each input file; build maps for files added from libraries
6297 and scripts.
6298 (Sized_incremental_binary::check_input_args): New function.
6299 (Sized_incremental_binary::do_check_inputs): Build map of argument
6300 serial numbers to input arguments.
6301 (Sized_incremental_binary::do_file_has_changed): Rename
6302 do_file_is_unchanged to this; compare file modification times.
6303 (Sized_incremental_binary::do_init_layout): New function.
6304 (Sized_incremental_binary::do_reserve_layout): New function.
6305 (Sized_incremental_binary::do_get_input_reader): Remove.
6306 (Sized_incremental_binary::get_symtab_view): New function.
6307 (Incremental_checker::can_incrementally_link_output_file): Remove.
6308 (Incremental_inputs::report_command_line): Exclude --debug options.
6309 (Incremental_inputs::report_archive_begin): Add parameter; track
6310 argument serial numbers; don't put input file entry for archive
6311 before archive members.
6312 (Incremental_inputs::report_archive_end): Put input file entry
6313 for archive after archive members.
6314 (Incremental_inputs::report_object): Add parameter; track argument
6315 serial numbers and in_system_directory flag.
6316 (Incremental_inputs::report_script): Add parameter; track argument
6317 serial numbers.
6318 (Output_section_incremental_inputs::set_final_data_size): Adjust
6319 size of symbol info entry; check for forwarding symbols.
6320 (Output_section_incremental_inputs::write_input_files): Write
6321 in_system_directory flag and argument serial number.
6322 (Output_section_incremental_inputs::write_info_blocks): Map section
6323 indices between incremental info and original input file; store
6324 input section index for each symbol.
6325 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6326 change operator() to visit().
6327 (class Global_got_offset_visitor): Likewise.
6328 (class Global_symbol_visitor_got_plt):
6329 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6330 classes.
6331 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6332 (Sized_incr_relobj::do_read_symbols): New function.
6333 (Sized_incr_relobj::do_layout): New function.
6334 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6335 (Sized_incr_relobj::do_add_symbols): New function.
6336 (Sized_incr_relobj::do_should_include_member): New function.
6337 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6338 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6339 (Sized_incr_relobj::do_section_size): New function.
6340 (Sized_incr_relobj::do_section_name): New function.
6341 (Sized_incr_relobj::do_section_contents): New function.
6342 (Sized_incr_relobj::do_section_flags): New function.
6343 (Sized_incr_relobj::do_section_entsize): New function.
6344 (Sized_incr_relobj::do_section_address): New function.
6345 (Sized_incr_relobj::do_section_type): New function.
6346 (Sized_incr_relobj::do_section_link): New function.
6347 (Sized_incr_relobj::do_section_info): New function.
6348 (Sized_incr_relobj::do_section_addralign): New function.
6349 (Sized_incr_relobj::do_initialize_xindex): New function.
6350 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6351 (Sized_incr_relobj::do_read_relocs): New function.
6352 (Sized_incr_relobj::do_gc_process_relocs): New function.
6353 (Sized_incr_relobj::do_scan_relocs): New function.
6354 (Sized_incr_relobj::do_count_local_symbols): New function.
6355 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6356 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6357 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6358 (Sized_incr_relobj::do_relocate): New function.
6359 (Sized_incr_relobj::do_set_section_offset): New function.
6360 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6361 (Sized_incr_dynobj::do_read_symbols): New function.
6362 (Sized_incr_dynobj::do_layout): New function.
6363 (Sized_incr_dynobj::do_add_symbols): New function.
6364 (Sized_incr_dynobj::do_should_include_member): New function.
6365 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6366 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6367 (Sized_incr_dynobj::do_section_size): New function.
6368 (Sized_incr_dynobj::do_section_name): New function.
6369 (Sized_incr_dynobj::do_section_contents): New function.
6370 (Sized_incr_dynobj::do_section_flags): New function.
6371 (Sized_incr_dynobj::do_section_entsize): New function.
6372 (Sized_incr_dynobj::do_section_address): New function.
6373 (Sized_incr_dynobj::do_section_type): New function.
6374 (Sized_incr_dynobj::do_section_link): New function.
6375 (Sized_incr_dynobj::do_section_info): New function.
6376 (Sized_incr_dynobj::do_section_addralign): New function.
6377 (Sized_incr_dynobj::do_initialize_xindex): New function.
6378 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6379 (make_sized_incremental_object): New function.
6380 (Incremental_library::copy_unused_symbols): New function.
6381 (Incremental_library::do_for_all_unused_symbols): New function.
6382 * incremental.h (enum Incremental_input_flags): New type.
6383 (class Incremental_checker): Remove.
6384 (Incremental_input_entry::Incremental_input_entry): Add argument
6385 serial number.
6386 (Incremental_input_entry::arg_serial): New function.
6387 (Incremental_input_entry::set_is_in_system_directory): New function.
6388 (Incremental_input_entry::is_in_system_directory): New function.
6389 (Incremental_input_entry::arg_serial_): New data member.
6390 (Incremental_input_entry::is_in_system_directory_): New data member.
6391 (class Script_info): Move here from script.h.
6392 (Script_info::Script_info): Add filename parameter.
6393 (Script_info::filename): New function.
6394 (Script_info::filename_): New data member.
6395 (Incremental_script_entry::Incremental_script_entry): Add argument
6396 serial number.
6397 (Incremental_object_entry::Incremental_object_entry): Likewise.
6398 (Incremental_object_entry::add_input_section): Build list of input
6399 sections with map to original shndx.
6400 (Incremental_object_entry::get_input_section_index): New function.
6401 (Incremental_object_entry::shndx_): New data member.
6402 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6403 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6404 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6405 serial number.
6406 (Incremental_inputs::report_archive_begin): Likewise.
6407 (Incremental_inputs::report_object): Likewise.
6408 (Incremental_inputs::report_script): Likewise.
6409 (class Incremental_global_symbol_reader): New class.
6410 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6411 and store flags and input file type.
6412 (Incremental_input_entry_reader::arg_serial): New function.
6413 (Incremental_input_entry_reader::type): Extract type from flags.
6414 (Incremental_input_entry_reader::is_in_system_directory): New function.
6415 (Incremental_input_entry_reader::get_input_section_count): Call
6416 accessor function for type.
6417 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6418 function for type; adjust size of global symbol entry.
6419 (Incremental_input_entry_reader::get_global_symbol_count): Call
6420 accessor function for type.
6421 (Incremental_input_entry_reader::get_object_count): Likewise.
6422 (Incremental_input_entry_reader::get_object_offset): Likewise.
6423 (Incremental_input_entry_reader::get_member_count): Likewise.
6424 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6425 (Incremental_input_entry_reader::get_member_offset): Likewise.
6426 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6427 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6428 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6429 (Incremental_input_entry_reader::get_global_symbol_reader): New
6430 function.
6431 (Incremental_input_entry_reader::get_output_symbol_index): New
6432 function.
6433 (Incremental_input_entry_reader::type_): Remove.
6434 (Incremental_input_entry_reader::flags_): New data member.
6435 (Incremental_inputs_reader::input_file_offset): New function.
6436 (Incremental_inputs_reader::input_file_index): New function.
6437 (Incremental_inputs_reader::input_file): Call input_file_offset.
6438 (Incremental_inputs_reader::input_file_at_offset): New function.
6439 (Incremental_relocs_reader::get_r_type): Reformat.
6440 (Incremental_relocs_reader::get_r_shndx): Reformat.
6441 (Incremental_relocs_reader::get_r_offset): Reformat.
6442 (Incremental_relocs_reader::data): New function.
6443 (Incremental_binary::Incremental_binary): Initialize new data members.
6444 (Incremental_binary::check_inputs): Add cmdline parameter.
6445 (Incremental_binary::file_is_unchanged): Remove.
6446 (Input_reader::arg_serial): New function.
6447 (Input_reader::get_unused_symbol_count): New function.
6448 (Input_reader::get_unused_symbol): New function.
6449 (Input_reader::do_arg_serial): New function.
6450 (Input_reader::do_get_unused_symbol_count): New function.
6451 (Input_reader::do_get_unused_symbol): New function.
6452 (Incremental_binary::input_file_count): New function.
6453 (Incremental_binary::get_input_reader): Change signature to use
6454 index instead of filename.
6455 (Incremental_binary::file_has_changed): New function.
6456 (Incremental_binary::get_input_argument): New function.
6457 (Incremental_binary::get_library): New function.
6458 (Incremental_binary::get_script_info): New function.
6459 (Incremental_binary::init_layout): New function.
6460 (Incremental_binary::reserve_layout): New function.
6461 (Incremental_binary::output_file): New function.
6462 (Incremental_binary::do_check_inputs): New function.
6463 (Incremental_binary::do_file_is_unchanged): Remove.
6464 (Incremental_binary::do_file_has_changed): New function.
6465 (Incremental_binary::do_init_layout): New function.
6466 (Incremental_binary::do_reserve_layout): New function.
6467 (Incremental_binary::do_input_file_count): New function.
6468 (Incremental_binary::do_get_input_reader): Change signature.
6469 (Incremental_binary::input_args_map_): New data member.
6470 (Incremental_binary::library_map_): New data member.
6471 (Incremental_binary::script_map_): New data member.
6472 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6473 new data members.
6474 (Sized_incremental_binary::output_section): New function.
6475 (Sized_incremental_binary::inputs_reader): Add const.
6476 (Sized_incremental_binary::symtab_reader): Add const.
6477 (Sized_incremental_binary::relocs_reader): Add const.
6478 (Sized_incremental_binary::got_plt_reader): Add const.
6479 (Sized_incremental_binary::get_symtab_view): New function.
6480 (Sized_incremental_binary::Inputs_reader): New typedef.
6481 (Sized_incremental_binary::Input_entry_reader): New typedef.
6482 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6483 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6484 (Sized_incremental_binary::do_file_has_changed): New function.
6485 (Sized_incremental_binary::do_init_layout): New function.
6486 (Sized_incremental_binary::do_reserve_layout): New function.
6487 (Sized_input_reader::Inputs_reader): Remove.
6488 (Sized_input_reader::Input_entry_reader): Remove.
6489 (Sized_input_reader::do_arg_serial): New function.
6490 (Sized_input_reader::do_get_unused_symbol_count): New function.
6491 (Sized_input_reader::do_get_unused_symbol): New function.
6492 (Sized_incremental_binary::do_input_file_count): New function.
6493 (Sized_incremental_binary::do_get_input_reader): Change signature;
6494 use index instead of filename.
6495 (Sized_incremental_binary::section_map_): New data member.
6496 (Sized_incremental_binary::input_entry_readers_): New data member.
6497 (class Sized_incr_relobj): New class.
6498 (class Sized_incr_dynobj): New class.
6499 (make_sized_incremental_object): New function.
6500 (class Incremental_library): New class.
6501 * layout.cc (Free_list::num_lists): New static data member.
6502 (Free_list::num_nodes): New static data member.
6503 (Free_list::num_removes): New static data member.
6504 (Free_list::num_remove_visits): New static data member.
6505 (Free_list::num_allocates): New static data member.
6506 (Free_list::num_allocate_visits): New static data member.
6507 (Free_list::init): New function.
6508 (Free_list::remove): New function.
6509 (Free_list::allocate): New function.
6510 (Free_list::dump): New function.
6511 (Free_list::print_stats): New function.
6512 (Layout_task_runner::run): Resize output file for incremental updates.
6513 (Layout::Layout): Initialize new data members.
6514 (Layout::set_incremental_base): New function.
6515 (Layout::init_fixed_output_section): New function.
6516 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6517 incremental updates.
6518 (Layout::create_gold_note): Do not create gold note section for
6519 incremental updates.
6520 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6521 for incremental updates.
6522 (Layout::set_section_offsets): For incremental updates, allocate space
6523 from free list.
6524 (Layout::create_symtab_sections): Layout with offsets relative to
6525 start of section; for incremental updates, allocate space from free
6526 list.
6527 (Layout::create_shdrs): For incremental updates, allocate space from
6528 free list.
6529 (Layout::finish_dynamic_section): For incremental updates, do not
6530 check --as-needed (fixed in subsequent patch).
6531 * layout.h (class Free_list): New class.
6532 (Layout::set_incremental_base): New function.
6533 (Layout::incremental_base): New function.
6534 (Layout::init_fixed_output_section): New function.
6535 (Layout::allocate): New function.
6536 (Layout::incremental_base_): New data member.
6537 (Layout::free_list_): New data member.
6538 * main.cc (main): Print Free_list statistics.
6539 * object.cc (Relobj::finalize_incremental_relocs): Add
6540 clear_counts parameter; clear counts only when clear_counts is set.
6541 (Sized_relobj::Sized_relobj): Initialize new base class.
6542 (Sized_relobj::do_layout): Don't report special sections.
6543 (Sized_relobj::do_for_all_local_got_entries): New function.
6544 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6545 symtab_off to all symbol table offsets.
6546 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6547 * object.h (class Got_offset_list): Move to top of file.
6548 (Object::Object): Allow case where input_file == NULL.
6549 (Object::~Object): Likewise.
6550 (Object::input_file): Assert that input_file != NULL.
6551 (Object::lock): Allow case where input_file == NULL.
6552 (Object::unlock): Likewise.
6553 (Object::is_locked): Likewise.
6554 (Object::token): Likewise.
6555 (Object::release): Likewise.
6556 (Object::is_incremental): New function.
6557 (Object::get_mtime): New function.
6558 (Object::for_all_local_got_entries): New function.
6559 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6560 (Object::set_is_in_system_directory): New function.
6561 (Object::is_in_system_directory): New function.
6562 (Object::do_is_incremental): New function.
6563 (Object::do_get_mtime): New function.
6564 (Object::do_for_all_local_got_entries): New function.
6565 (Object::is_in_system_directory_): New data member.
6566 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6567 (class Sized_relobj_base): New class.
6568 (class Sized_relobj): Derive from Sized_relobj_base.
6569 (class Sized_relobj::Symbols): Redeclare from base class.
6570 (class Sized_relobj::local_got_offset_list): Remove.
6571 (class Sized_relobj::Output_sections): Redeclare from base class.
6572 (class Sized_relobj::do_for_all_local_got_entries): New function.
6573 (class Sized_relobj::write_local_symbols): Add offset parameter.
6574 (class Sized_relobj::local_symbol_offset_): Update comment.
6575 (class Sized_relobj::local_dynsym_offset_): Update comment.
6576 * options.cc (Input_arguments::add_file): Remove const.
6577 * options.h (Input_file_argument::Input_file_argument):
6578 Initialize arg_serial_ (all constructors).
6579 (Input_file_argument::set_arg_serial): New function.
6580 (Input_file_argument::arg_serial): New function.
6581 (Input_file_argument::arg_serial_): New data member.
6582 (Input_arguments::Input_arguments): Initialize file_count_.
6583 (Input_arguments::add_file): Remove const.
6584 (Input_arguments::number_of_input_files): New function.
6585 (Input_arguments::file_count_): New data member.
6586 (Command_line::number_of_input_files): Call
6587 Input_arguments::number_of_input_files.
6588 * output.cc (Output_segment_headers::Output_segment_headers):
6589 Set current size.
6590 (Output_section::Input_section::current_data_size): New function.
6591 (Output_section::Output_section): Initialize new data members.
6592 (Output_section::add_input_section): Don't do merge sections for
6593 an incremental link; allocate space from free list for an
6594 incremental update.
6595 (Output_section::add_output_section_data): Allocate space from
6596 free list for an incremental update.
6597 (Output_section::update_data_size): New function.
6598 (Output_section::set_fixed_layout): New function.
6599 (Output_section::reserve): New function.
6600 (Output_segment::set_section_addresses): Remove const.
6601 (Output_segment::set_section_list_addresses): Remove const; allocate
6602 space from free list for an incremental update.
6603 (Output_segment::set_offset): Adjust size of RELRO segment for an
6604 incremental update.
6605 * output.h (Output_data::current_data_size): Move here from
6606 child classes.
6607 (Output_data::pre_finalize_data_size): New function.
6608 (Output_data::update_data_size): New function.
6609 (Output_section_headers::update_data_size): new function.
6610 (Output_section_data_build::current_data_size): Move to Output_data.
6611 (Output_data_strtab::update_data_size): New function.
6612 (Output_section::current_data_size): Move to Output_data.
6613 (Output_section::set_fixed_layout): New function.
6614 (Output_section::has_fixed_layout): New function.
6615 (Output_section::reserve): New function.
6616 (Output_section::update_data_size): New function.
6617 (Output_section::has_fixed_layout_): New data member.
6618 (Output_section::free_list_): New data member.
6619 (Output_segment::set_section_addresses): Remove const.
6620 (Output_segment::set_section_list_addresses): Remove const.
6621 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6622 New function.
6623 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6624 New function.
6625 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6626 parameter when calling Add_symbols constructor; store argument
6627 serial number for members of a lib group.
6628 (Add_symbols::locks): Allow case where token == NULL.
6629 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6630 (Read_member::~Read_member): New function.
6631 (Read_member::is_runnable): New function.
6632 (Read_member::locks): New function.
6633 (Read_member::run): New function.
6634 (Check_script::~Check_script): New function.
6635 (Check_script::is_runnable): New function.
6636 (Check_script::locks): New function.
6637 (Check_script::run): New function.
6638 (Check_library::~Check_library): New function.
6639 (Check_library::is_runnable): New function.
6640 (Check_library::locks): New function.
6641 (Check_library::run): New function.
6642 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6643 (Add_symbols::library_): New data member.
6644 (class Read_member): New class.
6645 (class Check_script): New class.
6646 (class Check_library): New class.
6647 * reloc.cc (Read_relocs::is_runnable): Allow case where
6648 token == NULL.
6649 (Read_relocs::locks): Likewise.
6650 (Scan_relocs::locks): Likewise.
6651 (Relocate_task::locks): Likewise.
6652 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6653 to clear counters.
6654 (Sized_relobj::incremental_relocs_scan): Fix comment.
6655 (Sized_relobj::do_relocate): Pass output file offset to
6656 write_local_symbols.
6657 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6658 from class declaration.
6659 * script.cc (read_input_script): Allocate Script_info; pass
6660 argument serial number to report_script.
6661 * script.h (class Script_info): Move to incremental.h.
6662 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6663 * symtab.h (Symbol_table::add_from_incrobj): New function.
6664 (Symbol_table::set_file_offset): New function.
6665
b961d0d7
CC
66662011-04-05 Cary Coutant <ccoutant@google.com>
6667
6668 * incremental-dump.cc (dump_incremental_inputs): Change signature
6669 to take a Sized_incremental_binary; change caller. Use readers
6670 in Sized_incremental_binary.
6671 * incremental.cc
6672 (Sized_incremental_binary::find_incremental_inputs_sections):
6673 Rename do_find_incremental_inputs_sections to this.
6674 (Sized_incremental_binary::setup_readers): New function.
6675 (Sized_incremental_binary::do_check_inputs): Check
6676 has_incremental_info_ flag; move setup code to setup_readers;
6677 use input readers.
6678 (Sized_incremental_binary::do_file_is_unchanged): New function.
6679 (Sized_incremental_binary::do_get_input_reader): New function.
6680 * incremental.h (class Incremental_binary): Move to end of file.
6681 (Incremental_binary::file_is_unchanged): New function.
6682 (Incremental_binary::do_file_is_unchanged): New function.
6683 (Incremental_binary::Input_reader): New class.
6684 (Incremental_binary::get_input_reader): New function.
6685 (class Sized_incremental_binary): Move to end of file.
6686 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6687 input section reader classes.
6688 (Sized_incremental_binary::has_incremental_info): New function.
6689 (Sized_incremental_binary::inputs_reader): New function.
6690 (Sized_incremental_binary::symtab_reader): New function.
6691 (Sized_incremental_binary::relocs_reader): New function.
6692 (Sized_incremental_binary::got_plt_reader): New function.
6693 (Sized_incremental_binary::do_file_is_unchanged): New function.
6694 (Sized_incremental_binary::Sized_input_reader): New class.
6695 (Sized_incremental_binary::get_input_reader): New function.
6696 (Sized_incremental_binary::find_incremental_inputs_sections):
6697 Rename do_find_incremental_inputs_sections to this.
6698 (Sized_incremental_binary::setup_readers): New function.
6699 (Sized_incremental_binary::has_incremental_info_): New data member.
6700 (Sized_incremental_binary::inputs_reader_): New data member.
6701 (Sized_incremental_binary::symtab_reader_): New data member.
6702 (Sized_incremental_binary::relocs_reader_): New data member.
6703 (Sized_incremental_binary::got_plt_reader_): New data member.
6704 (Sized_incremental_binary::current_input_file_): New data member.
6705
a869183f
PP
67062011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6707
6708 PR gold/12640
6709 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6710 violation.
6711
67122011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
6713
6714 * archive.cc (Archive::include_member): Adjust call to report_object.
6715 (Add_archive_symbols::run): Add script_info to call to
6716 report_archive_begin.
6717 (Lib_group::include_member): Adjust call to report_object.
6718 (Add_lib_group_symbols::run): Adjust call to report_object.
6719 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6720 blocks. Add object count for script input files.
6721 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6722 script_info parameter; change all callers.
6723 (Incremental_inputs::report_object): Add script_info parameter;
6724 change all callers.
6725 (Incremental_inputs::report_script): Store backpointer to
6726 incremental info entry.
6727 (Output_section_incremental_inputs::set_final_data_size): Record
6728 additional information for scripts.
6729 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6730 * incremental.h (Incremental_script_entry::add_object): New function.
6731 (Incremental_script_entry::get_object_count): New function.
6732 (Incremental_script_entry::get_object): New function.
6733 (Incremental_script_entry::objects_): New data member; adjust
6734 constructor.
6735 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6736 (Incremental_inputs::report_object): Add script_info parameter.
6737 (Incremental_inputs_reader::get_object_count): New function.
6738 (Incremental_inputs_reader::get_object_offset): New function.
6739 * options.cc (Input_arguments::add_file): Return reference to
6740 new input argument.
6741 * options.h (Input_argument::set_script_info): New function.
6742 (Input_argument::script_info): New function.
6743 (Input_argument::script_info_): New data member; adjust all
6744 constructors.
6745 (Input_file_group::add_file): Return reference to new input argument.
6746 (Input_file_lib::add_file): Likewise.
6747 (Input_arguments::add_file): Likewise.
6748 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6749 * script.cc (Parser_closure::Parser_closure): Add script_info
6750 parameter; adjust all callers.
6751 (Parser_closure::script_info): New function.
6752 (Parser_closure::script_info_): New data member.
6753 (read_input_script): Report scripts earlier to incremental info.
6754 (script_add_file): Set script_info in Input_argument.
6755 (script_add_library): Likewise.
6756 * script.h (Script_options::Script_info): Rewrite class.
6757
a869183f 67582011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
6759
6760 * archive.cc (Library_base::should_include_member): Move
6761 method here from class Archive.
6762 (Archive::Archive): Initialize base class.
6763 (Archive::should_include_member): Move to base class.
6764 (Archive::do_for_all_unused_symbols): New function.
6765 (Add_archive_symbols::run): Remove redundant access to
6766 incremental_inputs.
6767 (Lib_group::Lib_group): Initialize base class.
6768 (Lib_group::do_filename): New function.
6769 (Lib_group::include_member): Pass pointer to Lib_group to
6770 report_object.
6771 (Lib_group::do_for_all_unused_symbols): New function.
6772 (Add_lib_group_symbols::run): Report archive information for
6773 incremental links.
6774 * archive.h (class Library_base): New base class.
6775 (class Archive): Derive from Library_base.
6776 (Archive::filename): Move to base class.
6777 (Archive::set_incremental_info): Likewise.
6778 (Archive::incremental_info): Likewise.
6779 (Archive::Should_include): Likewise.
6780 (Archive::should_include_member): Likewise.
6781 (Archive::Armap_entry): Remove.
6782 (Archive::Unused_symbol_iterator): Remove.
6783 (Archive::unused_symbols_begin): Remove.
6784 (Archive::unused_symbols_end): Remove.
6785 (Archive::do_filename): New function.
6786 (Archive::do_get_mtime): New function.
6787 (Archive::do_for_all_unused_symbols): New function.
6788 (Archive::task_): Move to base class.
6789 (Archive::incremental_info_): Likewise.
6790 (class Lib_group): Derive from Library_base.
6791 (Lib_group::do_filename): New function.
6792 (Lib_group::do_get_mtime): New function.
6793 (Lib_group::do_for_all_unused_symbols): New function.
6794 (Lib_group::task_): Move to base class.
6795 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6796 function.
6797 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6798 function.
6799 * incremental.cc (Incremental_inputs::report_archive_begin):
6800 Use Library_base; call library's get_mtime; add incremental inputs
6801 entry before members.
6802 (class Unused_symbol_visitor): New class.
6803 (Incremental_inputs::report_archive_end): Use Library_base; use
6804 visitor class to record unused symbols; don't add incremental inputs
6805 entry after members.
6806 (Incremental_inputs::report_object): Use Library_base.
6807 * incremental.h
6808 (Incremental_archive_entry::Incremental_archive_entry): Remove
6809 unused Archive parameter.
6810 (Incremental_inputs::report_archive_begin): Use Library_base.
6811 (Incremental_inputs::report_archive_end): Likewise.
6812 (Incremental_inputs::report_object): Likewise.
6813 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6814 function.
6815 * object.h (Object::for_all_global_symbols): New function.
6816 (Object::do_for_all_global_symbols): New function.
6817 (Sized_relobj::do_for_all_global_symbols): New function.
6818 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6819 function.
6820 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6821 function.
6822
61ab3e40
ILT
68232011-03-27 Ian Lance Taylor <iant@google.com>
6824
6825 * archive.cc (Archive::interpret_header): Return -1 if something
6826 goes wrong. Change callers accordingly.
6827
30e1f9e6
CC
68282011-03-25 Cary Coutant <ccoutant@google.com>
6829
6830 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6831 * testsuite/Makefile.in: Regenerate.
6832
9370ce59 68332011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
6834
6835 * plugin.cc (get_view): New.
6836 (Plugin::load): Pass get_view to the plugin.
6837 (Plugin_manager::get_view): New.
6838
9312bb0a
ILT
68392011-03-21 Ian Lance Taylor <iant@google.com>
6840
6841 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 6842 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 6843
7e12ba9e
ST
68442011-03-21 Sriraman Tallam <tmsriram@google.com>
6845
6846 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6847 Change == to -eq.
6848 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6849 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6850 Change == to -eq.
6851 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6852 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6853
fd7a005d
ILT
68542011-03-14 Ian Lance Taylor <iant@google.com>
6855
6856 * script-sections.cc (Sort_output_sections::script_compare):
6857 Rename from is_before, change return type.
6858 (Sort_output_sections::operator()): Adjust accordingly.
6859
ed16fd1b
ILT
68602011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6861
6862 PR gold/12572
6863 * testsuite/odr_violation2.cc: Add comment to make all error line
6864 numbers double digits.
6865 * testsuite/debug_msg.sh: Adjust expected errors.
6866
71ff8986
ILT
68672011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6868
6869 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6870 but mark earlier ones as non-canonical
6871 (offset_to_iterator): Update search target and example
6872 (do_addr2line): Return extra lines in a vector*
6873 (format_file_lineno): Extract from do_addr2line
6874 (one_addr2line): Add vector* out-param
6875 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6876 when a lineno entry appeared last for its instruction
6877 (Dwarf_line_info): Add vector* out-param
6878 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6879 * symtab.cc (Odr_violation_compare): Include the lineno in the
6880 comparison again.
6881 (linenos_from_loc): New. Combine the canonical line for an
6882 address with its other lines.
6883 (True_if_intersect): New. Helper functor to make
6884 std::set_intersection a query.
6885 (detect_odr_violations): Compare sets of lines instead of just
6886 one line for each function. This became less deterministic, but
6887 has fewer false positives.
6888 * symtab.h: Declarations.
6889 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6890 mix an optimized and non-optimized object in the same binary
6891 (odr_violation2.so): Same.
6892 * testsuite/Makefile.in: Regenerate from Makefile.am.
6893 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6894 * testsuite/debug_msg.sh: Update line numbers and add
6895 assertions.
6896 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6897 non-optimized context.
6898 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6899 isn't inlined, and use OdrDerived in an optimized context.
6900 * testsuite/odr_header1.h: Defines OdrDerived, where
6901 optimization will change the
6902 first-instruction-in-the-destructor's file and line number.
6903 * testsuite/odr_header2.h: Defines OdrBase.
6904
a19fefdc
ILT
69052011-03-09 Ian Lance Taylor <iant@google.com>
6906
6907 * fileread.cc (File_read::clear_views): Don't delete the whole
6908 file view.
6909
ecb351e9
ILT
69102011-03-08 Ian Lance Taylor <iant@google.com>
6911
6912 PR gold/12525
6913 * fileread.cc: #include <climits>.
6914 (GOLD_IOV_MAX): Define.
6915 (File_read::read_multiple): Limit number of entries by iov_max.
6916 * fileread.h (class File_read): Always set max_readv_entries to
6917 128.
6918
b821d13c
ILT
69192011-03-07 Ian Lance Taylor <iant@google.com>
6920
6921 PR gold/12525
6922 * options.h (class General_options): Add -dy and -dn.
6923
89243142
CC
69242011-03-02 Cary Coutant <ccoutant@google.com>
6925
6926 * testsuite/script_test_9.t: Add TLS segment.
6927
d0773f31
ILT
69282011-03-02 Simon Baldwin <simonb@google.com>
6929
6930 * configure.ac: Add check for gnu_indirect_function support in
6931 the toolchain building binutils.
6932 * configure: Rebuild.
6933
9370ce59 69342011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
6935
6936 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6937 plugin only symbols.
6938 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6939 in plugin files as not needed in the symbol table.
6940
4cf7a849
ST
69412011-02-11 Sriraman Tallam <tmsriram@google.com>
6942
6943 * output.cc (Output_section::add_input_section): Delay fill
6944 generation for section ordering.
6945
b578bd7d
ILT
69462011-02-09 Ian Lance Taylor <iant@google.com>
6947
6948 PR gold/12316
6949 * object.h (class Sized_relobj): Remove clear_local_symbols.
6950 * reloc.cc (Sized_relobj::do_relocate): Don't call
6951 clear_local_symbols.
6952
9370ce59 69532011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
6954
6955 * plugin.cc (is_visible_from_outside): Return true for symbols
6956 in the -u option.
6957
55382fb7
ILT
69582011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6959
6960 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6961 filename.
6962
4e271fff
ST
69632011-02-02 Sriraman Tallam <tmsriram@google.com>
6964
6965 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 6966 to std::string.
4e271fff 6967 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 6968 section_name to be std::string.
4e271fff
ST
6969 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6970
d433c3ac
ILT
69712011-01-25 Ian Lance Taylor <iant@google.com>
6972
6973 * script.cc (script_add_extern): Rewrite to use
6974 add_symbol_reference.
6975
880473a6
DK
69762011-01-25 Doug Kwan <dougkwan@google.com>
6977
d433c3ac 6978 * icf.cc (get_section_contents): Always lock section's object.
880473a6 6979
f30f86fa
ILT
69802011-01-24 Ian Lance Taylor <iant@google.com>
6981
6982 * options.h (class General_options): Accept
6983 --no-detect-odr-violations.
6984
8e51a0b9
ILT
69852011-01-24 Ian Lance Taylor <iant@google.com>
6986
6987 * version.cc (version_string): Bump to 1.11.
6988
0f3b89d8
ILT
69892011-01-24 Ian Lance Taylor <iant@google.com>
6990
6991 * plugin.cc (class Plugin_rescan): Define new class.
6992 (Plugin_manager::claim_file): Set any_claimed_.
6993 (Plugin_manager::save_archive): New function.
6994 (Plugin_manager::save_input_group): New function.
6995 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6996 necessary.
6997 (Plugin_manager::new_undefined_symbol): New function.
6998 (Plugin_manager::rescan): New function.
6999 (Plugin_manager::rescannable_defines): New function.
7000 (Plugin_manager::add_input_file): Set any_added_.
7001 * plugin.h (class Plugin_manager): define new fields rescannable_,
7002 undefined_symbols_, any_claimed_, and any_added_. Declare
7003 Plugin_rescan as friend. Declare new functions.
7004 (Plugin_manager::Rescannable): Define type.
7005 (Plugin_manager::Rescannable_list): Define type.
7006 (Plugin_manager::Undefined_symbol_list): Define type.
7007 (Plugin_manager::Plugin_manager): Initialize new fields.
7008 * archive.cc (Archive::defines_symbol): New function.
7009 (Add_archive_symbols::run): Pass archive to plugins if any.
7010 * archive.h (class Archive): Declare defines_symbol.
7011 * readsyms.cc (Input_group::~Input_group): New function.
7012 (Finish_group::run): Pass input_group to plugins if any.
7013 * readsyms.h (class Input_group): Declare destructor.
7014 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7015 any.
7016
3bb951e5
ILT
70172011-01-10 Ian Lance Taylor <iant@google.com>
7018
7019 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7020 section as relro.
7021 (Layout::set_segment_offsets): Reset increase_relro before calling
7022 set_section_addresses a second time.
7023
0aa45fac
CC
70242011-01-04 Cary Coutant <ccoutant@google.com>
7025
7026 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7027 sections before NOBITS sections.
7028
0db46eb4
L
70292011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7030
7031 * version.cc (print_version): Update copyright to 2011.
7032
829c9745
CC
70332010-12-23 Cary Coutant <ccoutant@google.com>
7034
7035 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7036 of OS to this->add. Add OD parameter to second form of the function.
7037
7500420b
ILT
70382010-12-20 Ian Lance Taylor <iant@google.com>
7039
7040 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7041 second of two consecutive entries with same offset.
7042
f8e9a930
RW
70432010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7044
7045 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7046 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7047 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7048 to avoid unneeded links against $(LDADD).
7049 * testsuite/Makefile.in: Regenerate.
7050
2fbb4320
ILT
70512010-12-15 Ian Lance Taylor <iant@google.com>
7052
7053 PR gold/12324
7054 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
7055 for R_X86_64_32 and R_X86_64_PC32.
7056 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7057 ver_matching_def_pic.o.
7058 (ver_matching_def_pic.o): New target.
7059
fedb228d
RW
70602010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7061
7062 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7063 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7064 Move definition before File_read::View member definitions.
7065 (File_read::View::~View): Initialize and hold lock before
7066 updating current_mapped_bytes.
7067
9b547ce6
RW
70682010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7069
7070 * dwarf_reader.cc: Remove outdated comment.
7071 * gold-threads.cc: Fix typo in error message.
7072 * archive.cc: Fix typos in comments.
7073 * archive.h: Likewise.
7074 * arm-reloc-property.cc: Likewise.
7075 * arm-reloc-property.h: Likewise.
7076 * arm-reloc.def: Likewise.
7077 * arm.cc: Likewise.
7078 * attributes.h: Likewise.
7079 * cref.cc: Likewise.
7080 * ehframe.cc: Likewise.
7081 * fileread.h: Likewise.
7082 * gold.h: Likewise.
7083 * i386.cc: Likewise.
7084 * icf.cc: Likewise.
7085 * incremental.h: Likewise.
7086 * int_encoding.cc: Likewise.
7087 * layout.h: Likewise.
7088 * main.cc: Likewise.
7089 * merge.h: Likewise.
7090 * object.cc: Likewise.
7091 * object.h: Likewise.
7092 * options.cc: Likewise.
7093 * readsyms.cc: Likewise.
7094 * reduced_debug_output.cc: Likewise.
7095 * reloc.cc: Likewise.
7096 * script-sections.cc: Likewise.
7097 * sparc.cc: Likewise.
7098 * symtab.h: Likewise.
7099 * target-reloc.h: Likewise.
7100 * target.cc: Likewise.
7101 * target.h: Likewise.
7102 * timer.cc: Likewise.
7103 * timer.h: Likewise.
7104 * x86_64.cc: Likewise.
7105
83e17bd5
CC
71062010-12-09 Cary Coutant <ccoutant@google.com>
7107
7108 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
7109 stack.
7110 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
7111 parameter; change all callers.
7112 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
7113 * options.h (warn_execstack): New option.
7114
017257f8
DK
71152010-12-07 Doug Kwan <dougkwan@google.com>
7116
7117 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
7118 like function call relocations.
7119
c20cbc06
ILT
71202010-12-07 Ian Lance Taylor <iant@google.com>
7121
7122 * archive.cc (Archive::get_elf_object_for_member): Permit
7123 punconfigured to be NULL.
7124 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7125 (Archive::include_member): Pass NULL to get_elf_object_for_member
7126 if we searched for the archive and this is the first included
7127 object.
7128
4dbfafcc
ILT
71292010-12-01 Ian Lance Taylor <iant@google.com>
7130
7131 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7132 track_relocs_type_ field.
7133 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7134 Set track_relocs_type_.
7135 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7136 contents when using RELA relocs.
7137 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7138 reloc_map_.
7139 * reloc.cc (Track_relocs::next_addend): New function.
7140 * reloc.h (class Track_relocs): Declare next_addend.
7141
e5e19edd
ILT
71422010-12-01 Ian Lance Taylor <iant@google.com>
7143
7144 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7145 virtual destructor.
7146
9a5ce24c
ILT
71472010-12-01 Ian Lance Taylor <iant@google.com>
7148
7149 * README: Update compilers known to work and fail.
7150
c7791212
NC
71512010-11-23 Matthias Klose <doko@ubuntu.com>
7152
7153 * configure.in: For --enable-gold, handle value `default' instead of
7154 `both*'. Always install ld as ld.bfd, install as ld if gold is
7155 not the default.
7156 * configure: Regenerate.
7157
0ad220c9
DK
71582010-11-18 Doug Kwan <dougkwan@google.com>
7159
7160 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7161 and right_alignment to be zero. Store result alignment only if it is
7162 greater than existing alignment.
7163
ab8056e0
CC
71642010-11-16 Cary Coutant <ccoutant@google.com>
7165
7166 PR gold/12220
7167 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7168 Check for ".zdebug_line".
7169
fd064a5b
CC
71702010-11-16 Doug Kwan <dougkwan@google.com>
7171 Cary Coutant <ccoutant@google.com>
7172
7173 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7174 by reference; adjust all callers.
7175 * output.cc (Output_segment::set_section_addresses): Adjust references
7176 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7177 list is empty.
7178 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7179 end at page boundary.
7180
6fc6ea19
CC
71812010-11-16 Cary Coutant <ccoutant@google.com>
7182
7183 PR gold/12220
7184 * layout.cc (Layout::choose_output_section): Transform names of
7185 compressed sections even when using a script with a SECTIONS clause.
7186 (Layout::output_section_name): Remove code to transform
7187 compressed debug section names.
7188 * output.cc (Output_section::add_input_section): Use uncompressed
7189 section size when tracking input sections.
7190
95a2c8d6
RS
71912010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7192
7193 * symtab.h (Symbol::NON_PIC_REF): Remove.
7194 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7195 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7196 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7197 (Symbol::use_plt_offset): Take a flags argument and pass it
7198 directly to needs_dynamic_reloc. Restrict check for undefined
7199 weak symbols to function calls.
7200 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7201 (Target_arm::Scan::global): Use it.
7202 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7203 (Target_arm::Relocate::relocate): Likewise.
7204 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7205 parameter with an r_type parameter. Use get_reference_flags
7206 to get the flags.
7207 (Target_arm::Relocate::relocate): Update accordingly.
7208 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7209 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7210 (Target_i386::Scan::global): Likewise.
7211 (Target_i386::Relocate::relocate): Likewise.
7212 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7213 parameter with an r_type parameter. Use get_reference_flags
7214 to get the flags.
7215 (Target_i386::Relocate::relocate): Update accordingly.
7216 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7217 (Target_powerpc::Scan::global): Use it.
7218 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7219 (Target_powerpc::Relocate::relocate): Likewise.
7220 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7221 (Target_sparc::Scan::global): Use it.
7222 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7223 (Target_sparc::Relocate::relocate): Likewise.
7224 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7225 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7226 (Target_x86_64::Scan::global): Likewise.
7227 (Target_x86_64::Relocate::relocate): Likewise.
7228
f625ae50
DK
72292010-11-08 Doug Kwan <dougkwan@google.com>
7230 Cary Coutant <ccoutant@google.com>
7231
7232 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7233 (Arm_exidx_merge_section::section_contents_): New data member.
7234 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7235 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 7236 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
7237 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7238 in parameters instead of calling Object::section_contents without
7239 locking.
7240 (Arm_output_section::group_section): New parameter TASK. Pass it
7241 to callees that need locking objects.
7242 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7243 to lock EXIDX input sections. Fix a formatting issue. Call
7244 Arm_exidx_merged_section::build_contents to create merged section
7245 contents.
7246 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7247 to lock object of stub table owner.
7248 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7249 TEXT_SIZE to initialize data member TEXT_SIZE_.
7250 (Arm_exidx_input_section::addralign): Fix typo in comment.
7251 (Arm_exidx_input_section::text_size): New method.
7252 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7253 that require locking objects. Lock objects before scanning for stubs
7254 and updating local symbols.
7255 (Arm_input_section<big_endian>::init): Copy contents of original
7256 input section.
2e702c99 7257 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
7258 original input section instead of calling Object::section_contents
7259 without locking.
7260 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7261 size without calling Object::section_size().
7262 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7263 for size. Allocate a buffer for merged EXIDX entries.
7264 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7265 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7266 building code to Arm_exidx_merged_section::build_contetns. Write
7267 out contetns in buffer instead of building it on the fly.
7268 (Arm_relobj::make_exidx_input_section): Also pass text section size
7269 to Arm_exidx_input_section constructor.
7270 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7271 (Arm_dynobj::do_read_symbols): Fix memory leak.
7272 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7273 * target.h: (class Task): Add forward declaration.
7274 (Target::relax): Add new parameter TASK and pass it to
7275 Target::do_relax().
7276 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7277
5f9bcf58
CC
72782010-11-05 Cary Coutant <ccoutant@google.com>
7279
7280 PR gold/10708
7281 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7282 object when reading from the file.
7283 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7284 second layout pass.
7285 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7286 when reading section contents.
7287 (get_section_contents): Likewise.
7288 (icf::find_identical_sections): Likewise.
7289 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7290 object when reading from the file.
7291 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7292 the object when doing deferred section layout.
7293
e597fa08
NC
72942010-11-03 Nick Clifton <nickc@redhat.com>
7295
7296 PR gold/12001
7297 * script.h (class Symbol_assignment: name): New member. Returns
7298 the name of the symbol.
7299 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7300 Returns true if the given symbol name is on the list of
7301 assignments wating to be processed.
7302 * archive.cc (should_incldue_member): If the symbol is undefined,
7303 check to see if it is on the list of symbols pending assignment.
7304
3f9a3278
ILT
73052010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7306
7307 * script-sections.cc (Script_sections::find_memory_region): Check
7308 for a NULL output section pointer.
7309
d06fb4d1
DK
73102010-10-29 Doug Kwan <dougkwan@google.com>
7311
7312 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7313 Output_section::add_relaxed_input_section.
7314 * output.cc (Output_section::add_relaxed_input_section): Add new
7315 arguments LAYOUT and NAME. Set section order index.
7316 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7317 Copy section order index.
7318 * output.h (Output_section::add_relaxed_input_section): Add new
7319 arguments LAYOUT and NAME.
7320
90e24de5
ILT
73212010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7322
7323 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7324 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7325 * testsuite/Makefile.in: Regenerate.
7326
c9484ea5
DK
73272010-10-20 Doug Kwan <dougkwan@google.com>
7328
7329 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7330 without SHF_LINK_ORDER flags.
7331 * layout.cc (Layout::choose_output_section): Do not filter
7332 SHF_LINK_ORDER flag in a relocatable link.
7333
5bc2f5be
CC
73342010-10-17 Cary Coutant <ccoutant@google.com>
7335
7336 * output.h (Output_segment::set_section_addresses): Change function
7337 signature. Update all callers.
7338 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7339 sections.
7340 (Output_segment::set_section_addresses): Align after last TLS
7341 section. Add padding before last relro section instead of after.
7342
0c91cf04
DK
73432010-10-17 Doug Kwan <dougkwan@google.com>
7344
7345 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7346 GOT output section to be writable.
7347
8c21d9d3
CC
73482010-10-14 Cary Coutant <ccoutant@google.com>
7349
7350 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7351 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7352 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7353 mode.
7354 * incremental.cc (report_command_line): Ignore all forms of
7355 --incremental.
7356 * layout.cc (Layout::Layout): Check parameters for incremental link
7357 mode.
7358 * options.cc (General_options::parse_incremental): New function.
7359 (General_options::parse_no_incremental): New function.
7360 (General_options::parse_incremental_full): New function.
7361 (General_options::parse_incremental_update): New function.
7362 (General_options::incremental_mode_): New data member.
7363 (General_options::finalize): Check incremental_mode_.
7364 * options.h (General_options): Update help text for --incremental.
7365 Add --no-incremental, --incremental-full, --incremental-update.
7366 (General_options::Incremental_mode): New enum type.
7367 (General_options::incremental_mode): New function.
7368 (General_options::incremental_mode_): New data member.
7369 * parameters.cc (Parameters::incremental_mode_): New data member.
7370 (Parameters::set_options): Set incremental_mode_.
7371 (Parameters::set_incremental_full): New function.
7372 (Parameters::incremental): New function.
7373 (Parameters::incremental_update): New function.
7374 (set_parameters_incremental_full): New function.
7375 * parameters.h (Parameters::set_incremental_full): New function.
7376 (Parameters::incremental): New function.
7377 (Parameters::incremental_update): New function.
7378 (Parameters::incremental_mode_): New data member.
7379 (set_parameters_incremental_full): New function.
7380 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7381 incremental link mode.
7382 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7383 (Sized_relobj::do_relocate_sections): Likewise.
7384 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7385 option.
7386 * testsuite/Makefile.in: Regenerate.
7387 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7388
bb32aa18 73892010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7390
7391 * script-sections.h (class Script_sections): Make
7392 Sections_elements typedef public.
7393 * script-sections.cc (class Sort_output_sections): Add elements_
7394 field. Add constructor which sets it; change all callers.
7395 (Sort_output_sections::is_before): New function.
7396 (Sort_output_sections::operator()): Call is_before.
7397 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7398 conditional.
7399 * testsuite/script_test_10.sh: New test. Test script section
7400 order.
7401 * testsuite/script_test_10.t: Likewise.
7402 * testsuite/script_test_10.s: Likewise.
7403 * testsuite/Makefile.am: Wrap the cross linker tests and the
7404 common tests into NATIVE_OR_CROSS_LINKER.
7405 (check_SCRIPTS): Add script_test_10.sh.
7406 (check_DATA): Add script_test_10.stdout.
7407 (script_test_10.o, script_test_10): New targets.
7408 (script_test_10.stdout): New target.
7409 * configure, testsuite/Makefile.in: Regenerate.
7410
3cef7179
ILT
74112010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7412
7413 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7414 error for the deprecated relocations.
7415 (Target_arm::Scan::global): Likewise.
7416 (Target_arm::Relocate::relocate): Likewise.
7417
7411e9a8
RS
74182010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7419
7420 * fileread.cc (Input_file::find_file): Initialize *found_name
7421 and *namep when using the fallback search for case 4.
7422
6a9da32a
CC
74232010-10-11 Cary Coutant <ccoutant@google.com>
7424
7425 * options.h (class General_options): Redefine -z lazy as an alias for
7426 the negation of -z now.
7427
ac897c20
ILT
74282010-10-11 Ian Lance Taylor <iant@google.com>
7429
7430 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7431 binding.
7432
ea5cae92
NC
74332010-10-06 Nick Clifton <nickc@redhat.com>
7434
7435 * script-sections.cc(class Memory_region): Remove
7436 current_lma_offset_ field. Rename current_vma_offset_ to
7437 current_offset_. Add last_section_ field.
7438 (Memory_region::get_current_vma_address): Rename to
7439 get_current_address.
7440 (Memory_region::get_current_lma_address): Delete.
7441 (Memory_region::increment_vma_offset): Rename to
7442 increment_offset.
7443 (Memory_region::increment_lma_offset): Delete.
7444 (Memory_region::attributes_compatible): New method. Returns
7445 true if the provided section is compatible with the region.
7446 (Memory_region::get_last_section): New method. Returns the last
7447 section to use the region.
7448 (Memory_region::set_last_section): New method. Stores the last
7449 section to use the region.
7450 (Script_sections::block_in_region): New method. Returns true if
7451 a block of memory is contained within a region.
7452 (Script_sections::find_memory_region): New method. Locates a
7453 memory region to be used to set a VMA or LMA address.
7454 (Output_section_definition::set_section_addresses): Add code to
7455 check for addresses set by memory regions.
7456 (Output_segment::set_section_addresses): Remove memory region
7457 walking code.
7458 (Script_sections::create_segment): Add a warning if a header
7459 segment is created outside of any region.
7460 * script-sections.h (class Script_sections): Add prototypes for
7461 find_memory_region and block_in_region methods.
7462 * testsuite/memory_test.s: Use .long instead of .word.
7463 * testsuite/memory_test.t: Add some more output sections.
7464 * testsuite/memory_test.sh: Update expected output.
7465
a9bfd952
DK
74662010-10-02 Doug Kwan <dougkwan@google.com>
7467
7468 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7469 defintion to symtab.h
7470 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7471 declaration to defintion.
7472
bacff3ab
NC
74732010-10-01 Nick Clifton <nickc@redhat.com>
7474
7475 * expression.cc (eval): Replace dummy argument with NULL.
7476 (eval_maybe_dot): Check for a NULL result section pointer.
7477 (Symbol_expression::value): Likewise.
7478 (Dot_expression::value): Likewise.
7479 (BINARY_EXPRESSION): Likewise.
7480 (Max_expression::value): Likewise.
7481 (Min_expression::value): Likewise.
7482 (Absolute_expression::value): Likewise.
7483 (Addr_expression::value_from_output_section): Likewise.
7484 (Loaddddr_expression::value_from_output_section): Likewise.
7485 (Segment_start_expression::value): Likewise.
7486 * script-sections.cc
7487 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7488 argument with NULL.
7489 (Sections_elememt_dot_assignment::set_section_addresses):
7490 Likewise.
7491 (Output_data_expression::do_write_to_buffer): Likewise.
7492 (Output_section_definition::finalize_symbols): Likewise.
7493 (Output_section_definition::set_section_addresses): Likewise.
7494
f81bc8b5
DK
74952010-09-30 Doug Kwan <dougkwan@google.com>
7496
7497 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7498
c95e9f27
ST
74992010-09-28 Sriraman Tallam <tmsriram@google.com>
7500
7501 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 7502 function.
c95e9f27
ST
7503 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7504 virtual function.
7505 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7506 virtual function.
7507 * icf.cc (get_section_contents): Inline merge sections only when
7508 target allows it.
7509
3cac54d2
RW
75102010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7511
7512 * configure: Regenerate.
7513
2904037a
ILT
75142010-09-17 Ian Lance Taylor <iant@google.com>
7515
7516 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7517 * testsuite/Makefile.am (memory_test.o): New target.
7518 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7519 memory_test.t.
7520 * testsuite/Makefile.in: Rebuild.
2904037a 7521
bca7fb63
DK
75222010-09-17 Doug Kwan <dougkwan@google.com>
7523
7524 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7525 defintion if relocation uses GOT entries of the symbol.
7526 * testsuite/icf_safe_test.sh: Fix test.
7527 * testsuite/icf_safe_so_test.sh: Fix test.
7528
4ef28648
CC
75292010-09-16 Cary Coutant <ccoutant@google.com>
7530
7531 * script_sections.cc (class Memory_region): Remove "NULL" from
7532 vector initializations.
7533
793990de
CC
75342010-09-15 Cary Coutant <ccoutant@google.com>
7535
7536 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7537 Resolve forwarding symbols.
7538
81e015e2
DK
75392010-09-15 Doug Kwan <dougkwan@google.com>
7540
7541 * gold/testsuite/script_test_3.t: Add ARM special sections.
7542 * gold/testsuite/script_test_4.t: Same.
7543 * gold/testsuite/script_test_5.t: Same.
7544 * gold/testsuite/script_test_6.t: Same.
7545 * gold/testsuite/script_test_7.t: Same.
7546 * gold/testsuite/script_test_7.t: Same.
7547 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7548
36171d64
CC
75492010-09-14 Cary Coutant <ccoutant@google.com>
7550
7551 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7552 (Target_x86_64::Relocate::relocate_tls): Replace check for
7553 saw_tls_block_reloc_ with test for executable section.
7554
d89051bd
CC
75552010-09-12 Cary Coutant <ccoutant@google.com>
7556
7557 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7558 position-independent executables to shared libraries need dynamic
7559 relocations.
7560 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7561 position-independent executables.
7562 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7563 * testsuite/Makefile.in: Regenerate.
7564
fca41f0f
NC
75652010-09-10 Nick Clifton <nickc@redhat.com>
7566
7567 PR gold/11997
7568 * testsuite/memory_test.t: Discard any sections that are not
7569 needed.
7570
6695e4b3
L
75712010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7572
7573 PR gold/11996
7574 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7575 "This::" to work around a bug in gcc 4.2.
7576
7577 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7578
0f72bf6f
RÁE
75792010-09-09 Rafael Espindola <espindola@google.com>
7580
7581 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7582 sections with different PF_X flags in the same segment.
7583 (Layout::find_first_load_seg): Search all segments to find the first
7584 one.
7585 * options.h (rosegment): New.
7586
75872010-09-08 Rafael Espindola <espindola@google.com>
a6577478 7588
05a79166 7589 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 7590
aa98ff75
DK
75912010-09-08 Doug Kwan <dougkwan@google.com>
7592
7593 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7594 (Arm_relobj::do_relocate_sections): Add new parameter for output
7595 file to match the parent.
7596 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7597 of local symbols instead of input values. Update code to track
7598 changes in gold::relocate_section.
7599 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7600 (Sized_relobj::compute_final_local_value_internal): New methods.
7601 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7602 body into private version of Sized_relobj::compute_final_local_value.
7603 Call the inline method.
7604 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7605 merged symbol value if there is one.
7606 (Symbol_value::has_output_value): New method defintiion.
7607 (Sized_relobj::Compute_final_local_value_status): New enum type.
7608 (Sized_relobj::compute_final_local_value): New methods.
7609 (Sized_relobj::compute_final_local_value_internal): New methods.
7610 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7611 and arm_cortex_a8.sh.
7612 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7613 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7614 New tests.
7615 * Makefile.in: Regenerate.
7616 * testsuite/arm_bl_out_of_range.s: Update test.
7617 * testsuite/thumb_bl_out_of_range.s: Ditto.
7618 * testsuite/thumb_blx_out_of_range.s: Ditto.
7619 * testsuite/arm_branch_out_of_range.sh: New file.
7620 * testsuite/arm_cortex_a8.sh: Ditto.
7621 * testsuite/arm_cortex_a8_b.s: Ditto.
7622 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7623 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7624 * testsuite/arm_cortex_a8_bl.s: Ditto.
7625 * testsuite/arm_cortex_a8_blx.s: Ditto.
7626 * testsuite/arm_cortex_a8_local.s: Ditto.
7627 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7628 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7629
05a79166
L
76302010-09-08 Rafael Espindola <espindola@google.com>
7631
7632 * Makefile.am (memory_test.stdout): Run readelf with -W.
7633 * Makefile.in: Regenerate.
7634 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7635 64 bit output.
7636
33dbc701
RÁE
76372010-09-08 Rafael Espindola <espindola@google.com>
7638
7639 * script-sections.cc (Script_sections::add_memory_region): Convert
7640 field precision to int.
7641 * script.cc (script_set_section_region, script_set_section_region):
7642 Convert field precision to int.
7643
731ca54a
RÁE
76442010-09-08 Rafael Espindola <espindola@google.com>
7645
7646 * arm.cc (do_finalize_sections): Create the __exidx_start and
7647 __exdix_end symbols even when the section is missing.
7648
7f8cd844
NC
76492010-09-08 Nick Clifton <nickc@redhat.com>
7650
7651 * README: Remove claim that MEMORY is not supported.
7652 * expression.cc (script_exp_function_origin)
7653 (script_exp_function_length): Move from here to ...
7654 * script.cc: ... here.
7655 (script_set_section_region, script_add_memory)
7656 (script_parse_memory_attr, script_include_directive): New
7657 functions.
7658 * script-sections.cc
7659 (class Memory_region): New class.
7660 (class Output_section_definition): Add set_memory_region,
7661 set_section_vma, set_section_lma and get_section_name methods.
7662 (class Script_Sections): Add add_memory_region,
7663 find_memory_region, find_memory_region_origin,
7664 find_memory_region_length and set_memory_region methods.
7665 Have set_section_addresses method walk the list of set memory
7666 regions.
7667 Extend the print methos to display memory regions.
7668 * script-sections.h: Add prototypes for new methods.
7669 Add enum for MEMORY region attributes.
7670 * yyscript.y: Add support for parsing MEMORY regions.
7671 * script-c.h: Add prototypes for new functions.
7672 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7673 * testsuite/Makefile.in: Regenerate.
7674 * testsuite/memory_test.sh: New script.
7675 * testsuite/memory_test.s: New assembler source file.
7676 * testsuite/memory_test.t: New linker script.
7677
a4649286
DK
76782010-08-27 Doug Kwan <dougkwan@google.com>
7679
7680 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7681 reference override an existing dynamic weak reference.
7682 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7683 * testsuite/Makefile.in: Regenerate.
7684 * testsuite/dyn_weak_ref.sh: New file.
7685 * testsuite/dyn_weak_ref_1.c: Ditto.
7686 * testsuite/dyn_weak_ref_2.c: Ditto.
7687
b56648ad
ILT
76882010-08-27 Ian Lance Taylor <iant@google.com>
7689
7690 * incremental.h (class Incremental_input_entry): Add virtual
7691 destructor.
7692
809313cb
ILT
76932010-08-27 Ian Lance Taylor <iant@google.com>
7694
7695 * testsuite/start_lib_test_3.c: Mark t3 as used.
7696
11e32464
NC
76972010-08-27 Nick Clifton <nickc@redhat.com>
7698
7699 * options.cc (version_script): Fix small typo in previous
7700 whitespace tidyup.
7701
ca09d69a
NC
77022010-08-25 Nick Clifton <nickc@redhat.com>
7703
7704 * archive.cc: Formatting fixes: Remove whitespace between
7705 typename and following asterisk. Remove whitespace between
7706 function name and opening parenthesis.
7707 * archive.h: Likewise.
7708 * arm.cc: Likewise.
7709 * attributes.cc: Likewise.
7710 * attributes.h: Likewise.
7711 * common.cc: Likewise.
7712 * copy-relocs.cc: Likewise.
7713 * dirsearch.h: Likewise.
7714 * dynobj.cc: Likewise.
7715 * ehframe.cc: Likewise.
7716 * ehframe.h: Likewise.
7717 * expression.cc: Likewise.
7718 * fileread.cc: Likewise.
7719 * fileread.h: Likewise.
7720 * gc.h: Likewise.
7721 * gold-threads.cc: Likewise.
7722 * gold.cc: Likewise.
7723 * i386.cc: Likewise.
7724 * icf.h: Likewise.
7725 * incremental-dump.cc: Likewise.
7726 * incremental.cc: Likewise.
7727 * layout.cc: Likewise.
7728 * layout.h: Likewise.
7729 * main.cc: Likewise.
7730 * merge.cc: Likewise.
7731 * merge.h: Likewise.
7732 * object.cc: Likewise.
7733 * object.h: Likewise.
7734 * options.cc: Likewise.
7735 * options.h: Likewise.
7736 * output.cc: Likewise.
7737 * output.h: Likewise.
7738 * plugin.cc: Likewise.
7739 * plugin.h: Likewise.
7740 * powerpc.cc: Likewise.
7741 * reloc.cc: Likewise.
7742 * script-c.h: Likewise.
7743 * script-sections.cc: Likewise.
7744 * script.cc: Likewise.
7745 * stringpool.cc: Likewise.
7746 * symtab.cc: Likewise.
7747 * symtab.h: Likewise.
7748 * target.cc: Likewise.
7749 * timer.cc: Likewise.
7750 * timer.h: Likewise.
7751 * version.cc: Likewise.
7752 * x86_64.cc: Likewise.
7753
b8fa8750
NC
77542010-08-24 Nick Clifton <nickc@redhat.com>
7755
7756 PR 11899
7757 * layout.cc (segment_precedes): Sort segments by their physical
7758 addresses, if they have been set.
7759
9919d93b
CC
77602010-08-23 Cary Coutant <ccoutant@google.com>
7761
7762 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7763 symbols data.
7764 (Lib_group::include_member): Unlock object after deleting its
7765 symbols data.
7766 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7767 the bug fixed here.
7768
97b4be1c
CC
77692010-08-19 Neil Vachharajani <nvachhar@google.com>
7770 Cary Coutant <ccoutant@google.com>
7771
7772 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7773 constructor, and set_blocker.
7774 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7775 readsyms_blocker_.
7776 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7777 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7778 * testsuite/Makefile.am (start_lib_test): New test case.
7779 * testsuite/Makefile.in: Regenerate.
7780 * testsuite/start_lib_test_main.c: New file.
7781 * testsuite/start_lib_test_1.c: New file.
7782 * testsuite/start_lib_test_2.c: New file.
7783 * testsuite/start_lib_test_3.c: New file.
7784
dd0b1884
ILT
77852010-08-19 Ian Lance Taylor <iant@google.com>
7786
7787 * Makefile.in: Rebuild with automake 1.11.1.
7788 * aclocal.m4: Likewise.
7789 * testsuite/Makefile.in: Likewise.
7790
7223e9ca
ILT
77912010-08-19 Ian Lance Taylor <iant@google.com>
7792
7793 PR 10893
7794 * i386.cc (class Output_data_plt_i386): Update declarations.
7795 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7796 local_ifuncs_ fields.
7797 (Target_i386::do_plt_section_for_global): New function.
7798 (Target_i386::do_plt_section_for_local): New function.
7799 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7800 parameter; change all callers. Initialize global_ifuncs_ and
7801 local_ifuncs_. If doing a static link define __rel_iplt_start and
7802 __rel_iplt_end.
7803 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7804 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7805 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7806 symbols.
7807 (Target_i386::make_plt_section): New function, broken out of
7808 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7809 (Target_i386::make_plt_entry): Call make_plt_section.
7810 (Target_i386::make_local_ifunc_plt_entry): New function.
7811 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7812 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7813 R_386_IRELATIVE to switch.
7814 (Target_i386::Scan::global): Likewise.
7815 (Target_i386::Relocate::relocate): Likewise.
7816 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7817 switch.
7818 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7819 (Target_x86_64::do_plt_section_for_global): New function.
7820 (Target_x86_64::do_plt_section_for_local): New function.
7821 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7822 parameter; change all callers. If doing a static link define
7823 __rela_iplt_start and __rela_iplt_end.
7824 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7825 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7826 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7827 to point to .plt.
7828 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7829 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7830 switch.
7831 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7832 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7833 R_X86_64_IRELATIVE to switch.
7834 (Target_x86_64::Scan::global): Likewise.
7835 (Target_x86_64::Relocate::relocate): Likewise.
7836 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7837 switch.
7838 * target.h (class Target): Add plt_section_for_global and
7839 plt_section_for_local functions. Add do_plt_section_for_global
7840 and do_plt_section_for_local virtual functions.
7841 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7842 clarifying comments.
7843 (Symbol::use_plt_offset): Handle IFUNC symbol.
7844 * object.cc (Sized_relobj::Sized_relobj): Initialize
7845 local_plt_offsets_.
7846 (Sized_relobj::local_has_plt_offset): New function.
7847 (Sized_relobj::local_plt_offset): New function.
7848 (Sized_relobj::set_local_plt_offset): New function.
7849 (Sized_relobj::do_count): Handle IFUNC symbol.
7850 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7851 a bit away from input_shndx_ field. Add set_is_func_symbol and
7852 is_ifunc_symbol functions.
7853 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7854 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7855 local_plt_offsets_ field.
7856 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7857 * output.h (class Output_section_data): Add non-const
7858 output_section function.
7859 (class Output_data_got): Update declarations.
7860 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7861 Add use_plt_offset parameter to global and local constructors.
7862 Change all callers. Change local_sym_index_ field to 31 bits.
7863 Change GSYM_CODE and CONSTANT_CODE accordingly.
7864 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7865 doing a static link don't set sh_link field.
7866 (Output_data_got::Got_entry::write): Use PLT offset if
7867 appropriate.
7868 (Output_data_got::add_global_plt): New function.
7869 (Output_data_got::add_local_plt): New function.
7870 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7871 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7872 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7873 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7874 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7875 IFUNC conditional.
7876 * testsuite/ifunc-sel.h: New file.
7877 * testsuite/ifuncmain1.c: New file.
7878 * testsuite/ifuncmain1vis.c: New file.
7879 * testsuite/ifuncmod1.c: New file.
7880 * testsuite/ifuncdep2.c: New file.
7881 * testsuite/ifuncmain2.c: New file.
7882 * testsuite/ifuncmain3.c: New file.
7883 * testsuite/ifuncmod3.c: New file.
7884 * testsuite/ifuncmain4.c: New file.
7885 * testsuite/ifuncmain5.c: New file.
7886 * testsuite/ifuncmod5.c: New file.
7887 * testsuite/ifuncmain6pie.c: New file.
7888 * testsuite/ifuncmod6.c: New file.
7889 * testsuite/ifuncmain7.c: New file.
7890 * configure, testsuite/Makefile.in: Rebuild.
7891
56f75c03
ILT
78922010-08-18 Ian Lance Taylor <iant@google.com>
7893
7894 * incremental.cc
7895 (Output_section_incremental_inputs::write_input_files): Add cast
7896 to avoid signed/unsigned comparison warning.
7897 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7898
55455f89
CC
78992010-08-12 Cary Coutant <ccoutant@google.com>
7900
7901 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7902
e2054bcb
ILT
79032010-08-13 Ian Lance Taylor <iant@google.com>
7904
7905 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7906
74f67560
DK
79072010-08-12 Cary Coutant <ccoutant@google.com>
7908 Doug Kwan <dougkwan@google.com>
7909
7910 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7911 defintion overrides non-weak undef, remember that the original undef
7912 is not weak.
7913 * symtab.cc (Symbol_table::sized_write_global): For undef without
7914 an original weak binding, set binding to global in output.
7915 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7916 * testsuite/Makefile.in: Regenerate.
7917 * testsuite/strong_ref_weak_def.sh: New file.
7918 * testsuite/strong_ref_weak_def_1.c: Ditto.
7919 * testsuite/strong_ref_weak_def_2.c: Ditto.
7920
d1238d12
CC
79212010-08-12 Cary Coutant <ccoutant@google.com>
7922
7923 * testsuite/incremental_test.sh: Rewrite.
7924 * testsuite/incremental_test_1.c: Rewrite.
7925 * testsuite/incremental_test_2.c: Rewrite.
7926
0e70b911
CC
79272010-08-12 Cary Coutant <ccoutant@google.com>
7928
7929 * arm.cc (Target_arm::got_size): Add const.
7930 (Target_arm::got_entry_count): New function.
7931 (Target_arm::plt_entry_count): New function.
7932 (Target_arm::first_plt_entry_offset): New function.
7933 (Target_arm::plt_entry_size): New function.
7934 (Output_data_plt_arm::entry_count): New function.
7935 (Output_data_plt_arm::first_plt_entry_offset): New function.
7936 (Output_data_plt_arm::get_plt_entry_size): New function.
7937 * i386.cc (Target_i386::got_size): Add const.
7938 (Target_i386::got_entry_count): New function.
7939 (Target_i386::plt_entry_count): New function.
7940 (Target_i386::first_plt_entry_offset): New function.
7941 (Target_i386::plt_entry_size): New function.
7942 (Output_data_plt_i386::entry_count): New function.
7943 (Output_data_plt_i386::first_plt_entry_offset): New function.
7944 (Output_data_plt_i386::get_plt_entry_size): New function.
7945 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7946 find_incremental_inputs_sections. Dump incremental_got_plt section.
7947 * incremental.cc: Include target.h.
7948 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7949 parameter. Adjust all callers. Find incremental_got_plt section.
7950 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7951 section.
7952 (Output_section_incremental_inputs::set_final_data_size): Calculate
7953 size of incremental_got_plt section.
7954 (Output_section_incremental_inputs::do_write): Write the
7955 incremental_got_plt section.
7956 (Got_plt_view_info): New struct.
7957 (Local_got_offset_visitor): New class.
7958 (Global_got_offset_visitor): New class.
7959 (Global_symbol_visitor_got_plt): New class.
7960 (Output_section_incremental_inputs::write_got_plt): New function.
7961 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7962 Add parameter. Adjust all callers.
7963 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7964 (Incremental_inputs::got_plt_section): New function.
7965 (Incremental_inputs::got_plt_section_): New data member.
7966 (Incremental_got_plt_reader): New class.
7967 * layout.cc (Layout::create_incremental_info_sections): Add the
7968 incremental_got_plt section.
7969 * object.h (Got_offset_list::get_list): New function.
7970 (Got offset_list::for_all_got_offsets): New function.
7971 (Sized_relobj::local_got_offset_list): New function.
7972 * powerpc.cc (Target_powerpc::got_size): Add const.
7973 (Target_powerpc::got_entry_count): New function.
7974 (Target_powerpc::plt_entry_count): New function.
7975 (Target_powerpc::first_plt_entry_offset): New function.
7976 (Target_powerpc::plt_entry_size): New function.
7977 (Output_data_plt_powerpc::entry_count): New function.
7978 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7979 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7980 * sparc.cc (Target_sparc::got_size): Add const.
7981 (Target_sparc::got_entry_count): New function.
7982 (Target_sparc::plt_entry_count): New function.
7983 (Target_sparc::first_plt_entry_offset): New function.
7984 (Target_sparc::plt_entry_size): New function.
7985 (Output_data_plt_sparc::entry_count): New function.
7986 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7987 (Output_data_plt_sparc::get_plt_entry_size): New function.
7988 * symtab.h (Symbol::got_offset_list): New function.
7989 (Symbol_table::for_all_symbols): New function.
7990 * target.h (Sized_target::got_entry_count): New function.
7991 (Sized_target::plt_entry_count): New function.
7992 (Sized_target::plt_entry_size): New function.
7993 * x86_64.cc (Target_x86_64::got_size): Add const.
7994 (Target_x86_64::got_entry_count): New function.
7995 (Target_x86_64::plt_entry_count): New function.
7996 (Target_x86_64::first_plt_entry_offset): New function.
7997 (Target_x86_64::plt_entry_size): New function.
7998 (Output_data_plt_x86_64::entry_count): New function.
7999 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8000 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8001
09ec0418
CC
80022010-08-12 Cary Coutant <ccoutant@google.com>
8003
8004 * archive.cc: Include incremental.h.
8005 (Archive::Archive): Initialize incremental_info_.
8006 (Archive::include_member): Record archive members in incremental info.
8007 (Add_archive_symbols::run): Record begin and end of an archive in
8008 incremental info.
8009 (Lib_group::include_member): Record objects in incremental info.
8010 * archive.h (Incremental_archive_entry): Forward declaration.
8011 (Archive::set_incremental_info): New member function.
8012 (Archive::incremental_info): New member function.
8013 (Archive::Unused_symbol_iterator): New class.
8014 (Archive::unused_symbols_begin): New member function.
8015 (Archive::unused_symbols_end): New member function.
8016 (Archive::incremental_info_): New data member.
8017 * incremental-dump.cc (find_input_containing_global): New function.
8018 (dump_incremental_inputs): Dump new incremental info sections.
8019 * incremental.cc: Include symtab.h.
8020 (Output_section_incremental_inputs): New class.
8021 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8022 new incremental info sections.
8023 (Sized_incremental_binary::do_check_inputs): Likewise.
8024 (Incremental_inputs::report_archive): Remove.
8025 (Incremental_inputs::report_archive_begin): New function.
8026 (Incremental_inputs::report_archive_end): New function.
8027 (Incremental_inputs::report_object): New function.
8028 (Incremental_inputs::finalize_inputs): Remove.
8029 (Incremental_inputs::report_input_section): New function.
8030 (Incremental_inputs::report_script): Rewrite.
8031 (Incremental_inputs::finalize): Do nothing but finalize string table.
8032 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8033 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8034 (Incremental_inputs::create_data_sections): New function.
8035 (Incremental_inputs::relocs_entsize): New function.
8036 (Output_section_incremental_inputs::set_final_data_size): New function.
8037 (Output_section_incremental_inputs::do_write): New function.
8038 (Output_section_incremental_inputs::write_header): New function.
8039 (Output_section_incremental_inputs::write_input_files): New function.
8040 (Output_section_incremental_inputs::write_info_blocks): New function.
8041 (Output_section_incremental_inputs::write_symtab): New function.
8042 * incremental.h (Incremental_script_entry): Forward declaration.
8043 (Incremental_object_entry): Forward declaration.
8044 (Incremental_archive_entry): Forward declaration.
8045 (Incremental_inputs): Forward declaration.
8046 (Incremental_inputs_header_data): Remove.
8047 (Incremental_inputs_header): Remove.
8048 (Incremental_inputs_header_write): Remove.
8049 (Incremental_inputs_entry_data): Remove.
8050 (Incremental_inputs_entry): Remove.
8051 (Incremental_inputs_entry_write): Remove.
8052 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
8053 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
8054 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8055 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
8056 Likewise.
8057 (Incremental_input_entry): New class.
8058 (Incremental_script_entry): New class.
8059 (Incremental_object_entry): New class.
8060 (Incremental_archive_entry): New class.
8061 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8062 (Incremental_inputs::report_inputs): Remove.
8063 (Incremental_inputs::report_archive): Remove.
8064 (Incremental_inputs::report_archive_begin): New function.
8065 (Incremental_inputs::report_archive_end): New function.
8066 (Incremental_inputs::report_object): Change prototype.
8067 (Incremental_inputs::report_input_section): New function.
8068 (Incremental_inputs::report_script): Change prototype.
8069 (Incremental_inputs::get_reloc_count): New function.
8070 (Incremental_inputs::set_reloc_count): New function.
8071 (Incremental_inputs::create_data_sections): New function.
8072 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8073 (Incremental_inputs::inputs_section): New function.
8074 (Incremental_inputs::symtab_section): New function.
8075 (Incremental_inputs::relocs_section): New function.
8076 (Incremental_inputs::get_stringpool): Add const.
8077 (Incremental_inputs::command_line): Add const.
8078 (Incremental_inputs::inputs): Remove.
8079 (Incremental_inputs::command_line_key): New function.
8080 (Incremental_inputs::input_file_count): New function.
8081 (Incremental_inputs::input_files): New function.
8082 (Incremental_inputs::relocs_entsize): New function.
8083 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8084 (Incremental_inputs::finalize_inputs): Remove.
8085 (Incremental_inputs::Input_info): Remove.
8086 (Incremental_inputs::lock_): Remove.
8087 (Incremental_inputs::inputs_): Change type.
8088 (Incremental_inputs::inputs_map_): Remove.
8089 (Incremental_inputs::current_object_entry_): New data member.
8090 (Incremental_inputs::inputs_section_): New data member.
8091 (Incremental_inputs::symtab_section_): New data member.
8092 (Incremental_inputs::relocs_section_): New data member.
8093 (Incremental_inputs::reloc_count_): New data member.
8094 (Incremental_inputs_reader): New class.
8095 (Incremental_symtab_reader): New class.
8096 (Incremental_relocs_reader): New class.
8097 * layout.cc (Layout::finalize): Move finalization of incremental info
8098 and creation of incremental info sections to follow finalization of
8099 symbol table. Set offsets for postprocessing sections.
8100 (Layout::create_incremental_info_sections): Call
8101 Incremental_inputs::create_data_sections. Add incremental symtab
8102 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
8103 sections to layout after input sections.
8104 * layout.h (struct Timespec): Forward declaration.
8105 (Layout::incremental_inputs): Add const.
8106 (Layout::create_incremental_info_sections): Add parameter.
8107 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
8108 * object.cc: Include incremental.h.
8109 (Relobj::finalize_incremental_relocs): New function.
8110 (Sized_relobj::do_layout): Record input sections in incremental info.
8111 * object.h (Object::output_section): New function.
8112 (Object::output_section_offset): Moved from Relobj.
8113 (Object::get_incremental_reloc_base): New function.
8114 (Object::get_incremental_reloc_count): New function.
8115 (Object::do_output_section): New function.
8116 (Object::do_output_section_offset): Moved from Relobj.
8117 (Object::do_get_incremental_reloc_base): New function.
8118 (Object::do_get_incremental_reloc_count): New function.
8119 (Object::Object): Initialize new data members.
8120 (Relobj::output_section): Renamed do_output_section and moved to
8121 protected.
8122 (Relobj::output_section_offset): Moved to Object.
8123 (Relobj::do_get_incremental_reloc_base): New function.
8124 (Relobj::do_get_incremental_reloc_count): New function.
8125 (Relobj::allocate_incremental_reloc_counts): New function.
8126 (Relobj::count_incremental_reloc): New function.
8127 (Relobj::finalize_incremental_relocs): New function.
8128 (Relobj::next_incremental_reloc_index): New function.
8129 (Relobj::reloc_counts_): New data member.
8130 (Relobj::reloc_bases_): New data member.
8131 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8132 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8133 (Sized_relobj::incremental_relocs_scan): New function.
8134 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8135 (Sized_relobj::incremental_relocs_write): New function.
8136 (Sized_relobj::incremental_relocs_write_reltype): New function.
8137 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8138 incremental link.
8139 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8140 archives and object files elsewhere.
8141 (Add_symbols::run): Report object files here.
8142 (Finish_group::run): Report end of archive at end of group.
8143 * reloc.cc: Include layout.h, incremental.h.
8144 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8145 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8146 (Sized_relobj::incremental_relocs_scan): New function.
8147 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8148 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8149 (Sized_relobj::incremental_relocs_write): New function.
8150 (Sized_relobj::incremental_relocs_write_reltype): New function.
8151 * script.cc (read_input_script): Rewrite test for incremental link.
8152 Change call to Incremental_inputs::report_script.
8153 * symtab.h (Symbol_table::first_global_index): New function.
8154 (Symbol_table::output_count): New function.
8155
ce0d1972
DK
81562010-08-12 Doug Kwan <dougkwan@google.com>
8157
8158 * arm.cc (Target_arm::merge_object_attributes): Check command line
8159 options --no-wchar-size-warning and --no-enum-size-warning.
8160 * options.h (General_options): Add ld-compatible options
8161 --no-enum-size-warning and --no-wchar-size-warning.
8162
6e5710ce
ILT
81632010-08-04 Ian Lance Taylor <iant@google.com>
8164
8165 * x86_64.cc (Target_x86_64::Scan::local): Use
8166 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8167 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8168 (Target_x86_64::Scan::global): Likewise.
8169 (Target_x86_64::Relocate::relocate): Likewise.
8170 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8171 Likewise.
8172
fef830db
CC
81732010-08-03 Cary Coutant <ccoutant@google.com>
8174
8175 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8176 to reserve space in merged_strings vector. Keep total input size
8177 for stats.
8178 (Output_merge_string::do_print_merge_stats): Print total input size.
8179 * merge.h (Output_merge_string): Add input_size_ field.
8180 * stringpool.cc (Stringpool_template::string_length): Move
8181 implementations out of Stringpool_template class and place in
8182 stringpool.h.
8183 * stringpool.h (string_length): Move out of Stringpool_template.
8184
1e3811b0
ILT
81852010-08-03 Ian Lance Taylor <iant@google.com>
8186
8187 PR 11712
8188 * layout.cc (relaxation_loop_body): If address of load segment is
8189 set, adjust address to include headers if possible.
8190
7af0c620
ILT
81912010-08-03 Ian Lance Taylor <iant@google.com>
8192
8193 * version.cc (version_string): Bump to 1.10.
8194
22f0da72
ILT
81952010-08-03 Ian Lance Taylor <iant@google.com>
8196
8197 PR 11805
8198 * layout.h (enum Output_section_order): Define.
8199 (class Layout): Update declarations.
8200 * layout.cc (Layout::get_output_section): Add order parameter.
8201 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8202 is_first_non_relro parameters. Change all callers.
8203 (Layout::choose_output_section): Likewise.
8204 (Layout::add_output_section_data): Likewise.
8205 (Layout::make_output_section): Likewise. Set order.
8206 (Layout::default_section_order): New function.
8207 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8208 * output.cc (Output_section::Output_section): Initialize order_.
8209 Don't initialize deleted fields.
8210 (Output_segment::Output_segment): Don't initialize deleted
8211 fields.
8212 (Output_segment::add_output_section_to_load): New function
8213 replacing add_output_section. Change all callers to call this or
8214 add_output_section_to_nonload.
8215 (Output_segment::add_output_section_to_nonload): New function.
8216 (Output_segment::remove_output_section): Rewrite.
8217 (Output_segment::add_initial_output_data): Likewise.
8218 (Output_segment::has_any_data_sections): Likewise.
8219 (Output_segment::is_first_section_relro): Likewise.
8220 (Output_segment::maximum_alignment): Likewise.
8221 (Output_segment::has_dynamic_reloc): New function replacing
8222 dynamic_reloc_count. Change all callers.
8223 (Output_segment::has_dynamic_reloc_list): New function replacing
8224 dynamic_reloc_count_list. Change all callers.
8225 (Output_segment::set_section_addresses): Rewrite.
8226 (Output_segment::set_offset): Rewrite.
8227 (Output_segment::find_first_and_last_list): Remove.
8228 (Output_segment::set_tls_offsets): Rewrite.
8229 (Output_segment::first_section_load_address): Likewise.
8230 (Output_segment::output_section_count): Likewise.
8231 (Output_segment::section_with_lowest_load_address): Likewise.
8232 (Output_segment::write_section_headers): Likewise.
8233 (Output_segment::print_sections_to_map): Likewise.
8234 * output.h (class Output_data): Remove dynamic_reloc_count_
8235 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8236 (Output_data::add_dynamic_reloc): Rewrite.
8237 (Output_data::has_dynamic_reloc): New function.
8238 (Output_data::dynamic_reloc_count): Remove.
8239 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8240 is_last_relro_, is_first_non_relro_, is_interp_,
8241 is_dynamic_linker_section_ fields. Add order and set_order
8242 functions. Remove is_relro_local, set_is_relro_local,
8243 is_last_relro, set_is_last_relro, is_first_non_relro,
8244 set_is_first_non_relro functions, is_interp, set_is_interp,
8245 is_dynamic_linker_section, and set_is_dynamic_linker_section
8246 functions.
8247 (class Output_segment): Change Output_data_list from std::list to
8248 std:;vector. Add output_lists_ field. Remove output_data_ and
8249 output_bss_ fields. Update declarations.
8250
3ff2ccb0
ILT
82512010-08-02 Ian Lance Taylor <iant@google.com>
8252
8253 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8254 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8255 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8256
88a4108b
ILT
82572010-08-02 Ian Lance Taylor <iant@google.com>
8258
8259 PR 11855
8260 * script.cc (Script_options::Script_options): Initialize
8261 symbol_definitions_ and symbol_references_.
8262 (Script_options::add_symbol_assignment): Update
8263 symbol_definitions_ and symbol_references_.
8264 (Script_options::add_symbol_reference): New function.
8265 (script_symbol): New function.
8266 * script.h (class Script_options): Add symbol_definitions_ and
8267 symbol_references_ fields.
8268 (Script_options::referenced_const_iterator): New type.
8269 (Script_options::referenced_begin): New function.
8270 (Script_options::referenced_end): New function.
8271 (Script_options::is_referenced): New function.
8272 (Script_options::any_unreferenced): New function.
8273 * script-c.h (script_symbol): Declare.
8274 * yyscript.y (exp): Call script_symbol.
8275 * symtab.cc: Include "script.h".
8276 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8277 Change all callers. Check symbols referenced by scripts.
8278 (Symbol_table::add_undefined_symbols_from_command_line): Add
8279 layout parameter. Change all callers.
8280 (Symbol_table::do_add_undefined_symbols_from_command_line):
8281 Likewise. Break out loop body. Check symbols referenced by
8282 scripts.
8283 (Symbol_table::add_undefined_symbol_from_command_line): New
8284 function broken out of
8285 do_add_undefined_symbols_from_command_line.
8286 * symtab.h (class Symbol_table): Update declarations.
8287 * archive.cc: Include "layout.h".
8288 (Archive::should_include_member): Add layout parameter. Change
8289 all callers. Check for symbol mentioned in expression.
8290 * archive.h (class Archive): Update declaration.
8291 * object.cc (Sized_relobj::do_should_include_member): Add layout
8292 parameter.
8293 * object.h (Object::should_include_member): Add layout parameter.
8294 Change all callers.
8295 (Object::do_should_include_member): Add layout parameter.
8296 (class Sized_relobj): Update declaration.
8297 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8298 parameter.
8299 * dynobj.h (class Sized_dynobj): Update declaration.
8300 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8301 layout parameter.
8302 * plugin.h (class Sized_pluginobj): Update declaration.
8303
5f1ab67a
ILT
83042010-08-02 Ian Lance Taylor <iant@google.com>
8305
8306 PR 11866
8307 * output.cc (Output_segment::set_offset): Search for the first and
8308 last sections rather than assuming that the list is in order.
8309 (Output_segment::find_first_and_last_list): New function.
8310 * output.h (class Output_segment): Update declarations.
8311 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8312 (relro_strip_test_SOURCES): New variable.
8313 (relro_strip_test_DEPENDENCIES): New variable.
8314 (relro_strip_test_LDFLAGS): New variable.
8315 (relro_strip_test_LDADD): New variable.
8316 (relro_strip_test.so): New target.
8317
a8df5856
ILT
83182010-08-02 Ian Lance Taylor <iant@google.com>
8319
8320 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8321 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8322 (Target_i386::got_tlsdesc_section): New function.
8323 (Target_i386::got_section): Create space for GOT entries for
8324 TLSDESC relocations.
8325 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8326 R_386_TLS_GOTDESC.
8327 (Target_i386::Scan::global): Likewise.
8328 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8329 using TLSDESC GOT.
8330 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8331 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8332 (Target_x86_64::got_tlsdesc_section): New function.
8333 (Target_x86_64::got_section): Create space for GOT entries for
8334 TLSDESC relocations.
8335 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8336 R_386_TLS_GOTDESC.
8337 (Target_x86_64::Scan::global): Likewise.
8338 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8339 using TLSDESC GOT.
8340
0c10a0a6
ILT
83412010-08-02 Ian Lance Taylor <iant@google.com>
8342
8343 * testsuite/final_layout.sh: Use dc to convert from hex to
8344 decimal.
8345
41cbeecc
ST
83462010-07-29 Sriraman Tallam <tmsriram@google.com>
8347
8348 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8349 paramter to the call to gold::gc_process_relocs.
8350 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8351 paramter to the call to gold::gc_process_relocs.
8352 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8353 parameter to the call to gold::gc_process_relocs.
8354 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8355 template parameter to the call to gold::gc_process_relocs.
8356 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8357 paramter to the call to gold::gc_process_relocs.
8358 * gc.h (get_embedded_addend_size): New function.
8359 (gc_process_relocs): Save the size of the reloc for use by ICF.
8360 * icf.cc (get_section_contents): Get the addend from the text section
8361 for SHT_REL relocation sections.
8362 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8363 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8364 * int_encoding.h (read_from_pointer): New overloaded function.
8365 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8366 * testsuite/icf_sht_rel_addend_test.sh: New file.
8367 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8368 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8369
6ea55b82
RW
83702010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8371
8372 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8373 * Makefile.in: Regenerate.
8374 * testsuite/Makefile.in: Regenerate.
8375
9691462b
ILT
83762010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8377
8378 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8379 * gold/testsuite/debug_msg.cc: Likewise.
8380 * gold/testsuite/odr_violation1.cc
8381 * gold/testsuite/odr_violation2.cc
8382
76897331
CC
83832010-07-21 Cary Coutant <ccoutant@google.com>
8384
8385 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8386 string, and length fields.
8387 (Output_merge_string::Merged_strings_list): New type.
8388 (Output_merge_string::Merged_strings_lists): New typedef.
8389 (Output_merge_string): Replace merged_strings_ with
8390 merged_strings_lists_.
8391 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8392 Merged_strings_list per input object and section. Don't store pointer
8393 to the string. Don't store length with each merged string entry.
8394 (Output_merge_string::finalize_merged_data): Loop over list of merged
8395 strings lists. Recompute length of each merged string.
8396
78384e8f
CC
83972010-07-15 Cary Coutant <ccoutant@google.com>
8398
8399 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8400 here.
8401
783659f9
ILT
84022010-07-14 Ian Lance Taylor <iant@google.com>
8403
8404 * descriptors.cc (Descriptors::open): Report correct name in error
8405 message.
8406
131687b4
DK
84072010-07-13 Doug Kwan <dougkwan@google.com>
8408
8409 * arm.cc (Arm_input_section::Arm_input_section): For a
8410 SHT_ARM_EXIDX section, always keeps the input sections.
8411 (Arm_input_section::set_exidx_section_link): New method.
8412 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8413 has_errors_ to false.
8414 (Arm_exidx_input_section::has_errors,
8415 Arm_exidx_input_section::set_has_errors): New methods.
8416 (Arm_exidx_input_section::has_errors_): New data member.
8417 (Arm_relobj::get_exidx_shndx_list): New method.
8418 (Arm_output_section::append_text_sections_to_list): Do not skip
8419 section without SHF_EXECINSTR.
8420 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8421 errors.
2e702c99 8422 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8423 section header. Make error messages more verbose. Check for
8424 a non-executable section linked to an EXIDX section.
8425 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8426 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8427 check that there is no deferred EXIDX section if we exit early.
8428 Instead of not making an EXIDX section in case of an error, make one
8429 and set the has_errors flag of it.
8430 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8431 in a relocatable link.
8432 (Target_arm::do_relax): Look for the EXIDX output section instead of
8433 assuming that it is called .ARM.exidx.
2e702c99 8434 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8435 section list. Do not check for SHF_EXECINSTR section flags but
8436 skip any input section with errors.
8437 * output.cc (Output_section::Output_section): Initialize
8438 always_keeps_input_sections_ to false.
8439 (Output_section::add_input_section): Check for
8440 always_keeps_input_sections_.
8441 * output.h (Output_section::always_keeps_input_sections,
8442 Output_section::set_always_keeps_input_sections): New methods.
8443 (Output_section::always_keeps_input_sections): New data member.
8444
69517287
RÁE
84452010-07-13 Rafael Espindola <espindola@google.com>
8446
8447 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8448 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8449
82742395
ILT
84502010-07-13 Philip Herron <herron.philip@googlemail.com>
8451 Ian Lance Taylor <iant@google.com>
8452
8453 * output.h (Output_section_lookup_maps::add_merge_section):
8454 Correct check of whether value was inserted.
8455 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8456 (Output_section_lookup_maps::add_relaxed_input_section):
8457 Likewise.
8458 * arm.cc (Target_arm::got_section): Remove used local os.
8459 * i386.cc (Target_i386::got_section): Likewise.
8460 * x86_64.cc (Target_x86_64::got_section): Likewise.
8461 * sparc.cc (Target_sparc::got_section): Likewise.
8462 (Target_sparc::relocate): Remove unused local have_got_offset.
8463 * powerpc.cc (Target_powerpc::relocate): Likewise.
8464
f2d707b5
ILT
84652010-07-13 Ian Lance Taylor <iant@google.com>
8466
241531d6
ILT
8467 * compressed_output.cc (zlib_decompress): Fix signature in
8468 !HAVE_ZLIB_H case.
8469
f2d707b5
ILT
8470 * archive.cc (Archive::include_member): Unlock an external member
8471 of a thin archive. Don't bother to delete an object we know is
8472 NULL.
8473
a2e47362
CC
84742010-07-12 Cary Coutant <ccoutant@google.com>
8475
8476 * compressed_output.cc (zlib_decompress): New function.
8477 (get_uncompressed_size): New function.
8478 (decompress_input_section): New function.
8479 * compressed_output.h (get_uncompressed_size): New function.
8480 (decompress_input_section): New function.
8481 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8482 Handle compressed debug sections.
8483 * layout.cc (is_compressed_debug_section): New function.
8484 (Layout::output_section_name): Map compressed section names to
8485 canonical names.
8486 * layout.h (is_compressed_debug_section): New function.
8487 (is_debug_info_section): Recognize compressed debug sections.
8488 * merge.cc: Include compressed_output.h.
8489 (Output_merge_data::do_add_input_section): Handle compressed
8490 debug sections.
8491 (Output_merge_string::do_add_input_section): Handle compressed
8492 debug sections.
8493 * object.cc: Include compressed_output.h.
8494 (Sized_relobj::Sized_relobj): Initialize new data members.
8495 (build_compressed_section_map): New function.
8496 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8497 * object.h (Object::section_is_compressed): New method.
8498 (Object::do_section_is_compressed): New method.
8499 (Sized_relobj::Compressed_section_map): New type.
8500 (Sized_relobj::do_section_is_compressed): New method.
8501 (Sized_relobj::compressed_sections_): New data member.
8502 * output.cc (Output_section::add_input_section): Handle compressed
8503 debug sections.
8504 * reloc.cc: Include compressed_output.h.
8505 (Sized_relobj::write_sections): Handle compressed debug sections.
8506
ce279a62
CC
85072010-07-08 Cary Coutant <ccoutant@google.com>
8508
8509 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8510 weak when resolving to a dynamic def.
8511 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8512 for weak undef/dynamic def cases. Adjust callers.
8513 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8514 undef_binding_weak_.
8515 (Symbol_table::sized_write_globals): Adjust symbol binding.
8516 (Symbol_table::sized_write_symbol): Add binding parameter.
8517 * symtab.h (Symbol::set_undef_binding): New method.
8518 (Symbol::is_undef_binding_weak): New method.
8519 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8520 (Symbol_table::should_override): Add new parameter.
8521 (Symbol_table::sized_write_symbol): Add new parameter.
8522
8523 * testsuite/weak_undef_file1.cc: Add new test case.
8524 * testsuite/weak_undef_file2.cc: Fix header comment.
8525 * testsuite/weak_undef_test.cc: Add new test case.
8526
b2286c10
DK
85272010-06-29 Doug Kwan <dougkwan@google.com>
8528
8529 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8530 Initialize USE_SYMBOL_.
8531 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8532 definition.
8533 (Arm_reloc_property::uses_symbol_): New data member declaration.
8534 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8535 uses symbol value and symbol is undefined but not weakly undefined.
8536
4802450a
RÁE
85372010-06-28 Rafael Espindola <espindola@google.com>
8538
8539 * plugin.cc (Plugin::load): Use dlerror.
8540
e5ca47ba
ILT
85412010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8542
8543 * symtab.cc (detect_odr_violations): When reporting an ODR
8544 violation, report an object where the symbol is defined.
8545
8a75a161
DK
85462010-06-25 Doug Kwan <dougkwan@google.com>
8547
8548 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8549 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8550 definition.
8551 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8552 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8553 target hook to detect function points.
8554 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8555 * icf.h (Icf::check_section_for_function_pointers): Change type of
8556 parameter SECTION_NAME to const reference to std::string. Use
8557 target hook to determine if section may have unsafe pointers.
8558 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8559 method definition.
8560
42218b9f
RÁE
85612010-06-21 Rafael Espindola <espindola@google.com>
8562
8563 * fileread.cc (Input_file::find_fie): New
8564 (Input_file::open): Use Input_file::find_fie.
8565 * fileread.h (Input_file::find_fie): New
8566 * plugin.cc (set_extra_library_path): New.
8567 (Plugin::load): Add set_extra_library_path to the transfer vector.
8568 (Plugin_manager::set_extra_library_path): New.
8569 (Plugin_manager::add_input_file): Use the extra search path if set.
8570 (set_extra_library_path(): New.
8571 * plugin.h (Plugin_manager): Add set_extra_library_path and
8572 extra_search_path_.
8573
a0506cca
CC
85742010-06-19 Cary Coutant <ccoutant@google.com>
8575
8576 * layout.cc (gdb_sections): Add .debug_types.
8577 (lines_only_debug_sections): Likewise.
8578
6508b958
RÁE
85792010-06-18 Rafael Espindola <espindola@google.com>
8580
8581 * plugin.cc (add_input_file,add_input_library)
8582 (Plugin_manager::add_input_file): Make filename arguments const.
8583 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8584 const.
8585
3e235302
DK
85862010-06-16 Doug Kwan <dougkwan@google.com>
8587
8588 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8589 .ARM.attributes section if we have not merged any input
8590 attributes sections.
8591
106e8a6c
DK
85922010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8593
8594 * arm.cc: Allow combining objects with no EABI version
8595 information.
8596
91ff43fe
RÁE
85972010-06-15 Rafael Espindola <espindola@google.com>
8598
8599 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8600
68ed838c
ILT
86012010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8602
8603 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8604 (struct iovec): Correct !HAVE_READV definition.
8605
f3a2388f
CC
86062010-06-10 Cary Coutant <ccoutant@google.com>
8607
8608 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8609 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8610 reloc sections.
8611 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8612
8613 PR 11683
8614 * symtab.h (Symbol::is_placeholder): New member function.
8615 * target-reloc.h (relocate_section): Check for placeholder symbols.
8616
8617 * testsuite/Makefile.am (plugin_test_8): New test.
8618 (plugin_test_9): New test.
8619 * testsuite/Makefile.in: Regenerate.
8620
e1df38aa
NC
86212010-06-09 Nick Clifton <nickc@redhat.com>
8622
8623 * yyscript.y (input_list_element): Allow strings prefixed with
8624 the '-' character. Treat these as libraries.
8625 * script.cc (script_add_library): New function. Adds a library
8626 specified by "-l<name>" found in an input script.
8627 * script-c.h: Add prototype for script_add_library.
8628
25bbe950
DK
86292010-06-07 Doug Kwan <dougkwan@google.com>
8630
8631 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8632 Restrict stub-group size to be within long conditional branch
8633 range when working around cortex-A8 erratum.
8634
0f32ea4c
ILT
86352010-06-07 Damien Diederen <dd@crosstwine.com>
8636
8637 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8638 #ifdef typo.
8639
8fe2a369
ST
86402010-06-03 Sriraman Tallam <tmsriram@google.com>
8641
8642 PR gold/11658
8643 * output.cc
8644 (Output_section::Input_section_sort_entry::compare_section_ordering):
8645 Change to return non-zero correctly.
8646 (Output_section::Input_section_sort_section_order_index_compare
8647 ::operator()): Change to fix ambiguity in comparisons.
8648
6e9ba2ca
ST
86492010-06-01 Sriraman Tallam <tmsriram@google.com>
8650
8651 * gold.h (is_wildcard_string): New function.
8652 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8653 (Layout::layout_eh_frame): Ditto.
8654 (Layout::find_section_order_index): New method.
8655 (Layout::read_layout_from_file): New method.
8656 * layout.h (Layout::find_section_order_index): New method.
8657 (Layout::read_layout_from_file): New method.
8658 (Layout::input_section_position_): New private member.
8659 (Layout::input_section_glob_): New private member.
8660 * main.cc (main): Call read_layout_from_file here.
8661 * options.h (--section-ordering-file): New option.
8662 * output.cc (Output_section::input_section_order_specified_): New
8663 member.
8664 (Output_section::Output_section): Initialize new member.
8665 (Output_section::add_input_section): Add new parameter.
8666 Keep input sections when --section-ordering-file is used.
8667 (Output_section::set_final_data_size): Sort input sections when
8668 section ordering file is specified.
8669 (Output_section::Input_section_sort_entry): Add new parameter.
8670 Check sorting type.
8671 (Output_section::Input_section_sort_entry::compare_section_ordering):
8672 New method.
8673 (Output_section::Input_section_sort_compare::operator()): Change to
8674 consider section_order_index.
8675 (Output_section::Input_section_sort_init_fini_compare::operator()):
8676 Change to consider section_order_index.
8677 (Output_section::Input_section_sort_section_order_index_compare
8678 ::operator()): New method.
8679 (Output_section::sort_attached_input_sections): Change to sort
8680 according to section order when specified.
e1df38aa
NC
8681 (Output_section::add_input_section<32, true>): Add new parameter.
8682 (Output_section::add_input_section<64, true>): Add new parameter.
8683 (Output_section::add_input_section<32, false>): Add new parameter.
8684 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
8685 * output.h (Output_section::add_input_section): Add new parameter.
8686 (Output_section::input_section_order_specified): New
8687 method.
8688 (Output_section::set_input_section_order_specified): New method.
8689 (Input_section::Input_section): Initialize section_order_index_.
8690 (Input_section::section_order_index): New method.
8691 (Input_section::set_section_order_index): New method.
8692 (Input_section::section_order_index_): New member.
8693 (Input_section::Input_section_sort_section_order_index_compare): New
8694 struct.
8695 (Output_section::input_section_order_specified_): New member.
8696 * script-sections.cc (is_wildcard_string): Delete and move modified
8697 method to gold.h.
8698 (Output_section_element_input::Output_section_element_input): Modify
8699 call to is_wildcard_string.
8700 (Output_section_element_input::Input_section_pattern
8701 ::Input_section_pattern): Ditto.
8702 (Output_section_element_input::Output_section_element_input): Ditto.
8703 * testsuite/Makefile.am (final_layout): New test case.
8704 * testsuite/Makefile.in: Regenerate.
8705 * testsuite/final_layout.cc: New file.
8706 * testsuite/final_layout.sh: New file.
8707
3537c84b
RÁE
87082010-06-01 Rafael Espindola <espindola@google.com>
8709
8710 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8711
105b6afd
RÁE
87122010-06-01 Rafael Espindola <espindola@google.com>
8713
8714 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8715 visibility of symbols.
8716
29e11421
DK
87172010-05-27 Doug Kwan <dougkwan@google.com>
8718
8719 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8720 from start of output section instead of address for a local symbol
8721 in a merged or relaxed section when doing a relocatable link.
8722
5e0f337e
RÁE
87232010-05-26 Rafael Espindola <espindola@google.com>
8724
703d02da 8725 PR 11604
5e0f337e
RÁE
8726 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8727 adding sections the garbage collector removed.
8728 * gold/testsuite/Makefile.am: Add test.
8729 * gold/testsuite/Makefile.in: Regenerate.
8730 * gold/testsuite/plugin_test_7.sh: New.
8731 * gold/testsuite/plugin_test_7_1.c: New.
8732 * gold/testsuite/plugin_test_7_2.c: New.
8733
f4187277
RÁE
87342010-05-26 Rafael Espindola <espindola@google.com>
8735
8736 * script-sections.cc (Output_section_definition::set_section_addresses):
8737 Check for --section-start.
8738
5c388529
DK
87392010-05-26 Doug Kwan <dougkwan@google.com>
8740
8741 * arm.cc (Arm_scan_relocatable_relocs): New class.
8742 (Target_arm::relocate_special_relocatable): New method.
8743 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8744 (Arm_relocate_functions::thumb_branch_common): Same.
8745 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8746 instead of Default_scan_relocatable_relocs.
8747 * target-reloc.h (relocate_for_relocatable): Let target handle
8748 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8749 * target.h (Sized_target::relocate_special_relocatable): New method.
8750
bca1c3ae
ILT
87512010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8752
8753 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8754
0439c796
DK
87552010-05-23 Doug Kwan <dougkwan@google.com>
8756
8757 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8758 instead of a cast.
8759 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8760 with a direct branch, not a conditional branch, to a stub.
8761 * merge.cc (Output_merge_base::record_input_section): New method
8762 defintion.
8763 (Output_merge_data::do_add_input_section): Record input section if
8764 keeps-input-sections flag is set.
8765 (Output_merge_string::do_add_input_section): Ditto.
8766 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8767 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8768 INPUT_SECTIONS_.
8769 (Output_merge_base::keeps_input_sections,
8770 Output_merge_base::set_keeps_input_sections,
8771 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8772 method definitions.
8773 (Output_merge_base::Input_sections): New type declaration.
8774 (Output_merge_base::input_sections_begin,
8775 Output_merge_base::input_sections_end,
8776 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8777 (Output_merge_base::bool keeps_input_sections_,
8778 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8779 Output_merge_base::input_sections_): New data members.
8780 (Output_merge_data::do_set_keeps_input_sections): New method
8781 defintion.
8782 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8783 * output.cc (Output_section::Input_section::relobj): Move method
8784 defintion from class declaration to here and handle merge sections.
8785 (Output_section::Input_section::shndx): Ditto.
8786 (Output_section::Output_section): Remove initializations of removed
8787 data members and initialize new data member LOOKUP_MAPS_.
8788 (Output_section::add_input_section): Set keeps-input-sections flag
8789 for a newly created merge output section as appropriate. Adjust code
8790 to use Output_section_lookup_maps class.
8791 (Output_section::add_relaxed_input_section): Adjst code for lookup
8792 maps code refactoring.
2e702c99 8793 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
8794 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8795 class. If adding input section to a newly created merge output
8796 section fails, remove the new merge section.
8797 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 8798 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 8799 (Output_section::find_merge_section): Ditto.
0439c796 8800 (Output_section::build_lookup_maps): New method defintion.
2e702c99 8801 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
8802 Output_section_lookup_maps class.
8803 (Output_section::get_input_sections): Export merge sections. Adjust
8804 code to use Output_section_lookup_maps class.
8805 (Output_section:::add_script_input_section): Adjust code to use
8806 Output_section_lookup_maps class. Update lookup maps for merge
8807 sections also.
8808 (Output_section::discard_states): Use Output_section_lookup_maps.
8809 (Output_section::restore_states): Same.
8810 * output.h (Merge_section_properties): Move class defintion out of
8811 Output_section.
8812 (Output_section_lookup_maps): New class.
8813 (Output_section::Input_section::is_merge_section): New method
8814 defintion.
8815 (Output_section::Input_section::relobj): Move defintion out of class
8816 defintion. Declare method only.
8817 (Output_section::Input_section::shndx): Ditto.
8818 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 8819 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
8820 (Output_section::Merge_section_by_properties_map,
8821 Output_section::Output_section_data_by_input_section_map,
8822 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8823 Remove types.
2e702c99 8824 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
8825 KEEPS_INPUT_SECTIONS.
8826 (Output_section::build_lookup_maps): New method declaration.
8827 (Output_section::merge_section_map_,
8828 Output_section::merge_section_by_properties_map_,
8829 Output_section::relaxed_input_section_map_,
8830 Output_section::is_relaxed_input_section_map_valid_): Remove data
8831 members.
8832 (Output_section::lookup_maps_): New data member.
8833
76295588
L
88342010-05-21 Doug Kwan <dougkwan@google.com>
8835
8836 PR gold/11619
8837 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8838 avoid a compilation error.
8839
d103a984
RÁE
88402010-05-19 Rafael Espindola <espindola@google.com>
8841
8842 * script-sections.cc (Output_section_definition::allocate_to_segment):
8843 Update the phdrs_list even when the output section is NULL.
8844 * testsuite/Makefile.am: Add test.
8845 * testsuite/Makefile.in: Regenerate.
8846 * testsuite/script_test_9.cc: New.
8847 * testsuite/script_test_9.sh: New.
8848 * testsuite/script_test_9.t: New.
8849
6625d24e
DK
88502010-05-19 Doug Kwan <dougkwan@google.com>
8851
8852 * arm.cc (Arm_input_section::original_size): New method.
8853 (Arm_input_section::do_addralign): Add a cast.
8854 (Arm_input_section::do_output_offset): Remove static cast.
8855 (Arm_input_section::original_addralign,
8856 Arm_input_section::original_size_): Change type to uint32_t.
8857 (Arm_input_section::init): Add safe casts for section alignment
8858 and size.
8859 (Arm_input_section::set_final_data_size): Do not set address and
8860 offset of stub table.
8861 (Arm_output_section::fix_exidx_coverage): Change use of of
8862 Output_section::Simple_input_section to that of
8863 Output_section::Input_section.
8864 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8865 except for the first pass.
8866 * output.cc (Output_section::get_input_sections): Change type of
8867 input_sections to std::list<Input_section>.
8868 (Output_section::add_script_input_section): Rename from
8869 Output_section::add_simple_input_section. Change type of SIS
8870 parameter from Simple_input_section to Input_section.
8871 * output.h (Output_section::Simple_input_section): Remove class.
8872 (Output_section::Input_section): Change class visibility to public.
8873 (Output_section::Input_section::addralign): Use stored alignments
8874 for special input sections if set.
8875 (Output_section::Input_section::set_addralign): New method.
8876 (Output_section::get_input_sections): Change parameter type from
8877 list of Simple_input_section to list of Input_section.
8878 (Output_section::add_script_input_section): Rename from
8879 Output_section::add_simple_input_section. Change first parameter's
8880 type from Simple_input_section to Input_section and remove the
8881 second and third parameters.
8882 * script-sections.cc (Input_section::Input_section_list): Change
8883 type to list of Output_section::Input_section/
8884 (Input_section_info::Input_section_info): Change parameter type of
8885 INPUT_SECTION to Output_section::Input_section.
8886 (Input_section_info::input_section): Change return type.
8887 (Input_section_info::input_section_): Change type to
8888 Output_section::Input_section.
8889 (Output_section_element_input::set_section_addresses): Adjust code
8890 to use Output_section::Input_section instead of
8891 Output_section::Simple_input_section. Adjust code for renaming
8892 of Output_section::add_simple_input_section.
8893 (Orphan_output_section::set_section_addresses): Ditto.
8894
e1e82ea4
RW
88952010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8896
8897 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8898 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8899
91e75c8a
RÁE
89002010-05-18 Rafael Espindola <espindola@google.com>
8901
8902 * options.cc (General_options::finalize): Handle -nostdlib.
8903 * options.h (nostdlib): New option.
8904 * script.cc (script_add_search_dir): Handle -nostdlib.
8905
da59ad79
DK
89062010-05-12 Doug Kwan <dougkwan@google.com>
8907
8908 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8909 attributes section only if there no attributes section after merging.
8910 (Target_arm::merge_object_attributes): Move value of
e1df38aa 8911 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
8912 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8913 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8914 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8915 and arm_attr_merge_7.stdout.
8916 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8917 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8918 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8919 arm_attr_merge_7b.o): New rules.
8920 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8921 arm_attr_merge_7
8922 * testsuite/Makefile.in: Regenerate.
8923 * testsuite/arm_attr_merge.sh: New file.
8924 * testsuite/arm_attr_merge_[67][ab].s: Same.
8925
3e01a7fd
NC
89262010-05-05 Nick Clifton <nickc@redhat.com>
8927
8928 * po/es.po: Updated Spanish translation.
8929
7ad2014a
L
89302010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8931
8932 * Makefile.am (install-exec-local): Properly install gold as
8933 default cross linker.
8934 * Makefile.in: Regenerated.
8935
4fda8867
NC
89362010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8937 Nick Clifton <nickc@redhat.com>
8938
8939 * configure.ac (install_as_default): Define and set to false
8940 unless --enable-gold or --enable-gold=both/gold has been
8941 specified.
8942 * configure: Regenerate.
8943
8944 * Makefile.am (install-exec-local): Install the executable as
8945 'ld.gold'. If install_as_default is true then also install it as
8946 'ld'.
8947 * Makefile.in: Regenerated.
8948
bd288ea2
ILT
89492010-04-24 Ian Lance Taylor <iant@google.com>
8950
8951 * layout.cc (Layout::layout_reloc): In relocatable link don't
8952 combine reloc sections for grouped sections.
8953
ef38fd8a
ST
89542010-04-23 Sriraman Tallam <tmsriram@google.com>
8955
8956 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8957 sections that are not ordinary to icf.
8958 * icf.cc (get_section_contents): Handle relocation pointing to section
8959 with no object or shndx information.
8960 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8961 * testsuite/Makefile.in: Regenerate.
8962 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8963 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8964
f6973bdc
ILT
89652010-04-22 Ian Lance Taylor <iant@google.com>
8966
8967 * expression.cc (Expression::Expression_eval_info): Add
8968 result_alignment_pointer field.
8969 (Expression::eval_with_dot): Add result_alignment_pointer
8970 parameter. Change all callers.
8971 (Expression::eval_maybe_dot): Likewise.
8972 (class Binary_expression): Add alignment_pointer parameter to
8973 left_value and right_value. Change all callers.
8974 (BINARY_EXPRESSION): Set result alignment.
8975 (class Trinary_expression): Add alignment_pointer parameter to
8976 arg2_value and arg3_value. Change all callers.
8977 (Trinary_cond::value): Set result alignment.
8978 (Max_expression::value, Min_expression::value): Likewise.
8979 (Align_expression::value): Likewise.
8980 * script-sections.cc (class Sections_element): Add dot_alignment
8981 parameter to set_section_addresses virtual function. Update
8982 instantiations.
8983 (class Output_section_element): Likewise.
8984 (Script_sections::create_segments): Add dot_alignment parameter.
8985 Change all callers.
8986 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8987 (Script_sections::set_phdrs_clause_addresses): Likewise.
8988 * script-sections.h: Update declarations.
8989 * script.h: Update declarations.
8990 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8991 min_p_align.
8992 * testsuite/script_test_3.t: Set large alignment.
8993 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8994 segment has expected alignment.
8995
9c9c98a5
NC
89962010-04-22 Nick Clifton <nickc@redhat.com>
8997
8998 * po/gold.pot: Updated by the Translation project.
8999 * po/vi.po: Updated Vietnamese translation.
9000
2253bfba
L
90012010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9002
9003 * testsuite/Makefile.am (check_PROGRAMS): Add
9004 icf_virtual_function_folding_test.
9005 * testsuite/Makefile.in: Regenerated.
9006
85fdf906
AH
90072010-04-15 Andrew Haley <aph@redhat.com>
9008
9009 * options.h (merge_exidx_entries): New option.
9010 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9011 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9012 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9013 (Target_arm::merge_exidx_entries): New function.
9014 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9015 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9016 to Arm_exidx_fixup constructor.
9017 Add new arg, merge_exidx_entries.
9018 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9019 Arm_output_section::fix_exidx_coverage.
9020
ce97fa81
ST
90212010-04-18 Sriraman Tallam <tmsriram@google.com>
9022
9023 * icf.cc (get_section_contents): Check for preemptible functions.
9024 Ignore addend when appropriate.
9025 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9026 section folded.
9027 (add_from_relobj): Check for section folded.
9028 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9029 * symtab.h (should_add_dynsym_entry): Add new parameter.
9030 * target-reloc.h (scan_relocs): Check for section folded.
9031 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9032 Check reloc types for function pointers in shared objects.
9033 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9034 case.
9035 (icf_preemptible_functions_test): New test case.
9036 (icf_string_merge_test): New test case.
9037 * testsuite.Makefile.in: Regenerate.
9038 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9039 bar_glob. Refactor code.
9040 * testsuite/icf_preemptible_functions_test.cc: New file.
9041 * testsuite/icf_preemptible_functions_test.sh: New file.
9042 * testsuite/icf_string_merge_test.cc: New file.
9043 * testsuite/icf_string_merge_test.sh: New file.
9044 * testsuite/icf_virtual_function_folding_test.cc: New file.
9045 * testsuite/icf_virtual_function_folding_test.sh: New file.
9046
04ceb17c
DK
90472010-04-14 Doug Kwan <dougkwan@google.com>
9048
9049 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
9050 for local symbol recounting if we remove a section due to ICF.
9051 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
9052 there are no regular objects in input.
9053
153e7da4
DK
90542010-04-13 Doug Kwan <dougkwan@google.com>
9055
9056 * arm.cc (Arm_input_section::set_final_data_size): Compute
9057 accurate final data size instead of using current data size.
9058
4dbd9faf
DK
90592010-04-09 Doug Kwan <dougkwan@google.com>
9060
9061 * layout.cc (Layout::choose_output_section): Handle script section
9062 types.
9063 (Layout::make_output_section_for_script): Add section type parameter.
9064 Handle script section types.
9065 * layout.h (Layout::make_output_section_for_script): Add section
9066 type parameter.
9067 * output.cc (Output_section::Output_section): Initialize data member
9068 is_noload_.
9069 (Output_section::do_reset_address_and_file_offset): Do not set address
9070 to 0 if section is a NOLOAD section.
9071 * output.h (Output_section::is_noload): New method.
9072 (Output_section::set_is_noload): Ditto.
9073 (Output_section::is_noload_): New data member.
9074 * script-c.h (Script_section_type): New enum type.
9075 (struct Parser_output_section_header): Add new file section_type.
9076 * script-sections.cc (Sections_element::output_section_name): Add
9077 parameter for returning script section type.
9078 (Output_section_definition::output_section_name): Ditto.
9079 (Output_section_definition::section_type)P; New method.
9080 (Output_section_definiton::script_section_type_name): Ditto.
9081 (Output_section_definition::script_section_type_): New data member.
9082 (Output_section_definition::Output_section_definition): Initialize
9083 data member Output_section_definition::script_section_type_.
9084 (Output_section_definition::create_sections): Pass script section type
9085 to Layout::make_output_section_for_script.
9086 (Output_section_definition::output_section_name): Return script
9087 section type to caller.
9088 (Output_section_definition::set_section_address): Do not advance
9089 dot value and load address if section type is NOLOAD. Set address
9090 of NOLOAD sections regardless of section flags.
9091 (Output_section_definition::print): Print section type if it is
9092 not SCRIPT_SECTION_TYPE_NONE.
9093 (Output_section_definition::section_type): New method.
9094 (Output_section_definition::script_section_type_name): Ditto.
9095 (Script_sections::output_section_name): Add new parameter
9096 PSECTION_TYPE for returning script section type. Pass it to
9097 section elements. Handle discard sections.
9098 (Sort_output_sections::operator()): Handle NOLOAD sections.
9099 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 9100 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
9101 returning script section type.
9102 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
9103 INFO and NOLOAD.
9104 * yyscript.y (union): Add new field SECTION_TYPE.
9105 (COPY, DSECT, INFO, NOLOAD): New tokens.
9106 (opt_address_and_section_type): Change type to output_section_header.
9107 (section_type): New non-terminal
9108 (section_header): Handle section type.
2253bfba 9109 (opt_address_and_section_type): Return section type value.
4dbd9faf 9110
721ea635
L
91112010-04-09 H.J. Lu <hongjiu.lu@intel.com>
9112
9113 * testsuite/plugin_common_test_1.c (foo): Add prototype.
9114 * testsuite/plugin_common_test_2.c (foo): Likewise.
9115
6bf924b0
DK
91162010-04-08 Doug Kwan <dougkwan@google.com>
9117
9118 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
9119 Output_merge_data.
9120 * output.cc (Output_section::add_merge_input_section): Simplify
9121 code and return status of Output_merge_base::add_input_section.
e1df38aa 9122 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
9123 returns true.
9124
24af6f92
DK
91252010-04-07 Doug Kwan <dougkwan@google.com>
9126
9127 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9128 if section is marked as containing instructions but has no mapping
9129 symbols.
9130 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9131 correct section index.
9132 (Arm_relobj::find_linked_text_section): Ditto.
9133
00698fc5
CC
91342010-04-07 Cary Coutant <ccoutant@google.com>
9135
9136 * archive.cc (include_member): Destroy Read_symbols_data object before
9137 releasing file.
9138 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9139 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9140 (Read_symbols_data::~Read_symbols_data) New destructor.
9141 (Section_relocs::Section_relocs) New constructor.
9142 (Section_relocs::~Section_relocs) New destructor.
9143 (Read_relocs_data::Read_relocs_data) New constructor.
9144 (Read_relocs_data::~Read_relocs_data) New destructor.
9145 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9146 pointers to NULL after deleting.
9147
7296d933
DK
91482010-04-07 Doug Kwan <dougkwan@google.com>
9149
9150 * arm.cc: Replace "endianity" with "endianness" in comments.
9151 (Arm_exidx_cantunwind): Ditto.
9152 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9153 (Arm_relobj::merge_flags_and_attributes): New method.
9154 (Arm_relobj::merge_flags_and_attributes_): New data member.
9155 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9156 (Arm_relobj::scan_sections_for_stubs): Ditto.
9157 (Arm_relobj::do_read_symbols): Check to see if we really want to
9158 merge processor-specific flags and attributes. Exit early if
9159 an object is empty except for section names and the undefined symbol.
9160 (Target_arm::do_finalize_sections): Move check for ELF format to
9161 Arm_relobj::do_read_symbols. Merge processor specific flags and
9162 attributes from a regular object only when we have determined that
9163 it is aapropriate. Do not create an .ARM.attributes section in
9164 output if there is no regular input object.
9165 (Target_arm::merge_processor_specific_flags): Check
9166 --warn-mismatch before printing any error.
9167 (Target_arm::merge_object_attributes): Ditto.
9168 * gold.cc (queue_middle_tasks): Handle the case in which there is
9169 no regular object in input.
9170 * options.cc (General_options::parse_EB): New method.
9171 (General_options::parse_EL): Same.
9172 (General_options::General_options): Initialize endianness_.
9173 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9174 New options.
9175 (General_options::Endianness): New enum.
9176 (General_options::endianness): New method.
9177 (General_options::endianness_): New data member.
9178 * parameters.cc (Parameters::set_options): Check target endianness.
9179 (Parameters::set_target_once): Ditto.
9180 (Parameters::check_target_endianness): New method.
9181 (parameters_force_valid_target): If either -EL or -EB is specified,
9182 use it to define endianness of default target.
9183 * parameters.h (Parameters::check_target_endianness): New method
9184 declaration.
9185 * target.h (class Target): Change "endianity" to "endianness"
9186 in comments.
9187
efc8d4f2
RW
91882010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9189
9190 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9191 * configure: Regenerate.
9192 * Makefile.in: Regenerate.
9193 * testsuite/Makefile.in: Regenerate.
9194
be234d88
CC
91952010-04-06 Cary Coutant <ccoutant@google.com>
9196
9197 gcc PR lto/42757
9198 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9199 prevailing definitions of common symbols.
9200 * testsuite/plugin_test_6.sh: New test case.
9201 * testsuite/plugin_common_test_1.c: New test case.
9202 * testsuite/plugin_common_test_2.c: New test case.
9203 * testsuite/Makefile.am (plugin_test_6): New test case.
9204 * testsuite/Makefile.in: Regenerate.
9205
bd32c6bd
NC
92062010-04-06 Nick Clifton <nickc@redhat.com>
9207
9208 * po/vi.po: New Vietnamese translation.
9209
323c532f
DK
92102010-03-30 Doug Kwan <dougkwan@google.com>
9211
9212 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9213
4fcd97eb
DK
92142010-03-25 Doug Kwan <dougkwan@google.com>
9215
9216 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9217 to avoid a conversion warning on a 32-bit host.
9218
4ebf39db
ILT
92192010-03-24 Ian Lance Taylor <iant@google.com>
9220
9221 * testsuite/script_test_3.t: Add a TLS segment.
9222 * testsuite/Makefile.am (check_PROGRAMS): Add
9223 tls_phdrs_script_test.
9224 (tls_phdrs_script_test_SOURCES): Define.
9225 (tls_phdrs_script_test_DEPENDENCIES): Define.
9226 (tls_phdrs_script_test_LDFLAGS): Define.
9227 (tls_phdrs_script_test_LDADD): Define.
9228 * testsuite/Makefile.in: Rebuild.
9229
4a599bdd
CC
92302010-03-23 Cary Coutant <ccoutant@google.com>
9231
9232 * fileread.cc (find_or_make_view): Fix comment.
9233
6c93b22c
ILT
92342010-03-23 Ian Lance Taylor <iant@google.com>
9235
9236 * script-sections.cc (class Orphan_section_placement): Define
9237 PLACE_TLS and PLACE_TLS_BSS.
9238 (Orphan_section_placement::Orphan_section_placement): Initialize
9239 new places.
9240 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9241 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9242 (tls_script_test_SOURCES): Define.
9243 (tls_script_test_DEPENDENCIES): Define.
9244 (tls_script_test_LDFLAGS): Define.
9245 (tls_script_test_LDADD): Define.
9246 * testsuite/Makefile.in: Rebuild.
9247
a2c7281b
DK
92482010-03-22 Doug Kwan <dougkwan@google.com>
9249
9250 * arm.cc (Arm_relocate_functions::abs8,
9251 Arm_relocate_functions::abs16): Use correct check for overflow
9252 specified in the ARM ELF specs.
9253 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9254 target of a BLX instruction specially.
9255 (Reloc_stub::stub_type_for_reloc): Ditto.
9256 (Relocate::relocate): Use symbolic names instead of numeric relocation
9257 codes to report error.
9258 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9259 workaround.
9260 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9261 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9262 thumb2_blx_out_of_range.stdout
9263 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9264 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9265 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9266 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9267 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9268 thumb2_blx_in_range, thumb2_blx_in_range.o,
9269 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9270 thumb2_blx_out_of_range.o): New rules.
2e702c99 9271 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
9272 thumb2_blx_in_range and thumb2_blx_out_of_range.
9273 * testsuite/Makefile.in: Regenerate.
9274 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9275 * testsuite/thumb_blx_in_range.s: New file.
9276 * testsuite/thumb_blx_out_of_range.s: New file.
9277
b0193076
RÁE
92782010-03-22 Rafael Espindola <espindola@google.com>
9279
9280 * archive.cc (Should_include): Move to archive.h.
9281 (should_include_member): Make it a member of Archive.
9282 (Lib_group): New.
9283 (Add_lib_group_symbols): New.
9284 * archive.h: Include options.h.
9285 (Archive_member): Moved from Archive.
9286 (Should_include): Moved from archive.cc.
9287 (Lib_group): New.
9288 (Add_lib_group_symbols): New.
9289 * dynobj.cc (do_should_include_member): New.
9290 * dynobj.h (do_should_include_member): New.
9291 * gold.cc (queue_initial_tasks): Update call to queue.
9292 * main.cc (main): Print lib group stats.
9293 * object.cc (do_should_include_member): New.
9294 * object.h: Include archive.h.
9295 (Object::should_include_member): New.
9296 (Object::do_should_include_member): New.
9297 (Sized_relobj::do_should_include_member): New.
9298 * options.cc (General_options::parse_start_lib): New.
9299 (General_options::parse_end_lib): New.
9300 (Input_arguments::add_file): Handle lib groups.
9301 (Input_arguments::start_group): Check we are not in a lib.
9302 (Input_arguments::start_lib): New.
9303 (Input_arguments::end_lib): New.
9304 * options.h (General_options): Add start_lib and end_lib.
9305 (Input_argument::lib_): New.
9306 (Input_argument::lib): New.
9307 (Input_argument::is_lib): New.
9308 (Input_file_lib): New.
9309 (Input_arguments::in_lib_): New.
9310 (Input_arguments::in_lib): New.
9311 (Input_arguments::start_lib): New.
9312 (Input_arguments::end_lib_): New.
9313 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9314 in unused members as preempted.
9315 (Sized_pluginobj::do_should_include_member): New.
9316 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9317 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9318 return the blocker.
9319 (Read_symbols::do_whole_lib_group): New.
9320 (Read_symbols::do_lib_group): New.
9321 (Read_symbols::do_read_symbols): Handle lib groups.
9322 (Read_symbols::get_name): Handle lib groups.
9323 * readsyms.h (Read_symbols): Add an archive member pointer.
9324 (Read_symbols::do_whole_lib_group): New.
9325 (Read_symbols::do_lib_group): New.
9326 (Read_symbols::member_): New.
9327 * script.cc (read_input_script): Update call to queue_soon.
9328
d099120c
DK
93292010-03-19 Doug Kwan <dougkwan@google.com>
9330
9331 * arm.cc (Stub_table::Stub_table): Initialize new data members
9332 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9333 (Stub_table::add_reloc_stub): Assign stub offset and update
9334 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9335 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9336 New data members.
2e702c99 9337 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9338 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9339 instead of going over all reloc stubs.
2e702c99 9340 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9341 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9342 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9343 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9344 Stringpool_template::offset_.
9345 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9346 Stringpool_template::offset_ to zero.
9347
1aa37384
DK
93482010-03-15 Doug Kwan <dougkwan@google.com>
9349
9350 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9351 offset_.
9352 (Stringpool_template::new_key_offset): New method.
9353 (Stringpool_template::add_string): Assign offsets when adding new
9354 strings.
9355 (Stringpool_template::set_string_offsets): Do not set string offsets
9356 when not optimizing.
9357 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9358 member size_.
2e702c99
RM
9359 (Chunked_vector::clear): Clear size_.
9360 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9361 (Chunked_vector::size): Return size_.
9362 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9363 (Chunked_vector::size_): New data member.
1aa37384
DK
9364 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9365 (Stringpool_template::new_key_offset): New method declaration.
9366 (Stringpool_template::offset_): New data member.
9367
b672b057
RÁE
93682010-03-15 Rafael Espindola <espindola@google.com>
9369
9370 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9371 Add_symbols' constructor.
9372 * readsyms.h (Add_symbols): Remove the input_group member.
9373
b6848d3c
ILT
93742010-03-10 Ian Lance Taylor <iant@google.com>
9375
9376 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9377 target to ask whether a reference to a symbol requires a stack
9378 split.
9379 * target.h (Target::is_call_to_non_split): New function.
9380 (Target::do_is_call_to_non_split): Declare virtual function.
9381 * target.cc: Include "symtab.h".
9382 (Target::do_is_call_to_non_split): New function.
9383 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9384
a2a5469e
CC
93852010-03-10 Cary Coutant <ccoutant@google.com>
9386
9387 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9388 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9389 (File_read::open[2]): Add whole_file_view_ to list of views.
9390 (File_read::make_view): Remove test of whole_file_view_.
9391 (File_read::find_or_make_view): Create whole_file_view_ if
9392 necessary.
9393 (File_read::clear_views): Replace bool parameter with enum;
9394 adjust all callers. Don't delete views with permanent data;
9395 do delete cached views and views from archives if
9396 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9397 if clearing the corresponding view.
9398 * fileread.h (File_read::Clear_views_mode): New enum.
9399 (File_read::View::is_permanent_view): New method.
9400 (File_read::clear_views): Replace bool parameter
9401 with enum; adjust all callers.
9402 * options.h (General_options): Change keep_files_mapped option;
9403 add map_whole_files.
9404 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9405 releasing the file.
9406 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9407 the file.
9408
8861f32b
DM
94092010-03-10 David S. Miller <davem@davemloft.net>
9410
9411 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9412
d62d0f5f
ST
94132010-03-09 Sriraman Tallam <tmsriram@google.com>
9414
9415 * icf.cc (get_section_contents): Add '@' marker after processing the
9416 merge reloc.
9417
9177756d
DK
94182010-03-08 Doug Kwan <dougkwan@google.com>
9419
9420 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9421 due to a conversion warning.
9422 (Arm_relobj::update_output_local_symbol_count): Check for local
9423 symbol with unset output index.
9424
9e9e071b
ILT
94252010-03-05 Ian Lance Taylor <iant@google.com>
9426
9427 * options.h (class General_options): Add --spare-dynamic-tags.
9428 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9429 --spare-dynamic-tags.
9430
a81ee015
ILT
94312010-03-05 Ian Lance Taylor <iant@google.com>
9432
9433 * incremental.cc: Include "libiberty.h".
9434
44ec90b9
RO
94352010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9436
9437 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9438 function, is_info_ member.
9439 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9440 (Versions::Versions): Update caller.
9441 (Versions::define_base_version): Likewise.
9442 (Versions::add_def): Likewise.
9443
0897ed3b
ST
94442010-03-03 Sriraman Tallam <tmsriram@google.com>
9445
9446 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9447 (Scan::possible_function_pointer_reloc): New function.
9448 (Scan::local_reloc_may_be_function_pointer): Change to call
9449 possible_function_pointer_reloc.
9450 (Scan::global_reloc_may_be_function_pointer): Ditto.
9451 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9452 relocations in ".data.rel.ro._ZTV" section.
9453 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9454 * testsuite/icf_safe_so_test.cc: Ditto.
9455 * testsuite/icf_safe_test.cc: Ditto.
9456 * testsuite/icf_safe_test.sh: Ditto.
9457
d3bbad62
ILT
94582010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9459 Ian Lance Taylor <iant@google.com>
9460
9461 * target-reloc.h (relocate_section): Check the symbol table index
9462 for -1U before setting the local symbol index.
9463 (scan_relocatable_relocs): If copying the relocation, record that
9464 the local symbol is required.
9465 * object.h (Symbol_value::is_output_symtab_index_set): New
9466 function.
9467 (Symbol_value::may_be_discarded_from_output_symtab): New
9468 function.
9469 (Symbol_value::has_output_symtab_entry): New function.
9470 (Symbol_value::needs_output_symtab_entry): Remove.
9471 (Symbol_value::output_symtab_index): Make sure the symbol index is
9472 set.
9473 (Symbol_value::set_output_symtab_index): Make sure the symbol
9474 index is not set. Make sure the new index is valid.
9475 (Symbol_value::set_must_have_output_symtab_entry): New function.
9476 (Symbol_value::has_output_dynsym_entry): New function.
9477 (Symbol_value::set_output_dynsym_index): Make sure the new index
9478 is valid.
9479 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9480 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9481 local symbol if permitted.
9482 (Sized_relobj::do_finalize_local_symbols): Call
9483 is_output_symtab_index_set rather than needs_output_symtab_entry.
9484 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9485 rather than needs_output_symtab_entry. Call
9486 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9487 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9488 is_output_symtab_index_set rather than needs_output_symtab_entry.
9489 * testsuite/discard_locals_relocatable_test.c: New file.
9490 * testsuite/discard_locals_test.sh: Test -r.
9491 * testsuite/Makefile.am (check_DATA): Add
9492 discard_locals_relocatable_test1.syms,
9493 discard_local_relocatable_test2.syms.
9494 (MOSTLYCLEANFILES): Likewise. Also add
9495 discard_locals_relocatable_test1.lout and
9496 discard_locals_relocatable_test2.out.
9497 (discard_locals_relocatable_test1.syms): New target.
9498 (discard_locals_relocatable_test.o): New target.
9499 (discard_locals_relocatable_test1.out): New target.
9500 (discard_locals_relocatable_test2.syms): New target.
9501 (discard_locals_relocatable_test2.out): New target.
9502 (various): Add missing ../ld-new dependencies.
9503 * testsuite/Makefile.in: Rebuild.
9504
7e8ccf26
NC
95052010-03-03 Nick Clifton <nickc@redhat.com>
9506
9507 * po/fi.po: New Finnish translation.
9508
2a0ff005
DK
95092010-03-01 Doug Kwan <dougkwan@google.com>
9510
9511 * layout.cc (Layout::Layout): Force section types of .init_array*,
9512 .preinit_array* and .fini_array* sections.
9513 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9514 Fix check of return value of std::string::find.().
9515 (Output_section::Input_section_sort_compare::operator()): Remove
9516 comment about .init_array.
9517 (Output_section::Input_section_sort_init_fini_compare::operator()):
9518 New method.
9519 (Output_section::sort_attached_input_sections): Handle .init_array
9520 and .fini_array specially.
9521 * output.h (Output_section::Inut_section_sort_compare): Update
9522 comment.
9523 (Output_section::Input_section_sort_init_fini_compare): New struct.
9524
c3e4ae29
DK
95252010-02-26 Doug Kwan <dougkwan@google.com>
9526
9527 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9528 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9529 * testsuite/debug_msg.sh: Avoid matching source line number for
9530 use of global variable undef_int.
9531
2fd9ae7a
DK
95322010-02-26 Doug Kwan <dougkwan@google.com>
9533
9534 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9535 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9536 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9537 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9538 * options.cc (General_options::General_options): Initialize member
9539 fix_v4bx_.
9540 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9541 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9542 and rm_no_fix_v4bx.stdout
9543 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9544 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9545 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9546 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9547 and arm_no_fix_v4bx.
9548 * Makefile.in: Regenerate.
9549 * testsuite/arm_fix_v4bx.s: New file.
9550 * testsuite/arm_fix_v4bx.sh: Ditto.
9551
67ec7d0b
DK
95522010-02-24 Doug Kwan <dougkwan@google.com>
9553
9554 * arm.cc (Target_arm::got_section): Make the .got section the first
9555 non RELRO section in the data segment.
9556 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9557 suffixes of section names.
9558
10165461
DK
95592010-02-24 Doug Kwan <dougkwan@google.com>
9560
9561 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9562 flags and attributes merging if an input file is a binary file.
9563 * fileread.cc (Input_file::open): Record format of original file.
9564 * fileread.h (Input_file::Format): New enum type.
2e702c99 9565 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9566 (Input_file::format): New method definition.
9567 (Input_file::format_):: New data member.
9568
4a54abbb
DK
95692010-02-24 Doug Kwan <dougkwan@google.com>
9570
9571 * arm.cc (Arm_output_data_got): New class.
9572 (ARM_TCB_SIZE): New constant
9573 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9574 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9575 If user uses a script with a SECTIONS clause, issue only a warning
9576 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9577 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9578 garbage collection.
9579 (Target_arm::got_mode_index_entry): Handle static linking.
9580 (Target_arm::Scan::local): Ditto.
9581 (Target_arm::Scan::global): Ditto.
9582 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9583 all incorrectly implemented relocations.
e1df38aa 9584 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
9585 Arm_output_section::fix_exidx_coverage.
9586 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9587 from ".ARM.exidx." and ".ARM.extab.".
9588
ca419a6f
ILT
95892010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9590
9591 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9592 section if it does not already exist.
9593 * attributes.cc (Attributes_section_data::Attributes_section_data):
9594 Don't crash if size is zero.
9595
135b9c78
ILT
95962010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9597 Ian Lance Taylor <iant@google.com>
9598
9599 * gold.cc (queue_middle_tasks): If no input files were opened,
9600 exit.
9601 * workqueue.h (Task_function::Task_function): Assert that there is
9602 a blocker.
9603
bb0bfe4f
DK
96042010-02-22 Doug Kwan <dougkwan@google.com>
9605
9606 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9607 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9608 types to avoid warnings due to different uint64_t implementations
9609 on different hosts.
9610
2a2b6d42
DK
96112010-02-21 Doug Kwan <dougkwan@google.com>
9612
9613 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9614 handling of the maximum backward branch offset.
2e702c99 9615 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
9616 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9617 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 9618 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
9619 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9620 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9621 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9622 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9623 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9624 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9625 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9626 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9627 thumb2_bl_out_of_range.o): New rules.
9628 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9629 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9630 thumb2_bl_out_of_range
9631 * testsuite/Makefile.in: Regenerate.
9632 * testsuite/arm_bl_in_range.s: New file.
9633 * testsuite/arm_bl_out_of_range.s: Ditto.
9634 * testsuite/arm_branch_in_range.sh: Ditto.
9635 * testsuite/arm_branch_range.t: Ditto.
9636 * testsuite/thumb2_branch_range.t: Ditto.
9637 * testsuite/thumb_bl_in_range.s: Ditto.
9638 * testsuite/thumb_bl_out_of_range.s: Ditto.
9639 * testsuite/thumb_branch_range.t: Ditto.
9640
b487ad64
ST
96412010-02-20 Sriraman Tallam <tmsriram@google.com>
9642
9643 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9644 Add reloc offset information.
9645 * icf.cc (get_section_contents): Change iterators to point to the new
9646 vectors. Add reloc offset information to the contents.
9647 * icf.h (Icf::Sections_reachable_info): New typedef.
9648 (Icf::Sections_reachable_list): New typedef.
9649 (Icf::Offset_info): New typedef.
9650 (Icf::Reloc_info): New struct typedef.
9651 (Icf::Reloc_info_list): New typedef.
9652 (Icf::symbol_reloc_list): Delete method.
9653 (Icf::addend_reloc_list): Delete method.
9654 (Icf::section_reloc_list): Delete method.
9655 (Icf::reloc_info_list): New method.
9656 (Icf::reloc_info_list_): New member.
9657
f96accdf
DK
96582010-02-19 Doug Kwan <dougkwan@google.com>
9659
9660 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9661 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9662 * arm.cc (Arm_relocation_functions): New forward declaration.
9663 (Target_arm::Target_arm): Initialize new data members
9664 got_mod_index_offset_ and tls_base_symbol_defined_.
9665 (Target_arm::Relocate::relocate_tls): New method.
9666 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9667 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9668 New methods.
2e702c99 9669 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
9670 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9671 (Target_arm::got_mod_index_offset_,
9672 Target_arm::tls_base_symbol_defined_): New data members.
9673 (Target_arm::Scan::local, Target::Scan::global,
9674 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9675 relocations.
9676
c8761b9a
DK
96772010-02-18 Doug Kwan <dougkwan@google.com>
9678
9679 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9680 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9681 text section as a parameter becuase some broken tools may not set
9682 the link in section header.
9683 (Target_arm::has_got_section): New method.
9684 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9685 without any mapping symbol as data only. Remove warning.
9686 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9687 link in its section header, try to discover the link by inspecting the
9688 REL31 relocation at the beginning of the section.
9689 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9690 in error message.
9691 (Target_arm::Scan::global): Treat any reference to the symbol
9692 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9693
21bb3914
ST
96942010-02-12 Sriraman Tallam <tmsriram@google.com>
9695
9696 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9697 (Scan::global_reloc_may_be_function_pointer): New function.
9698 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9699 (Scan::global_reloc_may_be_function_pointer): New function.
9700 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9701 (Scan::global_reloc_may_be_function_pointer): New function.
9702 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9703 (Scan::global_reloc_may_be_function_pointer): New function.
9704 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9705 (Scan::global_reloc_may_be_function_pointer): New function.
9706 (Scan::possible_function_pointer_reloc): New function.
9707 (Target_x86_64::can_check_for_function_pointers): New function.
9708 * gc.h (gc_process_relocs): Scan relocation types to determine if
9709 function pointers were taken for targets that support it.
9710 * icf.cc (Icf::find_identical_sections): Include functions for
9711 folding in safe ICF whose pointer is not taken.
9712 * icf.h (Secn_fptr_taken_set): New typedef.
9713 (fptr_section_id_): New member.
9714 (section_has_function_pointers): New function.
9715 (set_section_has_function_pointers): New function.
9716 (check_section_for_function_pointers): New function.
9717 * options.h: Fix comment for safe ICF option.
9718 * target.h (can_check_for_function_pointers): New function.
9719 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9720 Modify icf_safe_test for X86-64.
9721 * testsuite/Makefile.in: Regenerate.
9722 * testsuite/icf_safe_so_test.cc: New file.
9723 * testsuite/icf_safe_so_test.sh: New file.
9724 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9725 (main): Change to take pointer to function kept_func_3.
9726 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9727 folding is done correctly for X86-64.
9728
0da6fa6c
DM
97292010-02-12 David S. Miller <davem@davemloft.net>
9730
9731 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9732 is_symbolless parameter.
9733 (Output_reloc<SHT_REL>::is_symbolless): New.
9734 (Output_reloc<SHT_REL>::is_symbolless_): New.
9735 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9736 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9737 (Output_reloc<SHT_RELA>::is_symbolless): New.
9738 (Output_data_reloc::add_global): Handle is_symbolless.
9739 (Output_data_reloc::add_global_relative): Likewise.
9740 (Output_data_reloc::add_local): Likewise.
9741 (Output_data_reloc::add_local_relative): Likewise.
9742 (Output_data_reloc::add_symbolless_global_addend): New.
9743 (Output_data_reloc::add_symbolless_local_addend): New.
9744 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9745 is_symbolless.
9746 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9747 instead of ->is_relative_
9748 (Output_reloc::write): Likewise.
9749 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9750 (Output_reloc::write_rel): Simplify.
9751
9752 * sparc.cc (Target_sparc::Scan::local): Use
9753 ->add_symbolless_local_addend as needed.
9754 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9755 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9756 based upon relocation offset.
9757
e4782e83
DK
97582010-02-11 Doug Kwan <dougkwan@google.com>
9759
9760 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9761 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9762 beginning of function.
9763 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9764 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9765 parameter is_32bit in calls to should_apply_static_reloc.
9766 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9767 (check_DATA): Add arm_abs_global.stdout.
9768 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9769 arm_abs_global.stdout): New rules.
9770 (MOSTLLYCLEANFILES): Add arm_abs_global
9771 * Makefile.in: Regenerate.
9772 * testsuite/arm_abs_global.s: New file.
9773 * testsuite/arm_abs_global.sh: Ditto.
9774 * testsuite/arm_abs_lib.s: Ditto.
9775
93ceb764
ILT
97762010-02-11 Ian Lance Taylor <iant@google.com>
9777
9778 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9779 Read_relocs task.
9780 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9781 Allocate_commons_task first.
9782 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9783 task, rather than symtab_lock_.
9784 (Gc_process_relocs::~Gc_process_relocs): New function.
9785 (Gc_process_relocs::is_runnable): Check this_blocker_.
9786 (Gc_process_relocs::locks): Use next_blocker_ rather than
9787 blocker_.
9788 (Scan_relocs::~Scan_relocs): New function.
9789 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9790 symtab_lock_.
9791 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9792 next_blocker_.
9793 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9794 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9795 constructor accordingly.
9796 (class Gc_process_relocs): Likewise.
9797 (class Scan_relocs): Likewise.
9798 * common.h (class Allocate_commons_task): Remove symtab_lock_
9799 field, and corresponding constructor parameter.
9800 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9801 symtab_lock_.
9802 (Allocate_commons_task::locks): Likewise.
9803
114dfbe1
ILT
98042010-02-11 Ian Lance Taylor <iant@google.com>
9805
9806 * gold-threads.h (class Once): Define.
9807 (class Initialize_lock): Rewrite as child of Once.
9808 * gold-threads.cc (class Once_initialize): Define.
9809 (once_pointer_control): New static variable.
9810 (once_pointer, once_arg): New static variables.
9811 (c_run_once): New static function.
9812 (Once::Once, Once::run_once, Once::internal_run): New functions.
9813 (class Initialize_lock_once): Remove.
9814 (initialize_lock_control): Remove.
9815 (initialize_lock_pointer): Remove.
9816 (initialize_lock_once): Remove.
9817 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9818 (Initialize_lock::initialize): Rewrite.
9819 (Initialize_lock::do_run_once): New function.
9820 * archive.cc (Archive::interpret_header): Only clear name if it is
9821 not already empty.
9822 * fileread.cc: Include "gold-threads.h"
9823 (file_counts_lock): New static variable.
9824 (file_counts_initialize_lock): Likewise.
9825 (File_read::release): Only increment counts when using --stats.
9826 Use a lock around the increment.
9827 * parameters.cc (class Set_parameters_target_once): Define.
9828 (set_parameters_target_once): New static variable.
9829 (Parameters::Parameters): Move here from parameters.h.
9830 (Parameters::set_target): Rewrite.
9831 (Parameters::set_target_once): New function.
9832 (Parameters::clear_target): Move here and rewrite.
9833 * parameters.h (class Parameters): Update declarations. Add
9834 set_parameters_target_once_ field.
9835 (Parameters::Parameters): Move to parameters.cc.
9836 (Parameters::clear_target): Likewise.
9837 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9838 task.
9839 (Start_group::~Start_group): New function.
9840 (Start_group::is_runnable): New function.
9841 (Start_group::locks, Start_group::run): New functions.
9842 (Finish_group::run): Change saw_undefined to size_t.
9843 * readsyms.h (class Start_group): Define.
9844 (class Finish_group): Change saw_undefined_ field to size_t.
9845 (Finish_group::Finish_group): Remove saw_undefined and
9846 this_blocker parameters. Change all callers.
9847 (Finish_group::set_saw_undefined): New function.
9848 (Finish_group::set_blocker): New function.
9849 * symtab.h (class Symbol_table): Change saw_undefined to return
9850 size_t. Change saw_undefined_ field to size_t.
9851 * target-select.cc (Set_target_once::do_run_once): New function.
9852 (Target_selector::Target_selector): Initialize set_target_once_
9853 field. Don't initialize lock_ and initialize_lock_ fields.
9854 (Target_selector::instantiate_target): Rewrite.
9855 (Target_selector::set_target): New function.
9856 * target-select.h (class Set_target_once): Define.
9857 (class Target_selector): Update declarations. Make
9858 Set_target_once a friend. Remove lock_ and initialize_lock_
9859 fields. Add set_target_once_ field.
9860
fa17a3f4
ILT
98612010-02-10 Ian Lance Taylor <iant@google.com>
9862
9863 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9864 queueing any tasks.
9865 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9866 (queue_middle_tasks): Add all blockers before queueing any tasks.
9867 (queue_final_tasks): Likewise.
9868 * token.h (Task_token::add_blockers): New function.
9869 * object.h (Input_objects::number_of_relobjs): New function.
9870
c7177d31
ILT
98712010-02-10 Ian Lance Taylor <iant@google.com>
9872
5de0e392
ILT
9873 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9874 shared, not if not position independent.
9875 * x86_64.cc (Relocate::relocate_tls): Likewise.
9876 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9877 (tls_pie_pic_test): New target.
9878 * testsuite/Makefile.in: Rebuild.
9879
c7177d31
ILT
9880 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9881 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9882 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9883 * testsuite/Makefile.in: Rebuild.
9884
684b268a
DM
98852010-02-09 David S. Miller <davem@davemloft.net>
9886
9887 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9888 R_SPARC_RELATIVE using ->add_local_relative().
9889 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9890
612a8d3d
DM
9891 * output.h (Output_data_dynamic::add_section_size): New method
9892 that takes two Output_data objects.
9893 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9894 entry param. Handle it in initializers.
9895 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9896 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9897 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9898 arg.
9899 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9900 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9901 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9902 for dynrel_includes_plt.
9903 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9904 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9905 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9906 before .rela.plt
9907 (Target_sparc::do_finalize_sections): Update to pass true for
9908 dynrel_includes_plt.
9909 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9910 output before .rela.plt
9911 (Target_powerpc::do_finalize_sections): Update to pass true for
9912 dynrel_includes_plt when 32-bit.
9913
cb1be87e
DK
99142010-02-08 Doug Kwan <dougkwan@google.com>
9915
9916 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9917 method.
9918 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9919 Arm_relobj::scan_section_for_cortex_a8_stubs,
9920 Arm_relobj::do_relocation_section): Instead of calling
9921 Output_section::output_address, use faster
9922 Arm_relobj::simple_input_section_output_address.
9923
705b5121
DM
99242010-02-08 David S. Miller <davem@davemloft.net>
9925
9926 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9927 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9928 relocation helper function.
9929
024c4466
DM
9930 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9931 just like R_SPARC_GOT{10,13,22}.
9932 (Target_sparc::Scan::local): Likewise.
9933 (Target_sparc::Relocate:relocate): Likewise.
9934
9109c078
ILT
99352010-02-06 Ian Lance Taylor <iant@google.com>
9936
9937 * configure.ac: Rewrite targetobjs duplicate removal code to use
9938 only shell constructs.
9939 * configure: Rebuild.
9940
cf846138
DK
99412010-02-05 Doug Kwan <dougkwan@google.com>
9942
9943 PR 11247
9944 * arm.cc (Arm_relobj::section_is_scannable): New method.
9945 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9946 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9947
6cfaf60b
DK
99482010-02-04 Doug Kwan <dougkwan@google.com>
9949
9950 PR 11247
9951 * arm-reloc-property.cc (cstdio): Include.
9952 * configure.ac (targetobjs): Remove duplicates.
9953 * configure: Regenerate.
9954 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9955 big and little endian version for a given address size.
9956
5c57f1be
DK
99572010-02-03 Doug Kwan <dougkwan@google.com>
9958
9959 * arm-reloc-property.cc
9960 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9961 definition.
9962 * arm-reloc-property.h
9963 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9964 New method definition.
9965 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9966 declaration.
9967 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9968 overflow to N.
9969 (GOT_PREL): Change implemented to Y.
9970 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9971 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9972 (Arm_relocate_functions::movw_abs_nc): Remove method.
9973 (Arm_relocate_functions::movt_abs): Ditto.
9974 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9975 (Arm_relocate_functions::thm_movt_abs): Ditto.
9976 (Arm_relocate_functions::movw_rel_nc): Ditto.
9977 (Arm_relocate_functions::movw_rel): Ditto.
9978 (Arm_relocate_functions::movt_rel): Ditto.
9979 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9980 (Arm_relocate_functions:thm_movw_rel): Ditto.
9981 (Arm_relocate_functions:thm_movt_rel): Ditto.
9982 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9983 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9984 New method definitions.
9985 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9986 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9987 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9988 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9989 (Target_arm::Relocate::relocate): Check for non-static or
9990 unimplemented relocation code and exit early. Change calls to
9991 Target_arm::reloc_uses_thumb_bit and
9992 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9993 instead. Refactor code to handle similar relocations to increase
9994 code sharing. Remove check for unsupported relocation code in switch
9995 statement.
9996 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9997 relocation property table to find out size. Change error message to
9998 print out the name of a relocation code instead of the numeric value.
9999 (Target_arm::scan_reloc_for_stub): Use relocation property table
10000 instead of calling Target_arm::reloc_uses_thumb_bit().
10001
218c5831
DK
100022010-02-02 Doug Kwan <dougkwan@google.com>
10003
10004 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10005 types of relaxed input section.
10006
0d31c79d
DK
100072010-02-02 Doug Kwan <dougkwan@google.com>
10008
10009 * Makefile.am (HFILES): Add arm-reloc-property.h.
10010 (DEFFILES): New.
2e702c99
RM
10011 (TARGETSOURCES): Add arm-reloc-property.cc
10012 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
10013 (libgold_a_SOURCES): $(DEFFILES)
10014 * Makefile.in: Regenerate.
10015 * arm-reloc-property.cc: New file.
10016 * arm-reloc-property.h: New file.
10017 * arm-reloc.def: New file.
10018 * arm.cc: Update comments.
10019 (arm-reloc-property.h): New included header.
10020 (arm_reloc_property_table): New global variable.
10021 (Target_arm::do_select_as_default_target): New method definition.
10022 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10023 arm-reloc-property to targ_extra_obj.
10024 * parameters.cc (set_parameters_target): Call
10025 Target::select_as_default_target().
10026 * target.h (Target::select_as_default_target): New method definition.
10027 (Target::do_select_as_default_target): Same.
10028
546c7457
DK
100292010-02-01 Doug Kwan <dougkwan@google.com>
10030
10031 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10032 first_output_text_section_.
10033 (Arm_exidx_fixup::first_output_text_section): New method definition.
10034 (Arm_exidx_fixup::first_output_text_section_): New data member.
10035 (Arm_exidx_fixup::process_exidx_section): Record the first text
10036 output section seen.
10037 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10038 and entsize in output section header.
10039
11b861d5
DK
100402010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10041
10042 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10043 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10044 (Arm_relocate_functions::thm_alu11): New Method.
10045 (Arm_relocate_functions::thm_pc8): New Method.
10046 (Arm_relocate_functions::thm_pc12): New Method.
10047 (Target_arm::Scan::local): Handle the relocations.
10048 (Target_arm::Scan::global): Likewise.
10049 (Target_arm::Relocate::relocate): Likewise.
10050 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10051
c9a2c125
DK
100522010-01-29 Doug Kwan <dougkwan@google.com>
10053
10054 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
10055 of relocation types as ld.
10056
1521477a
DK
100572010-01-29 Doug Kwan <dougkwan@google.com>
10058
10059 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10060 to public.
10061 (Arm_relocate_functions::thumb_branch_common): Ditto.
10062 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10063 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10064 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10065 Arm_relocate_functions::jump24): Remove.
10066 (Target_arm::Relocate::relocate): Adjust code to call
10067 Arm_relocation_functions::arm_branch_common and
10068 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 10069 wrappers. Merge switch-cases together to reduce source code size.
1521477a 10070
e7eca48c
DK
100712010-01-29 Doug Kwan <dougkwan@google.com>
10072
10073 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10074 output_local_symbol_count_needs_update_.
10075 (Arm_relobj::output_local_symbol_count_needs_update,
10076 Arm_relobj::set_output_local_symbol_count_needs_update,
10077 Arm_relobj::update_output_local_symbol_count): New methods.
10078 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10079 member.
10080 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10081 of pointed function as in a R_ARM_PREL31 relocation.
10082 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10083 for output local symbol count updating.
10084 (Target_arm::do_relax): Update output local symbol counts in objects
10085 if necessary.
10086 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10087
02961d7e
ILT
100882010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10089
10090 * arm.cc: Added support for the ARM relocations:
10091 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
10092 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
10093 (Arm_relocate_functions::movw_rel_nc): Renamed (was
10094 movw_prel_nc).
10095 (Arm_relocate_functions::movw_rel): New method.
10096 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
10097 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
10098 thm_movw_prel_nc).
10099 (Arm_relocate_functions::thm_movw_rel): New method.
10100 (Arm_relocate_functions::thm_movt_rel): Renamed (was
10101 thm_movt_prel).
10102 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
10103 relocations.
10104 (Target_arm::Scan::global): Likewise.
10105 (Target_arm::Relocate::relocate): Likewise.
10106 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10107 Likewise.
10108
b10d2873
ILT
101092010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10110
10111 * arm.cc: Added support for ARM group relocations.
10112 (Target_arm::reloc_needs_sym_origin): New method.
10113 (Arm_relocate_functions::calc_grp_kn): New method.
10114 (Arm_relocate_functions::calc_grp_residual): New method.
10115 (Arm_relocate_functions::calc_grp_gn): New method.
10116 (Arm_relocate_functions::arm_grp_alu): New Method.
10117 (Arm_relocate_functions::arm_grp_ldr): New Method.
10118 (Arm_relocate_functions::arm_grp_ldrs): New Method.
10119 (Arm_relocate_functions::arm_grp_ldc): New Method.
10120 (Target_arm::Scan::local): Handle the ARM group relocations.
10121 (Target_arm::Scan::global): Likewise.
10122 (Target_arm::Relocate::relocate): Likewise.
10123 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10124 Likewise.
10125
2b328d4e
DK
101262010-01-26 Doug Kwan <dougkwan@google.com>
10127
10128 * arm.cc (set): Include.
10129 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10130 pointer type.
2e702c99 10131 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
10132 (Arm_output_section::append_text_sections_to_list): New method.
10133 (Arm_output_section::fix_exidx_coverage): Ditto.
10134 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 10135 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
10136 Relobj::set_section_offset() instead of
10137 Sized_relobj::invalidate_section_offset().
2e702c99 10138 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
10139 parameter for section headers. Ignore relocation sections for
10140 unallocated sections and EXIDX sections.
10141 (Target_arm::fix_exidx_coverage): New method.
10142 (Target_arm::output_section_address_less_than): New type.
10143 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10144 linked text section instead of the EXIDX section.
10145 (Arm_output_section::create_stub_group): Add an assertion to check
10146 that this is not an EXIDX output section.
10147 (Arm_output_section::append_text_sections_to_list): New method.
10148 (Arm_output_section::fix_exidx_coverage): Ditto.
10149 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 10150 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
10151 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10152 first pass.
10153 (Target_arm::fix_exidx_coverage): New method.
10154 * object.h (Relobj::set_output_section): New method.
10155 (Sized_relobj::invalidate_section_offset): Remove method.
10156 (Sized_relobj::do_invalidate_section_offset): Remove method.
10157 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10158
c7f3c371
DK
101592010-01-25 Doug Kwan <dougkwan@google.com>
10160
10161 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10162 Fix warning due to signed and unsigned comparison on a 32-bit host.
10163
8923b24c
DK
101642010-01-22 Doug Kwan <dougkwan@google.com>
10165
10166 * arm.cc (Target_arm::do_relax): Record an output section for section
10167 offset adjustment it contains any stub table that has changed.
10168 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10169 offsets in an output section if necessary.
10170 * output.cc (Output_section::Output_section): Initialize
10171 section_offsets_need_adjustments_.
10172 (Output_section::add_input_section_for_script): Renamed to
10173 Output_section::add_simple_input_section.
10174 (Output_section::save_states): Add a comment.
10175 (Output_section::discard_states): New method defintion.
10176 (Output_section::adjust_section_offsets): Same.
10177 * output.h (Output_section::add_input_section_for_script): Renamed to
10178 Output_section::add_simple_input_section.
10179 (Output_section::discard_states): New method declaration.
10180 (Output_section::adjust_section_offsets): Same.
10181 (Output_section::section_offsets_need_adjustment,
10182 Output_section::set_section_offsets_need_adjustment): New method
10183 definitions.
10184 (Output_section::section_offsets_need_adjustment_): New data member.
10185 * script-sections.cc
10186 (Output_section_element_input::set_section_address): Adjust code for
10187 renaming of Output_section::add_input_section_for_script.
10188 (Orphan_output_section::set_section_address): Same.
10189
9b2fd367
DK
101902010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10191
10192 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10193 Fix_v4bx enum values .
10194 * gold/options.h (General_options): New option definitions.
10195 (General_options::fix_v4bx): New method.
10196 (General_options::Fix_v4bx): New enum.
10197 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10198 (General_options::parse_fix_v4bx_interworking): New method.
10199
80d0d023
DK
102002010-01-22 Doug Kwan <dougkwan@google.com>
10201
10202 * arm.cc (Arm_exidx_fixup): New class.
10203
af2cdeae
DK
102042010-01-21 Doug Kwan <dougkwan@google.com>
10205
10206 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10207 classes.
10208 (Arm_exidx_section_offset_map): New type.
10209
993d07c1
DK
102102010-01-21 Doug Kwan <dougkwan@google.com>
10211
10212 * arm.cc (Arm_exidx_input_section): New class.
10213 (Arm_relobj::exidx_input_section_by_link,
10214 Arm_relobj::exidx_input_section_by_shndx,
10215 Arm_relobj::make_exidx_input_section): New methods.
10216 (read_arm_attributes_section): Remove.
10217 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10218 information about them.
10219 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10220 to here.
10221
5ac169d4
DK
102222010-01-20 Doug Kwan <dougkwan@google.com>
10223
10224 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10225 Input_section_specifier to Section_id.
10226 (Target_arm::new_arm_input_section: Adjust code for change of key
10227 type.
10228 (Target_arm::find_arm_input_section): Ditto.
10229 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10230 (Section_id): Remove.
10231 (Garbage_collection::Section_id_hash): Remove.
10232 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10233 (Section_id): Remove.
10234 (Icf::Section_id_hash): Remove.
10235 * object.h (Section_id, Const_section_id, Section_id_hash,
10236 Const_section_id_hash): New type definitions.
10237 * output.cc (Output_section::add_relaxed_input_section): Change to
10238 use Const_section_id instead of Input_section_specifier as key type.
10239 (Output_section::add_merge_input_section): Ditto.
10240 (Output_section::build_relaxation_map): Change to use Section_id
10241 instead of Input_section_specifier as key type.
2e702c99 10242 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
10243 Ditto.
10244 (Output_section::convert_input_sections_to_relaxed_sections): Change
10245 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 10246 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
10247 (Output_section::find_relaxed_input_section): Ditto.
10248 * output.h (Input_section_specifier): Remove class.
10249 (Output_section::Output_section_data_by_input_section_map): Change
10250 key type to Const_section_id.
10251 (Output_section::Output_relaxed_input_section_by_input_section_map):
10252 Ditto.
10253 (Output_section::Relaxation_map): Change key type to Section_id.
10254
a2162063
ILT
102552010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10256
10257 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10258 (class Arm_v4bx_stub): New class.
10259 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10260 (Stub_factory::make_arm_v4bx_stub): New method.
10261 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10262 (Stub_table::empty): Handle v4bx stubs.
10263 (Stub_table::add_arm_v4bx_stub): New method.
10264 (Stub_table::find_arm_v4bx_stub): New method.
10265 (Arm_relocate_functions::v4bx): New method.
10266 (Target_arm::fix_v4bx): New method.
10267 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10268 (Stub_table::relocate_stubs): Likewise.
10269 (Stub_table::do_write): Likewise.
10270 (Stub_table::update_data_size_and_addralign): Likewise.
10271 (Stub_table::finalize_stubs): Likewise.
10272 (Target_arm::Scan::local): Likewise.
10273 (Target_arm::Scan::global): Likewise.
10274 (Target_arm::do_finalize_sections): Likewise.
10275 (Target_arm::Relocate::relocate): Likewise.
10276 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10277 Likewise.
10278 (Target_arm::scan_reloc_for_stub): Likewise.
10279 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10280
5696ab0b
ILT
102812010-01-19 Ian Lance Taylor <iant@google.com>
10282
10283 * output.cc (Output_section_headers::do_sized_write): Write large
10284 segment count to sh_info field.
10285 (Output_file_header::do_sized_write): For large segment count,
10286 write PN_XNUM to e_phnum field.
10287
800d0f56
ILT
102882010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10289
10290 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10291 (Arm_relocate_functions::thm_jump8): New function.
10292 (Arm_relocate_functions::thm_jump11): New function.
10293 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10294 R_ARM_THM_JUMP11.
10295 (Target_arm::Scan::global): Likewise.
10296 (Target_arm::Relocate::relocate): Likewise.
10297 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10298 Likewise.
10299
41263c05
DK
103002010-01-14 Doug Kwan <dougkwan@google.com>
10301
10302 * arm.cc (map, utility): Include headers.
10303 (Target_arm::apply_cortex_a8_workaround): New method.
10304 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10305 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10306 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10307 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10308 the --[no-]fix-cortex-a8 command line options.
10309 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10310 (Target_arm::relocate_stub): Use addend in instruction template.
10311 * options.h (DEFINE_bool): Set the user-set flag.
10312 (General_options): Add --[no-]-fix-cortex options.
10313 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10314 : Update fast look-up map after conversion.
41263c05 10315
459e9b03
ST
103162010-01-14 Sriraman Tallam <tmsriram@google.com>
10317
10318 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10319 in the first pass of do_layout.
10320
b521dfe4
DK
103212010-01-13 Doug Kwan <dougkwan@google.com>
10322
10323 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10324 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10325 apparent compiler problem of not folding static constant integral
10326 data members of elfcpp::Elf_sizes<32>.
10327
44272192
DK
103282010-01-13 Doug Kwan <dougkwan@google.com>
10329
10330 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10331 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10332 Arm_relobj::scan_section_for_cortex_a8_erratum,
10333 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10334 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10335 sections to scan for relocation stubs into a new method
10336 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10337 relocation and Cortex-A8 stub scanning.
10338 (Target_arm::do_relax): Force stubs to be after stubbed sections
10339 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10340 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10341 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10342
44b71ece
ILT
103432010-01-12 Ian Lance Taylor <iant@google.com>
10344
10345 * target-reloc.h (visibility_error): New inline function.
10346 (relocate_section): Call visibility_error.
10347 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10348 (MOSTLYCLEANFILES): Likewise.
10349 (protected_4_pic.o, protected_3.err): New targets.
10350 * testsuite/protected_4.cc: New file.
10351
a120bc7f
DK
103522010-01-12 Doug Kwan <dougkwan@google.com>
10353
10354 * arm.cc (Cortex_a8_reloc): New class.
10355 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10356 and cortex_a8_relocs_info_.
10357 (Target_arm::fix_cortex_a8): New method definition.
10358 (Target_arm::Cortex_a8_relocs_info): New type.
10359 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10360 New data member declarations.
10361 (Target_arm::scan_reloc_for_stub): Record information about
10362 relocations for THUMB branches that might be exempted from the
10363 Cortex-A8 workaround.
10364 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10365 at the beginning of a relaxation pass.
10366
20138696
DK
103672010-01-12 Doug Kwan <dougkwan@google.com>
10368
10369 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10370 (Arm_relobj::Mapping_symbol_position,
10371 Arm_reloj::Mapping_symbol_position_less,
10372 Arm_relobj::Mapping_symbols_info): New types.
10373 (Target_arm::is_mapping_symbol_name): New method definition.
10374 (Arm_relobj::do_count_local_symbols): Save information about mapping
10375 symbols.
10376
089d69dc
DK
103772010-01-11 Doug Kwan <dougkwan@google.com>
10378
10379 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10380 Arm_relocate_functions::thumb32_branch_upper,
10381 Arm_relocate_functions::thumb32_branch_lower,
10382 Arm_relocate_functions::thumb32_cond_branch_offset,
10383 Arm_relocate_functions::thumb32_cond_branch_upper,
10384 Arm_relocate_functions::thumb32_cond_branch_lower,
10385 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10386 branch offset encoding.
10387 (Arm_relocate_functions::thumb_branch_common): Use new branch
10388 offset encoding methods to avoid code duplication.
10389 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10390 (Stub_addend_reader::operator()): Use new branch encoding method
10391 to avoid code duplication.
10392
99e5bff2
DK
103932010-01-11 Doug Kwan <dougkwan@google.com>
10394
10395 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10396 (Target_arm::do_finalize_sections): Define special EXIDX section
10397 symbols only if referenced.
10398 * gc.h (Garbage_collection::add_reference): New method.
10399 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10400 code duplication.
10401
98e090bd
ILT
104022010-01-11 Ian Lance Taylor <iant@google.com>
10403
d0a91bd8
ILT
10404 * script.cc (Version_script_info::build_expression_list_lookup):
10405 Change complaing about duplicate wildcard match from error to
10406 warning.
10407
98e090bd
ILT
10408 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10409 of 2009-12-30.
10410 (Version_script_info::Version_script_info): Initialize globs_,
10411 default_version_, default_is_global_, and exact_. Don't
10412 initialize globals_ or locals_.
10413 (Version_script_info::build_lookup_tables): Build local symbols
10414 first.
10415 (Version_script_info::unquote): New function.
10416 (Version_script_info::add_exact_match): New function.
10417 (Version_script_info::build_expression_list_lookup): Remove lookup
10418 parameter. Add is_global parameter. Change all callers. Handle
10419 wildcard pattern specially. Unquote pattern. Call
10420 add_exact_match.
10421 (Version_script_info::get_name_to_match): New function.
10422 (Version_script_info::get_symbol_version): New function.
10423 (Version_script_info::get_symbol_version_helper): Remove.
10424 (Version_script_info::check_unmatched_names): Call unquote.
10425 * script.h (class Version_script_info): Change get_symbol_version
10426 to be non-inline and add is_global parameter; change all callers.
10427 Rewrite symbol_is_local. Update declarations. Define struct
10428 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10429 Remove globals_ and locals_ members. Add exact_, globs_,
10430 default_version_, is_global_.
10431 (Version_script_info::Glob): Remove pattern, add expression and
10432 is_global. Update constructor. Change all callers.
10433 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10434 default version.
10435 (Versions::symbol_section_contents): If a symbol is undefined, or
10436 defined in a dynamic object, set the version index to
10437 VER_NDX_LOCAL.
10438 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10439 symbol_is_local.
10440 (Symbol_table::add_from_pluginobj): Likewise.
10441 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10442
d56962d3
DK
104432010-01-11 Doug Kwan <dougkwan@google.com>
10444
10445 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10446 (incremental_dump_LDADD): Add linking option for libintl.
10447 * Makefile.in: Regenerate.
10448
94e6ee91
L
104492010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10450
10451 PR gold/11144
10452 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10453 instead of -Ds.
10454 * testsuite/Makefile.in: Regenerated.
10455
e96c574b
DK
104562010-01-10 Doug Kwan <dougkwan@google.com>
10457
10458 * options.h (DEFINE_var): Use parentheses around argument varname__
10459 in macro body to avoid any unintended subsequent substitutions.
10460
7198066b
ILT
104612010-01-10 Ian Lance Taylor <iant@google.com>
10462
ba4d53bf
ILT
10463 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10464 candidates before doing symbol resolution.
10465
7198066b
ILT
10466 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10467 ODR candidates if only one is weak.
10468
a2beed37
ILT
104692010-01-08 Ian Lance Taylor <iant@google.com>
10470
10471 * script.cc (Version_script_info::build_expression_list_lookup):
10472 Don't warn about ambiguous version, just record the ambiguity.
10473 (Version_script_info::get_symbol_version_helper): Give error if
10474 version is ambiguous.
10475
2fb7225c
DK
104762010-01-08 Doug Kwan <dougkwan@google.com>
10477
10478 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10479 prev_data_size_ and prev_addralign_. Remove initializer for
10480 deleted data member has_been_changed_.
10481 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10482 to determine if the table is empty.
10483 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10484 Remove.
10485 (Stub_table::add_reloc_stub): Define method in class definition
10486 instead of just declaring it there.
10487 (Stub_table::add_cortex_a8_stub): New method definition.
10488 (Stub_table::update_data_size_and_addralign): Ditto.
10489 (Stub_table::finalize_stubs): Ditto.
10490 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10491 (Stub_table::do_addralign_): Return address alignment in the
10492 (Stub_table::do_reset_address_and_file_offset): Define method in
10493 class definition instead of declaring it there. Set current data
10494 size to be the data size of the previous pass.
10495 (Stub_table::set_final_data_size): Use current data size as the
10496 final data size.
10497 (Stub_table::relocate_stub): Change parameter type of stub from
10498 Reloc_stub pointer to Stub pointer.
10499 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10500 (Stub_table::Cortex_a8_stub_list): New typedef.
10501 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10502 Stub_table::prev_addralign_): New data member.
10503 (Arm_relobj::Arm_relobj): Initialize data member
10504 section_has_cortex_a8_workaround_.
10505 (Arm_relobj::section_has_cortex_a8_workaround,
10506 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10507 definitions.
10508 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10509 declarations.
10510 (Target_arm::relocate_stub): Change parameter type of stub from
10511 Reloc_stub pointer to Stub pointer.
10512 (Insn_template::size, Insn_template::alignment): Handle
10513 THUMB16_SPECIAL_TYPE.
10514 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10515 Stub_table::update_data_size_and_addralign,
10516 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10517 definitions.
10518 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10519 (Stub_table::do_write): Ditto.
10520 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10521
880cd20d
ILT
105222010-01-08 Ian Lance Taylor <iant@google.com>
10523
10524 PR 11108
10525 * symtab.h (class Symbol): Remove fields is_target_special_ and
10526 has_plt_offset_. Add field is_defined_in_discarded_section_.
10527 (Symbol::is_defined_in_discarded_section): New function.
10528 (Symbol::set_is_defined_in_discarded_section): New function.
10529 (Symbol::has_plt_offset): Rewrite.
10530 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10531 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10532 Don't initialize is_target_special_ or has_plt_offset_.
10533 Initialize is_defined_in_discarded_section_.
10534 (Symbol_table::add_from_relobj): If appropriate, set
10535 is_defined_in_discarded_section.
10536 * resolve.cc (Symbol::override_base_with_special): Don't test
10537 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10538 * target-reloc.h (relocate_section): Do special handling for
10539 symbols defined in discarded sections for global symbols as well
10540 as local symbols.
10541
2703e3eb
ILT
105422010-01-08 Ian Lance Taylor <iant@google.com>
10543
10544 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10545 the SHT_SYMTAB case.
10546
339d40a3
ILT
105472010-01-08 Ian Lance Taylor <iant@google.com>
10548
10549 * object.cc (Sized_relobj::do_layout): Don't get confused if
10550 layout_eh_frame returns NULL.
10551
abecea76
ILT
105522010-01-08 Ian Lance Taylor <iant@google.com>
10553
10554 PR 11084
10555 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10556 dynamic symbol table, use the normal symbol table.
10557 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10558 symbol table.
10559
6b7dd3f3
ILT
105602010-01-08 Ian Lance Taylor <iant@google.com>
10561
10562 PR 11072
10563 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10564 sections.
10565
36c50e63
L
105662010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10567
10568 * version.cc (print_version): Change to "Copyright 2010".
10569
e291e7b9
ILT
105702010-01-08 Ian Lance Taylor <iant@google.com>
10571
10572 PR 10287
10573 PR 11063
10574 * i386.cc (class Target_i386): Change return type of plt_section
10575 to be non-const.
10576 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10577 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10578 tls_desc_rel_ field.
10579 (Output_data_plt_i386::rel_tls_desc): New function.
10580 (Target_i386::rel_tls_desc_section): New function.
10581 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10582 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10583 R_386_TLS_DESC reloc in rel_tls_desc_section.
10584 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10585 Define struct Tlsdesc_info.
10586 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10587 (Target_x86_64::do_reloc_symbol_index): New function.
10588 (Target_x86_64::add_tlsdesc_info): New function.
10589 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10590 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10591 tlsdesc_rel_ field.
10592 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10593 all callers.
10594 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10595 (Target_x86_64::rela_tlsdesc_section): New function.
10596 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10597 handling.
10598 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10599 (Target_x86_64::do_reloc_addend): New function.
10600 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10601 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10602 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10603 (Output_reloc::type): New function.
10604 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10605 (Output_reloc::is_target_specific): New function.
10606 (Output_reloc::target_arg): New function.
10607 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10608 absolute relocs and target specific relocs.
10609 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10610 add_target_specific.
10611 (class Output_data_reloc) [SHT_RELA]: Likewise.
10612 * output.cc (Output_reloc::Output_reloc): Add four new versions
10613 for absolute relocs and target specific relocs.
10614 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10615 (Output_reloc::get_symbol_index): Likewise.
10616 (Output_reloc::local_section_offset): Check that local_sym_index_
10617 is not TARGET_CODE or 0.
10618 (Output_reloc::symbol_value): Likewise.
10619 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10620 reloc.
10621 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10622 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10623 functions.
10624 * layout.cc (add_target_dynamic_tags): Use output section for
10625 DT_PLTRELSZ and DT_JMPREL.
10626
3a44184e
ILT
106272010-01-07 Ian Lance Taylor <iant@google.com>
10628
10629 PR 11061
10630 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10631 function.
10632 (class Output_data_reloc_generic): Define.
10633 (class Output_data_reloc_base): Change base class to
10634 Output_data_reloc_generic. Change add() method to call
10635 bump_relative_reloc_count for a relative reloc. Remove
10636 sort_relocs_ field.
10637 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10638 to sort_relocs().
10639 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10640 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10641 appropriate.
10642 * layout.h (class Layout): Update declaration.
10643
ea715a34
ILT
106442010-01-07 Ian Lance Taylor <iant@google.com>
10645
10646 * output.h (class Output_data): Add const version of
10647 output_section and do_output_section.
10648 (class Output_section_data): Add const version of
10649 do_output_section.
10650 (class Output_section): Likewise.
10651 * layout.cc (Layout::add_target_dynamic_tags): New function.
10652 * layout.h (class Layout): Update declarations.
10653 * arm.cc (Target_arm::do_finalize_sections): Use
10654 add_target_dynamic_tags.
10655 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10656 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10657 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10658 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10659
659948a4
ILT
106602010-01-07 Ian Lance Taylor <iant@google.com>
10661
10662 PR 11042
10663 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10664 object as needed.
10665
9d3b86f6
ILT
106662010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10667 Ian Lance Taylor <iant@google.com>
10668
10669 PR 11019
10670 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10671 Xindex::read_symtab_xindex.
10672
bb0d3eb0
DK
106732010-01-07 Doug Kwan <dougkwan@google.com>
10674
10675 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10676 (Insn_template::thumb16_bcond_insn): New method declaration.
10677 (Insn_template): Fix spelling.
10678 (Stub::thumb16_special): New method declaration.
10679 (Stub::do_write): Define virtual method which was previously pure
10680 virtual.
10681 (Stub::do_thumb16_special): New method declaration.
10682 (Stub::do_fixed_endian_write): New template member.
10683 (Reloc_stub::do_write): Remove.
10684 (Reloc_stub::do_fixed_endian_write): Remove.
10685 (Cortex_a8_stub): New class definition.
10686 (Stub_factory::make_cortex_a8_stub): New method definition.
10687 (Stub_factory::Stub_factory): Add missing static storage class
10688 qualifier for elf32_arm_stub_a8_veneer_blx.
10689
ffeef7df
ILT
106902010-01-07 Ian Lance Taylor <iant@google.com>
10691
dc3f80fe
ILT
10692 PR 10980
10693 * options.h (class General_options): Add --warn-unresolved-symbols
10694 and --error-unresolved-symbols.
10695 * errors.cc (Errors::undefined_symbol): Implement
10696 --warn-unresolved-symbols.
10697
ffeef7df
ILT
10698 * options.h (class General_options): Add -z text and -z textoff.
10699 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10700
f1ec9ded
ST
107012010-01-06 Sriraman Tallam <tmsriram@google.com>
10702
10703 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10704 (Garbage_collection::cident_sections): New function.
10705 (Garbage_collection::add_cident_section): New function.
10706 (Garbage_collection::cident_sections_): New member.
10707 (gc_process_relocs): Add references to sections whose names are C
10708 identifiers.
10709 * gold.h (cident_section_start_prefix): New constant.
10710 (cident_section_stop_prefix): New constant.
10711 (is_cident): New function.
10712 * layout.cc (Layout::define_section_symbols): Replace string constants
10713 with the newly defined constants.
10714 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10715 C identifiers.
10716 * testsuite/Makefile.am: Add gc_orphan_section_test.
10717 * testsuite/Makefile.in: Regenerate.
10718 * testsuite/gc_orphan_section_test.cc: New file.
10719 * testsuite/gc_orphan_section_test.sh: New file.
10720
6eda8c29
ILT
107212010-01-06 Ian Lance Taylor <iant@google.com>
10722
b9674e17
ILT
10723 PR 10980
10724 * options.h (class General_options): Add --warn-shared-textrel.
10725 * layout.cc (Layout::finish_dynamic_section): Implement
10726 --warn-shared-textrel.
10727
6eda8c29
ILT
10728 PR 10980
10729 * options.h (class General_options): Add --warn-multiple-gp.
10730
32dcd44e
ILT
107312010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10732
10733 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10734 $(THREADSLIB) and $(LIBDL).
10735 * Makefile.in: Rebuild.
10736
a192ba05
ILT
107372010-01-06 Ian Lance Taylor <iant@google.com>
10738
10739 PR 10980
10740 * options.cc (General_options::parse_section_start): New function.
10741 (General_options::section_start): New function.
10742 (General_options::General_options): Initialize all members.
10743 * options.h: Include <map>
10744 (class General_options): Add --section-start. Add section_starts_
10745 member.
10746 * layout.cc (Layout::attach_allocated_section_to_segment): If
10747 --section-start was used, set the address of the segment. Remove
10748 local sort_sections.
10749 (Layout::relaxation_loop_body): If the address of the load segment
10750 has been set by --section-start, don't use it.
10751 * output.h (Output_segment::update_flags_for_output_section): New
10752 function.
10753 * output.cc (Output_segment::add_output_section): Call
10754 update_flags_for_output_section.
10755
dde3f402
ILT
107562010-01-05 Ian Lance Taylor <iant@google.com>
10757
62dfdd4d
ILT
10758 PR 10980
10759 * options.h (class General_options): Add --undefined-version.
10760 * script.cc (struct Version_expression): Add was_matched_by_symbol
10761 field.
10762 (Version_script_info::matched_symbol): New function.
10763 (Version_script_info::get_symbol_version_helper): Call
10764 matched_symbol.
10765 (Version_script_info::check_unmatched_names): New function.
10766 * script.h (class Version_script_info): Update declarations.
10767 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10768
9c4ae156
ILT
10769 * options.h (class General_options): Use DEFINE_bool_alias for
10770 allow_multiple_definition.
10771 * resolve.cc (Symbol_table::should_override): Don't test
10772 allow_multiple_definition.
10773
dde3f402
ILT
10774 PR 10980
10775 * options.h (class General_options): Add --cref.
10776 * main.cc (main): Print cref table if --cref. Don't close mapfile
10777 until after printing cref table.
10778 * cref.cc: Include "symtab.h".
10779 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10780 (Cref_table_compare::operator()): New function.
10781 (Cref_inputs::gather_cref): New function.
10782 (filecol): New static const.
10783 (Cref_inputs::print_cref): New function.
10784 (Cref::print_cref): New function.
10785 * cref.h: Include <cstdio>.
10786 (class Cref): Update declarations.
10787 * mapfile.h (Mapfile::file): New function.
10788 * object.h (class Object): Define Symbols. Declare virtual
10789 do_get_global_symbols.
10790 (Object::get_global_symbols): New function.
10791 * object.cc (Input_objects::add_object): Pass object to cref_ if
10792 --cref.
10793 (Input_objects::archive_start): Likewise.
10794 (Input_objects::archive_stop): Likewise.
10795 (Input_objects::print_cref): New function.
10796 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10797 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10798 --cref.
10799 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10800 function.
10801 * plugin.h (class Sized_pluginobj): Update declarations.
10802
8781f709
ILT
108032010-01-05 Ian Lance Taylor <iant@google.com>
10804
10805 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10806 to is_default_version. Rename insdef to insdefault.
10807 (Symbol_table::add_from_relobj): Rename def to is_default_version
10808 and local to is_forced_local.
10809 (Symbol_table::add_from_pluginobj): Likewise.
10810 (Symbol_table::add_from_dynobj): Likewise.
10811 (Symbol_table::define_special_symbol): Rename insdef to
10812 insdefault.
10813
fe35d28d
ILT
108142010-01-04 Ian Lance Taylor <iant@google.com>
10815
30bc8c46
ILT
10816 PR 10980
10817 * options.h (class General_options): Add
10818 --allow-multiple-definition and -z muldefs.
10819 * resolve.cc (Symbol_table::should_override): Don't warn about a
10820 multiple symbol definition if --allow-multiple-definition or -z
10821 muldefs.
10822
7eaea549
ILT
10823 PR 10980
10824 * options.h (class General_options): Add --add-needed and
10825 --copy-dt-needed-entries. Tweak --as-needed help entry.
10826 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10827 error if --copy-dt-needed-entries aka --add-needed is used and
10828 would cause a change in behaviour.
10829
fe35d28d
ILT
10830 PR 10980
10831 * options.h (class General_options): Add -G as a short version of
10832 --shared. Add no-op options -assert, -g, and -i.
10833
55a2bb35
ST
108342010-01-04 Sriraman Tallam <tmsriram@google.com>
10835
10836 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10837 check for .text or .gnu.linkonce.t sections.
10838 * icf.cc (Icf::find_identical_sections): Ditto.
10839 Change the detection for mangled function name within the section
10840 name.
10841 * icf.h (is_section_foldable_candidate): New function.
10842
719328e1
ILT
108432009-12-30 Ian Lance Taylor <iant@google.com>
10844
10845 PR 10980
10846 * options.h (class General_options): Permit two dashes with
10847 --retain-symbols-file.
10848
d7bb5745
ILT
108492009-12-30 Ian Lance Taylor <iant@google.com>
10850
403a15dd
ILT
10851 PR 10979
10852 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10853 don't put the file header and segment headers in the text
10854 segment.
10855
eda294df
ILT
10856 PR 10979
10857 * common.cc (Sort_commons::operator()): Stabilize sort when both
10858 entries are NULL.
10859 (Symbol_table::do_allocate_commons_list): When allocating common
10860 symbols, skip a symbol which is no longer common.
10861 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10862 an object before checking its type.
10863 * testsuite/common_test_2.c: New file.
10864 * testsuite/common_test_3.c: New file.
10865 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10866 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10867 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10868 (common_test_2_pic.o, common_test_2.so): New targets.
10869 (common_test_3_pic.o, common_test_3.so): New targets.
10870 * testsuite/Makefile.in: Rebuild.
10871
d7bb5745
ILT
10872 PR 10979
10873 * script.cc (read_input_script): If we see a new SECTIONS clause,
10874 and we have added an input section, give an error.
10875 * layout.h (class Layout): Add have_added_input_section function.
10876 Add have_added_input_section_ field.
10877 * layout.cc (Layout::Layout): Initialize
10878 have_added_input_section_.
10879 (Layout::layout): Set have_added_input_section_.
10880 (Layout::layout_eh_frame): Likewise.
10881
fc59c572
ILT
108822009-12-30 Ian Lance Taylor <iant@google.com>
10883
10884 PR 10931
10885 * options.h (class General_options): Add --sort-common option.
10886 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10887 * common.cc (Sort_common): Add sort_order parameter to
10888 constructor. Add sort_order_ field.
10889 (Sort_commons::operator): Check sort_order_.
10890 (Symbol_table::allocate_commons): Determine the sort order.
10891 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10892 Change all callers.
10893 (Symbol_table::do_allocate_commons_list): Likewise.
10894
1c74fab0
ILT
108952009-12-30 Ian Lance Taylor <iant@google.com>
10896
10897 PR 10916
10898 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10899 symbols from this object, don't change the visibility of an
10900 undefined symbol.
10901 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10902
6affe781
ILT
109032009-12-30 Ian Lance Taylor <iant@google.com>
10904
10905 PR 10861
10906 * script.h (class Version_script_info): Define Language enum.
10907 Update declarations. Define Glob, Exact, and Lookup types. Add
10908 new fields globals_, locals_, and is_finalized_.
10909 * script.cc: Various formatting fixes.
10910 (class Parser_closure): Change language_stack_ from a vector of
10911 std::string to one of Version_script_info::Language. Adjust all
10912 uses accordingly.
10913 (class Lazy_demangler): Remove.
10914 (struct Version_expression): Change language from std::string to
10915 Version_script_info::Language.
10916 (Version_script_info::Version_script_info): New function.
10917 (Version_script_info::~Version_script_info): Don't call clear.
10918 (Version_script_info::finalize): New function.
10919 (Version_script_info::build_lookup_tables): New function.
10920 (Version_script_info::build_expression_list_lookup): New
10921 function.
10922 (Version_script_info::get_symbol_version_helper): Rewrite to use
10923 lookup tables.
10924 (Version_script_info::print_expression_list): Adjust to use
10925 Version_script_info::Language.
10926 (script_push_lex_into_version_mode): Check that the version script
10927 has not been finalized.
10928 (version_script_push_lang): Change language string to
10929 Version_script_info::Language.
10930 * options.cc (Command_line::version_script): New function.
10931 * options.h (class General_options): Add finalize_dynamic_list
10932 function. Change version_script from declaration to definition.
10933 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10934 * testsuite/version_script.map: Remove duplicate def of foo.
10935 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10936 version_script.map.
10937 * testsuite/Makefile.in: Rebuild.
10938
818bf354
ILT
109392009-12-30 Ian Lance Taylor <iant@google.com>
10940
10941 PR 10843
10942 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10943 if the input symbol index is 0, make the output symbol index 0.
10944
ebcc8304
ILT
109452009-12-30 Ian Lance Taylor <iant@google.com>
10946
10947 PR 10670
10948 * options.h (class General_options): Add -x/--discard-all.
10949 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10950 --discard-all. If the local symbol needs a dynamic entry, check
10951 that before handling --discard-locals.
10952
176fe33f
ILT
109532009-12-30 Ian Lance Taylor <iant@google.com>
10954
bb321bb1
ILT
10955 PR 10450
10956 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10957 flags to PF_R.
10958 (Output_segment::add_output_section): Don't change the flags if
10959 the type is PT_TLS.
10960
176fe33f
ILT
10961 PR 10450
10962 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10963 GNU hash table if they need a dynamic value. Otherwise, don't add
10964 them if they are defined in a dynamic object or are forced local.
10965
e8cd95c7
ILT
109662009-12-29 Ian Lance Taylor <iant@google.com>
10967
1b81fb71
ILT
10968 PR 10450
10969 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10970 .gnu.hash table for a 32-bit target.
10971
8d6d383d
ILT
10972 PR 10450
10973 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10974 regular and a dynamic object only needs a dynamic symbol table
10975 entry if it is externally visible.
10976
e785ec03
ILT
10977 PR 10450
10978 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10979 constructor. Add global_offset_table_ field.
10980 (Target_i386::got_section): Set global_offset_table_.
10981 (Target_i386::do_finalize_sections): Set global_offset_table_
10982 size.
10983 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10984 in constructor. Add global_offset_table_ field.
10985 (Target_x86_64::got_section): Set global_offset_table_.
10986 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10987 size.
10988
1a2dff53
ILT
10989 * layout.cc (Layout::Layout): Initialize increase_relro_.
10990 (Layout::get_output_section): Add is_relro, is_last_relro, and
10991 is_first_non_relro parameters. Change all callers.
10992 (Layout::choose_output_section): Likewise.
10993 (Layout::add_output_section_data): Likewise.
10994 (Layout::make_output_section): Likewise.
10995 (Layout::set_segment_offsets): Clear increase_relro when using a
10996 linker script.
10997 * layout.h (class Layout): Add increase_relro method. Add
10998 increase_relro_ field. Update declarations.
10999 * output.cc (Output_section::Output_section): Initialize
11000 is_last_relro_ and is_first_non_relro_.
11001 (Output_segment::add_output_section): Group relro sections is
11002 do_sort is true. Handle is_last_relro and is_first_non_relro.
11003 (Output_segment::maximum_alignment): Remove relro handling.
11004 (Output_segment::set_section_addresses): Add increase_relro
11005 parameter. Change all callers. Add initial alignment to align
11006 relro sections on separate page. Remove old relro handling.
11007 (Output_segment::set_section_list_addresses): Remove in_relro
11008 parameter. Change all callers.
11009 (Output_segment::set_offset): Add increase parameter. Change all
11010 callers. Remove old relro handling.
11011 * output.h (class Output_section): Add new methods: is_last_relro,
11012 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11013 Add is_last_relro_ and is_first_non_relro_ fields.
11014 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11015 Create separate .got.plt section. Call increase_relro.
11016 * x86_64.cc (Target_x86_64::got_section): Likewise.
11017 * testsuite/relro_script_test.t: Add .got.plt.
11018
f0ba79e2
ILT
11019 PR 10450
11020 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11021 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11022 (Layout::finalize): Call set_dynamic_symbol_size.
11023 (Layout::set_dynamic_symbol_size): New function.
11024 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11025 set_dynamic_symbol_size.
11026
e8cd95c7
ILT
11027 PR 10450
11028 * output.h (class Output_section): Add is_entsize_zero_ field.
11029 * output.cc (Output_section::Output_section): Initialize
11030 is_entsize_zero_.
11031 (Output_section::set_entsize): If two different entsizes are
11032 requested, force it to zero.
11033 (Output_section::add_input_section): Set flags for .debug_str
11034 before updating section flags. Set entsize.
11035 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11036 and SHF_STRING if all input sections have those flags.
11037
3e1b9a8a
RÁE
110382009-12-29 Rafael Espindola <espindola@google.com>
11039
11040 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
11041 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11042 reporting.
3e1b9a8a 11043
3dcad376
ST
110442009-12-29 Sriraman Tallam <tmsriram@google.com>
11045
11046 * options.cc (General_options::parse_version): Allow -v to exit
11047 without an error if there is nothing to link.
11048
084e2665
ILT
110492009-12-29 Ian Lance Taylor <iant@google.com>
11050
11051 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
11052 using a version of gcc before 4.1.
11053 * configure: Rebuild.
11054
250acde3
CD
110552009-12-28 Chris Demetriou <cgd@google.com>
11056
11057 * attributes.cc (Output_attributes_section_data::do_write): Use
11058 std::vector::front rather than std::vector::data.
11059
99fff23b
ILT
110602009-12-28 Ian Lance Taylor <iant@google.com>
11061
11062 * symtab.h (class Symbol_table): Add enum Defined.
11063 * resolve.cc (Symbol_table::should_override): Add defined
11064 parameter. Change all callers. Test whether object is NULL
11065 before calling a method on it.
11066 (Symbol_table::report_resolve_problem): Add defined parameter.
11067 Change all callers.
11068 (Symbol_table::should_override_with_special): Likewise.
11069 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11070 parameter. Change all callers.
11071 (Symbol_table::do_define_in_output_data): Likewise.
11072 (Symbol_table::define_in_output_segment): Likewise.
11073 (Symbol_table::do_define_in_output_segment): Likewise.
11074 (Symbol_table::define_as_constant): Likewise.
11075 (Symbol_table::do_define_as_constant): Likewise.
11076 * script.h (class Symbol_assignment): Add is_defsym parameter to
11077 constructor; change all callers.
11078 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11079 parameter. Change all callers. Add is_defsym_ field.
11080 (class Parser_closure): Add parsing_defsym parameter to
11081 constructor; change all callers. Add parsing_defsym accessor
11082 function. Add parsing_defsym_ field.
11083
556bd683
ILT
110842009-12-28 Ian Lance Taylor <iant@google.com>
11085
11086 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 11087 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 11088
1782c879
ILT
110892009-12-23 Ian Lance Taylor <iant@google.com>
11090
11091 * i386.cc (Target_i386::do_calls_non_split): Recognize
11092 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
11093 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
11094 -fsplit-stack prologue when using %r11.
1782c879 11095
329ca2b1
ST
110962009-12-21 Sriraman Tallam <tmsriram@google.com>
11097
11098 * options.cc (General_options::parse_version): Make -v continue and do
11099 the link like GNU ld does.
11100
d675ff46
RÁE
111012009-12-17 Rafael Avila de Espindola <espindola@google.com>
11102
11103 * Makefile.am (CCFILES): Add timer.cc.
11104 (HFILES): Add timer.h.
11105 * configure.ac: Check for sysconf and times.
11106 * main.cc: include timer.h.
11107 (main): Use Timer instead of get_run_time.
11108 * timer.cc: New.
11109 * timer.h: New.
11110 * workqueue.cc: include timer.h.
11111 (Workqueue::find_and_run_task):
11112 Report user, sys and wall time.
11113 * Makefile.in: Regenerate.
11114 * config.in: Regenerate.
11115 * configure: Regenerate.
11116
d6344fb5
DK
111172009-12-16 Doug Kwan <dougkwan@google.com>
11118
11119 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
11120 sections.
11121 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11122 relaxed input sections.
11123 * output.cc (Output_section::find_relaxed_input_section): Change
11124 return type to Output_relaxed_input_section pointer. Adjust code
11125 for new type of relaxed_input_section_map_.
11126 * output.h (Output_section::find_relaxed_input_section): Change
11127 return type to Output_relaxed_input_section pointer.
11128 (Output_section::Output_relaxed_input_section_by_input_section_map):
11129 New type.
11130 (Output_section::relaxed_input_section_map_): Change type to
11131 Output_section::Output_relaxed_input_section_by_input_section_map.
11132 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11133 input section.
11134
0e0d5469
ILT
111352009-12-15 Ian Lance Taylor <iant@google.com>
11136
11137 * layout.cc (Layout::create_shstrtab): Only write out after input
11138 sections if we are compressing debug sections.
11139
0649a889
ILT
111402009-12-15 Ian Lance Taylor <iant@google.com>
11141
11142 * archive.cc (Archive::add_symbols): Only look up a symbol without
11143 a version if there is, in fact, a version.
11144
2ea97941
ILT
111452009-12-14 Ian Lance Taylor <iant@google.com>
11146
11147 Revert -Wshadow changes, all changes from:
11148 2009-12-11 Doug Kwan <dougkwan@google.com>
11149 2009-12-11 Nick Clifton <nickc@redhat.com>
11150 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11151
b0eec2cc
DK
111522009-12-11 Doug Kwan <dougkwan@google.com>
11153
11154 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11155 due to -Wshadow.
11156 * attributes.cc (Object_attribute::size): Ditto.
11157 (Attributes_section_data::size): Ditto.
11158 (Attributes_section_data::Attributes_section_data): Ditto.
11159 (Output_attributes_section_data::do_write): Ditto.
11160 * attributes.h (Object_attribute::set_type): Ditto.
11161 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11162
91d6fa6a
NC
111632009-12-11 Nick Clifton <nickc@redhat.com>
11164
11165 * archive.cc: Fix shadowed variable warnings.
11166 * arm.cc: Likewise.
11167 * compressed_output.cc: Likewise.
11168 * compressed_output.h: Likewise.
11169 * configure: Likewise.
11170 * dwarf_reader.cc: Likewise.
11171 * dynobj.cc: Likewise.
11172 * dynobj.h: Likewise.
11173 * ehframe.cc: Likewise.
11174 * ehframe.h: Likewise.
11175 * errors.cc: Likewise.
11176 * expression.cc: Likewise.
11177 * fileread.cc: Likewise.
11178 * fileread.h: Likewise.
11179 * freebsd.h: Likewise.
11180 * i386.cc: Likewise.
11181 * icf.cc: Likewise.
11182 * incremental.h: Likewise.
11183 * layout.cc: Likewise.
11184 * layout.h: Likewise.
11185 * mapfile.cc: Likewise.
11186 * merge.cc: Likewise.
11187 * merge.h: Likewise.
11188 * object.cc: Likewise.
11189 * object.h: Likewise.
11190 * options.h: Likewise.
11191 * output.cc: Likewise.
11192 * output.h: Likewise.
11193 * parameters.cc: Likewise.
11194 * plugin.cc: Likewise.
11195 * powerpc.cc: Likewise.
11196 * reduced_debug_output.cc: Likewise.
11197 * reduced_debug_output.h: Likewise.
11198 * reloc.cc: Likewise.
11199 * reloc.h: Likewise.
11200 * resolve.cc: Likewise.
11201 * script-sections.cc: Likewise.
11202 * script.cc: Likewise.
11203 * script.h: Likewise.
11204 * sparc.cc: Likewise.
11205 * symtab.cc: Likewise.
11206 * symtab.h: Likewise.
11207 * target-select.cc: Likewise.
11208 * target-select.h: Likewise.
11209 * token.h: Likewise.
11210 * workqueue.cc: Likewise.
11211 * workqueue.h: Likewise.
11212 * x86_64.cc: Likewise.
11213
a0351a69
DK
112142009-12-10 Doug Kwan <dougkwan@google.com>
11215
11216 * arm.cc (attributes.h): New include.
11217 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11218 (Arm_relobj::~Arm_relobj): Delete object pointed by
11219 attributes_section_data_.
11220 (Arm_relobj::attributes_section_data): New method definition.
11221 (Arm_relobj::attributes_section_data_): New data member declaration.
11222 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11223 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11224 attributes_section_data_.
11225 (Arm_dynobj::attributes_section_data): New method definition.
11226 (Arm_dynobj::attributes_section_data_): New data member declaration.
11227 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11228 initialization value of may_use_blx_ to false.
2e702c99 11229 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
11230 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11231 object attributes to compute results instead of hard-coding.
11232 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11233 Target_arm::get_secondary_compatible_arch,
11234 Target_arm::set_secondary_compatible_arch
11235 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11236 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11237 New method declarations.
11238 (Target_arm::get_aeabi_object_attribute): New method definition.
11239 (Target_arm::attributes_section_data_): New data member declaration.
11240 (read_arm_attributes_section): New template definition.
11241 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11242 (Arm_dynobj::do_read_symbols): Ditto.
11243 (Target_arm::do_finalize_sections): Merge attributes sections from
11244 input. Check for BLX use after attributes section merging.
11245 Fix __exidx_start and __exidx_end visibility. Create an
11246 .ARM.attributes section if necessary.
11247 (Target_arm::get_secondary_compatible_arch,
11248 Target_arm::set_secondary_compatible_arch,
11249 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11250 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 11251 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
11252 New method definitions.
11253
b59befec
ILT
112542009-12-09 Ian Lance Taylor <iant@google.com>
11255
11256 * plugin.cc (Plugin::load): Don't cast from void* to a function
11257 pointer.
11258
1276bc89
ILT
112592009-12-09 Ian Lance Taylor <iant@google.com>
11260
11261 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11262 information fields.
11263
2f2de248
L
112642009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11265
11266 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11267 Replace two_file_shared_1.so with two_file_shared_2.so.
11268 * testsuite/Makefile.in: Regenerated.
11269
4f787271
DK
112702009-12-08 Doug Kwan <dougkwan@google.com>
11271
11272 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11273 (HFILES): Add attributes.h and int_encoding.h.
11274 * Makefile.in: Regenerate.
11275 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11276 function definitions to int_encoding.cc
11277 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11278 prototypes to int_encoding.h
11279 * reduced_debug_output.cc (int_encoding.h): New include.
11280 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11281 function definitions to int_encoding.cc
11282 (insert_into_vector, read_from_pointer): Move template definitions to
11283 int_encoding.h
11284 * attributes.cc: New file.
11285 * attributes.h: New file.
11286 * int_encoding.cc: New file.
11287 * int_encoding.h: New file.
11288
20b52f1a
RÁE
112892009-12-07 Rafael Avila de Espindola <espindola@google.com>
11290
11291 PR gold/11055
11292 * incremental-dump.cc (dump_incremental_inputs): New.
11293 (main): Use dump_incremental_inputs.
11294
53d7974c
L
112952009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11296
11297 PR gold/10893
11298 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11299 checking elfcpp::STT_FUNC.
11300 (Target_i386::Relocate::relocate): Likewise.
11301 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11302
11303 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11304 symbols from shared libraries into normal FUNC symbols.
11305
11306 * symtab.h (Symbol): Add is_func and use it.
11307
05a352e6
DK
113082009-12-05 Doug Kwan <dougkwan@google.com>
11309
11310 * arm.cc (Target_arm::arm_info): Initialize new fields
11311 attributes_section and attributes_vendor.
11312 * i386.cc (Target_i386::i386_info): Same.
11313 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11314 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11315 fields attributes_section and attributes_vendor.
53d7974c 11316 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11317 * target.h (Target::attributes_section, Target::attributes_vendor,
11318 Target::is_attributes_section, Target::attribute_arg_type,
11319 Target::attributes_order): New method definitions.
11320 (Target::Target_info::attributes_section,
11321 Target::Target_info::attributes_vendor): New fields.
11322 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11323 virtual method definitions.
11324 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11325 attributes_section and attributes_vendor.
11326 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11327
f4e5969c
DK
113282009-12-05 Doug Kwan <dougkwan@google.com>
11329
11330 * arm.cc: Update comments about interworking and stub generation.
11331 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11332 considered as non-PIC.
11333 (Arm_relocate_functions::base_abs): Fix formatting.
11334 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11335 of function to use GOT entry address instead of offset.
11336 (Target_arm::Scan::global): Issue an error if a symbol would need a
11337 PLT does not get one because it is untyped. Remove code to create
11338 dynamic symbols for relative branches.
11339 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11340 takes unsigned integer instead of boolean.
11341
1abce4a6
L
113422009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11343
11344 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11345 (two_file_test_LDADD): Likewise.
11346 (common_test_1_LDADD): Likewise.
11347 (exception_test_LDADD) Likewise.
11348 (weak_test_LDADD): Likewise.
11349 (many_sections_test_LDADD): Likewise.
11350 (initpri1_LDADD): Likewise.
11351 (script_test_1_LDADD): Likewise.
11352 (script_test_2_LDADD): Likewise.
11353 (justsyms_LDADD): Likewise.
11354 (binary_test_LDADD): Likewise.
11355 (large_LDADD): Likewise.
11356 * testsuite/Makefile.in: Regenerated.
11357
adcf2816 113582009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11359
adcf2816
L
11360 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11361 (Symbol_table::override_with_special): Likewise.
11362 (Symbol_table::add_from_object): Likewise.
11363
28e67f5d
RÁE
113642009-12-04 Rafael Avila de Espindola <espindola@google.com>
11365
11366 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11367 Don't set the data_offset twice.
11368
ae10a101
RÁE
113692009-12-04 Rafael Avila de Espindola <espindola@google.com>
11370
11371 * testsuite/Makefile.in: Regenerate.
11372
f59f41f3
DK
113732009-12-03 Doug Kwan <dougkwan@google.com>
11374
11375 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11376 (Target_arm::do_finalize_sections): Add parameter for symbol table
11377 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11378 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11379 parameter for symbol table pointer.
11380 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11381 an additional parameter for a pointer to symbol table.
11382 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11383 parameter for a symbol table pointer.
11384 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11385 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11386 Ditto.
11387 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11388 parameter for a symbol table pointer.
11389
ca55d848
RÁE
113902009-12-03 Rafael Avila de Espindola <espindola@google.com>
11391
11392 * incremental.cc (Incremental_inputs_header)
11393 (Incremental_inputs_header_write, Incremental_inputs_entry)
11394 (Incremental_inputs_entry_write): Move ...
11395 * incremental.h (Incremental_inputs_header)
11396 (Incremental_inputs_header_write, Incremental_inputs_entry)
11397 (Incremental_inputs_entry_write): here.
11398
3aec4f9c
RÁE
113992009-12-02 Rafael Avila de Espindola <espindola@google.com>
11400
11401 * incremental.cc (make_sized_incremental_binary): Set the target.
11402 Error if it is incompatible.
11403 * output.h (Output_file): Add filename method.
11404
9c0ae74d
RÁE
114052009-12-02 Rafael Avila de Espindola <espindola@google.com>
11406
11407 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11408 from the get_* methods.
11409
a45500ae
RÁE
114102009-12-02 Rafael Avila de Espindola <espindola@google.com>
11411
11412 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11413 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11414 Write 0 for the data_offset of scripts.
11415
325e6408
RÁE
114162009-12-02 Rafael Avila de Espindola <espindola@google.com>
11417
11418 * testsuite/Makefile.am: Add the incremental_test.sh test.
11419 * testsuite/incremental_test.sh: New.
11420 * testsuite/incremental_test_1.c: New.
11421 * testsuite/incremental_test_2.c: New.
11422
954c3e2e
RÁE
114232009-12-01 Rafael Avila de Espindola <espindola@google.com>
11424
703d02da 11425 * incremental-dump.cc (main): Fix typos.
954c3e2e 11426
f8086623
RÁE
114272009-11-27 Rafael Avila de Espindola <espindola@google.com>
11428
11429 PR gold/11025
11430 * incremental-dump.cc (main): Use llu to print 64 bit values.
11431
3b0dd6ac
L
114322009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11433 H.J. Lu <hongjiu.lu@intel.com>
11434
11435 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11436 $(LIBDL).
11437 (incremental_dump_LDADD): Likewise.
11438 * Makefile.in: Regenerated.
11439
a6d1ef57 114402009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11441
a6d1ef57
DK
11442 Revert:
11443
11444 2009-11-25 Doug Kwan <dougkwan@google.com>
11445
11446 * arm.cc (Target_arm::Target_arm): Move method definition
11447 outside of class definition. Add code to handle
11448 --target1-rel, --target1-abs and --target2= options.
11449 (Target_arm::get_reloc_reloc_type): Change method to be
11450 non-static and const.
11451 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11452 New data member declaration.
11453 (Target_arm::Scan::local, Target_arm::Scan::global,
11454 Target_arm::Relocate::relocate,
11455 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11456 Adjust call to Target_arm::get_real_reloc_type.
11457 (Target_arm::get_real_reloc_type): Use command line options
11458 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11459 * options.h (--target1-rel, --target1-abs, --target2): New
11460 ARM-only options.
11461
50aeb7d4
DK
114622009-11-25 Doug Kwan <dougkwan@google.com>
11463
11464 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11465 class definition. Add code to handle --target1-rel, --target1-abs
11466 and --target2= options.
11467 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11468 and const.
11469 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11470 member declaration.
11471 (Target_arm::Scan::local, Target_arm::Scan::global,
11472 Target_arm::Relocate::relocate,
11473 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11474 call to Target_arm::get_real_reloc_type.
11475 (Target_arm::get_real_reloc_type): Use command line options to
11476 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11477 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11478 options.
11479
51938283
DK
114802009-11-25 Doug Kwan <dougkwan@google.com>
11481
11482 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11483 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11484 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11485 formatting.
11486 (Arm_relocate_functions::thm_call): Replace body with a call to
11487 Arm_relocate_functions::thumb_branch_common.
11488 (Arm_relocate_functions::thm_jump24,
11489 Arm_relocate_functions::thm_xpc22): New method definitions.
11490 (Arm_relocate_functions::thumb_branch_common): New method definition.
11491 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11492 operator.
11493 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11494 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11495
e2b8f3c4
RÁE
114962009-11-24 Rafael Avila de Espindola <espindola@google.com>
11497
11498 * Makefile.am: Build incremental-dump
11499 * Makefile.in: Regenerate.
11500 * incremental-dump.cc: New.
11501 * incremental.cc (Incremental_inputs_header_data,
11502 Incremental_inputs_entry_data): Move to incremental.h
11503 * incremental.h: (Incremental_inputs_header_data,
11504 Incremental_inputs_entry_data): Move from incremental.cc
11505
bcba9aec
RÁE
115062009-11-24 Rafael Avila de Espindola <espindola@google.com>
11507
11508 * incremental.cc (Incremental_inputs_header,
11509 Incremental_inputs_header_write, Incremental_inputs_entry,
11510 Incremental_inputs_entry_write): Add a typedef with the data type.
11511
7c3afe08
RÁE
115122009-11-24 Rafael Avila de Espindola <espindola@google.com>
11513
11514 * incremental.cc (Incremental_inputs_header,
11515 Incremental_inputs_header_write, Incremental_inputs_entry,
11516 Incremental_inputs_entry_write): Update comment about which
11517 type has the filed descriptions.
11518
d204b6e9
DK
115192009-11-15 Doug Kwan <dougkwan@google.com>
11520
11521 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11522 (Arm_relocate_functions::arm_branch_common): Change method defintion
11523 in class definition to a method declaration and update list of formal
11524 parameters.
11525 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11526 Arm_relocation_functions::jump24): Adjust call to
11527 Arm_relocate_functions::arm_branch_common. Update list of formal
11528 parameters.
11529 (Arm_relocate_functions::xpc25): New method definition.
11530 (Arm_relocate_functions::arm_branch_common): Move method defintion
11531 out from class definition. Use stubs for mode-switching and extending
11532 branch ranges.
11533 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11534 specially. Change code to enable use of stubs in ARM branches.
11535
43d12afe
DK
115362009-11-10 Doug Kwan <dougkwan@google.com>
11537
11538 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11539 in method declaration.
11540 (Target_arm::relocate_stub): New method declaration.
11541 (Target_arm::default_target): Change to return a pointer instead of
11542 a const reference.
11543 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11544 Target_arm::default_target.
11545 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11546 method definition.
11547 (Target_arm::relocate_section): Adjust view.
11548 (Target_arm::relocate_stub): New method definition.
11549
ac33a407
DK
115502009-11-10 Doug Kwan <dougkwan@google.com>
11551
11552 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11553 a format warning.
11554 * incremental.cc (open_incremental_binary): Initialized local
11555 variables to avoid warnings.
11556 * object.cc (make_elf_object): Ditto.
11557 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11558 a format warning.
e1df38aa 11559
88ee28e9
L
11560009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11561
11562 PR gold/10930
11563 * testsuite/plugin_test.c: Include "config.h".
11564
2daedcd6
DK
115652009-11-09 Doug Kwan <dougkwan@google.com>
11566
11567 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11568 (arm_symbol_value): Remove.
11569 (Arm_relocate_functions::arm_branch_common,
11570 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11571 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11572 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11573 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11574 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11575 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11576 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11577 Arm_relocate_functions::thm_mobw_abs_nc,
11578 Arm_relocate_functions::thm_mov_abs,
11579 Arm_relocate_functions::movw_prel_nc,
11580 Arm_relocate_functions::thm_movt_abs,
11581 Arm_relocate_functions::movt_prel,
11582 Arm_relocate_functions::thm_movw_prel_nc,
11583 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11584 (Target_arm::Relocate::relocate): Only decompose address into two
11585 parts if relocation type uses the thumb-bit and pass the actual
11586 bit instead of a flag indicating that the thumb-bit is used. Adjust
11587 calls to methods in Arm_relocate_functions for this change.
11588
1276bc89 115892009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
11590
11591 PR 10925
11592 * reloc.cc: Instantiate
11593 Sized_relobj::initialize_input_to_output_maps and
11594 Sized_relobj:free_input_to_output_maps.
11595
e53ad1b5
ILT
115962009-11-06 Ian Lance Taylor <iant@google.com>
11597
11598 PR 10876
11599 * defstd.cc (in_segment): Set only_if_ref true for "end".
11600
eb44217c
DK
116012009-11-06 Doug Kwan <dougkwan@google.com>
11602
11603 * arm.cc (class Reloc_stub): Correct a comment.
11604 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11605 (Target_arm::scan_section_for_stubs): New method declaration.
11606 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11607 Change methods from private to protected.
11608 (Target_arm::do_may_relax): New method definition.
11609 (Target_arm::do_relax, Target_arm::group_sections,
11610 Target_arm::scan_reloc_for_stub,
11611 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11612 (Target_arm::arm_input_section_map_): New data member declaration.
11613 (Target_arm::scan_reloc_for_stub,
11614 Target_arm::scan_reloc_section_for_stubs,
11615 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11616 Target_arm::do_relax): New method definitions.
11617
5d329b7d
ILT
116182009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11619
11620 * configure.ac: Check for (struct stat)::st_mtim
11621 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11622 * config.in: Regenerate.
11623 * configure: Regenerate.
11624
96a0d71b
ILT
116252009-11-05 Ian Lance Taylor <iant@google.com>
11626
11627 PR 10910
11628 * output.cc (Output_segment::add_output_section): Add missing
11629 return statement.
11630
594c8e5e
ILT
116312009-11-04 Ian Lance Taylor <iant@google.com>
11632
11633 PR 10880
11634 * object.h (class Object): Add is_needed and set_is_needed
11635 methods. Add is_needed_ field. Make bool fields into bitfields.
11636 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11637 defined in a dynamic object and referenced by a regular object,
11638 set is_needed for the dynamic object.
11639 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11640 if the file is marked with as_needed and it is not needed.
11641
22b127cc
ILT
116422009-11-04 Ian Lance Taylor <iant@google.com>
11643
11644 PR 10887
11645 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11646 tags if data is discarded by linker script.
11647 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11648 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11649 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11650 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11651
f5c870d2
ILT
116522009-11-04 Ian Lance Taylor <iant@google.com>
11653
11654 * layout.cc (Layout::get_output_section): Add is_interp and
11655 is_dynamic_linker_section parameters. Change all callers.
11656 (Layout::choose_output_section): Likewise.
11657 (Layout::make_output_section): Likewise.
11658 (Layout::add_output_section_data): Add is_dynamic_linker_section
11659 parameter. Change all callers.
11660 * layout.h (class Layout): Update declarations.
11661 * output.h (class Output_section): Add is_interp, set_is_interp,
11662 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11663 Add is_interp_, is_dynamic_linker_section_ fields. Change
11664 generate_code_fills_at_write_ to a bitfield.
11665 * output.cc (Output_section::Output_sections): Initialize new
11666 fields.
11667 (Output_segment::add_output_section): Add do_sort parameter.
11668 Change all callers.
11669
1ae4d23b
ILT
116702009-11-03 Ian Lance Taylor <iant@google.com>
11671
11672 PR 10860
11673 * options.h (class General_options): Add --warn-common.
11674 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11675 merging two common symbols.
11676 (Symbol_table::should_override): Handle --warn-common when merging
11677 a common symbol with a defined symbol. Use report_resolve_problem
11678 for multiple definitions.
11679 (Symbol_table::report_resolve_problem): New function.
11680 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11681
55da9579
DK
116822009-11-03 Doug Kwan <dougkwan@google.com>
11683
11684 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11685 stub_factory_.
11686 (Target_arm::stub_factory): New method definition.
11687 (Target_arm::new_arm_input_section,
11688 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11689 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 11690 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
11691 New type definitions.
11692 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11693 member declarations.
11694 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11695 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11696 New method definitions.
11697
37a9ac43
ILT
116982009-11-03 Ian Lance Taylor <iant@google.com>
11699
11700 * options.h (class General_options): Add --warn_constructors.
11701
b3d6a3d4
ILT
117022009-11-03 Ian Lance Taylor <iant@google.com>
11703
11704 PR 10893
11705 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11706 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11707
934b01dd
ILT
117082009-11-03 Ian Lance Taylor <iant@google.com>
11709
11710 PR 10895
11711 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11712 --msgid-bugs-address.
11713 (install-pdf): New target.
11714 (install-data_yes): Look up one directory to find mkinstalldirs.
11715
03c1939b
L
117162009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11717
11718 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11719 tree.
11720
ebd95253
DK
117212009-10-30 Doug Kwan <dougkwan@google.com>
11722
11723 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11724
e9bbb538
DK
117252009-10-30 Doug Kwan <dougkwan@google.com>
11726
11727 * arm.cc (Stub_addend_reader): New struct template definition
11728 and partial specializations.
11729 (Stub_addend_reader::operator()): New method definition for a
11730 partially specialized template.
11731
d5b40221
DK
117322009-10-30 Doug Kwan <dougkwan@google.com>
11733
11734 * arm.cc (Arm_relobj::processor_specific_flags): New method
11735 definition.
11736 (Arm_relobj::do_read_symbols): New method declaration.
11737 (Arm_relobj::processor_specific_flags_): New data member declaration.
11738 (Arm_dynobj): New class definition.
11739 (Target_arm::do_finalize_sections): Add input_objects parameter.
11740 (Target_arm::do_adjust_elf_header): New method declaration.
11741 (Target_arm::are_eabi_versions_compatible,
11742 (Target_arm::merge_processor_specific_flags): New method declaration.
11743 (Target_arm::do_make_elf_object): New overloaded method definitions
11744 and declaration.
11745 (Arm_relobj::do_read_symbols): New method definition.
11746 (Arm_dynobj::do_read_symbols): Ditto.
11747 (Target_arm::do_finalize_sections): Add input_objects parameters.
11748 Merge processor-specific flags from all input objects.
11749 (Target_arm::are_eabi_versions_compatible,
11750 Target_arm::merge_processor_specific_flags,
11751 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11752 New method definitions.
11753 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11754 Input_objects pointer type parameter.
11755 * layout.cc (Layout::finalize): Pass input objects to target's.
11756 finalize_sections function.
11757 * output.cc (Output_file_header::do_sized_write): Set ELF file
11758 header's processor-specific flags.
11759 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11760 Input_objects pointer type parameter.
11761 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11762 * target.h (Input_objects): New forward class declaration.
11763 (Target::processor_specific_flags,
11764 Target::are_processor_specific_flags_sect): New method definitions.
11765 (Target::finalize_sections): Add input_objects parameter.
11766 (Target::Target): Initialize processor_specific_flags_ and
11767 are_processor_specific_flags_set_.
11768 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11769 parameter.
11770 (Target::set_processor_specific_flags): New method definition.
11771 (Target::processor_specific_flags_,
11772 Target::are_processor_specific_flags_set_): New data member
11773 declarations.
11774 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11775 Input_objects pointer type parameter.
11776
ebabffbd
DK
117772009-10-30 Doug Kwan <dougkwan@google.com>
11778
11779 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11780
ad0f2072
ILT
117812009-10-28 Ian Lance Taylor <iant@google.com>
11782
11783 * object.h (class Relobj): Drop options parameter from
11784 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11785 do_scan_relocs, do_relocate. Change all callers.
11786 (class Sized_relobj): Drop options parameters from
11787 do_gc_process_relocs, do_scan_relocs, do_relocate,
11788 do_relocate_sections, relocate_sections, emit_relocs_scan,
11789 emit_relocs_scan_reltype. Change all callers.
11790 (struct Relocate_info): Remove options field and all references to
11791 it.
11792 * reloc.h (class Read_relocs): Remove options constructor
11793 parameter and options_ field. Change all callers.
11794 (class Gc_process_relocs, class Scan_relocs): Likewise.
11795 (class Relocate_task): Likewise.
11796 * target-reloc.h (scan_relocs): Remove options parameter. Change
11797 all callers.
11798 (scan_relocatable_relocs): Likewise.
11799 * target.h (class Sized_target): Remove options parameter from
11800 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11801 all callers.
11802 * gc.h (gc_process_relocs): Remove options parameter. Change all
11803 callers.
11804 * arm.cc: Update functions to remove options parameters.
11805 * i386.cc: Likewise.
11806 * powerpc.cc: Likewise.
11807 * sparc.cc: Likewise.
11808 * x86_64.cc: Likewise.
11809 * testsuite/testfile.cc: Likewise.
11810
8ffa3667
DK
118112009-10-28 Doug Kwan <dougkwan@google.com>
11812
11813 * arm.cc (Arm_relobj): New class definition.
e1df38aa 11814 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
11815 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11816 New method definitions.
11817
40f36857
CC
118182009-10-28 Cary Coutant <ccoutant@google.com>
11819
11820 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11821 (Plugin::cleanup_done_): New member.
11822 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11823 (Plugin_manager::cleanup_done_): Remove.
11824 (Plugin_manager::add_input_file): Edit error message.
11825 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11826 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11827
2c849493
ILT
118282009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11829
11830 * fileread.cc: (File_read::View::~View): Use the new
11831 data_ownership_ filed.
11832 (File_read::~File_read): Dispose the new whole_file_view_.
11833 (File_read::open): Mmap the whole file if needed.
11834 (File_read::open): Use whole_file_view_ instead of contents_.
11835 (File_read::find_view): Use whole_file_view_ if applicable.
11836 (File_read::do_read): Use whole_file_view_ instead of contents_.
11837 (File_read::make_view): Use whole_file_view_ instead of contents_,
11838 update File_read::View::View call.
11839 (File_read::find_or_make_view): Update File_read::View::View
11840 call.
11841 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11842 remove contents_
11843 (File_read::View::Data_ownership): New enum.
11844 (File_read::View::View): Replace bool mapped_ with Data_ownership
11845 argument.
11846 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11847 (File_read::View::data_ownership_): New field.
11848 (File_read::contents_): Remove (replaced by whole_file_view_).
11849 (File_read::whole_file_view_): New field.
11850 * options.h (class General_options): Add --keep-files-mapped.
11851
24998053
CC
118522009-10-27 Cary Coutant <ccoutant@google.com>
11853
11854 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11855 * testsuite/Makefile.am (plugin_test_5): New test case.
11856 * testsuite/Makefile.in: Regenerate.
11857
72adc4fa
DK
118582009-10-25 Doug Kwan <dougkwan@google.com>
11859
11860 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11861 from private to protected to allow access by child class.
11862 (Sized_relobj::do_relocate_sections): New method declaration.
11863 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 11864 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
11865 Sized_relobj::relocate_sections. Instantiate template explicitly
11866 for different target sizes and endianity.
11867
07f508a2
DK
118682009-10-24 Doug Kwan <dougkwan@google.com>
11869
11870 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11871 (Arm_input_section::as_arm_input_section): New method.
11872 (Arm_output_section): New class definition.
11873 (Arm_output_section::create_stub_group,
11874 Arm_output_section::group_sections): New method definitions.
11875
10ad9fe5
DK
118762009-10-22 Doug Kwan <dougkwan@google.com>
11877
11878 * arm.cc (Arm_input_section): New class definition.
11879 (Arm_input_section::init, Arm_input_section:do_write,
11880 Arm_input_section::set_final_data_size,
11881 Arm_input_section::do_reset_address_and_file_offset): New method
11882 definitions.
11883
56ee5e00
DK
118842009-10-21 Doug Kwan <dougkwan@google.com>
11885
11886 * arm.cc (Stub_table, Arm_input_section): New forward class
11887 declarations.
11888 (Stub_table): New class defintion.
11889 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11890 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11891 New method definition.
11892
b569affa
DK
118932009-10-21 Doug Kwan <dougkwan@google.com>
11894
11895 * arm.cc: Update copyright comments.
11896 (Target_arm): New forward class template declaration.
11897 (Arm_address): New type.
11898 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11899 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11900 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11901 constants.
11902 (Insn_template): Same.
11903 (DEF_STUBS): New macro.
11904 (Stub_type): New enum type.
11905 (Stub_template): New class definition.
11906 (Stub): Same.
11907 (Reloc_stub): Same.
11908 (Stub_factory): Same.
11909 (Target_arm::Target_arm): Initialize may_use_blx_ and
11910 should_force_pic_veneer_.
11911 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11912 Target_arm::should_force_pic_veneer,
11913 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11914 Target_arm::using_thumb_only, Target_arm:;default_target): New
11915 method defintions.
11916 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11917 New data member declarations.
11918 (Insn_template::size, Insn_template::alignment): New method defintions.
11919 (Stub_template::Stub_template): New method definition.
11920 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11921 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11922 (Stub_factory::Stub_factory): New method definition.
11923 * gold.h (string_hash): New template.
11924 * output.h (Input_section_specifier::hash_value): Use
11925 gold::string_hash.
11926 (Input_section_specifier::string_hash): Remove.
11927 * stringpool.cc (Stringpool_template::string_hash): Use
11928 gold::string_hash.
11929
6c172549
DK
119302009-10-20 Doug Kwan <dougkwan@google.com>
11931
11932 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11933 symbols of relaxed input sections.
11934 * output.h (Output_section::find_relaxed_input_section): Make
11935 method public.
11936
c5617f2f
DK
119372009-10-16 Doug Kwan <dougkwan@google.com>
11938
11939 * dynobj.cc (Versions::Versions): Initialize version_script_.
11940 Only insert base version symbol definition for a shared object
11941 if version script defines any version versions.
11942 (Versions::define_base_version): New method definition.
11943 (Versions::add_def): Check that base version is not needed.
11944 (Versions::add_need): Define base version lazily.
11945 * dynobj.h (Versions::define_base_version): New method declaration.
11946 (Versions::needs_base_version_): New data member declaration.
11947 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11948 (check_DATA): Add no_version_test.stdout.
11949 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11950 New make rules.
11951 * testsuite/Makefile.in: Regenerate.
11952 * testsuite/no_version_test.c: New file.
11953 * testsuite/no_version_test.sh: Ditto.
11954
3c12dcdb
DK
119552009-10-16 Doug Kwan <dougkwan@google.com>
11956
11957 * expression.cc (class Segment_start_expression): New class definition.
11958 (Segment_start_expression::value): New method definition.
11959 (script_exp_function_segment_start): Return a new
11960 Segment_start_expression.
11961 * gold/script-c.h (script_saw_segment_start_expression): New function
11962 prototype.
11963 * script-sections.cc (Script_sections::Script_sections): Initialize
11964 SAW_SEGMENT_START_EXPRESSION_ to false.
11965 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11966 and -Tbbs options to specify section addresses if given in
11967 command line and no SEGMENT_START expression is seen in a script.
11968 * script-sections.h (Script_sections::saw_segment_start_expression,
11969 Script_sections::set_saw_segment_start_expression): New method
11970 definition.
11971 (Script_sections::saw_segment_start_expression_): New data member
11972 declaration.
11973 * script.cc (script_saw_segment_start_expression): New function.
11974 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11975 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11976 script_test_7.sh and script_test_8.sh.
11977 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11978 script_test_8.stdout.
11979 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11980 (script_test_6, script_test_6.stdout, script_test_7,
11981 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11982 * Makefile.in: Regenerate.
11983 * testsuite/script_test_6.sh: New file.
11984 * testsuite/script_test_6.t: Same.
11985 * testsuite/script_test_7.sh: Same.
11986 * testsuite/script_test_7.t: Same.
11987 * testsuite/script_test_8.sh: Same.
11988
64b1ae37
DK
119892009-10-16 Doug Kwan <dougkwan@google.com>
11990
11991 * output.cc (Output_segment::set_section_list_address): Cast
11992 expressions to unsigned long long type to avoid format warnings.
11993
661be1e2
ILT
119942009-10-15 Ian Lance Taylor <iant@google.com>
11995
12edd763 11996 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 11997 dot assignment to script_sections_.
12edd763
ILT
11998 * script-sections.cc (Script_sections::add_dot_assignment):
11999 Initialize if necessary.
12000
68b6574b
ILT
12001 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12002 program headers with no load segment if there is a linker script.
12003
661be1e2
ILT
12004 * layout.cc (Layout::set_segment_offsets): Align the file offset
12005 to the segment aligment for -N or -n with no load segment.
12006 * output.cc (Output_segment::add_output_section): Don't crash if
12007 the first section is a TLS section.
12008 (Output_segment::set_section_list_addresses): Print an error
12009 message if the address moves backward in a linker script.
12010 * script-sections.cc
12011 (Output_section_element_input::set_section_addresses): Don't
12012 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12013 (Orphan_output_section::set_section_addresses): Likewise.
12014
f15f61a7
DK
120152009-10-15 Doug Kwan <dougkwan@google.com>
12016
12017 * layout.cc (Layout::finish_dynamic_section): Generate tags
12018 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12019 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12020 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12021
82bb573a
ILT
120222009-10-14 Ian Lance Taylor <iant@google.com>
12023
12024 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12025 fields.
12026 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12027 data_shdr fields of relinfo.
12028 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12029 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12030 R_386_TLS_LDO_32, adjust based on section flags.
12031 (Target_i386::Relocate::fix_up_ldo): Remove.
12032
374ad285
ILT
120332009-10-13 Ian Lance Taylor <iant@google.com>
12034
12035 Add support for -pie.
12036 * options.h (class General_options): Add -pie and
12037 --pic-executable.
12038 (General_options::output_is_position_independent): Test -pie.
12039 (General_options::output_is_executable): Return true if not shared
12040 and not relocatable.
12041 (General_options::output_is_pie): Remove.
12042 * options.cc (General_options::finalize): Reject incompatible uses
12043 of -pie.
12044 * gold.cc (queue_middle_tasks): A -pie link is not static.
12045 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12046 * symtab.cc (Symbol::final_value_is_known): Return false if
12047 output_is_position_independent.
12048 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
12049 output_is_position_independent.
12050 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
12051 output_is_position_independent.
12052 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
12053 output_is_position_independent.
12054 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
12055 two_file_pie_test.
12056 (basic_pie_test.o, basic_pie_test): New targets.
12057 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12058 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12059 (two_file_pie_test): New target.
12060 * testsuite/Makefile.in: Rebuild.
12061 * README: Remove note saying that -pie is not supported.
12062
c6585162
ILT
120632009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12064
12065 * options.h (class General_options): Add -init and -fini.
12066 * layout.cc (Layout::finish_dynamic_section): Emit
12067 given init and fini functions.
12068
032ce4e9
ST
120692009-10-13 Sriraman Tallam <tmsriram@google.com>
12070
12071 * gc.h (gc_process_relocs): Check if icf is enabled using new
12072 function.
12073 * gold.cc (queue_initial_tasks): Likewise.
12074 (queue_middle_tasks): Likewise.
12075 * object.cc (do_layout): Likewise.
12076 * symtab.cc (is_section_folded): Likewise.
12077 * main.cc (main): Likewise.
12078 * reloc.cc (Read_relocs::run): Likewise.
12079 (Sized_relobj::do_scan_relocs): Likewise.
12080 * icf.cc (is_function_ctor_or_dtor): New function.
12081 (Icf::find_identical_sections): Check if function is ctor or dtor when
12082 safe icf is chosen.
12083 * options.h (General_options::icf): Change option to be an enum.
12084 (Icf_status): New enum.
12085 (icf_enabled): New method.
12086 (icf_safe_folding): New method.
12087 (set_icf_status): New method.
12088 (icf_status_): New variable.
12089 * (options.cc) (General_options::finalize): Set icf_status_.
12090 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12091 icf_test and icf_keep_unique_test to use the --icf enum flag.
12092 * testsuite/icf_safe_test.sh: New file.
e1df38aa 12093 * testsuite/icf_safe_test.cc: New file.
032ce4e9 12094
f345227a
ST
120952009-10-12 Sriraman Tallam <tmsriram@google.com>
12096
12097 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
12098 includes to gc.h and icf.h.
12099 * arm.cc: Include gc.h.
12100 * gold.cc: Likewise.
12101 * i386.cc: Likewise.
12102 * powerpc.cc: Likewise.
12103 * sparc.cc: Likewise.
12104 * x86_64.cc: Likewise.
12105 * gc.h: Include icf.h.
12106
1c7814ed
ILT
121072009-10-11 Ian Lance Taylor <iant@google.com>
12108
12109 * plugin.cc: Include "gold.h" before other header files.
12110
ae3b5189
CD
121112009-10-10 Chris Demetriou <cgd@google.com>
12112
12113 * options.h (Input_file_argument::Input_file_type): New enum.
12114 (Input_file_argument::is_lib_): Replace with...
12115 (Input_file_argument::type_): New member.
12116 (Input_file_argument::Input_file_argument): Take Input_file_type
12117 'type' rather than boolean 'is_lib' as second argument.
12118 (Input_file_argument::is_lib): Use type_.
12119 (Input_file_argument::is_searched_file): New function.
12120 (Input_file_argument::may_need_search): Handle is_searched_file.
12121 * options.cc (General_options::parse_library): Support -l:filename.
12122 (General_options::parse_just_symbols): Update for Input_file_argument
12123 changes.
12124 (Command_line::process): Likewise.
12125 * archive.cc (Archive::get_file_and_offset): Likewise.
12126 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12127 * script.cc (read_script_file, script_add_file): Likewise.
12128 * fileread.cc (Input_file::Input_file): Likewise.
12129 (Input_file::will_search_for): Handle is_searched_file.
12130 (Input_file::open): Likewise.
12131 * readsyms.cc (Read_symbols::get_name): Likewise.
12132 * testsuite/Makefile.am (searched_file_test): New test.
12133 * testsuite/Makefile.in: Regenerate.
12134 * testsuite/searched_file_test.cc: New file.
12135 * testsuite/searched_file_test_lib.cc: New file.
12136
f3048a1d
ILT
121372009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12138 Ian Lance Taylor <iant@google.com>
12139
12140 * descriptor.cc: Include <cstdio> and "binary-io.h".
12141 (Descriptors::open): Open the files in binary mode always.
12142 * script.cc (Lex::get_token): Treat \r as whitespace.
12143
d4780e57
ILT
121442009-10-09 Ian Lance Taylor <iant@google.com>
12145
12146 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12147
d9a893b8
ILT
121482009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12149 Ian Lance Taylor <iant@google.com>
12150
12151 * configure.ac: Check for readv function also.
12152 * fileread.cc (readv): Define if not HAVE_READV.
12153 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12154 does not exist.
12155 * config.in: Regenerate.
12156 * configure: Regenerate.
12157
c0a62865
DK
121582009-10-09 Doug Kwan <dougkwan@google.com>
12159
12160 * layout.cc (Layout::make_output_section): Call target hook to make
12161 ordinary output section.
12162 (Layout::finalize): Adjust parameter list of call the
12163 Target::may_relax().
12164 * layout.h (class Layout::section_list): New method.
12165 * merge.h (Output_merge_base::entsize): Change visibility to public.
12166 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12167 New methods.
12168 (Output_merge_string::do_is_string): New method.
12169 * object.cc (Sized_relobj::do_setup): renamed from
12170 Sized_relobj::set_up.
12171 * object.h (Sized_relobj::adjust_shndx,
12172 Sized_relobj::initializ_input_to_output_maps,
12173 Sized_relobj::free_input_to_output_maps): Change visibilities to
12174 protected.
12175 (Sized_relobj::setup): Virtualize.
12176 (Sized_relobj::do_setup): New method declaration.
12177 (Sized_relobj::invalidate_section_offset,
12178 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12179 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12180 * options.cc (parse_int): New function.
12181 * options.h (parse_int): New declaration.
12182 (DEFINE_int): New macro.
12183 (stub_group_size): New option.
12184 * output.cc (Output_section::Output_section): Initialize memebers
12185 merge_section_map_, merge_section_by_properties_map_,
12186 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12187 (Output_section::add_input_section): Handled deferred code-fill
12188 generation and remove an old comment.
12189 (Output_section::add_relaxed_input_section): New method definition.
12190 (Output_section::add_merge_input_section): Use merge section by
12191 properties map to speed to search. Update merge section maps
12192 as appropriate.
12193 (Output_section::build_relaxation_map): New method definition.
12194 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12195 Same.
12196 (Output_section::relax_input_section): Renamed to
12197 Output_section::convert_input_sections_to_relaxed_sections and change
12198 interface to take a vector of pointers to relaxed sections.
12199 (Output_section::find_merge_section,
12200 Output_section::find_relaxed_input_section): New method definitions.
12201 (Output_section::is_input_address_mapped,
12202 Output_section::output_offset, Output_section::output_address):
12203 Use output section data maps to speed up searching.
12204 (Output_section::find_starting_output_address): Add comments.
12205 (Output_section::do_write,
12206 Output_section::write_to_postprocessing_buffer): Do code-fill
12207 generation as appropriate.
12208 (Output_section::get_input_sections): Invalidate relaxed input section
12209 map.
12210 (Output_section::restore_states): Adjust type of checkpoint .
12211 Invalidate relaxed input section map.
12212 * output.h (Output_merge_base): New class declaration.
12213 (Input_section_specifier): New class defintion.
12214 (class Output_relaxed_input_section) Change base class to
12215 Output_section_data_build.
12216 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12217 base class initializer.
12218 (Output_section::add_relaxed_input_section): New method declaration.
12219 (Output_section::Input_section): Change visibility to protected.
2e702c99 12220 (Output_section::Input_section::relobj,
c0a62865
DK
12221 Output_section::Input_section::shndx): Handle relaxed input sections.
12222 Output_section::input_sections) Change visibility to protected. Also
12223 define overload to return a non-const pointer.
12224 (Output_section::Merge_section_properties): New class defintion.
12225 (Output_section::Merge_section_by_properties_map,
12226 Output_section::Output_section_data_by_input_section_map,
12227 Output_section::Relaxation_map): New types.
12228 (Output_section::relax_input_section): Rename method to
12229 Output_section::convert_input_sections_to_relaxed_sections and change
12230 interface to take a vector of relaxed section pointers.
12231 (Output_section::find_merge_section,
12232 Output_section::find_relaxed_input_section,
12233 Output_section::build_relaxation_map,
12234 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12235 New method declarations.
12236 (Output_section::merge_section_map_
12237 Output_section::merge_section_by_properties_map_,
12238 Output_section::relaxed_input_section_map_,
12239 Output_section::is_relaxed_input_section_map_valid_,
12240 Output_section::generate_code_fills_at_write_): New data members.
12241 * script-sections.cc
12242 (Output_section_element_input::set_section_addresses): Call
12243 current_data_size and addralign methods of relaxed input sections.
12244 (Orphan_output_section::set_section_addresses): Call current_data_size
12245 and addralign methods of relaxed input sections.
12246 * symtab.cc (Symbol_table::compute_final_value): Extract template
12247 from the body of Symbol_table::sized_finalize_symbol.
12248 (Symbol_table::sized_finalized_symbol): Call
12249 Symbol_table::compute_final_value.
12250 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12251 (Symbol_table::compute_final_value): New templated method declaration.
12252 * target.cc (Target::do_make_output_section): New method defintion.
12253 * target.h (Target::make_output_section): New method declaration.
12254 (Target::relax): Add more parameters for input objects, symbol table
12255 and layout. Adjust call to do_relax.
12256 (Target::do_make_output_section): New method declaration.
12257 (Target::do_relax): Add parameters for input objects, symbol table
12258 and layout.
12259
d446d6c4
ILT
122602009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12261
12262 * pread.c: Include stdio.h.
12263
bc06c745
ILT
122642009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12265
12266 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12267 defined.
12268
75aea3d0
ILT
122692009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12270
12271 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12272 Change read_shndx type to unsigned int.
12273 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12274 int.
12275 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12276 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12277 Change read_shndx type to unsigned int.
12278 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12279 int.
12280 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12281 * layout.cc (Layout::create_symtab_sections): Cast the result of
12282 local_symcount * symsize to off_t in the gold_assert.
12283
be8fcb75
ILT
122842009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12285
12286 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12287 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12288 R_ARM_BASE_ABS.
12289 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12290 (Arm_relocate_functions::thm_abs5): New function.
12291 (Arm_relocate_functions::abs12): New function.
12292 (Arm_relocate_functions::abs16): New function.
12293 (Arm_relocate_functions::base_abs): New function.
12294 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12295 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12296 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12297 R_ARM_BASE_ABS.
12298 (Scan::global): Likewise.
12299 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12300 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12301 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12302 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12303 R_ARM_BASE_ABS.
12304
c2a122b6
ILT
123052009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12306
12307 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12308 (Arm_relocate_functions::movt_prel): New function.
12309 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12310 (Arm_relocate_functions::thm_movt_prel): New function.
12311 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12312 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12313 (Scan::global, Relocate::relocate): Likewise.
12314 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12315
c4aa1e2d
ILT
123162009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12317
12318 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12319 Incremental_checker.
12320 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12321 unsigned int.
12322 (class Incremental_inputs_header): New class.
12323 (Incremental_inputs_header_writer): Edit comment.
12324 (Incremental_inputs_entry): New class.
12325 (Incremental_inputs_entry_writer): Edit comment.
12326 (Sized_incremental_binary::do_find_incremental_inputs_section):
12327 Add *strtab_shndx parameter, fill it.
12328 (Sized_incremental_binary::do_check_inputs): New method.
12329 (Incremental_checker::can_incrementally_link_output_file): Use
12330 Sized_incremental_binary::check_inputs.
12331 (Incremental_inputs::report_command_line): Save command line in
12332 command_line_.
12333 * incremental.h:
12334 (Incremental_binary::find_incremental_inputs_section): New
12335 method.
12336 (Incremental_binary::do_find_incremental_inputs_section): Add
12337 strtab_shndx parameter.
12338 (Incremental_binary::do_check_inputs): New pure virtual method.
12339 (Sized_incremental_binary::do_check_inputs): Declare.
12340 (Incremental_checker::Incremental_checker): Add incremental_inputs
12341 parameter, use it to initialize incremental_inputs_.
12342 (Incremental_checker::incremental_inputs_): New field.
12343 (Incremental_checker::command_line): New method.
12344 (Incremental_checker::inputs): New method.
12345 (Incremental_checker::command_line_): New field.
12346
c549a694
ILT
123472009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12348
12349 * incremental.cc: Include <cstdarg> and "target-select.h".
12350 (vexplain_no_incremental): New function.
12351 (explain_no_incremental): New function.
12352 (Incremental_binary::error): New method.
12353 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12354 method.
12355 (make_sized_incremental_binary): New function.
12356 (open_incremental_binary): New function.
12357 (can_incrementally_link_file): Add checks if output is ELF and has
12358 inputs section.
12359 * incremental.h: Include "elfcpp_file.h" and "output.h".
12360 (Incremental_binary): New class.
12361 (Sized_incremental_binary): New class.
12362 (open_incremental_binary): Declare.
12363 * object.cc (is_elf_object): Use
12364 elfcpp::Elf_recognizer::is_elf_file.
12365 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12366 * output.h (Output_file::filesize): New method.
12367
fd3c5f0b
ILT
123682009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12369
12370 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12371 New function.
12372 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12373 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12374 function.
12375 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12376 function.
12377 (Arm_relocate_functions::movw_abs_nc): New function.
12378 (Arm_relocate_functions::movt_abs): New function.
12379 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12380 (Arm_relocate_functions::thm_movt_abs): New function.
12381 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12382 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12383 (Scan::global): Likewise.
12384 (Relocate::relocate): Likewise.
12385 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12386
7f5309a5
ILT
123872009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12388
12389 * arm.cc (Arm_relocate_functions::got_prel) New function.
12390 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12391 (Relocate::relocate): Likewise.
12392 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12393
364c7fa5
ILT
123942009-10-06 Ian Lance Taylor <iant@google.com>
12395
12396 * options.h (class General_options): Define
12397 split_stack_adjust_size parameter.
12398 * object.h (class Object): Add uses_split_stack_ and
12399 has_no_split_stack_ fields. Add uses_split_stack and
12400 has_no_split_stack accessor functions. Declare
12401 handle_split_stack_section.
12402 (class Reloc_symbol_changes): Define.
12403 (class Sized_relobj): Define Function_offsets. Declare
12404 split_stack_adjust, split_stack_adjust_reltype, and
12405 find_functions.
12406 * object.cc (Object::handle_split_stack_section): New function.
12407 (Sized_relobj::do_layout): Call handle_split_stack_section.
12408 * dynobj.cc (Sized_dynobj::do_layout): Call
12409 handle_split_stack_section.
12410 * reloc.cc (Sized_relobj::relocate_sections): Call
12411 split_stack_adjust for executable sections in split_stack
12412 objects. Pass reloc_map to relocate_section.
12413 (Sized_relobj::split_stack_adjust): New function.
12414 (Sized_relobj::split_stack_adjust_reltype): New function.
12415 (Sized_relobj::find_functions): New function.
12416 * target-reloc.h: Include "object.h".
12417 (relocate_section): Add reloc_symbol_changes parameter. Change
12418 all callers.
12419 * target.h (class Target): Add calls_non_split method. Declare
12420 do_calls_non_split virtual method. Declare match_view and
12421 set_view_to_nop.
12422 * target.cc: Include "elfcpp.h".
12423 (Target::do_calls_non_split): New function.
12424 (Target::match_view): New function.
12425 (Target::set_view_to_nop): New function.
12426 * gold.cc (queue_middle_tasks): Give an error if mixing
12427 split-stack and non-split-stack objects with -r.
12428 * i386.cc (Target_i386::relocate_section): Add
12429 reloc_symbol_changes parameter.
12430 (Target_i386::do_calls_non_split): New function.
12431 * x86_64.cc (Target_x86_64::relocate_section): Add
12432 reloc_symbol_changes parameter.
12433 (Target_x86_64::do_calls_non_split): New function.
12434 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12435 parameter.
12436 * powerpc.cc (Target_powerpc::relocate_section): Add
12437 reloc_symbol_changes parameter.
12438 * sparc.cc (Target_sparc::relocate_section): Add
12439 reloc_symbol_changes parameter.
12440 * configure.ac: Call AM_CONDITIONAL for the default target.
12441 * configure: Rebuild.
12442 * testsuite/Makefile.am (TEST_AS): New variable.
12443 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12444 (check_DATA): Add split_i386 and split_x86_64 files.
12445 (SPLIT_DEFSYMS): Define.
12446 (split_i386_[1234n].o): New targets.
12447 (split_i386_[124]): New targets.
12448 (split_i386_[1234r].stdout): New targets.
12449 (split_x86_64_[1234n].o): New targets.
12450 (split_x86_64_[124]): New targets.
12451 (split_x86_64_[1234r].stdout): New targets.
12452 (MOSTLYCLEANFILES): Add new executables.
12453 * testsuite/split_i386.sh: New file.
12454 * testsuite/split_x86_64.sh: New file.
12455 * testsuite/split_i386_1.s: New file.
12456 * testsuite/split_i386_2.s: New file.
12457 * testsuite/split_i386_3.s: New file.
12458 * testsuite/split_i386_4.s: New file.
12459 * testsuite/split_i386_n.s: New file.
12460 * testsuite/split_x86_64_1.s: New file.
12461 * testsuite/split_x86_64_2.s: New file.
12462 * testsuite/split_x86_64_3.s: New file.
12463 * testsuite/split_x86_64_4.s: New file.
12464 * testsuite/split_x86_64_n.s: New file.
12465 * testsuite/testfile.cc (Target_test): Update relocation_section
12466 function.
12467 * testsuite/Makefile.in: Rebuild.
12468
e8a9fcda
ILT
124692009-10-06 Ian Lance Taylor <iant@google.com>
12470
12471 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12472 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12473 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12474 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12475 the address on ldo_addrs_.
12476 (Target_i386::Relocate::fix_up_ldo): New function.
12477
e99daf92
ILT
124782009-10-06 Rafael Espindola <espindola@google.com>
12479
12480 * plugin.cc (add_input_library): New.
12481 (Plugin::load): Add add_input_library to tv.
12482 (Plugin_manager::add_input_file): Add the is_lib argument.
12483 (add_input_file): Update call to Plugin_manager::add_input_file.
12484 (add_input_library): New.
12485 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12486
966d4097
DK
124872009-09-30 Doug Kwan <dougkwan@google.com>
12488
12489 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12490 symbol and call Symbol::may_need_copy_reloc to determine if
12491 a copy reloc is needed.
12492 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12493 nocopyreloc is given in command line.
12494 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12495 given in command line.
12496 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12497 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12498 of the removed Target_i386::may_need_copy_reloc.
12499 * options.h (copyreloc): New option with default value false.
12500 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12501 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12502 instead of the removed Target_powerpc::may_need_copy_reloc.
12503 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12504 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12505 instead of the removed Target_sparc::may_need_copy_reloc.
12506 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12507 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12508 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12509 instead of the removed Target_x86_64::may_need_copy_reloc.
12510
029ba973
ILT
125112009-09-30 Ian Lance Taylor <iant@google.com>
12512
12513 * object.h (class Object): Remove target_ field, and target,
12514 sized_target, and set_target methods.
12515 (Object::sized_target): Remove.
12516 (class Sized_relobj): Update declarations. Remove sized_target.
12517 * object.cc (Sized_relobj::setup): Remove target parameter.
12518 Change all callers.
12519 (Input_objects::add_object): Don't do anything with the target.
12520 (make_elf_sized_object): Add punconfigured parameter. Change all
12521 callers. Set or test parameter target.
12522 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12523 Change all callers.
12524 * parameters.cc (Parameters::set_target): Change parameter type to
12525 be non-const.
12526 (Parameters::default_target): Remove.
12527 (set_parameters_target): Change parameter type to be non-const.
12528 (parameters_force_valid_target): New function.
12529 (parameters_clear_target): New function.
12530 * parameters.h (class Parameters): Update declarations. Remove
12531 default_target method. Add sized_target and clear_target
12532 methods. Change target_ to be non-const.
12533 (set_parameters_target): Update declaration.
12534 (parameters_force_valid_target): Declare.
12535 (parameters_clear_target): Declare.
12536 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12537 as NULL if we aren't searching.
12538 (Add_symbols::run): Don't check for compatible target.
12539 * fileread.cc (Input_file::open_binary): Call
12540 parameters_force_valid_target.
12541 * gold.cc (queue_middle_tasks): Likewise.
12542 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12543 set_target on object.
12544 * dynobj.h (class Sized_dynobj): Update declarations.
12545 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12546 make_elf_object returns NULL.
12547 (Archive::include_member): Don't check whether object target is
12548 compatible.
12549 * output.cc (Output_section::add_input_section): Get target from
12550 parameters.
12551 (Output_section::relax_input_section): Likewise.
12552 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12553 parameters.
12554 (Sized_relobj::do_scan_relocs): Likewise.
12555 (Sized_relobj::relocate_sections): Likewise.
12556 * resolve.cc (Symbol_table::resolve): Likewise.
12557 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12558 parameter. Change all callers.
12559 (Symbol_table::add_from_object): Get target from parameters.
12560 (Symbol_table::add_from_relobj): Don't check object target.
12561 (Symbol_table::add_from_dynobj): Likewise.
12562 (Symbol_table::define_special_symbol): Get target from
12563 parameters.
12564 * symtab.h (class Symbol_table): Update declaration.
12565 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12566 parameter. Change all callers. Clear parameter target.
12567 (Binary_test): Test target here.
12568 * testsuite/object_unittest.cc (gold_testsuite): Remove
12569 target_test_pointer parameter. Change all callers.
12570 (Object_test): Test target here.
12571
a6a22b83
ILT
125722009-09-26 Ian Lance Taylor <iant@google.com>
12573
12574 * testsuite/initpri1.c: Don't try to use constructor priorities if
12575 compiling with gcc before 4.3.
12576
6a8f49fe
ILT
125772009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12578
12579 * testsuite/retain_symbols_file_test.sh (check_present): Change
12580 output file name to retain_symbols_file_test.stdout.
12581 (check_absent): Likewise.
12582
8c604651
CS
125832009-09-18 Craig Silverstein <csilvers@google.com>
12584
12585 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12586 * options.cc: Include <cerrno> and <fstream>.
12587 (General_options::finalize): Parse -retain-symbols-file tag.
12588 * options.h: New flag.
12589 (General_options): New method should_retain_symbol, new
12590 variable symbols_to_retain.
12591 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12592 should_retain_symbol map.
12593 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12594 * testsuite/Makefile.in: Regenerate.
12595 * testsuite/retain_symbols_file_test.sh: New file.
12596
ca58b19f
NC
125972009-09-18 Nick Clifton <nickc@redhat.com>
12598
12599 * po/es.po: Updated Spanish translation.
12600
20e6d0d6
DK
126012009-09-17 Doug Kwan <dougkwan@google.com>
12602
12603 * debug.h (DEBUG_RELAXATION): New constant.
12604 (DEBUG_ALL): Add DEBUG_RELAXATION.
12605 (debug_string_to_enum): Add relaxation debug option.
12606 * layout.cc
12607 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12608 Layout::Relaxation_debug_check::read_sections,
12609 Layout::Relaxation_debug_check::read_sections): New method definitions.
12610 (Layout::Layout): Initialize data members
12611 record_output_section_data_from_scrips_,
12612 script_output_section_data_list_ and relaxation_debug_check_.
12613 (Layout::save_segments, Layout::restore_segments,
12614 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12615 Layout::relaxation_loop_body): New method definitions.
12616 (Layout::finalize): Support relaxation. Move section layout code to
12617 Layout::relaxation_loop_body.
12618 (Layout::set_asection_address_from_script): Move code for orphan
12619 section placement out.
12620 (Layout::place_orphan_sections_in_script): New method definition.
12621 * layout.h (Output_segment_headers, Output_file_header):
12622 New forward class declarations.
12623 (Layout::~Layout): Define.
12624 (Layout::new_output_section_data_from_script): New method definition.
12625 (Layout::place_orphan_sections_in_script): New method declaration.
12626 (Layout::Segment_states): New type declaration.
12627 (Layout::save_segments, Layout::restore_segments,
12628 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12629 Layout::relaxation_loop_body): New method declarations.
12630 (Layout::Output_section_data_list): New type declaration.
12631 (Layout::Relaxation_debug_check): New class definition.
12632 (Layout::record_output_section_data_from_script_,
12633 Layout::script_output_section_data_list_, Layout::segment_states_,
12634 Layout::relaxation_debug_check_): New data members.
12635 * output.cc: (Output_section_headers::do_size): New method definition.
12636 (Output_section_headers::Output_section_headers): Move size
12637 computation to Output_section_headers::do_size.
12638 (Output_segment_headers::do_size): New method definition.
e1df38aa 12639 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
12640 Output_file_header::do_size and call it.
12641 (Output_file_header::do_size): New method definition.
12642 (Output_data_group::Output_data_group): Adjust call to
12643 Output_section_data.
12644 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12645 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 12646 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
12647 RELAXED_INPUT_SECTION_CODE.
12648 (Output_section::Output_section): Initialize data member checkpoint_.
12649 (Output_section::~Output_section): Delete checkpoint object pointed
12650 by checkpoint_.
12651 (Output_section::add_input_section): Always add an Input_section if
12652 relaxing.
12653 (Output_section::add_merge_input_section): Add assert.
12654 (Output_section::relax_input_section): New method definition.
12655 (Output_section::set_final_data_size): Set load address to zero for
12656 an unallocated section.
12657 (Output_section::do_address_and_file_offset_have_reset_values):
12658 New method definition.
12659 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12660 Handle relaxed input section.
12661 (Output_section::sort_attached_input_sections): Checkpoint input
12662 section list lazily.
12663 (Output_section::get_input_sections): Change type of input_sections to
12664 list of Simple_input_section pointers. Checkpoint input section list
12665 lazily. Also handle relaxed input sections.
12666 (Output_section::add_input_section_for_script): Take a reference to
12667 a Simple_input_section object instead of Relobj pointer and section
12668 index as parameter. Handle relaxed input sections.
12669 (Output_section::save_states, Output_section::restore_states): New
12670 method definitions.
12671 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12672 (Output_data::is_data_size_fixed): New method definition.
12673 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12674 if it is fixed.
12675 (Output_data::address_and_file_offset_have_reset_values): New method
12676 definition.
12677 (Output_data::do_address_and_file_offset_have_reset_values): New method
12678 definition.
12679 (Output_data::set_data_size): Check that data size is not fixed.
12680 (Output_data::fix_data_size): New method definition.
12681 (Output_data::is_data_size_fixed_): New data member.
12682 (Output_section_headers::set_final_data_size): New method definition.
12683 (Output_section_headers::do_size): New method declaration.
12684 (Output_segment_headers::set_final_data_size): New method definition.
12685 (Output_segment_headers::do_size): New method declaration.
12686 (Output_file_header::set_final_data_size)::New method definition.
12687 (Output_file_header::do_size)::New method declaration.
12688 (Output_section_data::Output_section_data): Add new parameter
12689 is_data_size_fixed and use it to fix data size.
12690 (Output_data_const::Output_data_const): Adjust call to base class
12691 constructor and fix data size.
12692 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12693 base class constructor and fix data size.
12694 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12695 base class constructor and fix data size.
12696 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12697 class constructor and fix data size.
12698 (Output_data_group::set_final_data_size): New method definition.
12699 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12700 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12701 class constructor and fix data size.
12702 (Output_relaxed_input_section): New class definition.
12703 (Output_section::Simple_input_section): New class definition.
12704 (Output_section::get_input_sections): Adjust parameter list.
12705 (Output_section::add_input_section_for_script): Same.
12706 (Output_section::save_states, Output_section::restore_states,
12707 Output_section::do_address_and_file_offset_have_reset_values,
12708 (Output_section::Input_section::Input_section): Handle
12709 RELAXED_INPUT_SECTION_CODE. Add new overload for
12710 Output_relaxed_input_section.
12711 (Output_section::Input_section::is_input_section,
12712 Output_section::Input_section::set_output_section): Handle relaxed
12713 input section.
12714 (Output_section::Input_section::is_relaxed_input_section,
12715 Output_section::Input_section::output_section_data,
12716 Output_section::Input_section::relaxed_input_section): New method
12717 definitions.
12718 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12719 value.
12720 (Output_section::Input_section::u1_): Update comments.
12721 (Output_section::Input_section::u2_): Add new union member poris.
12722 (Output_section::Checkpoint_output_section): New classs definition.
12723 (Output_section::relax_input_section): New method declaration.
12724 (Output_section::checkpoint_): New data member.
12725 (Output_segment): Update comments.
12726 (Output_segment::Output_segment): Un-privatize copy constructor.
12727 (Output_segment::operator=): Un-privatize.
12728 * script-sections.cc (Output_section_element::Input_section_list):
12729 Change element type to Output_section::Simple_input_section.
12730 (Output_section_element_dot_assignment::set_section_addresses):
12731 Register output section data for relaxation clean up.
12732 (Output_data_exression::Output_data_expression): Adjust call to base
12733 constructor to fix data size.
12734 (Output_section_element_data::set_section_addresses): Register
12735 Output_data_expression object for relaxation clean up.
12736 (struct Input_section_info): Replace Relobj pointer and section index
12737 pair with Output_section::Simple_input_section and Convert struct to a
12738 class.
12739 (Input_section_sorter::operator()): Adjust access to
e1df38aa 12740 Input_section_info data member to use accessors.
20e6d0d6
DK
12741 (Output_section_element_input::set_section_addresses): Use layout
12742 parameter. Adjust code to use Output_section::Simple_input_section
12743 and Input_secction_info classes. Register filler for relaxation
12744 clean up.
12745 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12746 and section index pair with Output_section::Simple_input_section
12747 class. Adjust code accordingly.
12748 (Phdrs_element::release_segment): New method definition.
12749 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12750 segment list.
12751 (Script_sections::release_segments): New method definition.
12752 * gold/script-sections.h (Script_sections::release_segments): New
12753 method declaration.
12754 * gold/target.h (Target::may_relax, Target::relax,
12755 Target::do_may_relax, Target::do_relax): New method definitions.
12756
5e445df6
ILT
127572009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12758
12759 * arm.cc (has_signed_unsigned_overflow): New function.
12760 (Arm_relocate_functions::abs8): New function.
12761 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12762 (Target_arm::Scan::global): Likewise.
12763 (Target_arm::relocate::relocate): Likewise.
12764 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12765 Likewise.
12766
8c604651 127672009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
12768
12769 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12770 * testsuite/Makefile.in: Regenerate.
12771
1e9cc1c2
NC
127722009-09-11 Nick Clifton <nickc@redhat.com>
12773
12774 * po/gold.pot: Updated by the Translation project.
12775
6a89f575
CC
127762009-09-08 Cary Coutant <ccoutant@google.com>
12777
12778 * output.cc (Output_file::open): Add execute permission to empty file.
12779 * testsuite/Makefile.am (permission_test): New test.
12780 * testsuite/Makefile.in: Regenerate.
12781
fdcac5af
ILT
127822009-09-02 Ian Lance Taylor <iant@google.com>
12783
12784 * output.cc (Output_file::resize): Call map_no_anonymous rather
12785 than map.
12786
44453f85
ILT
127872009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12788
12789 * gold.cc: Include "incremental.h".
12790 (queue_initial_tasks): Call Incremental_checker methods.
12791 * incremental.cc: Include "output.h".
12792 (Incremental_checker::can_incrementally_link_output_file): New
12793 method.
12794 * incremental.h (Incremental_checker): New class.
12795
12796 * output.cc (Output_file::open_for_modification): New method.
12797 (Output_file::map_anonymous): Changed return type to bool. Record
12798 map in base_ field.
12799 (Output_file::map_no_anonymous): New method, broken out of map.
12800 (Output_file::map): Use map_no_anonymous and map_anonymous.
12801 * output.h (class Output_file): Update declarations.
12802
293c1386
CC
128032009-08-24 Cary Coutant <ccoutant@google.com>
12804
12805 * options.h (Command_line::Pre_options): New class.
12806 (Command_line::pre_options): New member.
12807 * options.cc (gold::options::ready_to_register): New variable.
12808 (One_option::register_option): Do nothing if not registering options.
12809 Assert if same short option registered twice.
12810 (General_options::General_options): Turn off option registration when
12811 done constructing.
12812 (Command_line::Pre_options::Pre_options): New constructor.
12813
f773f3d2
CC
128142009-08-24 Cary Coutant <ccoutant@google.com>
12815
06a73cfe
CC
12816 * options.h (General_options::no_keep_memory): Remove incorrect
12817 short option.
f773f3d2 12818
a15af8e2
RW
128192009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12820
12821 * Makefile.am (am__skiplex, am__skipyacc): New.
12822 * Makefile.in: Regenerate.
12823
c462b41b
RW
128242009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12825
14ec8efd
RW
12826 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12827 (INCLUDES): ... this.
12828 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12829 (AM_CPPFLAGS): Renamed from ...
12830 (INCLUDE): ... this.
12831 * Makefile.in, testsuite/Makefile.in: Regenerate.
12832
81ecdfbb
RW
12833 * Makefile.in: Regenerate.
12834 * aclocal.m4: Likewise.
12835 * config.in: Likewise.
12836 * configure: Likewise.
12837 * testsuite/Makefile.in: Likewise.
12838
c462b41b
RW
12839 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12840 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12841 * Makefile.in: Regenerate.
12842 * testsuite/Makefile.in: Regenerate.
12843
2da73f13
CC
128442009-08-19 Cary Coutant <ccoutant@google.com>
12845
12846 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12847 symbols in shared libraries overridden by hidden or internal symbols
12848 in the main program.
12849
2db70501
CD
128502009-08-19 Chris Demetriou <cgd@google.com>
12851
12852 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12853 checking source file names in error messages.
12854
f733487b
DK
128552009-08-18 Doug Kwan <dougkwan@google.com>
12856
12857 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12858 an elcpp::Ehdr as parameter. Adjust call to set_target.
12859 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12860 an elfcpp::Ehdr as parameter.
12861 * object.cc (Object::set_target): Remove the version that looks up
12862 a target and sets it.
12863 (Sized_relobj::setup): Take a Target object instead of
12864 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12865 (make_elf_sized_object): Find target and ask target to
12866 make an ELF object.
12867 * object.h: (Object::set_target): Remove the version that looks up
12868 a target and sets it.
12869 (Sized_relobj::setup): Take a Target object instead of
12870 an elfcpp:Ehdr as parameter.
12871 * target.cc: Include dynobj.h.
12872 (Target::do_make_elf_object_implementation): New.
2e702c99 12873 (Target::do_make_elf_object): New.
f733487b
DK
12874 * target.h (Target::make_elf_object): New template declaration.
12875 (Target::do_make_elf_object): New method declarations.
12876 (Target::do_make_elf_object_implementation): New template declaration.
12877
cc70f101
ILT
128782009-08-14 Ian Lance Taylor <iant@google.com>
12879
12880 * gold.h (FUNCTION_NAME): Define.
12881 (gold_unreachable): Use FUNCTION_NAME.
12882
ef5e0cb1
ST
128832009-08-12 Sriraman Tallam <tmsriram@google.com>
12884
12885 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12886 symbol in the --keep-unique list is not found.
12887
48c187ce
ST
128882009-08-12 Sriraman Tallam <tmsriram@google.com>
12889
12890 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12891 been maked as --keep-unique.
12892 (Icf::unfold_section): New function.
12893 * icf.h (Icf::unfold_section): New function.
12894 * options.h (General_options::keep_unique): New option.
12895 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12896 * testsuite/Makefile.in: Regenerate.
12897 * testsuite/icf_keep_unique_test.sh: New file.
12898 * testsuite/icf_keep_unique_test.cc: New file.
12899
645afe0c
CC
129002009-08-12 Cary Coutant <ccoutant@google.com>
12901
12902 PR 10471
12903 * resolve.cc (Symbol_table::resolve): Check for references from
12904 dynamic objects to hidden and internal symbols.
12905 * testsuite/Makefile.am (hidden_test.sh): New test.
12906 * testsuite/Makefile.in: Regenerate.
12907 * testsuite/hidden_test.sh: New script.
12908 * testsuite/hidden_test_1.c: New test source.
12909 * testsuite/hidden_test_main.c: New test source.
12910
11af873f
DK
129112009-08-11 Doug Kwan <dougkwan@google.com>
12912
12913 * arm.cc: Update comments.
12914 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12915 segment to locate the .ARM.exidx section if present.
12916
b9f7d72d
DK
129172009-08-09 Doug Kwan <dougkwan@google.com>
12918
12919 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12920 patch.
12921
ddd3c53c
ST
129222009-08-07 Sriraman Tallam <tmsriram@google.com>
12923 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12924 compiler warnings.
12925
27721062
ST
129262009-08-06 Sriraman Tallam <tmsriram@google.com>
12927
12928 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12929 valid tls_segment only for non-debug-section relocations.
12930 * testsuite/Makefile.am: Add gc_tls_test.
12931 * testsuite/Makefile.in: Regenerate.
12932 * testsuite/gc_tls_test.cc: New file.
12933 * testsuite/gc_tls_test.sh: New file.
12934
ef15dade 129352009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 12936
ef15dade
ST
12937 * icf.cc: New file.
12938 * icf.h: New file.
12939 * Makefile.am (CCFILES): Add icf.cc.
12940 (HFILES): Add icf.h
12941 * Makefile.in: Regenerate.
12942 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12943 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12944 section, symbol and addend information for the relocs.
12945 * gold.cc (queue_middle_tasks): Call identical code folding.
12946 * gold.h: Add defines for multimap.
12947 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12948 to the call of finalize_local_symbols.
12949 * main.cc (main): Create object of class Icf.
12950 * object.cc (Sized_relobj::do_layout): Allow this function to be
12951 called twice during icf.
12952 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12953 to sections marked as identical by icf.
12954 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12955 when available.
12956 (Sized_relobj::do_section_entsize): New function.
12957 * object.h (Object::section_entsize): New function.
12958 (Object::do_section_entsize): New pure virtual function.
12959 (Relobj::finalize_local_symbols): Add new parameter.
12960 (Relobj::do_section_entsize): New function.
12961 * options.h (General_options::icf): New option.
12962 (General_options::icf_iterations): New option.
12963 (General_options::print_icf_sections): New option.
12964 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12965 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12966 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12967 icf.
12968 * symtab.cc (Symbol_table::is_section_folded): New function.
12969 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12970 to sections marked as identical by icf.
12971 * symtab.h (Symbol_table::set_icf): New function.
12972 (Symbol_table::icf): New function.
12973 (Symbol_table::is_section_folded): New function.
12974 (Symbol_table::icf_): New data member.
12975 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12976 * testsuite/Makefile.am: Add commands to build icf_test.
12977 * testsuite/Makefile.in: Regenerate.
12978 * testsuite/icf_test.sh: New file.
12979 * testsuite/icf_test.cc: New file.
12980
c3b65ac4
CD
129812009-07-24 Chris Demetriou <cgd@google.com>
12982
12983 * layout.cc (is_compressible_debug_section): Fix incorrect
12984 comment about compressed section names.
12985
1caf2c51
ILT
129862009-07-20 Ian Lance Taylor <ian@airs.com>
12987
12988 PR 10419
12989 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12990
1ef4d87f
ILT
129912009-07-16 Ian Lance Taylor <iant@google.com>
12992
12993 PR 10400
12994 * layout.h: #include <map>.
12995 (class Kept_section): Change from struct to class. Add accessors
12996 and setters. Add section size to Comdat_group mapping. Change
12997 Comdat_group to std::map. Add is_comdat_ field. Add
12998 linkonce_size field in union.
12999 (class Layout): Update declaration of find_or_add_kept_section.
13000 Don't declare find_kept_object.
13001 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13002 parameter. Add object, shndx, is_comdat, and is_group_name
13003 parameters. Change all callers. Adjust for new Kept_section.
13004 (Layout::find_kept_object): Remove.
13005 * object.cc (Sized_relobj::include_section_group): Update use of
13006 Kept_section. Rename secnum to shndx. Only record
13007 Kept_comdat_section if sections are the same size.
13008 (Sized_relobj::include_linkonce_section): Update use of
13009 Kept_section. Only record Kept_comdat_section if sections are the
13010 same size. Set size of linkonce section.
13011 (Sized_relobj::map_to_kept_section): Update call to
13012 get_kept_comdat_section.
13013 * object.h (class Sized_relobj): Rename fields in
13014 Kept_comdat_section to drop trailing underscores; change object
13015 field to Relobj*. Change Kept_comdat_section_table to store
13016 struct rather than pointer.
13017 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13018 Add kept_object and kept_shndx parameters. Change all callers.
13019 (Sized_relobj::get_kept_comdat_section): Change return type to
13020 bool. Add kept_object and kept_shndx parameters. Change all
13021 callers.
13022 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13023 Layout::find_or_add_kept_section.
13024
37c3b7b0
ILT
130252009-07-09 Ian Lance Taylor <iant@google.com>
13026
13027 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13028 Reserve space in the hash table.
13029
98fa85cb
ILT
130302009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13031
13032 * fileread.cc (File_read::get_mtime): New method.
13033 * fileread.h (Timespec): New structure.
13034 (File_read::get_mtime): New method.
13035 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13036 Renamed from timestamp_nsec.
13037 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13038 Elf_Xword.
e1df38aa 13039 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 13040 timestamp_nsec.
e1df38aa 13041 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
13042 (Incremental_inputs::report_obejct): Save mtime; style fix.
13043 (Incremental_inputs::report_script): Save mtime; style fix.
13044 (Incremental_inputs::finalize_inputs): Style fix.
13045 (Incremental_inputs::finalize): Style fix.
13046 (Incremental_inputs::create_input_section_data): Store inputs
13047 mtime.
13048 * incremental.h (Incremental_inputs::report_script): Add mtime
13049 argument.
13050 (Incremental_inputs::Input_info::Input_info): Intialize only one
13051 union member.
13052 (Incremental_inputs::Input_info::archive): Move to nameless
13053 union.
13054 (Incremental_inputs::Input_info::obejct): Move to nameless union.
13055 (Incremental_inputs::Input_info::script): Move to nameless union.
13056 (Incremental_inputs::mtime): New field.
13057 * script.cc (read_input_script): Pass file mtime to
13058 Incremental_input.
13059 * script.h (Script_info::inputs): Style fix.
13060
c9d70757
ILT
130612009-07-01 Ian Lance Taylor <ian@airs.com>
13062
13063 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13064 instead of 32.
13065
9c547ec3
ILT
130662009-06-24 Ian Lance Taylor <iant@google.com>
13067
13068 PR 10156
13069 * layout.cc (Layout::choose_output_section): If we find an
13070 existing section, update the flags.
13071 (Layout::create_notes): New function, broken out of
13072 Layout::finalize.
13073 (Layout::finalize): Don't create note sections.
13074 (Layout::create_note): Don't crash if linker script discards
13075 section.
13076 (Layout::create_gold_note): Likewise.
13077 (Layout::create_build_id): Likewise. Don't set
13078 after_input_sections on the section.
13079 (Layout::create_executable_stack_info): Remove target parameter.
13080 Change caller.
13081 * layout.h (class Layout): Declare create_notes. Update
13082 declaration of create_executable_stack_info.
13083 * gold.cc (queue_middle_tasks): Call create_notes.
13084 * output.cc (Output_section::update_flags_for_input_section): Move
13085 here from output.h. If SHF_ALLOC flag is newly set, mark address
13086 invalid.
13087 * output.h (Output_data::mark_address_invalid): New function.
13088 (class Output_section): Only declare, not define,
13089 update_flags_for_input_section. Remove set_flags.
13090
55458500
ILT
130912009-06-24 Ian Lance Taylor <iant@google.com>
13092
13093 * script-sections.cc (Output_section_definition::
13094 set_section_addresses): Rename shadowing local load_address to
13095 laddr.
13096
1307d6cd
ILT
130972009-06-24 Ian Lance Taylor <iant@google.com>
13098
13099 PR 10244
13100 * reloc.cc (relocate_sections): Skip empty relocation sections.
13101
ec3f783e
ILT
131022009-06-23 Ian Lance Taylor <iant@google.com>
13103
13104 PR 10156
13105 * layout.cc (Layout::create_note): Use choose_output_section
13106 rather than make_output_section.
13107
459c9f1c
ILT
131082009-06-23 Ian Lance Taylor <iant@google.com>
13109
13110 PR 10237
13111 * options.cc (General_options::parse_V): Set printed_version_.
13112 (General_options::General_options): Initialize printed_version_.
13113 * options.h (class General_options): Add printed_version_ field.
13114 * gold.cc (queue_initial_tasks): If there are no input files,
13115 don't give a fatal error if we printed the version information.
13116 (queue_middle_tasks): If using -r with a shared object, give a
13117 fatal error rather than an ordinary error.
13118
1518dc8f
ILT
131192009-06-23 Ian Lance Taylor <iant@google.com>
13120
13121 PR 10219
13122 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13123 (Layout::make_output_section): Set have_stabstr_section_ if we see
13124 a .stab*str section.
13125 (Layout::finalize): Call link_stabs_sections.
13126 (Layout::link_stabs_sections): New file.
13127 * layout.h (class Layout): Add have_stabstr_section_ field.
13128 Declare link_stabs_sections.
13129
3d857b98
DK
131302009-06-23 Doug Kwan <dougkwan@google.com>
13131
13132 * Makefile.am (libgold_a_LIBADD): New.
13133 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 13134 * Makefile.in: Regenerate.
3d857b98
DK
13135 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13136 * configure: Regenerate.
13137 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13138 * fileread.cc: Include sys/state.h
13139 * gold.h: Declare memmem and strndup if found missing.
13140 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13141
0639a6f6
ILT
131422009-06-23 Ian Lance Taylor <iant@google.com>
13143
13144 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13145 * configure: Rebuild.
13146
8d63875c
ILT
131472009-06-23 Ian Lance Taylor <iant@google.com>
13148
13149 PR 10147
13150 * object.cc (Object::section_contents): Don't try to get a view if
13151 the section has length zero.
13152 (Object::handle_gnu_warning_section): If the section is empty, use
13153 the name of the section as the warning.
13154
f7c8a183
ILT
131552009-06-23 Ian Lance Taylor <iant@google.com>
13156
13157 PR 10133
13158 * stringpool.h (class Stringpool_template): Add optimize_ field.
13159 (Stringpool_template::set_optimize): New function.
13160 * stringpool.cc (Stringpool_template::Stringpool_template):
13161 Initialize optimize_ field.
13162 (Stringpool_template::set_string_offsets): Test local optimize
13163 fild rather than parameter.
13164 * layout.cc (Layout::Layout): Call set_optimize on the section
13165 name stringpool.
13166
e6a307ba
ILT
131672009-06-22 Ian Lance Taylor <iant@google.com>
13168
13169 PR 10030
13170 * yyscript.y: Parse TARGET.
13171 * script.cc (script_set_target): New function.
13172 * script-c.h (script_set_target): Declare.
13173 * options.cc (General_options::string_to_object_format): Rename
13174 from string_to_object_format in anonymous namespace. Change
13175 callers.
13176 * options.h (class General_options): Declare
13177 string_to_object_format.
13178
3ee173de
ILT
131792009-06-22 Ian Lance Taylor <iant@google.com>
13180
13181 * script-sections.cc (Script_sections::create_segments): Don't put
13182 program headers in a PT_LOAD segment if -n or -N.
13183
131842009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
13185
13186 PR 10141
13187 * options.h (class General_options): Add -z lazy and -z now. Sort
13188 -z options into alphabetical order.
13189 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13190
cd6739a1 131912009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
13192
13193 * layout.cc (Layout::make_output_section): Call
13194 Target::new_output_section.
13195 (Layout::attach_allocated_section_to_segment): Put large section
13196 sections in a separate load segment with the large segment flag
13197 set.
13198 (Layout::segment_precedes): Sort large data segments after other
13199 load segments.
13200 (align_file_offset): New static function.
13201 (Layout::set_segment_offsets): Use align_file_offset.
13202 * output.h (class Output_section): Add is_small_section_ and
13203 is_large_section_ fields.
13204 (Output_section::is_small_section): New function.
13205 (Output_section::set_is_small_section): New function.
13206 (Output_section::is_large_section): New function.
13207 (Output_section::set_is_large_section): New function.
13208 (Output_section::is_large_data_section): New function.
13209 (class Output_segment): Add is_large_data_segment_ field.
13210 (Output_segment::is_large_data_segment): New function.
13211 (Output_segment::set_is_large_data_segment): New function.
13212 * output.cc (Output_section::Output_section): Initialize new
13213 fields.
13214 (Output_segment::Output_segment): Likewise.
13215 (Output_segment::add_output_section): Add assertion that large
13216 data sections always go in large data segments. Force small data
13217 sections to the end of the list of data sections. Force small BSS
13218 sections to the start of the list of BSS sections. For large BSS
13219 sections to the end of the list of BSS sections.
13220 * symtab.h (class Symbol): Declare is_common_shndx.
13221 (Symbol::is_defined): Check Symbol::is_common_shndx.
13222 (Symbol::is_common): Likewise.
13223 (class Symbol_table): Define enum Commons_section_type. Update
13224 declarations. Add small_commons_ and large_commons_ fields.
13225 * symtab.cc (Symbol::is_common_shndx): New function.
13226 (Symbol_table::Symbol_table): Initialize new fields.
13227 (Symbol_table::add_from_object): Put small and large common
13228 symbols in the right list.
13229 (Symbol_table::sized_finalized_symbol): Check
13230 Symbol::is_common_shndx.
13231 (Symbol_table::sized_write_globals): Likewise.
13232 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13233 common symbol lists. Don't call do_allocate_commons_list if the
13234 list is empty.
13235 (Symbol_table::do_allocate_commons_list): Remove is_tls
13236 parameter. Add comons_section_type parameter. Change all
13237 callers. Handle small and large common symbols.
13238 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13239 Symbol::is_common_shndx.
13240 * resolve.cc (symbol_to_bits): Likewise.
13241 * target.h (Target::small_common_shndx): New function.
13242 (Target::small_common_section_flags): New function.
13243 (Target::large_common_shndx): New function.
13244 (Target::large_common_section_flags): New function.
13245 (Target::new_output_section): New function.
13246 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13247 small_common_section_flags, and large_common_section_flags
13248 fields.
13249 (Target::do_new_output_section): New virtual function.
13250 * arm.cc (Target_arm::arm_info): Initialize new fields.
13251 * i386.cc (Target_i386::i386_info): Likewise.
13252 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13253 Likewise.
13254 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13255 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13256 (Target_x86_64::do_new_output_section): New function.
13257 * configure.ac: Define conditional MCMODEL_MEDIUM.
13258 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13259 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13260 (large_LDFLAGS): Define.
13261 * testsuite/large.c: New file.
13262 * testsuite/testfile.cc (Target_test::test_target_info):
13263 Initialize new fields.
13264 * configure, testsuite/Makefile.in: Rebuild.
13265
bb04269c
DK
132662009-06-05 Doug Kwan <dougkwan@google.com>
13267
13268 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13269 * Makefile.in: Regenerate.
bb04269c
DK
13270 * i386.cc (class Target_i386): Define new virtual method to
13271 override do_is_local_label_name in parent.
13272 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13273 local symbols if --discard-locals or -X is given.
13274 * options.h (class General_options): Declare new options
13275 '--discard-locals' and '-X' for discarding locals.
13276 * target.h (class Target): Define new methods is_local_label_name.
13277 Declare new virtual method do_is_local_label_name.
13278 * target.cc: New file.
13279 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13280 (check_SCRIPTS): Add discard_locals_test.sh.
13281 (check_DATA): Add discard_local_tests.syms.
13282 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13283 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13284 * testsuite/Makefile.in: Regenerate.
13285 * testsuite/discard_locals_test.c: New file.
13286 * testsuite/discard_locals_test.sh: Same.
13287
805bb01c
DK
132882009-06-05 Doug Kwan <dougkwan@google.com>
13289
13290 * object.cc (Sized_relobj::Sized_relobj): Initialize
13291 discarded_eh_frame_shndx_ to -1U.
13292 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13293 section.
13294 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13295 a discarded .eh_frame section.
13296 (Sized_relobj::do_finalize_local_symbols): Ditto.
13297 * object.h (class Sized_relobj): Declare new member
13298 discarded_eh_frame_shndx_.
13299 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13300 (local_labels_test.o, local_labels_test): New rules.
13301 * testsuite/Makefile.in: Regenerate.
13302
1dcd334d
DK
133032009-06-04 Doug Kwan <dougkwan@google.com>
13304
13305 * layout.cc (Layout::section_name_mapping): Add mapping for
13306 special ARM sections.
13307
96d49306
DK
133082009-06-03 Doug Kwan <dougkwan@google.com>
13309
13310 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13311 (utils::has_overflow): Same.
13312
dff16297
ILT
133132009-06-03 Ian Lance Taylor <iant@google.com>
13314
13315 * layout.cc (Layout::section_name_mapping): New array, replacing
13316 Layout::linkonce_mapping.
13317 (Layout::section_name_mapping_count): New variable, replacing
13318 Layout::linkonce_mapping_count.
13319 (Layout::linkonce_output_name): Remove.
13320 (Layout::output_section_name): Rewrite.
13321 * layout.h (class Layout): Rename Linkonce_mapping to
13322 Section_name_mapping, linkonce_mapping to section_name_mapping,
13323 linkonce_mapping_count to section_name_mapping_count. Don't
13324 declare linkonce_output_name.
13325
c121c671
DK
133262009-06-03 Doug Kwan <dougkwan@google.com>
13327
13328 * gold/arm.cc (namespace utils): New.
13329 (Target_arm::reloc_is_non_pic): Define new method.
13330 (class Arm_relocate_functions): New.
13331 (Target_arm::Relocate::relocate): Handle relocation types used by
13332 Android.
13333
07800fab
ILT
133342009-06-03 Ian Lance Taylor <iant@google.com>
13335
13336 * arm.cc (Target_arm::scan::global): Use || instead of |.
13337
c121c671
DK
133382009-06-02 Doug Kwan <dougkwan@google.com>
13339
13340 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13341 issued_non_pic_error_.
13342 (class Target_arm::Scan): Declare new method check_non_pic.
13343 Define new method symbol_needs_plt_entry.
13344 Declare new data member issued_non_pic_error_.
13345 (class Target_arm::Relocate): Declare new method
13346 should_apply_static_reloc.
13347 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13348 (Target_arm::Scan::check_non_pic): Define new method.
13349 (Target_arm::Scan::local): Handle a small subset of reloc types used
13350 by Android.
13351 (Target_arm::Scan::local): Same.
13352 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13353
b19b0c6d
ILT
133542009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13355
13356 * incremental.cc (Incremental_inputs::report_command_line): Filter
13357 out --incremental-* options.
13358
94cdfcff
DK
133592009-05-29 Doug Kwan <dougkwan@google.com>
13360
13361 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13362 template class.
13363 (class Target_arm): Update comment.
13364 (Target_arm::Target_arm): Initialize new data members GOT_,
13365 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13366 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13367 and Target_arm::rel_dyn_section.
13368 Declare new_enum Target_arm::Got_type.
13369 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13370 and DYNBSS_.
13371 Update commments for member do_dynsym_value.
13372 (Target_arm::got_size, Target_arm::plt_section,
13373 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13374 new methods inside class defintion.
13375 (Target_arm::got_section): Define new method.
13376 (Target_arm::rel_dyn_section): Same.
13377 (Output_data_plt_arm): New template class.
13378 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13379 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13380 (Output_data_plt_arm::add_entry): Same.
13381 (Output_data_plt_arm::first_plt_entry): Define new
13382 static data member for PLT instruction template.
13383 (Output_data_plt_arm::plt_entry): Same.
13384 (Output_data_plt_arm::do_write): Define new method.
13385 (Target_arm::make_plt_entry): Same.
13386 (Target_arm::do_finalize_sections): Same.
13387 (Target_arm::do_dynsym_value): Same.
13388
4a657b0d
DK
133892009-05-28 Doug Kwan <dougkwan@google.com>
13390
13391 * Makefile.am (TARGETSOURCES): Add arm.cc.
13392 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13393 * Makefile.in: Regenerate.
13394 * arm.cc: New file.
13395 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13396
e7ae8c36
DK
133972009-05-26 Doug Kwan <dougkwan@google.com>
13398
13399 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13400 (General_options::check_excluded_libs): Strip off directories in
13401 archive name before matching like GNU ld does.
13402 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13403 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13404 (exclude_libs_test_LDFLAGS): Add linker option
13405 -Wl,--exclude-libs,libexclude_libs_test_3
13406 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13407 an explicit archive without using -l.
13408 (alt/libexclude_libs_test_3.a): New make rule.
13409 * testsuite/Makefile.in: Regenerate.
13410 * testsuite/exclude_libs_test.c : Declare lib3_default().
13411 (main): Call it.
13412 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13413 * exclude_libs_test_3.c: New file.
13414
f12e7348
NC
134152009-05-26 Nick Clifton <nickc@redhat.com>
13416
13417 * po/id.po: New Indonesian translation.
13418 * po/gold.pot: Updated template file.
13419
4daadc0d
ST
134202009-05-22 Sriraman Tallam <tmsriram@google.com>
13421
e1df38aa 13422 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13423 gc_comdat_test files. Add -Wl,--gc-sections to build
13424 gc_comdat_test.
13425 * testsuite/Makefile.in: Regenerate.
13426 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13427
531813ad
ST
134282009-05-21 Sriraman Tallam <tmsriram@google.com>
13429
13430 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13431 kept comdat section was garbage collected.
13432 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13433 * testsuite/Makefile.in: Regenerate.
13434 * testsuite/gc_comdat_test.sh: New file.
13435 * testsuite/gc_comdat_test_1.cc: New file.
13436 * testsuite/gc_comdat_test_2.cc: New file.
13437
65514900
CC
134382009-05-19 Doug Kwan <dougkwan@google.com>
13439
13440 * archive.cc (Archive::Archive): Move constructor from archive.h
13441 to here. Initialize no_export_.
13442 (Archive::get_elf_object_for_member): Set no_export flag of object.
13443 * archive.h (Archive::Archive): Move constructor body to
13444 archive.cc.
13445 (Archive::no_export): New method.
13446 (Archive::no_export_): New field.
13447 * object.h (Object::Object): Initialize no_export_ to false.
13448 (Object::no_export, Object::set_no_export): New methods.
13449 (Object::no_export_): New field.
13450 * options.cc (General_options::parse_exclude_libs): New method.
13451 (General_options::check_excluded_libs) Same.
13452 * options.h (exclude_libs): New option.
13453 (General_options::check_excluded_libs): New method declaration.
13454 (General_options::excluded_libs_): New field.
13455 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13456 default or protected visibility if an object has no-export flag set.
13457 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13458 (check_SCRIPTS): Add exclude_libs_test.sh.
13459 (check_DATA): Add exclude_libs_test.syms.
13460 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13461 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13462 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13463 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13464 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13465 libexclude_libs_test_2.a): New rules.
13466 * testsuite/Makefile.in: Regenerate.
13467 * testsuite/exclude_libs_test.c: New file.
13468 * testsuite/exclude_libs_test.sh: Ditto.
13469 * testsuite/exclude_libs_test_1.c: Ditto.
13470 * testsuite/exclude_libs_test_2.c: Ditto.
13471
1b77ea50
ILT
134722009-05-15 Ian Lance Taylor <iant@google.com>
13473
13474 * configure.ac: Check for declarations for cases where libiberty.h
13475 checks HAVE_DECL_xxx.
13476 * configure, config.in: Rebuild.
13477
072fe7ce
ILT
134782009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13479
13480 * gold.h (Incremental_argument_list): Remove (invalid) forward
13481 declaration.
13482 * incremental.cc (Incremental_inputs::report_achive): New method.
13483 (Incremental_inputs::report_object): New method.
13484 (Incremental_inputs::report_script): New method.
13485 (Incremental_inputs::finalize_inputs): New method.
13486 (Incremental_inputs::finalize): Call finalize_inputs().
13487 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13488 Create inputs entries.
13489 * incremental.h (Incremental_input_type): New enum.
13490 (Incremental_inputs::Incremental_input): Initialize new fields.
13491 (Incremental_inputs::report_inputs): New method.
13492 (Incremental_inputs::report_achive): New method.
13493 (Incremental_inputs::report_object): New method.
13494 (Incremental_inputs::report_script): New method.
13495 (Incremental_inputs::finalize_inputs): New method.
13496 (Incremental_inputs::Input_info): New struct.
13497 (Incremental_inputs::Input_info_map): New typedef.
13498 (Incremental_inputs::lock_): New field.
13499 (Incremental_inputs::Inputs_): New field.
13500 (Incremental_inputs::Inputs_map): New field.
13501 * main.cc (main): Call Incremental_input::report_inputs.
13502 * options.h (Input_argument_list): Typedef moved from
13503 Input_arguments.
13504 (Input_file_group::Files): Remove, use ::Input_argument_list.
13505 (Input_file_group::Input_argument_list): Remove, use
13506 ::Input_argument_list.
13507 * plugin.cc (Plugin_manager::add_input_file): Add error in
13508 incremental build.
13509 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13510 functions.
13511 * script.cc (read_input_script): Call
13512 Incremental_input::report_script.
13513 * script.h (Script_info): New class.
13514
b0481b0b
ILT
135152009-04-27 Ian Lance Taylor <iant@google.com>
13516
13517 * x86_64.cc (do_adjust_output_section): Set entsize to
13518 plt_entry_size.
13519
b22a5a41 135202009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13521
13522 * output.cc (Output_file::close): After short writes, continue
13523 writing from the correct offset in the buffer being written.
13524
40fde488
CD
135252009-04-23 Chris Demetriou <cgd@google.com>
13526
13527 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13528 * configure: Regenerate.
13529 * config.in: Regenerate.
13530 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13531 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13532
3ce2c28e
ILT
135332009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13534
13535 * incremental.cc (Incremental_inputs_header_data): Renamed from
13536 Incremental_input_header_data.
13537 (Incremental_inputs_header_data::data_size): New field.
13538 (Incremental_inputs_header_data::put_input_file_count): Renamed
13539 from input_file_count.
13540 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13541 from command_line_offset.
13542 (Incremental_inputs_header_data::put_reserved): Renamed from
13543 put_reserved.
13544 (Incremental_inputs_entry_data): Renamed from
13545 Incremental_input_entry_data.
13546 (Incremental_inputs_entry_data::data_size): New field.
13547 (Incremental_inputs::report_command_line): New method.
13548 (Incremental_inputs::finalize): New method.
13549 (Incremental_inputs::create_incremental_inputs_data): New method.
13550 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13551 * incremental.h: New file.
13552 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13553 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13554 incremental builds.
703d02da 13555 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13556 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13557 (Layout::create_incremental_info_sections): New method.
13558 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13559 * main.cc (main): Notify Incremental_input of the command line.
13560
e55bde5e
ILT
135612009-04-01 Ian Lance Taylor <iant@google.com>
13562 Mikolaj Zalewski <mikolajz@google.com>
13563
13564 * gold.h (reserve_unordered_map): Define, three versions, one for
13565 each version of Unordered_map.
13566 * layout.cc (Layout::Layout): Remove options parameter. Add
13567 number_of_input_files parameter. Don't initialize options_.
13568 Initialize number_of_input_files_ and resized_signatures_. Move
13569 sections_are_attached_.
13570 (Layout::layout_group): Reserve space for group_signatures_.
13571 (Layout::find_or_add_kept_section): Change name parameter to be a
13572 reference. Resize signatures_ map when it gets large enough.
13573 (Layout::layout_eh_frame): Use parameters->options() instead of
13574 this->options_.
13575 (Layout::make_output_section): Likewise.
13576 (Layout::attach_allocated_section_to_segment): Likewise.
13577 (Layout::finalize, Layout::create_executable_stack): Likewise.
13578 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13579 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13580 * layout.h (class Layout): Update declarations. Remove options_
13581 field. Add number_of_input_files_ and resized_signatures_
13582 fields. Move sections_are_attached_ field.
13583 * main.cc (main): Pass number of input files to Layout
13584 constructor. Don't pass options.
13585
154b857c
ILT
135862009-03-30 Ian Lance Taylor <iant@google.com>
13587
13588 * ffsll.c (ffsll): Correct implementation.
13589
2f35ab9b
ILT
135902009-03-27 Ian Lance Taylor <iant@google.com>
13591
fd03461a
ILT
13592 * ffsll.c: New file.
13593 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13594 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13595 * ftruncate.c (ftruncate): Declare before definition.
13596 * mremap.c (mremap): Likewise.
13597 * pread.c (pread): Likewise.
13598 * configure, Makefile.in, config.in: Rebuild.
13599
2f35ab9b
ILT
13600 * mremap.c: New file.
13601 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13602 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13603 (mremap): Declare if HAVE_MREMAP is not defined.
13604 * configure, Makefile.in, config.in: Rebuild.
13605
33aea2fd
CC
136062009-03-27 Cary Coutant <ccoutant@google.com>
13607
13608 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13609 position independent.
13610 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13611 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13612
6d479619
CC
136132009-03-24 Cary Coutant <ccoutant@google.com>
13614
13615 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13616 an executable.
13617 (needs_dynamic_reloc): Likewise.
13618
afc06bb8
ILT
136192009-03-24 Ian Lance Taylor <iant@google.com>
13620
13621 * yyscript.y (file_cmd): Recognize EXTERN.
13622 (extern_name_list, extern_name_list_body): New nonterminals.
13623 * script.cc (script_add_extern): Define.
13624 * script-c.h (script_add_extern): Declare.
13625
f6060a4d
ILT
136262009-03-24 Rafael Avila de Espindola <espindola@google.com>
13627
13628 * object.cc (is_elf_object): Define.
13629 * object.h (is_elf_object): Declare.
13630 * archive.cc (Archive::get_elf_object_for_member): Call
13631 is_elf_object.
33aea2fd 13632 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 13633
26736d8e
ILT
136342009-03-24 Elliott Hughes <enh@google.com>
13635
13636 * output.cc (Output_file::map_anonymous): Define.
13637 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13638 try an anonymous one. Report the size if the mmap fails.
13639 * output.h (class Output_file): Declare map_anonymous.
13640
22fd9730
ILT
136412009-03-24 Ian Lance Taylor <iant@google.com>
13642
13643 * target-select.cc (instantiate_target): Don't acquire the lock if
13644 the instantiated_target_ field has already been set.
13645
cb010894
ILT
136462009-03-23 Ian Lance Taylor <iant@google.com>
13647
7f055c20
ILT
13648 * gold-threads.h (class Initialize_lock): Define.
13649 * gold-threads.cc (class Initialize_lock_once): Define.
13650 (initialize_lock_control): New static variable.
13651 (initialize_lock_pointer): New static variable.
13652 (initialize_lock_once): New static function.
13653 (Initialize_lock::Initialize_lock): Define.
13654 (Initialize_lock::initialize): Define.
13655 * target-select.h: Include "gold-threads.h".
13656 (class Target_selector): Add lock_ and initialize_lock_ fields.
13657 Don't define instantiate_target, just declare it.
13658 * target-select.cc (Target_selector::Target_selector): Initialize
13659 new fields.
13660 (Target_selector::instantiate_target): Define.
13661 * descriptors.h: Include "gold-threads.h".
13662 (class Descriptors): Add initialize_lock_ field.
13663 * descriptors.cc (Descriptors::Descriptors): Initialize new
13664 field.
13665 (Descriptors::open): Use initialize_lock_ field
13666 * errors.h (class Errors): Add initialize_lock_ field.
13667 * errors.cc (Errors::Errors): Initialize new field.
13668 (Errors::initialize_lock): Use initialize_lock_ field.
13669 * powerpc.cc (class Target_selector_powerpc): Remove
13670 instantiated_target_ field. In do_recognize call
13671 instantiate_target rather than do_instantiate_target. In
13672 do_instantiate_target just allocate a new target.
13673 * sparc.cc (class Target_selector_sparc): Likewise.
13674
36959681
ILT
13675 * freebsd.h: New file.
13676 * i386.cc: Include "freebsd.h".
13677 (Target_i386): Derive from Target_freebsd rather than
13678 Sized_target.
13679 (Target_selector_i386): Derive from Target_selector_freebsd rather
13680 than Target_selector.
13681 * x86_64.cc: Include "freebsd.h".
13682 (Target_x86_64): Derive from Target_freebsd rather than
13683 Sized_target.
13684 (Target_selector_x86_64): Derive from Target_selector_freebsd
13685 rather than Target_selector.
13686 * target.h (class Target): Add adjust_elf_header and
13687 do_adjust_elf_header.
13688 * output.cc (Output_file_header:: do_sized_write): Call target
13689 adjust_elf_header routine.
13690 * configure.tgt: Set targ_osabi.
13691 * configure.ac: Define GOLD_DEFAULT_OSABI.
13692 * parameters.cc (Parameters::default_target): Pass
13693 GOLD_DEFAULT_OSABI to select_target.
13694 * target-select.h (class Target_selector): Make instantiate_target
13695 protected rather than private.
13696 * Makefile.am (HFILES): Add freebsd.h.
13697 * configure, Makefile.in, config.in: Rebuild.
13698
cb010894
ILT
13699 * merge.cc (do_add_input_section): Correct pend value. Change
13700 message about last entry not being null terminated from error to
13701 warning.
13702
0e879927
ILT
137032009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13704
13705 * incremental.cc: New file.
13706 * Makefile.am (CCFILES): Add incremental.cc.
13707 * Makefile.in: Rebuild.
13708
41105937
PP
137092009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13710
13711 * layout.cc (Layout::output_section_name): Preserve names
13712 of '.note.' sections.
e1df38aa 13713
60439920
ILT
137142009-03-19 Ian Lance Taylor <iant@google.com>
13715
13716 * descriptors.cc (Descriptors::open): Check that the options are
13717 valid before using them.
13718
0d371ad3
ILT
137192009-03-18 Ian Lance Taylor <iant@google.com>
13720
13721 * script-sections.h: Include <list>.
13722 (class Script_sections): Change Sections_elements from std::vector
13723 to std::list. Typedef public Elements_iterator. Add
13724 orphan_section_placement_, data_segment_align_start_, and
13725 saw_data_segment_align_ fields. Remove data_segment_align_index_
13726 field.
13727 * script-sections.cc (class Orphan_section_placement): New class.
13728 (class Sections_element): Add virtual functions is_relro and
13729 orphan_section_init. Remove virtual function place_orphan_here.
13730 (class Output_section_definition): Add is_relro and
13731 orphan_section_init. Remove place_orphan_here.
13732 (class Orphan_output_section): Likewise.
13733 (Script_sections::Script_sections): Update for field changes.
13734 (Script_sections::data_segment_align): Set saw_data_segment_align_
13735 and data_segment_align_start_, not data_segment_align_index.
13736 (Script_sections::data_segment_relro_end): Check
13737 saw_data_segment_align_. Use data_segment_align_start_ rather
13738 than data_segment_align_index_.
13739 (Script_sections::place_orphan): Rewrite to use
13740 Orphan_section_placement.
13741
9201d894
ILT
137422009-03-17 Ian Lance Taylor <iant@google.com>
13743
9c5b8369
ILT
13744 * archive.cc (Archive::add_symbols): Check for a version attached
13745 to the symbol name in the archive map.
13746 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13747 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13748 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13749 (ver_test_11.a): New target.
13750 * testsuite/Makefile.in: Rebuild.
13751
9201d894
ILT
13752 * configure.ac: Check for chsize and posix_fallocate. Replace
13753 ftruncate.
13754 * ftruncate.c: New file, from gnulib.
13755 * output.cc (posix_fallocate): Define dummy version if not
13756 HAVE_POSIX_FALLOCATE.
13757 (Output_file::map): Call posix_fallocate rather than lseek and
13758 write.
13759 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13760 * configure, Makefile.in, config.in: Rebuild.
13761
ef4ab7a8 137622009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 13763
ef4ab7a8
PP
13764 * layout.h (Layout::create_note): Add section_name parameter.
13765 * layout.cc (Layout::create_note): Likewise.
13766 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 13767
8c500701
ILT
137682009-03-17 Ian Lance Taylor <iant@google.com>
13769
e85b18e1
ILT
13770 * descriptors.cc: Include "options.h".
13771 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13772 (Descriptors::open): Always use O_CLOEXEC when opening a new
13773 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13774 then set FD_CLOEXEC.
13775
9efe6174
ILT
13776 * sparc.cc (class Target_sparc): Add has_got_section.
13777 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13778 make sure we have a GOT section.
13779
13780 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13781 (Target_sparc::Scan::local): Likewise.
13782 (Target_sparc::Scan::global): Likewise.
13783 (Target_sparc::Relocate::relocate): Likewise.
13784 (Target_sparc::Relocate::relocate_tls): Likewise.
13785
8c500701
ILT
13786 * symtab.cc (Symbol_table::define_default_version): New function,
13787 broken out of add_from_object.
13788 (Symbol_table::add_from_object): Call define_default_version.
13789 (Symbol_table::define_special_symbol): Add resolve_oldsym
13790 parameter. Change all callers. If the version for a symbol comes
13791 from a version script, resolve it with the symbol with the same
13792 name with no version. Also add the symbol without a version if
13793 appropriate.
13794 (do_define_in_output_data): If resolving with oldsym, don't delete
13795 sym.
13796 (do_define_in_output_segment): Likewise.
13797 (do_define_as_constant): Likewise.
13798 * symtab.h (class Symbol_table): Update declarations.
13799
f1ed28fb
ILT
138002009-03-13 Ian Lance Taylor <iant@google.com>
13801
15f8229b
ILT
13802 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13803 (Read_symbols::requeue): New function.
13804 (Read_symbols::do_read_symbols): If make_elf_object fails because
13805 the target type is not configured, and the file was searched for,
13806 issue a warning and retry with the next directory.
13807 (Add_symbols::run): If the file has an incompatible format, and
13808 it was searched for, requeue the Read_symbols task. On error,
13809 release the object.
13810 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13811 dirindex parameter to constructor. Change all callers. Declare
13812 incompatible_warning and requeue.
13813 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13814 input_argument_ and input_group_ fields. Add them to
13815 constructor. Change all callers.
13816 (class Read_script): Add dirindex_ field. Add it to constructor.
13817 Change all callers.
13818 * archive.cc (Archive::setup): Remove input_objects parameter.
13819 Change all callers.
13820 (Archive::get_file_and_offset): Likewise.
13821 (Archive::read_all_symbols): Likewise.
13822 (Archive::read_symbols): Likewise.
13823 (Archive::get_elf_object_for_member): Remove input_objects
13824 parameter. Add punconfigured parameter. Change all callers.
13825 (Archive::add_symbols): Change return type to bool. Check return
13826 value of include_member.
13827 (Archive::include_all_members): Likewise.
13828 (Archive::include_member): Change return type to bool. Return
13829 false if first included object has incompatible target. Set
13830 included_member_ field.
13831 (Add_archive_symbols::run): If add_symbols returns false, requeue
13832 Read_symbols task.
13833 * archive.h (class Archive): Add included_member_ field.
13834 Initialize it in constructor. Add input_file and searched_for
13835 methods. Update declarations.
13836 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13837 input_argument_ fields. Add them to constructor. Change all
13838 callers.
13839 * script.cc: Include "target-select.h".
13840 (class Parser_closure): Add skip_on_incompatible_target_ and
13841 found_incompatible_target_ fields. Add
13842 skip_on_incompatible_target parameter to constructor. Change all
13843 callers. Add methods skip_on_incompatible_target,
13844 clear_skip_on_incompatible_target, found_incompatible_target, and
13845 set_found_incompatible_target.
13846 (read_input_script): Add dirindex parameter. Change all callers.
13847 If parser finds an incompatible target, requeue Read_symbols
13848 task.
13849 (script_set_symbol): Clear skip_on_incompatible_target in
13850 closure.
13851 (script_add_assertion, script_parse_option): Likewise.
13852 (script_start_sections, script_add_phdr): Likewise.
13853 (script_check_output_format): New function.
13854 * script.h (read_input_script): Update declaration.
13855 * script-c.h (script_check_output_format): Declare.
13856 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13857 (ignore_cmd): Remove OUTPUT_FORMAT.
13858 * fileread.cc (Input_file::Input_file): Add explicit this.
13859 (Input_file::will_search_for): New function.
13860 (Input_file::open): Add pindex parameter. Change all callers.
13861 * fileread.h (class Input_file): Add input_file_argument method.
13862 Declare will_search_for. Update declarations.
13863 * object.cc (make_elf_object): Add punconfigured parameter.
13864 Change all callers.
13865 * object.h (class Object): Make input_file public. Add
13866 searched_for method.
13867 (make_elf_object): Update declaration.
13868 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13869 restart search.
13870 * dirsearch.h (class Dirsearch): Update declaration.
13871 * options.h (class General_options): Add --warn-search-mismatch.
13872 * parameters.cc (Parameters::is_compatible_target): New function.
13873 * parameters.h (class Parameters): Declare is_compatible_target.
13874 * workqueue.cc (Workqueue::add_blocker): New function.
13875 * workqueue.h (class Workqueue): Declare add_blocker.
13876
f1ed28fb
ILT
13877 * fileread.cc (Input_file::open): Remove options parameter.
13878 Change all callers.
13879 (Input_file::open_binary): Likewise.
13880 * script.cc (read_input_script): Likewise.
13881 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13882 options parameter from constructor. Change all callers.
13883 (class Read_script): Likewise.
13884 * fileread.h (class Input_file): Update declarations.
13885 * script.h (read_input_script): Update declaration.
13886
34dd024a
NC
138872009-03-10 Nick Clifton <nickc@redhat.com>
13888
13889 * po/es.po: New Spanish translation.
13890
6d71b17c
CC
138912009-03-06 Cary Coutant <ccoutant@google.com>
13892
13893 * options.cc (parse_short_option): Keep dash_z from registering itself.
13894
031cdbed
ILT
138952009-03-03 Ian Lance Taylor <iant@google.com>
13896
13897 PR 9918
13898 * target-reloc.h (relocate_section): Pass output_section to
13899 relocate.
13900 * i386.cc (Target_i386::should_apply_static_reloc): Add
13901 output_section parameter. Change all callers.
13902 (Target_i386::Relocate::relocate): Add output_section parameter.
13903 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13904 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13905 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13906 * testsuite/two_file_shared.sh: New script.
13907 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13908 (check_DATA): Add two_file_shared.dbg.
13909 (two_file_shared.dbg): New target.
13910 * testsuite/Makefile.in: Rebuild.
13911
15d5fa16
ILT
139122009-03-01 Ian Lance Taylor <iant@google.com>
13913
13914 * configure.ac: Check for byteswap.h.
13915 * configure: Rebuild.
13916 * config.in: Rebuild.
13917
8a4c0b0d
ILT
139182009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13919
13920 * layout.cc (Layout::find_or_add_kept_section): New function.
13921 (Layout::add_comdat): Removed.
13922 * layout.h (struct Kept_section): Move out of class Layout.
13923 Remove trailing underscores from field names. Add group_sections
13924 field. Rename group_ field to is_group. Change all uses.
13925 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13926 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13927 comdat_groups_ field.
13928 (Sized_relobj::include_section_group): Use
13929 find_or_add_kept_section and Kept_section::group_sections.
13930 (Sized_relobj::include_linkonce_section): Likewise.
13931 * object.cc (class Sized_relobj): Don't define Comdat_group or
13932 Comdat_group_table. Remove find_comdat_group and
13933 add_comdat_group. Remove comdat_groups_ field.
13934 * plugin.cc (include_comdat_group): Use
13935 Layout::find_or_add_kept_section.
13936
b4ecf66b
ILT
139372009-02-28 Ian Lance Taylor <iant@google.com>
13938
14359ca0
ILT
13939 * README: --gc-sections and map files are now supported. Document
13940 some build requirements.
13941
b4ecf66b
ILT
13942 PR 6992
13943 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13944 relocatable link set the value of the section symbol to zero.
13945 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13946 relocatable link don't include the section address in the local
13947 symbol value.
13948
0602e05a
ILT
139492009-02-27 Ian Lance Taylor <iant@google.com>
13950
fd9d194f
ILT
13951 PR 6811
13952 * options.h (class Search_directory): Add is_system_directory.
13953 (class General_options): Declare is_in_system_directory.
13954 * options.cc (get_relative_sysroot): Make static.
13955 (get_default_sysroot): Make static.
13956 (General_optoins::is_in_system_directory): New function.
13957 * fileread.cc (Input_file::is_in_system_directory): New function.
13958 * fileread.h (class Input_file): Declare is_in_system_directory.
13959 * object.h (class Object): Add is_in_system_directory.
13960 (class Input_objects): Remove system_library_directory_ field.
13961 * object.cc (Input_objects::add_object): Don't set
13962 system_library_directory_.
13963 (input_objects::found_in_system_library_directory): Remove.
13964 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13965 parameter. Change all callers.
13966 (Symbol_table::sized_write_globals): Likewise.
13967 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13968 Call Object::is_in_system_directory.
13969 * symtab.h (class Symbol_table): Update declarations.
13970
61edd21f
ILT
13971 PR 5990
13972 * descriptors.h (Open_descriptor): Add is_on_stack field.
13973 * descriptors.cc (Descriptors::open): If the descriptor is on the
13974 top of the stack, remove it. Initialize is_on_stack field.
13975 (Descriptors::release): Only add pod to stack if it is not on the
13976 stack already.
13977 (Descriptors::close_some_descriptor): Clear stack_next and
13978 is_on_stack fields.
13979
e29e076a
ILT
13980 PR 7091
13981 * output.cc (Output_section::find_starting_output_address): Rename
13982 from starting_output_address; add PADDR parameter; change return
13983 type.
13984 * output.h (class Output_section): Declare
13985 find_starting_output_address instead of starting_output_address.
13986 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13987 section symbol for which we can't find a merge section.
13988
0602e05a
ILT
13989 PR 9836
13990 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13991 hidden or internal, force the symbol to be local.
13992 * resolve.cc (Symbol::override_visibility): Define.
13993 (Symbol::override_base): Use override_visibility.
13994 (Symbol_table::resolve): Likewise.
13995 (Symbol::override_base_with_special): Likewise.
13996 (Symbol_table::override_with_special): If the visibility is hidden
13997 or internal, force the symbol to be local.
13998 * symtab.h (class Symbol): Add set_visibility and
13999 override_visibility.
14000 * testsuite/ver_test_1.sh: New file.
14001 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14002 (check_DATA): Add ver_test_1.syms.
14003 (ver_test_1.syms): New target.
14004 * testsuite/Makefile.in: Rebuild.
14005
401a9a73
CC
140062009-02-25 Cary Coutant <ccoutant@google.com>
14007
14008 * layout.cc (Layout::choose_output_section): Don't rename sections
14009 when using a linker script that has a SECTIONS clause.
14010 * Makefile.in: Regenerate.
14011
14012 * testsuite/Makefile.am (script_test_5.sh): New test case.
14013 * testsuite/Makefile.in: Regenerate.
14014 * testsuite/script_test_5.cc: New file.
14015 * testsuite/script_test_5.sh: New file.
14016 * testsuite/script_test_5.t: New file.
14017
f488e4b0
CC
140182009-02-13 Rafael Avila de Espindola <espindola@google.com>
14019
14020 * archive.cc (Archive::include_member): Update calls to add_symbols.
14021 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14022 the Layout argument.
14023 * dynobj.h (do_add_symbols): Add the Layout argument.
14024 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14025 Layout argument.
14026 * object.h (Object::add_symbols): Add the Layout argument.
14027 (Object::do_add_symbols): Add the Layout argument.
14028 (Sized_relobj::do_add_symbols): Add the Layout argument.
14029 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14030 Unify the two versions.
14031 (Add_plugin_symbols): Remove.
14032 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14033 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14034 (Add_plugin_symbols): Remove.
14035 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14036 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14037 (Add_symbols::run): Make it work with Pulginobj.
14038
89dd1680
ILT
140392009-02-06 Ian Lance Taylor <iant@google.com>
14040
14041 * object.cc (Sized_relobj::do_layout): Make info message start
14042 with lower case letter.
14043
266d0a74
ILT
140442009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14045
602b464e
ILT
14046 * binary.cc: Fix file comment.
14047
266d0a74
ILT
14048 * options.h (enum Incremental_disposition): Define.
14049 (class General_options): Add new options: --incremental,
14050 --incremental_changed, --incremental_unchanged,
14051 --incremental_unknown. Add incremental_disposition_ and
14052 implicit_incremental_ fields.
14053 (General_options::incremental_disposition): New function.
14054 (class Position_dependent_options): Add incremental_disposition
14055 option.
14056 (Position_dependent_options::copy_from_options): Set incremental
14057 dispositions.
14058 * options.cc (General_options::parse_incremental_changed): New
14059 function.
2e702c99
RM
14060 (General_options::parse_incremental_unchanged): New function.
14061 (General_options::parse_incremental_unknown): New function.
14062 (General_options::General_options): Initialize new fields
266d0a74 14063 incremental_disposition_ and implicit_incremental_.
2e702c99 14064 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
14065 without --incremental.
14066
f073bbf7
CD
140672009-02-06 Chris Demetriou <cgd@google.com>
14068
14069 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14070 pointer and to report location as the file name associated with
14071 the symbol.
14072 (gold_undefined_symbol_at_location): New function to replace the
14073 old gold_undefined_symbol functionality.
14074 * target-reloc.h (relocate_section): Update to use
14075 gold_undefined_symbol_at_location.
14076 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14077 Call gold_undefined_symbol function rather than gold_error.
14078 * errors.h (Errors::undefined_symbol): Take location as a
14079 string, rather than calculating it from a relocation.
14080 * errors.cc (Errors::fatal): Print "fatal error:" before the
14081 formatted message.
14082 (Errors::error, Errors::error_at_location): Print "error: "
14083 before the formatted message.
14084 (Errors::undefined_symbol): Take location as a string, rather
14085 than calculating it from a relocation.
14086 (gold_undefined_symbol_at_location): New function akin to
14087 old gold_undefined_symbol, calculates location from relocation.
14088 (gold_undefined_symbol): Change to take only a Symbol pointer
14089 and to report location as the file name associated with the symbol.
14090 * testsuite/debug_msg.sh: Update for changed error messages.
14091 * testsuite/undef_symbol.sh: Likewise.
14092
8e94a90c
ILT
140932009-02-04 Duncan Sands <baldrick@free.fr>
14094
14095 PR 9812
14096 * reduced_debug_output.h
14097 (Output_reduced_debug_abbrev_section::failed): Use format for
14098 gold_warning.
14099 (Output_reduced_debug_info_section::faild): Likewise.
14100
88a0e15b
ILT
141012009-01-31 Mikolaj Zalewski <mikolajz@google.com>
14102
14103 * script.cc (Lazy_demangler): New class.
2e702c99 14104 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
14105 symbol only once.
14106
5efc7cd2
CC
141072009-01-29 Cary Coutant <ccoutant@google.com>
14108
14109 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
14110 to __tls_get_addr.
14111 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14112
e0ebcf42
ILT
141132009-01-28 Ian Lance Taylor <iant@google.com>
14114
5efc7cd2 14115 * version.cc (version_string): Bump to 1.9.
75fe7426 14116
e0ebcf42
ILT
14117 * gold.h: Include <cstring> and <stdint.h>.
14118 * version.cc: Include <cstdio>.
14119 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
14120 warning.
14121 * reduced_debug_output.cc (insert_into_vector): Rename from
14122 Insert_into_vector; change all callers. Use Swap_unaligned to
14123 avoid aliasing issue; remove union since it is unnecessary.
14124
8e2813be 141252009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
14126
14127 * Makefile.am (CCFILES): Add gc.cc.
14128 (HFILES): Add gc.h.
14129 * Makefile.in: Regenerate.
14130 * gold.cc (Gc_runner): New class.
14131 (queue_initial_tasks): Call garbage collection related tasks
14132 when corresponding options are invoked.
14133 (queue_middle_gc_tasks): New function.
14134 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14135 processed early before laying out sections during garbage collection.
14136 * gold.h (queue_middle_gc_tasks): New function.
14137 (is_prefix_of): Move from "layout.cc".
14138 * i386.cc (Target_i386::gc_process_relocs): New function.
14139 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14140 * main.cc (main): Create object of class "Garbage_collection".
14141 * object.cc (Relobj::copy_symbols_data): New function.
14142 (Relobj::is_section_name_included): New function.
e1df38aa
NC
14143 (Sized_relobj::do_layout): Allow this function to be called twice
14144 during garbage collection and defer layout of section during the
6d03d481
ST
14145 first call.
14146 * object.h (Relobj::get_symbols_data): New function.
14147 (Relobj::is_section_name_included): New function.
14148 (Relobj::copy_symbols_data): New function.
14149 (Relobj::set_symbols_data): New function.
14150 (Relobj::get_relocs_data): New function.
14151 (Relobj::set_relocs_data): New function.
14152 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14153 (Relobj::gc_process_relocs): New function.
14154 (Relobj::do_gc_process_relocs): New pure virtual function.
14155 (Relobj::sd_): New data member.
14156 (Sized_relobj::is_output_section_offset_invalid): New function.
14157 (Sized_relobj::do_gc_process_relocs): New function.
14158 * options.h (General_options::gc_sections): Modify to not be a no-op.
14159 (General_options::print_gc_sections): New option.
14160 * plugin.cc (Plugin_finish::run): Remove function call to
14161 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14162 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14163 * reloc.cc (Read_relocs::run): Add task to process relocs and
14164 determine unreferenced sections when doing garbage collection.
14165 (Gc_process_relocs): New class.
14166 (Sized_relobj::do_gc_process_relocs): New function.
14167 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14168 sections that are garbage collected.
14169 * reloc.h (Gc_process_relocs): New class.
14170 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14171 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14172 symbols whose corresponding sections are garbage collected.
14173 (Symbol_table::Symbol_table): Add new parameter for the garbage
14174 collection object.
14175 (Symbol_table::gc_mark_undef_symbols): New function.
14176 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14177 (Symbol_table::gc_mark_dyn_syms): New function.
14178 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14179 as garbage.
14180 (Symbol_table::add_from_object): Likewise.
14181 (Symbol_table::add_from_relobj): When building shared objects, do not
14182 treat externally visible symbols as garbage.
14183 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14184 table information for static and relocatable links.
14185 * symtab.h (Symbol_table::set_gc): New function.
14186 (Symbol_table::gc): New function.
14187 (Symbol_table::gc_mark_undef_symbols): New function.
14188 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14189 (Symbol_table::gc_mark_dyn_syms): New function.
14190 (Symbol_table::gc_): New data member.
e1df38aa 14191 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
14192 function.
14193 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14194 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14195
3b293544
CF
141962009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14197
14198 * options.h (General_options::gc_sections): Define as a no-op for now.
14199 (General_options::no_keep_memory): Ditto.
14200 (General_options::Bshareable): Define.
14201 * options.cc (General_options::finalize): Honor -Bshareable.
14202
83d22aa8
AS
142032009-01-20 Andreas Schwab <schwab@suse.de>
14204
14205 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14206 read the value in the contents, since we don't use it. Use the
14207 template endianness when writing.
14208 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14209
cd536b21
AS
142102009-01-19 Andreas Schwab <schwab@suse.de>
14211
14212 * configure.tgt (powerpc64-*): Fix targ_obj.
14213
99e9a495
ILT
142142009-01-15 Ian Lance Taylor <iant@google.com>
14215
14216 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14217 local symbols when stripping all symbols.
14218
bbbfea06
CC
142192009-01-14 Cary Coutant <ccoutant@google.com>
14220
99e9a495 14221 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 14222
0f7c0701
CC
142232009-01-14 Cary Coutant <ccoutant@google.com>
14224
14225 * archive.cc (Archive::get_elf_object_for_member): Remove call
14226 to File_read::claim_for_plugin.
14227 * descriptors.cc (Descriptors::open): Remove reference to
14228 is_claimed.
14229 (Descriptors::claim_for_plugin): Remove.
14230 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14231 (Descriptors::is_claimed): Remove.
14232 (claim_descriptor_for_plugin): Remove.
14233 * fileread.cc (File_read::claim_for_plugin): Remove.
14234 * fileread.h (File_read::claim_for_plugin): Remove.
14235 (File_read::descriptor): Reopen descriptor if necessary.
14236 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14237 (Plugin_manager::all_symbols_read): Add task parameter. Change
14238 all callers.
14239 (Plugin_manager::get_input_file): New function.
14240 (Plugin_manager::release_input_file): New function.
14241 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14242 corresponding data member.
14243 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14244 and pass to base constructor. Change all callers.
14245 (get_input_file, release_input_file): New functions.
14246 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14247 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14248 (Plugin_manager::all_symbols_read): Add task parameter.
14249 (Plugin_manager::get_input_file): New function.
14250 (Plugin_manager::release_input_file): New function.
14251 (Plugin_manager::task_): New data member.
14252 (Pluginobj::Pluginobj): Add filesize parameter.
14253 (Pluginobj::filename): New function.
14254 (Pluginobj::descriptor): New function.
14255 (Pluginobj::filesize): New function.
14256 (Pluginobj::filesize_): New data member.
14257 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14258 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14259 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14260
14261 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14262 with archive libraries.
14263 * testsuite/Makefile.in: Regenerate.
14264 * testsuite/plugin_test.c (struct sym_info): New type.
14265 (get_input_file, release_input_file): New static variables.
14266 (onload): Capture new transfer vector entries.
14267 (claim_file_hook): Stop reading at end of file according to filesize.
14268 Factor out parsing of readelf output into separate function.
14269 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14270 APIs and get the source file name from the symbol table. Convert
14271 source file name to corresponding object file name. Print info
14272 message when adding new input files.
14273 (parse_readelf_line): New function.
14274 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14275 * testsuite/plugin_test_2.sh: Likewise.
14276 * testsuite/plugin_test_3.sh: Likewise.
14277 * testsuite/plugin_test_4.sh: New test case.
14278
62a6d109
ILT
142792009-01-07 Ian Lance Taylor <iant@google.com>
14280
14281 * version.cc (version_string): Bump to 1.8.
14282
483620e8
CC
142832008-12-23 Cary Coutant <ccoutant@google.com>
14284
14285 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14286 * plugin.cc (Plugin_manager::finish): Rename as
14287 layout_deferred_objects. Move cleanup to separate function.
14288 (Plugin_manager::cleanup): New function.
14289 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14290 separately.
14291 * plugin.h (Plugin_manager::finish): Rename as
14292 layout_deferred_objects.
14293 (Plugin_manager::cleanup): New function.
14294 (Plugin_manager::cleanup_done): New field.
14295
d66a9eb3
CC
142962008-12-23 Cary Coutant <ccoutant@google.com>
14297
14298 * plugin.cc (is_visible_from_outside): New function.
14299 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14300 so we don't return "IR only" status for exported symbols or -r links.
14301
14302 * testsuite/Makefile.am (plugin_test_3): New test case.
14303 * testsuite/Makefile.in: Regenerate.
14304 * testsuite/plugin_test_3.sh: New file.
14305
5995b570
CC
143062008-12-22 Cary Coutant <ccoutant@google.com>
14307
14308 * object.cc (Sized_relobj::layout_section): New function.
14309 (Sized_relobj::do_layout): Defer layout of input sections until after
14310 plugin has provided replacement files.
14311 (Sized_relobj::do_layout_deferred_sections): New function.
14312 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14313 (Relobj::layout_deferred_sections): New function.
14314 (Relobj::do_layout_deferred_sections): New function.
14315 (Sized_relobj::do_layout_deferred_sections): New function.
14316 (Sized_relobj::layout_section): New function.
14317 (Sized_relobj::Deferred_layout): New structure.
14318 (Sized_relobj::deferred_layout_): New field.
14319 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14320 Change all callers. Layout deferred sections.
14321 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14322 references.
14323 (Plugin_hook::run): Move code from do_plugin_hook inline.
14324 (Plugin_hook::do_plugin_hook): Remove.
14325 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14326 (Plugin_manager::finish): Renamed, was cleanup.
14327 (Plugin_manager::should_defer_layout): New function.
14328 (Plugin_manager::add_deferred_layout_object): New function.
14329 (Plugin_manager::Deferred_layout_list): New type.
14330 (Plugin_manager::deferred_layout_objects_): New field.
14331 (Plugin_hook::do_plugin_hook): Remove.
14332
ee769c88
ILT
143332008-12-17 Ian Lance Taylor <iant@google.com>
14334
14335 * options.h (class General_options): Add --no case for
14336 --export-dynamic.
14337
abc8dcba
CC
143382008-12-16 Cary Coutant <ccoutant@google.com>
14339
14340 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14341 vector.
14342 (Plugin_manager::claim_file): Create plugin object even if
14343 plugin did not call the add_symbols callback.
14344 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14345 asking for more symbols than were added.
14346 * testsuite/Makefile.am (plugin_test_1): Add test case with
14347 no global symbols.
14348 (empty.syms): New target.
14349 * testsuite/Makefile.in: Regenerate.
14350 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14351 message. Don't call add_symbols if no globals.
14352 (all_symbols_read_hook): Don't provide replacement for empty
14353 claimed file.
14354
b0074644
ILT
143552008-12-12 Ian Lance Taylor <iant@google.com>
14356
68943102
ILT
14357 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14358 r_type == 0 for a local symbol with r_sym == 0.
14359 (scan_relocatable_relocs): Pass r_sym to
14360 local_non_section_strategy.
14361 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14362 r_sym parameter.
14363
b0074644
ILT
14364 * configure.ac: Update test for TLS descriptors: they are
14365 supported as of glibc 2.9.
14366 * configure: Rebuild.
14367
c2508178
ILT
143682008-12-11 Ian Lance Taylor <iant@google.com>
14369
14370 PR 7091
14371 * target-reloc.h (Default_scan_relocatable_relocs): For each
14372 function, map r_type == 0 to RELOC_DISCARD.
14373
2756a258
CC
143742008-12-10 Cary Coutant <ccoutant@google.com>
14375
14376 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14377 object to override a kept COMDAT group from a plugin object.
14378
bb6f53d3
ILT
143792008-12-09 Ian Lance Taylor <iant@google.com>
14380
fbc558e1
ILT
14381 PR 7088
14382 * yyscript.y (file_cmd): Handle INPUT.
14383
bb6f53d3
ILT
14384 * testsuite/initpri1.c: Change all declarations to be full
14385 prototypes by adding void, to avoid compiler warnings.
14386
4674ecfc
CC
143872008-12-05 Rafael Avila de Espindola <espindola@google.com>
14388
14389 * options.cc (General_options::parse_plugin_opt): New.
14390 (General_options::add_plugin): The argument now is just the filename.
14391 (General_options::add_plugin_option): New.
14392 * options.h (plugin_opt): New.
14393 (add_plugin): Change argument name.
14394 (add_plugin_option): New.
14395 * plugin.cc (Plugin::load): Don't parse the plugin option.
14396 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14397 (Plugin::add_option): New.
14398 (Plugin::args_): Change type.
14399 (Plugin::filename_): New.
14400 (Plugin_manager::add_plugin_option): New.
14401 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14402 * testsuite/Makefile.in: Regenerate.
14403
fd06b4aa
CC
144042008-12-05 Cary Coutant <ccoutant@google.com>
14405
14406 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14407 Handle --strip-lto-sections option.
14408 * options.h (strip_lto_sections): New option.
14409
6c52134c
CC
144102008-12-01 Cary Coutant <ccoutant@google.com>
14411
14412 * plugin.cc (ld_plugin_message): Change format parameter to const.
14413 Fix mismatch between new[] and delete.
14414
a45248e0
CC
144152008-11-14 Cary Coutant <ccoutant@google.com>
14416
14417 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14418 instead of -1U.
14419
c82fbeee
CS
144202008-11-05 Craig Silverstein <csilvers@google.com>
14421
14422 * options.cc (General_options::parse_dynamic_list): New function.
14423 * options.h (General_options): New flags dynamic_list,
14424 dynamic_list_data, dynamic_list_cpp_new, and
14425 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14426 (General_options::in_dynamic_list): New function.
14427 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14428 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14429 (Lex::can_continue_name): Likewise.
14430 (yylex): Likewise.
14431 (read_script_file): New parameter script_options.
14432 (read_dynamic_list): New function.
14433 (Script_options::define_dynamic_list): New function.
14434 (dynamic_list_keyword_parsecodes): New variable.
14435 (dynamic_list_keywords): New variable.
14436 * script.h (Script_options::define_dynamic_list): New function
14437 prototype.
14438 (read_dynamic_list): New function prototype.
14439 * symtab.cc (strprefix): New macro.
14440 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14441 dynamic_list_data, dynamic_list_cpp_new, and
14442 dynamic_list_cpp_typeinfo.
14443 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14444 (dynamic_list_expr): New rule.
14445 (dynamic_list_nodes): Likewise.
14446 (dynamic_list_node): Likewise.
14447 * testsuite/Makefile.am (dynamic_list): New test.
14448 * testsuite/Makefile.in: Regenerated.
14449 * testsuite/dynamic_list.t: New file.
14450 * testsuite/dynamic_list.sh: New file.
14451
e0bb29a5
CS
144522008-11-05 Craig Silverstein <csilvers@google.com>
14453
14454 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14455 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14456 (t11_last): Likewise.
14457 * testsuite/ver_test_6.c (main): Likewise.
14458
4e1e25e0
CC
144592008-10-07 Cary Coutant <ccoutant@google.com>
14460
14461 * options.c (General_options::finalize): Add check for -static and
14462 -shared.
14463 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14464 is not empty.
14465
92f03fcb
CC
144662008-10-02 Cary Coutant <ccoutant@google.com>
14467
14468 * plugin.cc (make_sized_plugin_object): Fix conditional
14469 compilation to work when not all targets are enabled.
14470
fbd8a257
CC
144712008-09-29 Cary Coutant <ccoutant@google.com>
14472
14473 * archive.cc (Archive::get_file_and_offset): Use filename instead
14474 of name to get library path.
14475 (Archive::include_member): Unlock external member of a thin archive.
14476
14477 * testsuite/Makefile.am (TEST_AR): New variable.
14478 (thin_archive_test_1): New test.
14479 (thin_archive_test_2): New test.
81636b3f
CC
14480 * testsuite/Makefile.in: Regenerate.
14481 * testsuite/thin_archive_main.cc: New file.
14482 * testsuite/thin_archive_test_1.cc: New file.
14483 * testsuite/thin_archive_test_2.cc: New file.
14484 * testsuite/thin_archive_test_3.cc: New file.
14485 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14486
eff45813
CC
144872008-09-29 Cary Coutant <ccoutant@google.com>
14488
14489 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14490 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14491 instead of -1U.
14492 (Sized_relobj::do_finalize_local_symbols): Likewise.
14493 (Sized_relobj::map_to_kept_section): Likewise.
14494 * object.h (Sized_relobj::invalid_address): New constant.
14495 (Sized_relobj::do_output_section_offset): Check for invalid_address
14496 and return -1ULL.
14497 * output.cc (Output_reloc::local_section_offset): Use constant
14498 invalid_address instead of -1U.
14499 (Output_reloc::get_address): Likewise.
14500 (Output_section::output_address): Change -1U to -1ULL.
14501 * output.h (Output_reloc::invalid_address): New constant.
14502 * reloc.cc (Sized_relobj::write_sections): Use constant
14503 invalid_address instead of -1U.
14504 (Sized_relobj::relocate_sections): Likewise.
14505 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14506 values for merge sections.
14507 * target-reloc.h (relocate_for_relocatable): Use constant
14508 invalid_address instead of -1U.
14509
89fc3421
CC
145102008-09-19 Cary Coutant <ccoutant@google.com>
14511
14512 Add plugin functionality for link-time optimization (LTO).
14513 * configure.ac (plugins): Add --enable-plugins option.
14514 * configure: Regenerate.
14515 * config.in: Regenerate.
14516 * Makefile.am (LIBDL): New variable.
14517 (CCFILES): Add plugin.cc.
14518 (HFILES): Add plugin.h.
14519 (ldadd_var): Add LIBDL.
14520 * Makefile.in: Regenerate.
14521
14522 * archive.cc: Include "plugin.h".
14523 (Archive::setup): Don't preread archive symbols when using a plugin.
14524 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14525 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14526 files.
14527 (Archive::include_member): Add symbols from plugin objects.
14528 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14529 * descriptors.cc (Descriptors::open): Check for file descriptors
14530 abandoned by plugins.
14531 (Descriptors::claim_for_plugin): New function.
14532 * descriptors.h (Descriptors::claim_for_plugin): New function.
14533 (Open_descriptor::is_claimed): New field.
14534 (claim_descriptor_for_plugin): New function.
14535 * fileread.cc (File_read::claim_for_plugin): New function.
14536 * fileread.h (File_read::claim_for_plugin): New function.
14537 (File_read::descriptor): New function.
14538 * gold.cc: Include "plugin.h".
14539 (queue_initial_tasks): Add task to call plugin hooks for generating
14540 new object files.
14541 * main.cc: Include "plugin.h".
14542 (main): Load plugin libraries.
14543 * object.h (Pluginobj): Declare.
14544 (Object::pluginobj): New function.
14545 (Object::do_pluginobj): New function.
14546 (Object::set_target): New function.
14547 * options.cc: Include "plugin.h".
14548 (General_options::parse_plugin): New function.
14549 (General_options::General_options): Initialize plugins_ field.
14550 (General_options::add_plugin): New function.
14551 * options.h (Plugin_manager): Declare.
14552 (General_options): Add --plugin option.
14553 (General_options::has_plugins): New function.
14554 (General_options::plugins): New function.
14555 (General_options::add_plugin): New function.
14556 (General_options::plugins_): New field.
14557 * plugin.cc: New file.
14558 * plugin.h: New file.
14559 * readsyms.cc: Include "plugin.h".
14560 (Read_symbols::do_read_symbols): Check for archive before checking
14561 for ELF file. Call plugin hooks to claim files.
14562 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14563 from a real object file; force override when processing replacement
14564 files.
14565 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14566 (Symbol::init_base_object): Likewise.
14567 (Symbol::init_base_output_data): Likewise.
14568 (Symbol::init_base_output_segment): Likewise.
14569 (Symbol::init_base_constant): Likewise.
14570 (Symbol::init_base_undefined): Likewise.
14571 (Symbol::output_section): Assert that object is not a plugin.
14572 (Symbol_table::add_from_pluginobj): New function.
14573 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14574 undefined.
14575 (Symbol_table::sized_write_globals): Likewise.
14576 (Symbol_table::add_from_pluginobj): Instantiate template.
14577 * symtab.h (Sized_pluginobj): Declare.
14578 (Symbol::in_real_elf): New function.
14579 (Symbol::set_in_real_elf): New function.
14580 (Symbol::in_real_elf_): New field.
14581 (Symbol_table::add_from_pluginobj): New function.
14582
14583 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14584 (LIBDL): New variable.
14585 (LDADD): Add LIBDL.
14586 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14587 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14588 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14589 (MOSTLYCLEANFILES): Likewise.
14590 * testsuite/Makefile.in: Regenerate.
14591 * testsuite/plugin_test.c: New file.
14592 * testsuite/plugin_test_1.sh: New file.
14593 * testsuite/plugin_test_2.sh: New file.
14594
de31bda5
ILT
145952008-09-16 Ian Lance Taylor <iant@google.com>
14596
9c2d0ef9
ILT
14597 * target-reloc.h (relocate_section): Check whether a symbol is
14598 defined by the ABI before reporting an undefined symbol error.
14599 * target.h (Target::is_defined_by_abi): Make parameter const.
14600 (Target::do_is_defined_by_abi): Likewise.
14601 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14602 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14603 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14604 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14605 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14606 * testsuite/Makefile.in: Rebuild.
14607
de31bda5
ILT
14608 * fileread.cc (make_view): Add casts to avoid warning.
14609
9fa33bee
AO
146102008-09-16 Alexandre Oliva <aoliva@redhat.com>
14611
14612 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14613 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14614
183fd0e3
AO
146152008-09-16 Alexandre Oliva <aoliva@redhat.com>
14616
14617 * options.h (General_options::output_is_executable): New.
14618 (General_options::output_is_pie): New.
14619 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14620 for shared libraries.
14621 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14622
7be8330a
CD
146232008-09-11 Chris Demetriou <cgd@google.com>
14624
14625 * options.h (origin): New -z option.
14626 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14627 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14628 in DT_FLAGS_1.
14629
a9caad02
CC
146302008-09-05 Cary Coutant <ccoutant@google.com>
14631
14632 * fileread.cc (File_read::make_view): Add check for attempt to map
14633 beyond end of file.
14634
ae6dce4d
CC
146352008-09-05 Cary Coutant <ccoutant@google.com>
14636
14637 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14638 explicit instantiations.
14639
d7ab2a47
KVH
146402008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14641
14642 PR gold/6858
14643 * options.cc (General_options::finalize): Allow undefined symbols
14644 in shlibs if linking -shared.
14645
14646 PR gold/6859
14647 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14648 symbols as not needing a dynsym entry.
14649
1e52a9c1
CS
146502008-08-20 Craig Silverstein <csilvers@google.com>
14651
14652 * fileread.cc (File_read::open): Do not lock the file unless it
14653 was successfully opened.
14654
d85c80a3
CC
146552008-08-14 Cary Coutant <ccoutant@google.com>
14656
14657 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14658 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14659 * testsuite/tls_test.cc (struct int128): 128-bit struct
14660 for testing TLS relocs with non-zero addend.
14661 (v12): New TLS variable.
14662 (t12): New test.
14663 (t_last): Add check for v12.
14664 * testsuite/tls_test.h (t12): New function.
14665 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14666
2d924fd9
ILT
146672008-08-13 Ian Lance Taylor <iant@google.com>
14668
14669 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14670 set tls_segment_ or relro_segment_.
14671 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14672 when appropriate.
14673 * output.h (Output_section::clear_is_relro): New function.
14674 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14675 sections specially even when output_data_ is empty.
14676 (Output_segment::maximum_alignment): When first section is relro,
14677 only force alignment for PT_LOAD segments.
14678 * script.cc (script_data_segment_align): New function.
14679 (script_data_segment_relro_end): New function.
14680 * script-c.h (script_data_segment_align): Declare.
14681 (script_data_segment_relro_end): Declare.
14682 * script-sections.h (class Script_sections): Declare
14683 data_segment_align and data_segment_relro_end. Add fields
14684 segment_align_index_ and saw_relro_end_.
14685 * script-sections.cc (class Sections_element): Add set_is_relro
14686 virtual function. Add new bool* parameter to place_orphan_here.
14687 Add get_output_section virtual function.
14688 (class Output_section_definition): Add set_is_relro. Add new
14689 bool* parameter to place_orphan_here. Add get_output_section.
14690 Add is_relro_ field.
14691 (Output_section_definition::Output_section_definition): Initialize
14692 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14693 and is_relro_ fields.
14694 (Output_section_definition::place_orphan_here): Add is_relro
14695 parameter.
14696 (Output_section_definition::set_section_addresses): Set relro for
14697 output section.
14698 (Output_section_definition::alternate_constraint): Likewise.
14699 (class Orphan_output_section): Add new bool* parameter to
14700 place_orphan_here. Add get_output_section.
14701 (Orphan_output_section::place_orphan_here): Add is_relro
14702 parameter.
14703 (Script_sections::Script_sections): Initialize
14704 data_segment_align_index_ and saw_relro_end_.
14705 (Script_sections::data_segment_align): New function.
14706 (Script_sections::data_segment_relro_end): New function.
14707 (Script_sections::place_orphan): Set or clear is_relro.
14708 (Script_sections::set_section_addresses): Force alignment of first
14709 TLS section.
14710 * yyscript.y (exp): Call script_data_segment_align and
14711 script_data_segment_relro_end.
14712 * testsuite/relro_script_test.t: New file.
14713 * testsuite/relro_test.cc (using_script): Declare.
14714 (t1, t2): Test using_script.
14715 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14716 (relro_script_test_SOURCES): Define.
14717 (relro_script_test_DEPENDENCIES): Define.
14718 (relro_script_test_LDFLAGS): Define.
14719 (relro_script_test_LDADD): Define.
14720 (relro_script_test.so): New target.
14721 * testsuite/Makefile.in: Rebuild.
14722
f827c9a9
CC
147232008-08-06 Cary Coutant <ccoutant@google.com>
14724
14725 * archive.cc (Archive::total_archives, Archive::total_members)
14726 (Archive::total_members_loaded): New variables.
14727 (Archive::setup): Add parameter. Add option to preread
14728 archive symbols.
14729 (Archive::read_armap): Add counter.
14730 (Archive::get_file_and_offset): New function.
14731 (Archive::get_elf_object_for_member): New function.
14732 (Archive::read_all_symbols): New function.
14733 (Archive::read_symbols): New function.
14734 (Archive::add_symbols): Add counters.
14735 (Archive::include_all_members): Use armap to find members if it's
14736 already built.
14737 (Archive::include_member): Skip reading symbols if already read.
14738 Factored code into Archive::get_file_and_offset and
14739 Archive::get_elf_object_for_member. Changed call to
14740 Mapfile::report_include_archive_member.
14741 (Archive::print_stats): New function.
14742 * archive.h: Declare Object and Read_symbols_data classes.
14743 (Archive::Archive): Add initializers for new members.
14744 (Archive::setup): Add parameter.
14745 (Archive::print_stats): New function.
14746 (Archive::total_archives, Archive::total_members)
14747 (Archive::total_members_loaded): New variables.
14748 (Archive::get_file_and_offset): New function.
14749 (Archive::get_elf_object_for_member): New function.
14750 (Archive::read_all_symbols): New function.
14751 (Archive::read_symbols): New function.
14752 (Archive::Archive_member): New class.
14753 (Archive::members_): New member.
14754 (Archive::num_members_): New member.
14755 * main.cc: Include archive.h.
14756 (main): Call Archive::print_stats.
14757 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14758 archive parameter; member_name is now the fully-decorated name.
14759 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14760 * options.h: (General_options): Add --preread-archive-symbols option.
14761 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14762 Archive::setup.
14763
de4c45bd
ILT
147642008-08-04 Ian Lance Taylor <iant@google.com>
14765
14766 * symtab.h (Symbol::use_plt_offset): New function.
14767 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14768 * powerpc.cc (Relocate::relocate): Likewise.
14769 * sparc.cc (Relocate::relocate): Likewise.
14770 * x86_64.cc (Relocate::relocate): Likewise.
14771 * testsuite/weak_plt.sh: New test.
14772 * testsuite/weak_plt_main.cc: New test.
14773 * testsuite/weak_plt_shared.cc: New test.
14774 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14775 (check_PROGRAMS): Add weak_plt.
14776 (check_DATA): Add weak_plt_shared.so.
14777 (weak_plt_main_pic.o, weak_plt): New targets.
14778 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14779 * testsuite/Makefile.in: Rebuild.
14780
14781 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14782 gcctestdir/ld.
14783 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14784 * testsuite/Makefile.in: Rebuild.
14785
323ee3f4
AM
147862008-08-04 Alan Modra <amodra@bigpond.net.au>
14787
14788 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14789 * Makefile.in: Regenerate.
14790 * po/POTFILES.in: Regenerate.
14791
7c07ecec
ILT
147922008-07-29 Ian Lance Taylor <iant@google.com>
14793
14794 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14795 symbols before other symbols.
14796 * testsuite/script_test_2.cc (test_addr): Declare.
14797 (test_addr_alias): Declare.
14798 (main): Check that test_addr and test_addr_alias have the right
cd536b21 14799 values.
7c07ecec
ILT
14800 * testsuite/script_test_2.t: Define test_addr_alias and
14801 test_addr.
14802
5778530e
ILT
148032008-07-24 Ian Lance Taylor <iant@google.com>
14804
2a00e4fb
ILT
14805 PR 5990
14806 * descriptors.cc: New file.
14807 * descriptors.h: New file.
14808 * gold-threads.h (class Hold_optional_lock): New class.
14809 * fileread.cc: Include "descriptors.h".
14810 (File_read::~File_read): Release descriptor rather than closing
14811 it.
14812 (File_read::open) [file]: Call open_descriptor rather than open.
14813 Set is_descriptor_opened_.
14814 (File_read::open) [memory]: Assert that descriptor is not open.
14815 (File_read::reopen_descriptor): New function.
14816 (File_read::release): Release descriptor.
14817 (File_read::do_read): Make non-const. Reopen descriptor.
14818 (File_read::read): Make non-const.
14819 (File_read::make_view): Reopen descriptor.
14820 (File_read::do_readv): Likewise.
14821 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14822 Update declarations.
14823 * layout.cc: Include "descriptors.h".
14824 (Layout::create_build_id): Use open_descriptor rather than open.
14825 * output.cc: Include "descriptors.h".
14826 (Output_file::open): Use open_descriptor rather than open.
14827 * archive.cc (Archive::const_iterator): Change Archive to be
14828 non-const.
14829 (Archive::begin, Archive::end): Make non-const.
14830 (Archive::count_members): Likewise.
14831 * archive.h (class Archive): Update declarations.
14832 * object.h (Object::read): Make non-const.
14833 * Makefile.am (CCFILES): Add descriptors.cc.
14834 (HFILES): Add descriptors.h.
14835 * Makefile.in: Rebuild.
14836
801647d1
ILT
14837 PR 6716
14838 * gold.h: Always include <clocale>. Add Solaris workarounds
14839 following code in binutils/sysdep.h.
14840
5edd166e
ILT
14841 PR 6048
14842 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14843 this->eh_frame_hdr_ is NULL before using it.
14844
c89ad728
ILT
14845 * dynobj.cc (Versions::Versions): Update comment.
14846
aa86f06b
ILT
14847 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14848 the base version name.
14849
5778530e
ILT
14850 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14851 array size plus one.
14852 (Stringpool_template::set_string_offsets): Subtract one from key
14853 before using it as an array index.
14854 (Stringpool_template::get_offset_with_length): Likewise.
14855 (Stringpool_template::write_to_buffer): Likewise.
14856 * stringpool.h (Stringpool_template::get_offset_from_key):
14857 Likewise.
14858
057ead22
ILT
148592008-07-23 Ian Lance Taylor <iant@google.com>
14860
7f649c59
ILT
14861 PR 6658
14862 * object.h (Merged_symbol_value::value): Do our best to handle a
14863 negative addend.
14864
057ead22
ILT
14865 PR 6647
14866 * script.cc (Version_script_info::get_versions): Don't add empty
14867 version tag to return value.
14868 (Version_script_info::get_symbol_version_helper): Change return
14869 type to bool. Add pversion parameter. Change all callers.
14870 (script_register_vers_node): Don't require a non-NULL tag.
14871 * script.h (class Version_script_info): Update declarations.
14872 (Version_script_info::get_symbol_version): Change return type to
14873 bool. Add version parameter. Change all callers.
14874 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14875 handling. Handle an empty version from a version script.
14876 (Symbol_table::define_special_symbol): Likewise.
14877 * testsuite/ver_test_10.script: New file.
14878 * testsuite/ver_test_10.sh: New file.
14879 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14880 (check_DATA): Add ver_test_10.syms.
14881 (ver_test_10.syms, ver_test_10.so): New target.
14882 * testsuite/Makefile.in: Rebuild.
14883
58e54ac2
CD
148842008-07-23 Simon Baldwin <simonb@google.com>
14885
14886 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14887 to zero for undefined symbols from dynamic libraries.
14888
95d14cd3
ILT
148892008-07-23 Ian Lance Taylor <iant@google.com>
14890
14891 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14892 Change all callers.
14893 * symtab.h (class Symbol_table): Update declaration.
14894 * testsuite/ver_test_9.cc: New file.
14895 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14896 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14897 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14898 (ver_test_9.so, ver_test_9.o): New targets.
14899 * testsuite/Makefile.in: Rebuild.
14900
92de84a6
ILT
149012008-07-22 Ian Lance Taylor <iant@google.com>
14902
34810851
ILT
14903 * options.h (class General_options): Define --check-sections.
14904 * layout.cc (Layout::set_segment_offsets): Handle
14905 --check-sections.
14906
af6156ef
ILT
14907 * options.h (class General_options): Define -n/--nmagic and
14908 -N/--omagic.
14909 * options.cc (General_options::finalize): For -n/--nmagic or
14910 -N/--omagic, set -static.
14911 * layout.cc (Layout::attach_allocated_section_to_segment): If
14912 -N/--omagic, don't put read-only and read-write sections in
14913 different segments.
14914 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14915 finding a read-only segment.
14916 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14917 don't set the minimum segment alignment to the common page size,
14918 and don't set the file offset to the address modulo the page size.
14919 * script-sections.cc (Script_sections::create_segments): If
14920 -n/--omagic, don't put read-only and read-write sections in
14921 different segments.
14922
92de84a6
ILT
14923 * cref.cc: New file.
14924 * cref.h: New file.
14925 * options.h (class General_options): Add --print-symbol-counts.
14926 * main.cc (main): Issue defined symbol report if requested.
14927 * archive.cc (Archive::interpret_header): Make into a const member
14928 function.
14929 (Archive::add_symbols): Call Input_objects::archive_start and
14930 archive_stop.
14931 (Archive::const_iterator): Define new class.
14932 (Archive::begin, Archive::end): New functions.
14933 (Archive::include_all_members): Rewrite to use iterator.
14934 (Archive::count_members): New function.
14935 * archive.h (class Archive): Update declarations.
14936 (Archive::filename): New function.
14937 * object.cc: Include "cref.h".
14938 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14939 (Sized_relobj::do_get_global_symbol_counts): New function.
14940 (Input_objects::add_object): Add object to cross-referencer.
14941 (Input_objects::archive_start): New function.
14942 (Input_objects::archive_stop): New function.
14943 (Input_objects::print_symbol_counts): New function.
14944 * object.h: Declare Cref and Archive.
14945 (Object::get_global_symbol_counts): New function.
14946 (Object::do_get_global_symbol_counts): New pure virtual function.
14947 (class Sized_relobj): Add defined_count_ field. Update
14948 declarations.
14949 (class Input_objects): Add cref_ field. Update constructor.
14950 Update declarations.
14951 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14952 defined_count_.
14953 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14954 symbol counts.
14955 (Sized_dynobj::do_get_global_symbol_counts): New function.
14956 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14957 defined_count_. Update declarations. Define Symbols typedef.
14958 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14959 parameter. Change all callers.
14960 (Symbol_table::add_from_dynobj): Add sympointers and defined
14961 parameters. Change all callers.
14962 * symtab.h (class Symbol_table): Update declarations.
14963 * Makefile.am (CCFILES): Add cref.cc.
14964 (HFILES): Add cref.h.
14965 * Makefile.in: Rebuild.
14966
3f7c5e1d
CD
149672008-07-22 Simon Baldwin <simonb@google.com>
14968
14969 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14970 to zero when writing undefined symbols.
14971
e0b64032
ILT
149722008-07-22 Ian Lance Taylor <iant@google.com>
14973
14974 * output.cc (Output_section::add_input_section): Don't try to
14975 merge empty merge sections.
14976
096b02cf
CS
149772008-07-21 Craig Silverstein <csilvers@google.com>
14978
14979 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14980 Include symbol version in error message.
cd536b21 14981
1d1f116d
CD
149822008-07-20 Chris Demetriou <cgd@google.com>
14983
cd536b21 14984 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
14985 (RANDOM_SEED_CFLAGS): New substituted variable.
14986 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14987 * configure: Rebuild.
14988 * Makefile.in: Likewise.
14989 * testsuite/Makefile.in: Likewise.
14990
a18f591e
ILT
149912008-07-18 Ian Lance Taylor <iant@google.com>
14992
14993 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14994 where we see NAME/NULL and NAME/VERSION as separate symbols.
14995 * testsuite/ver_test_main.cc (main): Call t4.
14996 (t4, t4_2a): Define.
14997 * testsuite/ver_test_2.cc (t4_2): Define.
14998 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14999 * testsuite/ver_test_4.cc (t4_2a): Define.
15000 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15001 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15002
c6e3f6ed
ILT
150032008-07-17 Ian Lance Taylor <iant@google.com>
15004
15005 * dynobj.cc (Versions::add_def): If we give an error about a
15006 missing version, go ahead and create the version anyhow.
15007
ef9beddf
ILT
150082008-07-10 Ian Lance Taylor <iant@google.com>
15009
15010 Handle output sections with more than 0x7fffffff bytes.
15011 * object.h (class Relobj): Change map_to_output_ to
15012 output_sections_, and just keep a section pointer. Change all
15013 uses. Move comdat group support to Sized_relobj.
15014 (Relobj::is_section_specially_mapped): Remove.
15015 (Relobj::output_section): Remove poff parameter. Change all
15016 callers.
15017 (Relobj::output_section_offset): New function.
15018 (Relobj::set_section_offset): Rewrite.
15019 (Relobj::map_to_output): Remove.
15020 (Relobj::output_sections): New function.
15021 (Relobj::do_output_section_offset): New pure virtual function.
15022 (Relobj::do_set_section_offset): Likewise.
15023 (class Sized_relobj): Add section_offsets_ field. Add comdat
15024 group support from Relobj. Update declarations.
15025 (Sized_relobj::get_output_section_offset): New function.
15026 (Sized_relobj::do_output_section_offset): New function.
15027 (Sized_relobj::do_set_section_offset): New function.
15028 * object.cc (Relobj::output_section_address): Remove.
15029 (Sized_relobj::Sized_relobj): Initialize new fields.
15030 (Sized_relobj::include_section_group): Cast find_kept_object to
15031 Sized_relobj.
15032 (Sized_relobj::include_linkonce_section): Likewise.
15033 (Sized_relobj::do_layout): Use separate arrays for output section
15034 and output offset.
15035 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15036 output_sections.
15037 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15038 output_sections and section_offsets.
15039 (Sized_relobj::write_local_symbols): Likewise.
15040 (map_to_kept_section): Compute output address directly.
15041 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15042 output_sections and section_offsets.
15043 (Sized_relobj::write_sections): Likewise.
15044 (Sized_relobj::relocate_sections): Likewise.
15045 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15046 * output.h (class Output_reloc): Update declarations. Change
15047 u2_.relobj to Sized_relobj*.
15048 (class Output_data_reloc): Change add functions to use
15049 Sized_relobj*.
15050 * output.cc (Output_reloc::Output_reloc): Change relobj to
15051 Sized_relobj*.
15052 (Output_reloc::local_section_offset): Change return type to
15053 Elf_Addr. Use get_output_section_offset.
15054 (Output_reloc::get_address): Likewise.
15055 (Output_section::is_input_address_mapped): Don't call
15056 is_section_specially_mapped.
15057 (Output_section::output_offset): Likewise.
15058 (Output_section::output_address): Likewise.
15059 (Output_section::starting_output_address): Likewise.
15060 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15061 parameter to Sized_relobj*.
15062 (Copy_relocs::need_copy_reloc): Likewise.
15063 (Copy_relocs::save): Likewise.
15064 * copy-relocs.h (class Copy_relocs): Update declarations.
15065 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15066 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15067 * target-reloc.h (relocate_for_relocatable): Change
15068 offset_in_output_section type to Elf_Addr. Change code that uses
15069 it as well.
15070 * layout.cc (Layout::layout): Always set *off.
15071 * mapfile.cc (Mapfile::print_input_section): Use
15072 output_section_offset.
15073 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15074 Sized_relobj*.
15075 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15076 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15077 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15078
5cb66f97
ILT
150792008-07-03 Ian Lance Taylor <iant@google.com>
15080
15081 * layout.cc (Layout::include_section): Do not discard unrecognized
15082 SHT_STRTAB sections.
15083
afe47622
CS
150842008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15085
15086 * script.cc (Lex::can_continue_name): Make '?' allowable in
15087 version-script names.
15088 * testsuite/version_script.map: Change glob pattern to use '?'
15089
5adf9721
ILT
150902008-06-30 Manish Singh <yosh@gimp.org>
15091
15092 PR 6585
15093 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
15094 Correct typo.
15095
e6fde208
ILT
150962008-06-30 Ian Lance Taylor <iant@google.com>
15097
15098 PR 6660
15099 PR 6682
15100 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
15101 versions]: Don't try to read the value in the contents, since we
15102 don't use it. Use the template endianness when writing.
15103
3f2e6a2d
CC
151042008-06-25 Cary Coutant <ccoutant@google.com>
15105
15106 * fileread.cc (File_read::make_view): Assert on zero-length view.
15107 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
15108 symbol table when there are no symbols to read.
15109
c43d3a48
CS
151102008-06-23 Craig Silverstein <csilvers@google.com>
15111
15112 * version.cc (version_string): Bump to 1.7
15113
5f494ea0
CS
151142008-06-18 Craig Silverstein <csilvers@google.com>
15115
15116 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
15117 constant 0xFFFF to type Valtype.
15118 (Powerpc_relocate_functions::rel16_ha): Likewise.
15119
c42e122e
ILT
151202008-06-17 Ian Lance Taylor <iant@google.com>
15121
f34787f8
ILT
15122 * output.h (Output_section::Input_section): Initialize p2align_ to
15123 zero for Output_section_data constructors.
15124 (Output_section::Input_section::addralign): If not an input
15125 section, return the alignment of the Output_section_data.
15126 * testsuite/copy_test.cc: New file.
15127 * testsuite/copy_test_1.cc: New file.
15128 * testsuite/copy_test_2.cc: New file.
15129 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15130 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15131 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15132 (copy_test_1_pic.o, copy_test_1.so): New targets.
15133 (copy_test_2_pic.o, copy_test_2.so): New targets.
15134 * testsuite/Makefile.in: Rebuild.
15135
c42e122e
ILT
15136 * script-sections.cc (Script_sections::place_orphan): Initialize
15137 local variable exact.
15138
ce3ac18a
DE
151392008-06-13 David Edelsohn <edelsohn@gnu.org>
15140
15141 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15142
42cacb20
DE
151432008-06-12 David Edelsohn <edelsohn@gnu.org>
15144 David S. Miller <davem@davemloft.net>
15145
15146 * powerpc.cc: New file.
15147 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15148 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15149 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15150 * Makefile.in: Rebuild.
15151
7b308235
ILT
151522008-06-09 Ian Lance Taylor <iant@google.com>
15153
15154 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15155 <exception>.
15156 (throwing, orig_terminate): New static variables.
15157 (terminate_handler): New static function.
15158 (t2): Set terminate handler.
15159
f0b886e3
ILT
151602008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15161
15162 PR 6584
cd536b21 15163 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
15164 alignment.
15165
3e90f135
CC
151662008-05-30 Cary Coutant <ccoutant@google.com>
15167
15168 * archive.cc (Archive::include_all_members) Correct to step
15169 over symbol table and extended name table in thin archives.
15170
e09ad04a
ILT
151712008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15172
15173 PR 6407
15174 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15175 calculation.
15176
62b01cb5
ILT
151772008-05-28 Caleb Howe <cshowe@google.com>
15178
15179 * reduced_debug_output.cc: New file.
15180 * reduced_debug_output.h: New file.
92de84a6 15181 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
15182 * options.cc (General_options::finalize): Add strip_debug_non_line
15183 to the strip heirarchy.
15184 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15185 fields.
15186 * layout.cc: Include "reduced_debug_output.h".
15187 (Layout::Layout): Initialize new fields.
15188 (line_only_debug_sections): New static array.
15189 (is_lines_only_debug_sections): New static inline function.
15190 (Layout::include_section): Handle --strip-debug-non-line.
15191 (Layout::make_output_section): If --strip-debug-non-line, build
15192 new output sections for .debug_abbrev and .debug_info.
15193 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15194 gold. Warn about possible overflow.
15195 (read_signed_LEB_128): Likewise.
15196 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15197 (read_signed_LEB_128): Declare.
15198 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15199 (HFILES): Add reduced_debug_output.h.
15200 * Makefile.in: Rebuild.
15201
7d9e3d98
ILT
152022008-05-21 Ian Lance Taylor <iant@google.com>
15203
15204 * mapfile.cc: New file.
15205 * mapfile.h: New file.
15206 * options.h (class General_options): Add -M/--print-map and -Map.
15207 * options.cc (General_options::finalize): Make -M equivalent to
15208 -Map -.
15209 * main.cc: Include <cstdio> and "mapfile.h".
15210 (main): Open mapfile if requested.
15211 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15212 constructor. Change caller.
15213 (queue_initial_tasks): Add mapfile parameter. Change caller.
15214 (queue_middle_tasks): Likewise.
15215 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15216 declarations.
15217 * archive.cc: Include "mapfile.h".
15218 (Archive::add_symbols): Add mapfile parameter. Change all
15219 callers. Pass mapfile, symbol, and reason to include_member.
15220 (Archive::include_all_members): Add mapfile parameter. Change all
15221 callers.
15222 (Archive::include_member): Add mapfile, sym, and why parameters.
15223 Change all callers. Report inclusion to map file.
15224 * archive.h: Include "fileread.h".
15225 (class Archive): Update declarations.
15226 (Archive::file): New const method.
15227 (class Add_archive_symbols): Add mapfile_ field. Update
15228 constructor. Change all callers.
15229 * readsyms.h (class Read_symbols): Likewise.
15230 (class Finish_group): Likewise.
15231 (class Read_script): Likewise.
15232 * common.cc: Include "mapfile.h".
15233 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15234 all callers.
15235 (Symbol_table::do_allocate_commons): Likewise.
15236 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15237 symbol allocation to mapfile.
15238 * common.h (class Allocate_commons_task): Add mapfile_ field.
15239 Update constructor. Change all callers.
15240 * symtab.h (class Symbol_table): Update declarations.
15241 * layout.cc: Include "mapfile.h".
15242 (Layout_task_runner::run): Print information to mapfile.
15243 (Layout::create_gold_note): Change Output_data_fixed_space to
15244 Output_data_zero_fill.
15245 (Layout::create_build_id): Likewise.
15246 (Layout::print_to_mapfile): New function.
15247 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15248 constructor. Change caller.
15249 (class Layout): Declare print_to_mapfile.
15250 * output.cc (Output_section::Input_section::print_to_mapfile): New
15251 function.
15252 (Output_section::add_input_section): If producing a map, always
15253 add to input_sections_ list.
15254 (Output_section::do_print_to_mapfile): New function.
15255 (Output_segment::print_sections_to_mapfile): New function.
15256 (Output_segment::print_section_list_to_mapfile): New function.
15257 * output.h: Include "mapfile.h".
15258 (Output_data::print_to_mapfile): New function.
15259 (Output_data::do_print_to_mapfile): New virtual function.
15260 (Output_segment_headers::do_print_to_mapfile): New function.
15261 (Output_file_header::do_print_to_mapfile): New function.
15262 (Output_data_const::do_print_to_mapfile): New function.
15263 (class Output_data_const_buffer): Add map_name_ field. Update
15264 constructor. Change all callers. Add do_print_to_mapfile
15265 function.
15266 (class Output_data_fixed_space): Likewise.
15267 (class Output_data_space): Likewise.
15268 (class Output_data_zero_fill): New class.
15269 (Output_data_strtab::do_print_to_mapfile): New function.
15270 (Output_data_reloc_base::do_print_to_mapfile): New function.
15271 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15272 (Output_data_group::do_print_to_mapfile): New function.
15273 (Output_data_got::do_print_to_mapfile): New function.
15274 (Output_data_dynamic::do_print_to_mapfile): New function.
15275 (Output_symtab_xindex::do_print_to_mapfile): New function.
15276 (class Output_section): Declare do_print_to_mapflie. Declare
15277 print_to_mapfile in Input_section.
15278 (class Output_segment): Declare new functions.
15279 * object.h (Sized_relobj::symbol_count): New function.
15280 * script-sections.cc
15281 (Output_section_element_dot_assignment::set_section_addresses):
15282 Change Output_data_fixed_space to Output_data_zero_fill.
15283 (Output_data_expression::do_print_to_mapfile): New function.
15284 * script.cc (read_input_script): Add mapfile parameter. Change
15285 all callers.
15286 * script.h (read_input_script): Update declaration.
15287 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15288 (Eh_frame::do_print_to_mapfile): New function.
15289 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15290 (Output_merge_string::do_print_to_mapfile): New function.
15291 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15292 function.
15293 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15294 function.
15295 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15296 function.
15297 * Makefile.am (CCFILES): Add mapfile.cc.
15298 (HFILES): Add mapfile.h.
15299 * Makefile.in: Rebuild.
15300
9f1d377b
ILT
153012008-05-19 Ian Lance Taylor <iant@google.com>
15302
15303 * options.h (class General_options): Add -z relro.
15304 * layout.cc (Layout::Layout): Initialize relro_segment_.
15305 (Layout::add_output_section_data): Return the output section.
15306 (Layout::make_output_section): Rcognize relro sections and mark
15307 them appropriately.
15308 (Layout::attach_allocated_section_to_segment): Put relro sections
15309 in a PT_GNU_RELRO segment.
15310 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15311 section as relro.
15312 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15313 PT_TLS segments.
15314 (Layout::linkonce_mapping): Map d.rel.ro.local to
15315 .data.rel.ro.local.
15316 (Layout::output_section_name): Us .data.rel.ro.local for any
15317 section which begins with that.
15318 * layout.h (class Layout): Update add_output_section_data
15319 declaration. Add relro_segment_ field.
15320 * output.cc (Output_section::Output_section): Initialize is_relro_
15321 and is_relro_local_ fields.
15322 (Output_segment::add_output_section): Group relro sections.
15323 (Output_segment::is_first_section_relro): New function.
15324 (Output_segment::maximum_alignment): If there is a relro section,
15325 align the segment to the common page size.
15326 (Output_segment::set_section_addresses): Track whether we are
15327 looking at relro sections. If the last section is a relro
15328 section, align to the common page size.
15329 (Output_segment::set_section_list_addresses): Add in_relro
15330 parameter. Change all callers. Align to the page size when
15331 moving from relro to non-relro section.
15332 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15333 segment.
15334 * output.h (class Output_section): Add is_relro_ and
15335 is_relro_local_ fields.
15336 (Output_section::is_relro): New function.
15337 (Output_section::set_is_relro): New function.
15338 (Output_section::is_relro_local): New function.
15339 (Output_section::set_is_relro_local): New function.
15340 (class Output_segment): Update declarations.
15341 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15342 * sparc.cc (Target_sparc::got_section): Likewise.
15343 * x86_64.cc (Target_x86_64::got_section): Likewise.
15344 * testsuite/relro_test_main.cc: New file.
15345 * testsuite/relro_test.cc: New file.
15346 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15347 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15348 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15349 (relro_test.so, relro_test_pic.o): New targets.
15350 * testsuite/Makefile.in: Rebuild.
15351
a984ee1d
ILT
153522008-05-16 Ian Lance Taylor <iant@google.com>
15353
01676dcd
ILT
15354 * output.cc (Output_segment::add_output_section): Remove front
15355 parameter.
15356 * output.h (class Output_segment): Remove
15357 add_initial_output_section and overloaded add_output_section.
15358 Update declaration of remaining add_output_section.
15359 * layout.cc (Layout::create_interp): Call add_output_section
15360 rather than add_initial_output_section.
15361 (Layout::finish_dynamic_section): Likewise.
15362
497897f9
ILT
15363 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15364 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15365 know the dynamic type.
15366 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15367 field. Initialize it in constructor.
15368 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15369 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15370 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15371 reloc.
15372
a984ee1d
ILT
15373 * output.cc (Output_reloc::get_address): Change return type to
15374 Elf_Addr.
15375 * output.h (class Output_reloc): Update get_address declaration.
15376 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15377 for section addresses.
15378
55ba0940
ILT
153792008-05-09 Ian Lance Taylor <iant@google.com>
15380
15381 PR 6493
15382 * gold.cc (gold_nomem): Use return value of write.
15383
75517b77
ILT
153842008-05-08 Ian Lance Taylor <iant@google.com>
15385
15386 * symtab.c (Symbol::init_base_output_data): Add version
15387 parameter. Change all callers.
15388 (Symbol::init_base_output_segment): Likewise.
15389 (Symbol::init_base_constant): Likewise.
15390 (Symbol::init_base_undefined): Likewise.
15391 (Sized_symbol::init_output_data): Likewise.
15392 (Sized_symbol::init_output_segment): Likewise.
15393 (Sized_symbol::init_constant): Likewise.
15394 (Sized_symbol::init_undefined): Likewise.
15395 (Symbol_table::do_define_in_output_data): If the new symbol has a
15396 version, mark it as the default.
15397 (Symbol_table::do_define_in_output_segment): Likewise.
15398 (Symbol_table::do_define_as_constant): Likewise.
15399 * symtab.h (class Symbol): Update declarations.
15400 (class Sized_symbol): Likewise.
15401 * resolve.cc (Symbol::override_version): New function.
c42e122e 15402 (Symbol::override_base): Call override_version.
75517b77
ILT
15403 (Symbol::override_base_with_special): Likewise.
15404 * testsuite/ver_script_8.script: New file.
15405 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15406 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15407 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15408 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15409
f1f70eae
ILT
154102008-05-06 Ian Lance Taylor <iant@google.com>
15411
f3e9c5c5
ILT
15412 PR 6049
15413 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15414 functions.
15415 (class General_options): Remove existing --undefined, and add
15416 --no-undefined instead. Add new --undefined as synonym for -u.
15417 * archive.cc (Archive::add_symbols): Check whether symbol was
15418 named with -u.
15419 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15420 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15421 all uses. Add IS_UNDEFINED. Update declarations to split
15422 different versions of init_base. Declare init_base_undefined.
15423 (Symbol::is_defined): Handle IS_UNDEFINED.
15424 (Symbol::is_undefined): Likewise.
15425 (Symbol::is_weak_undefined): Call is_undefined.
15426 (Symbol::is_absolute): Handle IS_CONSTANT.
15427 (class Sized_symbol): Update declarations to split different
15428 versions of init. Declare init_undefined.
15429 (class Symbol_table): Declare new functions.
15430 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15431 Change all callers.
15432 (Symbol::init_base_output_data): Likewise.
15433 (Symbol::init_base_output_segment): Likewise.
15434 (Symbol::init_base_constant): Likewise.
15435 (Symbol::init_base_undefined): New function.
15436 (Sized_symbol::init_object): Rename from init. Change all
15437 callers.
15438 (Sized_symbol::init_output_data): Likewise.
15439 (Sized_symbol::init_output_segment): Likewise.
15440 (Sized_symbol::init_constant): Likewise.
15441 (Sized_symbol::init_undefined): New function.
15442 (Symbol_table::add_undefined_symbols_from_command_line): New
15443 function.
15444 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15445 function.
15446 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15447 (Symbol::output_section): Likewise.
15448 (Symbol::set_output_section): Likewise.
15449 (Symbol_table::sized_finalize_symbol): Likewise.
15450 (Symbol_table::sized_write_globals): Likewise.
15451 * resolve.cc (Symbol_table::should_override): Likewise.
15452 (Symbol::override_base_with_special): Likewise.
15453
8bdcdf2c
ILT
15454 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15455 symbol, change it to have default visibility.
15456 * testsuite/protected_1.cc: New file.
15457 * testsuite/protected_2.cc: New file.
15458 * testsuite/protected_3.cc: New file.
15459 * testsuite/protected_main_1.cc: New file.
15460 * testsuite/protected_main_2.cc: New file.
15461 * testsuite/protected_main_3.cc: New file.
15462 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15463 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15464 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15465 (protected_1.so): New target.
15466 (protected_1_pic.o, protected_2_pic.o): New targets.
15467 (protected_3_pic.o): New target.
15468 (check_PROGRAMS): Add protected_2.
15469 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15470 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15471 * testsuite/Makefile.in: Rebuild.
15472
2b706932
ILT
15473 * options.h (DEFINE_var): Add set_user_set_##varname__.
15474 (DEFINE_bool_alias): New macro.
15475 (class General_options): Define -Bstatic using DEFINE_bool_alias
15476 rather than DEFINE_special. Add --undefined as an alias for -z
15477 defs.
15478 * options.cc (General_options::parse_Bstatic): Remove.
15479
d82a5bcc
ILT
15480 * options.h (class General_options): Add --fatal-warnings.
15481 * main.cc (main): Implement --fatal-warnings.
15482 * errors.h (Errors::warning_count): New function.
15483
f1f70eae
ILT
15484 * options.h (class General_options): Add -Bsymbolic-functions.
15485 * symtab.h (Symbol::is_preemptible): Check for
15486 -Bsymbolic-functions.
15487
8825ac63
ILT
154882008-05-05 Ian Lance Taylor <iant@google.com>
15489
d98bc257
ILT
15490 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15491 as noVARNAME rather than no-VARNAME.
15492 (class General_options): Add option -z combreloc.
15493 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15494 get_address.
15495 (Output_reloc::sort_before) [SHT_REL]: New function.
15496 (Output_reloc::sort_before) [SHT_RELA]: New function.
15497 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15498 Sort_relocs_comparison.
15499 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15500 parameter. Change all callers.
15501 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15502 sort_relocs parameter. Change all callers.
15503 * output.cc (Output_reloc::get_address): New function, broken out
15504 of write_rel.
15505 (Output_reloc::write_rel): Call it.
15506 (Output_reloc::compare): New function.
15507 (Output_data_reloc_base::do_write): Optionally sort relocs.
15508
60b2b4e7
ILT
15509 * configure.ac: If targ_extra_obj is set, link it in.
15510 * configure.tgt: Initialize all variables.
15511 (x86_64*): Set targ_extra_obj and targ_extra_size.
15512 * configure: Rebuild.
15513
8825ac63
ILT
15514 * object.cc (Sized_relobj::include_section_group): Adjust section
15515 indexes read from group data. Build vector to pass to
15516 layout_group.
15517 * layout.cc (Layout::layout_group): Add flags and shndxes
15518 parameters. Remove contents parameter. Change caller. Update
15519 explicit instantiations.
15520 * layout.h (class Layout): Update layout_group declaration.
15521 * output.cc (Output_data_group::Output_data_group): Add flags and
15522 input_shndxes parameters. Remove contents parameter. Change
15523 caller.
15524 (Output_data_group::do_write): Change input_sections_ to
15525 input_shndxes_.
15526 * output.h (class Output_data_group): Update constructor
15527 declaration. Rename input_sections_ to input_shndxes_.
15528 * testsuite/many_sections_test.cc: Add template.
15529
e94cf127
CC
155302008-04-30 Cary Coutant <ccoutant@google.com>
15531
4418b2d5
CC
15532 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15533
e94cf127
CC
15534 * layout.cc (Layout::include_section): Refactored check for debug
15535 info section.
15536 (Layout::add_comdat): Add new parameters. Change type
15537 of signature parameter. Add object and shndx to signatures table.
15538 (Layout::find_kept_object): New function.
15539 * layout.h: Include <cstring>.
15540 (Layout::is_debug_info_section): New function.
15541 (Layout::add_comdat): Add new parameters.
15542 (Layout::find_kept_object): New function.
15543 (Layout::Kept_section): New struct.
15544 (Layout::Signatures): Change type of map range.
15545 * object.cc (Relobj::output_section_address): New function.
15546 (Sized_relobj::include_section_group): Add new parameters. Change
15547 calls to Layout::add_comdat. Change to build table of kept comdat
15548 groups and table mapping discarded sections to kept sections.
15549 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15550 (Sized_relobj::do_layout): Change calls to include_section_group and
15551 include_linkonce_section.
15552 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15553 value to zero when section is discarded.
15554 (Sized_relobj::map_to_kept_section): New function.
15555 * object.h (Relobj::output_section_address): New function.
15556 (Relobj::Comdat_group): New type.
15557 (Relobj::find_comdat_group): New function.
15558 (Relobj::Comdat_group_table): New type.
15559 (Relobj::Kept_comdat_section): New type.
15560 (Relobj::Kept_comdat_section_table): New type.
15561 (Relobj::add_comdat_group): New function.
15562 (Relobj::set_kept_comdat_section): New function.
15563 (Relobj::get_kept_comdat_section): New function.
15564 (Relobj::comdat_groups_): New field.
15565 (Relobj::kept_comdat_sections_): New field.
15566 (Symbol_value::input_value): Update comment.
15567 (Sized_relobj::map_to_kept_section) New function.
15568 (Sized_relobj::include_linkonce_section): Add new parameter.
15569 * target-reloc.h (Comdat_behavior): New type.
15570 (get_comdat_behavior): New function.
15571 (relocate_section): Add code to map a discarded section to the
15572 corresponding kept section when applying a relocation.
15573
e4e5049b
CS
155742008-04-30 Craig Silverstein <csilvers@google.com>
15575
15576 * dwarf_reader.cc (next_generation_count): New static var.
15577 (Addr2line_cache_entry): New struct.
15578 (addr2line_cache): New static var.
15579 (Dwarf_line_info::one_addr2line): Added caching.
15580 (Dwarf_line_info::clear_addr2line_cache): New function.
15581 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15582 cache-size parameter.
15583 (Dwarf_line_info::one_addr2line_cache): New function.
15584 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15585 new cache-size argument to one_addr2line(), and clear cache.
15586
d09e9154
CC
155872008-04-28 Cary Coutant <ccoutant@google.com>
15588
15589 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15590 R_386_PC8 relocations.
15591
7ef73768
ILT
155922008-04-23 Ian Lance Taylor <iant@google.com>
15593
55438702
ILT
15594 * object.cc (Sized_relobj::include_section_group): Check for
15595 invalid section group.
15596
c165fb93
ILT
15597 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15598 header size.
15599
7ef73768
ILT
15600 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15601 than read for file header.
15602 * archive.cc (Archive::include_member): Likewise.
15603
6194aaab
L
156042008-04-23 Paolo Bonzini <bonzini@gnu.org>
15605
15606 * aclocal.m4: Regenerate.
15607 * configure: Regenerate.
15608
d491d34e
ILT
156092008-04-19 Ian Lance Taylor <iant@google.com>
15610
5ea2bac6
ILT
15611 * version.cc (version_string): Bump to 1.6.
15612
7bc3e21a
ILT
15613 * testsuite/Makefile.am (many_sections_r_test): New target.
15614 (many_sections_r_test_SOURCES): Remove.
15615 (many_sections_r_test_DEPENDENCIES): Remove.
15616 (many_sections_r_test_LDFLAGS): Remove.
15617 (many_sections_r_test_LDADD): Remove.
15618
7fcd3aa9
ILT
15619 * object.cc (Sized_relobj::do_add_symbols): Always pass
15620 local_symbol_count_ to add_from_relobj.
15621
4c94d6ae
ILT
15622 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15623 every thousand variables.
15624 * testsuite/Makefile.in: Rebuild.
15625
d491d34e
ILT
15626 * object.cc (Xindex::initialize_symtab_xindex): New function.
15627 (Xindex::read_symtab_xindex): New function.
15628 (Xindex::sym_xindex_to_shndx): New function.
15629 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15630 available.
15631 (Sized_relobj::do_initialize_xindex): New function.
15632 (Sized_relobj::do_read_symbols): Adjust section links.
15633 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15634 parameter. Change all callers.
15635 (Sized_relobj::include_section_group): Adjust section links and
15636 symbol section indexes.
15637 (Sized_relobj::do_layout): Adjust section links.
15638 (Sized_relobj::do_count_local_symbols): Adjust section links and
15639 symbol section indexes.
15640 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15641 ordinary and special symbols.
15642 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15643 dynsym_xindex parameters. Change all callers. Adjust section
15644 links. Use SHN_XINDEX when needed.
15645 (Sized_relobj::get_symbol_location_info): Adjust section links.
15646 Don't get fooled by special symbols.
15647 * object.h (class Xindex): Define.
15648 (class Object): Add xindex_ parameter. Declare virtual functoin
15649 do_initialize_xindex.
15650 (Object::adjust_sym_shndx): New function.
15651 (Object::set_xindex): New protected function.
15652 (class Symbol_value): Add is_ordinary_shndx_ field.
15653 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15654 (Symbol_value::value): Assert ordinary section.
15655 (Symbol_value::initialize_input_to_output_map): Likewise.
15656 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15657 Change all callers.
15658 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15659 all callers.
15660 (class Sized_relobj): Update declarations.
15661 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15662 parameter. Change all callers.
15663 (Sized_relobj::adjust_shndx): New function.
15664 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15665 field.
15666 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15667 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15668 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15669 (Sized_dynobj::read_dynsym_section): Adjust section links.
15670 (Sized_dynobj::read_dynamic): Likewise.
15671 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15672 section links.
15673 (Sized_dynobj::do_initialize_xindex): New function.
15674 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15675 do_initialize_xindex.
15676 (Sized_dynobj::adjust_shndx): New function.
15677 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15678 dynsym_xindex_ fields.
15679 (Layout::finalize): Add a call to set_section_indexes before
15680 creating the symtab sections.
15681 (Layout::set_section_indexes): Don't do anything if the section
15682 already has a section index.
15683 (Layout::create_symtab_sections): Add shnum parameter. Change
15684 caller. Create .symtab_shndx section if needed.
15685 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15686 caller.
15687 (Layout::allocated_output_section_count): New function.
15688 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15689 needed.
15690 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15691 fields. Update declarations.
15692 (Layout::symtab_xindex): New function.
15693 (Layout::dynsym_xindex): New function.
15694 (class Write_symbols_task): Add layout_ field.
15695 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15696 Change caller.
15697 * output.cc (Output_section_headers::Output_section_headers): Add
15698 shstrtab_section parameter. Change all callers.
15699 (Output_section_headers::do_sized_write): Store overflow values
15700 for section count and section string table section index in
15701 section header zero.
15702 (Output_file_header::do_sized_write): Check for overflow of
15703 section count and section string table section index.
15704 (Output_symtab_xindex::do_write): New function.
15705 (Output_symtab_xindex::endian_do_write): New function.
15706 * output.h (class Output_section_headers): Add shstrtab_section_.
15707 Update declarations.
15708 (class Output_symtab_xindex): Define.
15709 (Output_section::has_out_shndx): New function.
15710 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15711 field.
15712 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15713 Change all callers.
15714 (Sized_symbol::init): Likewise.
15715 (Symbol::output_section): Check for ordinary symbol.
15716 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15717 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15718 callers.
15719 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15720 Change all callers. Simplify handling of symbols from sections
15721 not included in the link.
15722 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15723 distinction.
15724 (Weak_alias_sorter::operator()): Assert that symbols are
15725 ordinary.
15726 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15727 distinction.
15728 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15729 parameters. Change all callers.
15730 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15731 symbol distinction. Use SHN_XINDEX when needed.
15732 (Symbol_table::write_section_symbol): Add symtab_xindex
15733 parameter. Change all callers.
15734 (Symbol_table::sized_write_section_symbol): Likewise. Use
15735 SHN_XINDEX when needed.
15736 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15737 declarations.
15738 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15739 (Symbol::is_defined): Check is_ordinary.
15740 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15741 (Symbol::is_absolute, Symbol::is_common): Likewise.
15742 (class Sized_symbol): Update declarations.
15743 (class Symbol_table): Update declarations.
15744 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15745 parameters. Change all callers.
15746 (Sized_symbol::override): Likewise.
15747 (Symbol_table::override): Likewise.
15748 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15749 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15750 is_ordinary, and orig_st_shndx parameters. Change all callers.
15751 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15752 to be in an ordinary section.
15753 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15754 object and is_ordinary parameters. Change all callers.
15755 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15756 Change all callers. Don't add undefined or non-ordinary symbols
15757 to reloc_map_.
15758 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15759 Change all callers.
15760 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15761 declarations.
15762 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15763 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15764 (Sized_relobj::relocate_sections): Likewise.
15765 * target-reloc.h (scan_relocs): Adjust section symbol index.
15766 (scan_relocatable_relocs): Likewise.
15767 * i386.cc (Scan::local): Check for ordinary symbols.
15768 * sparc.cc (Scan::local): Likewise.
15769 * x86_64.cc (Scan::local): Likewise.
15770 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15771 to symbol_section_and_value.
15772 * testsuite/many_sections_test.cc: New file.
15773 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15774 (check_PROGRAMS): Add many_sections_test.
15775 (many_sections_test_SOURCES): Define.
15776 (many_sections_test_DEPENDENCIES): Define.
15777 (many_sections_test_LDFLAGS): Define.
15778 (BUILT_SOURCES): Add many_sections_define.h.
15779 (many_sections_define.h): New target.
15780 (BUILT_SOURCES): Add many_sections_check.h.
15781 (many_sections_check.h): New target.
15782 (check_PROGRAMS): Add many_sections_r_test.
15783 (many_sections_r_test_SOURCES): Define.
15784 (many_sections_r_test_DEPENDENCIES): Define.
15785 (many_sections_r_test_LDFLAGS): Define.
15786 (many_sections_r_test_LDADD): Define.
15787 (many_sections_r_test.o): New target.
15788 * testsuite/Makefile.in: Rebuild.
15789
c5818ff1
CC
157902008-04-17 Cary Coutant <ccoutant@google.com>
15791
15792 * errors.cc (Errors::info): New function.
15793 (gold_info): New function.
15794 * errors.h (Errors::info): New function.
15795 * gold.h (gold_info): New function.
15796 * object.cc (Input_objects::add_object): Print trace output.
15797 * options.cc (options::parse_set): New function.
15798 (General_options::parse_wrap): Deleted.
15799 (General_options::General_options): Deleted initializer.
15800 * options.h (options::String_set): New typedef.
15801 (options::parse_set): New function.
15802 (DEFINE_set): New macro.
15803 (General_options::wrap): Changed to use DEFINE_set. Changed
15804 callers of any_wrap_symbols and is_wrap_symbol.
15805 (General_options::trace, General_options::trace_symbol):
15806 New options.
15807 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15808 (General_options::wrap_symbols_): Deleted.
15809 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15810
b5be4a7c
DM
158112008-04-17 David S. Miller <davem@davemloft.net>
15812
15813 * options.cc (General_options::parse_V): New function.
15814 * options.h: Add entries for -V and -Qy.
15815
155a0dd7
ILT
158162008-04-17 Ian Lance Taylor <iant@google.com>
15817
15818 * common.cc (Symbol_table::allocate_commons): Remove options
15819 parameter. Change caller.
15820 (Symbol_table::do_allocate_commons): Remove options parameter.
15821 Change caller. Just call do_allocate_commons_list twice.
15822 (Symbol_table::do_allocate_commons_list): New function, broken out
15823 of do_allocate_commons.
15824 * common.h (class Allocate_commons_task): Remove options_ field.
15825 Update constructor.
15826 * symtab.cc (Symbol_table::Symbol_table): Initialize
15827 tls_commons_.
15828 (Symbol_table::add_from_object): Put TLS common symbols on
15829 tls_commons_ list.
15830 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15831 which are IN_OUTPUT_DATA.
15832 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15833 allocate_commons and do_allocate_commons declarations. Declare
15834 do_allocate_commons_list.
15835 * gold.cc (queue_middle_tasks): Update creation of
15836 Allocate_commons_task to not pass options.
15837 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15838 (TLS_TEST_C_FLAGS): New variable.
15839 (tls_test_c_pic.o): New target.
15840 (tls_test_shared.so): Link in tls_test_c_pic.o.
15841 (tls_test_c_pic_ie.o): New target.
15842 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15843 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15844 (tls_test_c.o): New target.
15845 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15846 (tls_pic_test_LDADD): Likewise.
15847 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15848 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15849 (tls_test_c_gnu2.o): New target.
15850 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15851 tls_test_c_gnu2.o.
15852 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15853 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15854 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15855 * testsuite/tls_test.cc: Include "config.h".
15856 (t_last): Call t11_last.
15857 * testsuite/tls_test.h (t11, t11_last): Declare.
15858 * testsuite/tls_test_c.c: New file.
15859 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15860 * configure.ac: Check for OpenMP support.
15861 * configure, config.in, Makefile.in: Rebuild.
15862 * testsuite/Makefile.in: Rebuild.
15863
edfbb029
CC
158642008-04-16 Cary Coutant <ccoutant@google.com>
15865
15866 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15867 (Target_i386::tls_base_symbol_defined_): New field.
15868 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15869 (Target_i386::Scan::global): Likewise.
15870 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15871 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15872 (Target_x86_64::tls_base_symbol_defined_): New field.
15873 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15874 (Target_x86_64::Scan::global): Likewise.
15875
f3c69fca
CC
158762008-04-16 Cary Coutant <ccoutant@google.com>
15877
15878 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15879 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15880 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15881 building shared libraries.
15882 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15883 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15884 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15885 * testsuite/Makefile.in: Rebuild.
15886 * testsuite/weak_undef.h: New file.
15887 * testsuite/weak_undef_file1.cc: Add extra test cases.
15888 * testsuite/weak_undef_file2.cc: Likewise.
15889 * testsuite/weak_undef_test.cc: Likewise.
15890
7c414435
DM
158912008-04-16 David S. Miller <davem@davemloft.net>
15892
32b769e1
DM
15893 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15894 Add issued_non_pic_error_ field. Declare check_non_pic.
15895 (Target_sparc::Scan::check_non_pic): New function.
15896 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15897 (Target_sparc::Scan::global): Likewise.
15898
11936fb1
DM
15899 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15900 * configure: Rebuild.
15901
7c414435
DM
15902 * options.h (DEFINE_enable): New macro.
15903 (new_dtags): New enable option.
15904 (initfirst, interpose, loadfltr, nodefaultlib,
15905 nodelete, nodlopen, nodump): New -z options.
15906 * layout.cc (Layout:finish_dynamic_section): If new
15907 dtags enabled, emit DT_RUNPATH. Also, emit a
15908 DT_FLAGS_1 containing any specified -z flags.
15909
85c7bf8b
ILT
159102008-04-16 Ian Lance Taylor <iant@google.com>
15911
12c0daef
ILT
15912 * copy-relocs.cc: New file.
15913 * copy-relocs.h: New file.
15914 * reloc.cc: Remove Copy_relocs code.
15915 * reloc.h: Likewise.
15916 * reloc-types.h (struct Reloc_types) [both versions]: Add
15917 get_reloc_addend_noerror.
15918 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15919 variants of add_global which take an addend which must be zero.
15920 * i386.cc: Include "copy-relocs.h".
15921 (class Target_i386): Change type of copy_relocs_ to variable,
15922 update initializer.
15923 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15924 Change all callers.
15925 (Target_i386::do_finalize_sections): Change handling of
15926 copy_relocs_.
15927 * sparc.cc: Include "copy-relocs.h".
15928 (class Target_sparc): Change type of copy_relocs_ to variable,
15929 update initializer.
15930 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15931 Change all callers.
15932 (Target_sparc::do_finalize_sections): Change handling of
15933 copy_relocs_.
15934 * x86_64.cc: Include "copy-relocs.h".
15935 (class Target_x86_64): Change type of copy_relocs_ to variable,
15936 update initializer.
15937 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15938 class. Change all callers.
15939 (Target_x86_64::do_finalize_sections): Change handling of
15940 copy_relocs_.
15941 * Makefile.am (CCFILES): Add copy-relocs.cc.
15942 (HFILES): Add copy-relocs.h.
15943
4f4995b6
ILT
15944 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15945
85c7bf8b
ILT
15946 * testsuite/script_test_4.sh: Permit leading zeroes.
15947
4f2a9edd
ILT
159482008-04-15 Ian Lance Taylor <iant@google.com>
15949
e6188289
ILT
15950 * script-sections.cc (Script_sections::create_segments): Use
15951 header_size_adjustment even when there is enough room for the
15952 headers.
15953 * testsuite/script_test_4.sh: New file.
15954 * testsuite/script_test_4.t: New file.
15955 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15956 (check_DATA): Add script_test_4.stdout.
15957 (MOSTLYCLEANFILES): Likewise.
15958 (script_test_4): New target.
15959 (script_test_4.stdout): New target.
15960 * testsuite/Makefile.in: Rebuild.
15961
4f2a9edd
ILT
15962 * sparc.cc: Add definitions for Output_data_plt_sparc class
15963 constants.
15964
f5314dd5
DM
159652008-04-14 David S. Miller <davem@davemloft.net>
15966
15967 * sparc.cc: New file.
15968 * Makefile.am (TARGETSOURCES): Add sparc.cc
15969 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15970 * configure.tgt: Document targ_extra_size and
15971 targ_extra_big_endian. Add entries for sparc-* and
15972 sparc64-*.
15973 * configure.ac: Handle targ_extra_size and
15974 targ_extra_big_endian.
15975 * Makefile.in: Rebuild.
15976 * configure: Likewise.
15977 * po/POTFILES.in: Likewise.
15978 * po/gold.pot: Likewise.
15979
154e0e9a
ILT
159802008-04-14 Ian Lance Taylor <iant@google.com>
15981
15982 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15983 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15984 in the name/type/flags to section mapping. Don't call
15985 allocate_output_section.
15986 (Layout::choose_output_section): Change parameter from adjust_name
15987 to is_input_section. Don't permit input sections after sections
15988 are attached to segments. Don't call allocate_output_section.
15989 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15990 not write_enable_output_section.
15991 (Layout::make_output_section): Don't push to
15992 unattached_section_list_ nor call attach_to_segment. Call
15993 attach_section_to_segment if sections are attached.
15994 (Layout::attach_sections_to_segments): New function.
15995 (Layout::attach_section_to_segment): New function.
15996 (Layout::attach_allocated_section_to_segment): Rename from
15997 attach_to_segment. Remove flags parameter.
15998 (Layout::allocate_output_section): Remove function.
15999 (Layout::write_enable_output_section): Remove function.
16000 * layout.h (class Layout): Update for above changes. Add new
16001 field sections_are_attached_.
16002 * output.h (Output_section::update_flags_for_input_section): New
16003 function.
16004 * output.cc (Output_section::add_input_section): Call
16005 update_flags_for_input_section.
16006 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16007
009a67a2
CC
160082008-04-11 Cary Coutant <ccoutant@google.com>
16009
16010 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16011 thought unnecessary.
16012 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16013
759b1a24
ILT
160142008-04-11 Ian Lance Taylor <iant@google.com>
16015
16016 * output.h (class Output_section_data): Remove inline definition
16017 of set_addralign.
16018 * output.cc (Output_section_data::set_addralign): New function.
16019
c2b45e22
CC
160202008-04-11 Cary Coutant <ccoutant@google.com>
16021
16022 Add support for TLS descriptors for i386 and x86_64.
16023 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16024 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16025 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16026 GOT_TYPE_TLS_DESC.
16027 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16028 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16029 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16030 relocations.
16031 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16032 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16033 Fix problem with initial-exec relocations.
16034 (Target_i386::Relocate::relocate_tls): Likewise.
16035 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16036 relaxation.
16037 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16038 support for section-plus-offset dynamic table entries.
16039 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16040 (Output_data_dynamic::Dynamic_entry): Add support for
16041 section-plus-offset dynamic table entries.
16042 (Output_data_dynamic::Classification): Likewise.
16043 (Output_data_dynamic::classification_): Renamed offset_.
16044 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16045 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16046 (Target_x86_64::make_plt_section): New function.
16047 (Target_x86_64::reserve_tlsdesc_entries): New function.
16048 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
16049 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
16050 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
16051 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
16052 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
16053 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
16054 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
16055 add extra PLT entry for TLS descriptors.
16056 (Output_data_plt_x86_64::got_): New field.
16057 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16058 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16059 fields.
16060 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16061 descriptors.
16062 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16063 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16064 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16065 R_386_TLS_DESC_CALL relocations.
16066 (Target_x86_64::Scan::global): Likewise.
16067 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16068 for TLS descriptors.
16069 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16070 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16071 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16072 GD-to-IE relaxation.
16073 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16074 and TLS_DESCRIPTORS.
16075 * Makefile.in: Rebuild.
16076 * configure: Rebuild.
16077 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16078 (tls_test_shared2.so): New target.
16079 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16080 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16081 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16082 (tls_shared_gd_to_ie_test_LDADD): New variable.
16083 (tls_shared_gnu2_gd_to_ie_test): New target.
16084 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16085 New targets.
16086 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16087 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16088 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16089 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16090 (tls_shared_gnu2_test): New target.
16091 (tls_test_gnu2_shared.so): New target.
16092 (tls_shared_gnu2_test_SOURCES): New variable.
16093 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
16094 (tls_shared_gnu2_test_LDFLAGS): New variable.
16095 (tls_shared_gnu2_test_LDADD): New variable.
16096 * testsuite/Makefile.in: Rebuild.
16097 * testsuite/Makefile.
16098
83bfb6b7
ILT
160992008-04-11 Ian Lance Taylor <iant@google.com>
16100
16101 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
16102 justsyms.t.
16103 * testsuite/Makefile.in: Rebuild.
16104
16105 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
16106 long.
16107 * testsuite/script_test_2.cc (main): Adjust test.
16108
706e1f5e
ILT
161092008-04-11 David S. Miller <davem@davemloft.net>
16110 Ian Lance Taylor <iant@google.com>
16111
16112 * options.h (General_options): Add entries for '-Y' and
16113 '-relax'.
16114 * options.cc (General_options:finalize): If -Y was used, add those
16115 entries to the library path instead of the default "/lib" and
16116 "/usr/lib".
16117
7c98e6bb
DM
161182008-04-11 David S. Miller <davem@davemloft.net>
16119
16120 * testsuite/justsyms.t: Start at 0x100.
16121 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
16122 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16123 long.
16124 * testsuite/script_test_2.cc: Adjust string and section length
16125 checks.
7c98e6bb 16126
99a37bfd
ILT
161272008-04-09 Ian Lance Taylor <iant@google.com>
16128
2cefc357
ILT
16129 PR gold/5996
16130 * script-sections.cc (Sections_element::allocate_to_segment): Add
16131 orphan parameter.
16132 (Output_section_definition::allocate_to_segment): Likewise.
16133 (Orphan_output_section::allocate_to_segment): Likewise.
16134 (Script_sections::attach_sections_using_phdrs_clause): Don't
16135 propagate non-PT_LOAD segments to orphan sections.
16136 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16137 readelf rather than objdump.
16138 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16139 .interp section and PT_INTERP segment are the same size.
16140 * testsuite/Makefile.in: Rebuild.
16141
99a37bfd
ILT
16142 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16143 aliases for symbols defined in the same object.
16144 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16145 (weak_alias_test_SOURCES): New variable.
16146 (weak_alias_test_DEPENDENCIES): New variable.
16147 (weak_alias_test_LDFLAGS): New variable.
16148 (weak_alias_test_LDADD): New variable.
16149 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16150 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16151 (weak_alias_test_3.o): New target.
16152 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16153 * testsuite/weak_alias_test_main.cc: New file.
16154 * testsuite/weak_alias_test_1.cc: New file.
16155 * testsuite/weak_alias_test_2.cc: New file.
16156 * testsuite/weak_alias_test_3.cc: New file.
16157
780e49c5
ILT
161582008-04-08 Ian Lance Taylor <iant@google.com>
16159
cdb0b8f5
ILT
16160 * options.h (class General_options): Add --noinhibit-exec option.
16161 * main.cc (main): Check --noinhibit-exec.
16162
0864d551
ILT
16163 * options.h (class General_options): Define --wrap as a special
16164 option. Add wrap_symbols_ field.
16165 (General_options::any_wrap_symbols): New function.
16166 (General_options::is_wrap_symbol): New function.
16167 * options.cc (General_options::parse_wrap): New function.
16168 (General_options::General_options): Initialize wrap_symbols_.
16169 * symtab.cc (Symbol_table::wrap_symbol): New function.
16170 (Symbol_table::add_from_object): Handle --wrap.
16171 * symtab.h (class Symbol_table): Declare wrap_symbol.
16172 * target.h (Target::wrap_char): New function.
16173 (Target::Target_info): Add wrap_char field.
16174 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16175 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16176 * testsuite/testfile.cc (Target_test::test_target_info):
16177 Likewise.
16178
789aa6de
ILT
16179 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16180 there is one.
16181
2c38906f
ILT
16182 * layout.h (class Layout): Add added_eh_frame_data_ field.
16183 * layout.cc (Layout::Layout): Initialize new field.
16184 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16185 output section until we find a section we merged successfully.
16186 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16187 that the size be non-zero.
16188
780e49c5
ILT
16189 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16190 qualifier.
16191
7fcd0256
ILT
161922008-04-08 Craig Silverstein <csilvers@google.com>
16193
16194 * configure.ac: Export new conditional variable HAVE_ZLIB.
16195 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16196 on HAVE_ZLIB.
16197 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16198 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16199
6835af53
ILT
162002008-04-07 Ian Lance Taylor <iant@google.com>
16201
e24f324c
ILT
16202 * version.cc (version_string): Set to "1.5".
16203
a036edd8
ILT
16204 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16205 Add issued_non_pic_error_ field. Declare check_non_pic.
16206 (Target_x86_64::Scan::check_non_pic): New function.
16207 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16208 (Target_x86_64::Scan::global): Likewise.
16209
624f8810
ILT
16210 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16211 addend parameter. Change caller. Handle merge sections.
16212 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16213 Address to Addend. Don't add in the result of
16214 local_section_offset, pass down the addend and use the returned
16215 value.
16216 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16217 Update declarations of local_section_offset and symbol_value.
16218 * testsuite/two_file_test_1.cc (t18): New function.
16219 * testsuite/two_file_test_2.cc (f18): New function.
16220 * testsuite/two_file_test_main.cc (main): Call t18.
16221 * testsuite/two_file_test.h (t18, f18): Declare.
16222
6835af53
ILT
16223 * configure.ac: Don't test for objdump, c++filt, or readelf.
16224 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16225 conditionals.
16226 (TEST_READELF): New variable.
16227 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16228 (check_PROGRAMS): Add two_file_strip_test.
16229 (two_file_strip_test): New target.
16230 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16231 (two_file_same_shared_strip_test_SOURCES): New variable.
16232 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16233 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16234 (two_file_same_shared_strip_test_LDADD): New variable.
16235 (two_file_shared_strip.so): New target.
16236 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16237 (ver_test_5.syms, ver_test_7.syms): Likewise.
16238 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16239 (strip_test_3.stdout): Use TEST_OBJDUMP.
16240 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16241
86925eef
CC
162422008-04-04 Cary Coutant <ccoutant@google.com>
16243
16244 * symtab.h (Symbol::is_weak_undefined): New function.
16245 (Symbol::is_strong_undefined): New function.
16246 (Symbol::is_absolute): New function.
16247 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16248 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16249 absolute symbols.
16250 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16251 (weak_undef_test): New target.
16252 * testsuite/Makefile.in: Rebuild.
16253 * testsuite/weak_undef_file1.cc: New file.
16254 * testsuite/weak_undef_file2.cc: New file.
16255 * testsuite/weak_undef_test.cc: New file.
16256
126f3ece
ILT
162572008-04-03 Craig Silverstein <csilvers@google.com>
16258
16259 * compressed_output.h (class Output_compressed_section): Use
16260 unsigned buffer.
16261 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16262 add zlib header.
16263 (zlib_compressed_suffix): Removed.
16264 (Output_compressed_section::set_final_data_size): Use unsigned
16265 buffers.
16266 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16267 Fix linker invocation.
16268 (flagstest_o_specialfile_and_compress_debug_sections):
16269 Likewise.
16270 * testsuite/Makefile.in: Regenerated.
16271
deae2a14
DM
162722008-04-02 David S. Miller <davem@davemloft.net>
16273
16274 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16275 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16276
70752818
ILT
162772008-04-02 Craig Silverstein <csilvers@google.com>
16278
16279 * TODO: New file.
16280
39d0cb0e
ILT
162812008-04-02 Ian Lance Taylor <iant@google.com>
16282
16283 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16284 parameters. Update for new key type to views_. Change all
16285 callers.
16286 (File_read::read): Adjust for byteshift in returned view.
16287 (File_read::add_view): New function, broken out of
16288 find_and_make_view.
16289 (File_read::make_view): New function, broken out of
16290 find_and_make_view.
16291 (File_read::find_or_make_view): Add offset and aligned
16292 parameters. Rewrite accordingly. Change all callers.
16293 (File_read::get_view): Add offset and aligned parameters. Adjust
16294 for byteshift in return value.
16295 (File_read::get_lasting_view): Likewise.
16296 * fileread.h (class File_read): Update declarations.
16297 (class File_read::View): Add byteshift_ field. Add byteshift to
16298 constructor. Add byteshift method.
16299 * archive.h (Archive::clear_uncached_views): New function.
16300 (Archive::get_view): Add aligned parameter. Change all callers.
16301 * object.h (Object::get_view): Add aligned parameter. Change all
16302 callers.
16303 (Object::get_lasting_view): Likewise.
16304
16305 * fileread.cc (File_read::release): Don't call clear_views if
16306 there are multiple objects.
16307 * fileread.h (File_read::clear_uncached_views): New function.
16308 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16309 on the archive.
16310
a1207466
CC
163112008-03-31 Cary Coutant <ccoutant@google.com>
16312
16313 Add thin archive support.
16314 * archive.cc (Archive::armagt): New const.
16315 (Archive::setup): Remove task parameter and calls to unlock.
16316 (Archive::unlock_nested_archives): New function.
16317 (Archive::read_header): Add nested_off parameter. Change
16318 all callers.
16319 (Archive::interpret_header): Likewise.
16320 (Archive::include_all_members): Change to handle thin
16321 archives.
16322 (Archive::include_member): Likewise.
16323 * archive.h (Archive::Archive): Add new parameters and
16324 initializers.
16325 (Archive::armagt): New const.
16326 (Archive::setup): Remove task parameter.
16327 (Archive::unlock_nested_archives): New function.
16328 (Archive::read_header): Add nested_off parameter.
16329 (Archive::interpret_header): Likewise.
16330 (Archive::Nested_archive_table): New typedef.
16331 (Archive::is_thin_archive_): New field.
16332 (Archive::nested_archives_): New field.
16333 (Archive::options_): New field.
16334 (Archive::dirpath_): New field.
16335 (Archive::task_): New field.
16336 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16337 for thin archives. Pass additional parameters to
16338 Archive::Archive. Unlock the archive file after calling
16339 Archive::setup.
cd536b21 16340
479f6503
ILT
163412008-03-29 Ian Lance Taylor <iant@google.com>
16342
686c8caf
ILT
16343 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16344 version symbol to be local.
16345 * testsuite/ver_test_4.sh: New file.
16346 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16347 (check_DATA): Add ver_test_4.syms.
16348 (ver_test_4.syms): New target.
16349 * testsuite/Makefile.in: Rebuild.
16350
ab794b6b
ILT
16351 * output.cc
16352 (Output_section::Input_section_sort_entry::has_priority): New
16353 function.
16354 (Output_section::Input_section_sort_entry::match_file_name): New
16355 function.
16356 (Output_section::Input_section_sort_entry::match_section_name):
16357 Remove.
16358 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16359 Remove.
16360 (Output_section::Input_section_sort_entry::match_section_file):
16361 Remove.
16362 (Output_section::Input_section_sort_compare::operator()): Rewrite
16363 using new Input_section_sort_entry functions. Sort crtbegin and
16364 crtend first. Sort sections with no priority before sections with
16365 a priority.
16366 * testsuite/initpri1.c (d3): Check j != 4.
16367 (cd5): New constructor/destructor function.
16368 (main): Check j != 2.
16369
479f6503
ILT
16370 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16371 new symbol when resolving, don't call set_is_default.
16372 * testsuite/ver_test_7.cc: New file.
16373 * testsuite/ver_test_7.sh: New file.
16374 * testsuite/Makefile.am (ver_test_7.so): New target.
16375 (ver_test_7.o): New target.
16376 (check_SCRIPTS): Add ver_test_7.sh.
16377 (check_DATA): Add ver_test_7.syms.
16378 (ver_test_7.syms): New target.
16379
2fd32231
ILT
163802008-03-28 Ian Lance Taylor <iant@google.com>
16381
16382 * layout.cc (Layout::layout): If we see an input section with a
16383 name that needs sorting, set the must_sort flag for the output
16384 section.
16385 (Layout::make_output_section): If the name of the output section
16386 indicates that it might require sorting, set the may_sort flag.
16387 * output.h (Output_section::may_sort_attached_input_sections): New
16388 function.
16389 (Output_section::set_may_sort_attached_input_sections): New
16390 function.
16391 (Output_section::must_sort_attached_input_sections): New
16392 function.
16393 (Output_section::set_must_sort_attached_input_sections): New
16394 function.
16395 (class Output_section): Declare Input_section_sort_entry. Define
16396 Input_section_sort_compare. Declare
16397 sort_attached_input_sections. Add new fields:
16398 may_sort_attached_input_sections_,
16399 must_sort_attached_input_sections_,
16400 attached_input_sections_are_sorted_.
16401 * output.cc (Output_section::Output_section): Initialize new
16402 fields.
16403 (Output_section::add_input_section): Add an entry to
16404 input_sections_ if may_sort or must_sort are true.
16405 (Output_section::set_final_data_size): Call
16406 sort_attached_input_sections if necessary.
16407 (Output_section::Input_section_sort_entry): Define new class.
16408 (Output_section::Input_section_sort_compare::operator()): New
16409 function.
16410 (Output_section::sort_attached_input_sections): New function.
16411 * configure.ac: Check whether the compiler supports constructor
16412 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16413 * testsuite/initpri1.c: New file.
16414 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16415 CONSTRUCTOR_PRIORITY.
16416 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16417 (initpri1_LDFLAGS): New variable.
16418 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16419
18e6b24e
ILT
164202008-03-27 Ian Lance Taylor <iant@google.com>
16421
49bdd526
ILT
16422 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16423 * testsuite/common_test_1.c: New file.
16424 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16425 (common_test_1_SOURCES): New variable.
16426 (common_test_1_DEPENDENCIES): New variable.
16427 (common_test_1_LDFLAGS): New variable.
16428
18e6b24e
ILT
16429 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16430 and commons_ correctly when NAME/VERSION does not override
16431 NAME/NULL.
16432 * testsuite/ver_test_6.c: New file.
16433 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16434 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16435 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16436
04bf7072
ILT
164372008-03-26 Ian Lance Taylor <iant@google.com>
16438
5871526f
ILT
16439 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16440 of an undefined symbol from a version script.
16441 * testsuite/Makefile.am (ver_test_5.so): New target.
16442 (ver_test_5.o): New target.
16443 (check_SCRIPTS): Add ver_test_5.sh.
16444 (check_DATA): Add ver_test_5.syms.
16445 (ver_test_5.syms): New target.
16446 * testsuite/ver_test_5.cc: New file.
16447 * testsuite/ver_test_5.script: New file.
16448 * testsuite/ver_test_5.sh: New file.
16449 * Makefile.in, testsuite/Makefile.in: Rebuild.
16450
04bf7072
ILT
16451 PR gold/5986
16452 Fix problems building gold with gcc 4.3.0.
16453 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16454 (gold_error_at_location, gold_warning_at_location): Use it.
16455 * configure.ac: Check whether we can compile and use a template
16456 function with a printf attribute.
16457 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16458 when jumping over bytes.
16459 * object.cc: Instantiate Object::read_section_data.
16460 * debug.h: Include <cstring>
16461 * dwarf_reader.cc: Include <algorithm>
16462 * main.cc: Include <cstring>.
16463 * options.cc: Include <cstring>.
16464 * output.cc: Include <cstring>.
16465 * script.cc: Include <cstring>.
16466 * script.h: Include <string>.
16467 * symtab.cc: Include <cstring> and <algorithm>.
16468 * target-select.cc: Include <cstring>.
16469 * version.cc: Include <string>.
16470 * testsuite/testmain.cc: Include <cstdlib>.
16471 * configure, config.in: Rebuild.
16472
874c5b28
ILT
164732008-03-25 Ian Lance Taylor <iant@google.com>
16474
819d6c3a
ILT
16475 * options.cc: Include "../bfd/bfdver.h".
16476 (options::help): Print bug reporting address.
16477
f4b2c6f5
ILT
16478 * version.cc (print_version): Adjust output for current value of
16479 BFD_VERSION_STRING.
16480
16481 * NEWS: New file.
16482
e96caa79
ILT
16483 * options.cc (options::help): Print list of supported targets.
16484 * target-select.h: Include <vector>.
16485 (class Target_selector): Make machine_, size_, and is_big_endian_
16486 fields const. Add bfd_name_ and instantiated_target_ fields.
16487 (Target_selector::Target_selector): Add bfd_name parameter.
16488 (Target_selector::recognize): Make non-virtual, call
16489 do_recognize.
16490 (Target_selector::recognize_by_name): Make non-virtual, call
16491 do_recognize_by_name.
16492 (Target_selector::supported_names): New function.
16493 (Target_selector::bfd_name): New function.
16494 (Target_selector::do_instantiate_target): New pure virtual
16495 function.
16496 (Target_selector::do_recognize): New virtual function.
16497 (Target_selector::do_recognize_by_name): New virtual function.
16498 (Target_selector::instantiate_target): New private function.
16499 (supported_target_names): Declare.
16500 * target-select.cc (Target_selector::Target_selector): Update for
16501 new parameter and fields.
16502 (select_target_by_name): Check that the name matches before
16503 calling recognize_by_name.
16504 (supported_target_names): New function.
16505 * i386.cc (class Target_selector_i386): Update Target_selector
16506 constructor call. Remove recognize and recognize_by_name. Add
16507 do_instantiate_target.
16508 * x86_64.cc (class Target_selector_x86_64): Likewise.
16509 * testsuite/testfile.cc (class Target_selector_test): Update for
16510 changes to Target_selector.
16511
874c5b28
ILT
16512 * README: Rewrite, with some notes on unsupported features.
16513
0a65a3a7
CC
165142008-03-24 Cary Coutant <ccoutant@google.com>
16515
16516 * i386.cc (Target_i386::Got_type): New enum declaration.
16517 (Target_i386::Scan::local): Updated callers of Output_data_got
16518 member functions.
16519 (Target_i386::Scan::global): Likewise.
16520 (Target_i386::Relocate::relocate): Likewise.
16521 (Target_i386::Relocate::relocate_tls): Likewise.
16522 * object.h (Got_offset_list): New class.
16523 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16524 (Sized_relobj::local_got_offset): Likewise.
16525 (Sized_relobj::set_local_got_offset): Likewise.
16526 (Sized_relobj::local_has_tls_got_offset): Removed.
16527 (Sized_relobj::local_tls_got_offset): Removed.
16528 (Sized_relobj::set_local_tls_got_offset): Removed.
16529 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16530 * output.cc (Output_data_got::add_global): Added got_type parameter.
16531 (Output_data_got::add_global_with_rel): Likewise.
16532 (Output_data_got::add_global_with_rela): Likewise.
16533 (Output_data_got::add_global_pair_with_rel): New function.
16534 (Output_data_got::add_global_pair_with_rela): New function.
16535 (Output_data_got::add_local): Added got_type parameter.
16536 (Output_data_got::add_local_with_rel): Likewise.
16537 (Output_data_got::add_local_with_rela): Likewise.
16538 (Output_data_got::add_local_pair_with_rel): New function.
16539 (Output_data_got::add_local_pair_with_rela): New function.
16540 (Output_data_got::add_global_tls): Removed.
16541 (Output_data_got::add_global_tls_with_rel): Removed.
16542 (Output_data_got::add_global_tls_with_rela): Removed.
16543 (Output_data_got::add_local_tls): Removed.
16544 (Output_data_got::add_local_tls_with_rel): Removed.
16545 (Output_data_got::add_local_tls_with_rela): Removed.
16546 * output.h (Output_data_got::add_global): Added got_type parameter.
16547 (Output_data_got::add_global_with_rel): Likewise.
16548 (Output_data_got::add_global_with_rela): Likewise.
16549 (Output_data_got::add_global_pair_with_rel): New function.
16550 (Output_data_got::add_global_pair_with_rela): New function.
16551 (Output_data_got::add_local): Added got_type parameter.
16552 (Output_data_got::add_local_with_rel): Likewise.
16553 (Output_data_got::add_local_with_rela): Likewise.
16554 (Output_data_got::add_local_pair_with_rel): New function.
16555 (Output_data_got::add_local_pair_with_rela): New function.
16556 (Output_data_got::add_global_tls): Removed.
16557 (Output_data_got::add_global_tls_with_rel): Removed.
16558 (Output_data_got::add_global_tls_with_rela): Removed.
16559 (Output_data_got::add_local_tls): Removed.
16560 (Output_data_got::add_local_tls_with_rel): Removed.
16561 (Output_data_got::add_local_tls_with_rela): Removed.
16562 * resolve.cc (Symbol::override_base_with_special): Removed
16563 reference to has_got_offset_ field.
16564 * symtab.cc (Symbol::init_fields): Replaced initialization
16565 of got_offset_ with got_offsets_. Removed initialization
16566 of has_got_offset_
53fcba31 16567 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16568 (Symbol::got_offset): Likewise.
16569 (Symbol::set_got_offset): Likewise.
16570 (Symbol::has_tls_got_offset): Removed.
16571 (Symbol::tls_got_offset): Removed.
16572 (Symbol::set_tls_got_offset): Removed.
16573 (Symbol::got_offset_): Removed.
16574 (Symbol::tls_mod_got_offset_): Removed.
16575 (Symbol::tls_pair_got_offset_): Removed.
16576 (Symbol::got_offsets_): New field.
16577 (Symbol::has_got_offset): Removed.
16578 (Symbol::has_tls_mod_got_offset): Removed.
16579 (Symbol::has_tls_pair_got_offset): Removed.
16580 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16581 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16582 member functions.
16583 (Target_x86_64::Scan::global): Likewise.
16584 (Target_x86_64::Relocate::relocate): Likewise.
16585 (Target_x86_64::Relocate::relocate_tls): Likewise.
16586
bd52eafb
BE
165872008-03-25 Ben Elliston <bje@au.ibm.com>
16588
16589 * yyscript.y: Fix spelling error in comment.
16590
8b105e34
ILT
165912008-03-24 Ian Lance Taylor <iant@google.com>
16592
8ed814a9
ILT
16593 * options.h (class General_options): Define build_id option.
16594 * layout.h (class Layout): Declare write_build_id, create_note,
16595 create_build_id. Add build_id_note_ member.
16596 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16597 "libiberty.h", "md5.h", "sha1.h".
16598 (Layout::Layout): Initialize eh_frame_data_,
16599 eh_frame_hdr_section_, and build_id_note_.
16600 (Layout::finalize): Call create_build_id.
16601 (Layout::create_note): New function, broken out of
16602 Layout::create_gold_note.
16603 (Layout::create_gold_note): Call create_note.
16604 (Layout::create_build_id): New function.
16605 (Layout::write_build_id): New function.
16606 (Close_task_runner::run): Call write_build_id.
16607
8b105e34
ILT
16608 * x86_64.cc: Correct license to GPLv3.
16609
086a1841
ILT
166102008-03-23 Ian Lance Taylor <iant@google.com>
16611
16612 * options.cc: Include "demangle.h".
16613 (parse_optional_string): New function.
16614 (parse_long_option): Handle takes_optional_argument.
16615 (parse_short_option): Update dash_z initializer. Handle
16616 takes_optional_argument.
16617 (General_options::General_options): Initialize do_demangle_.
16618 (General_options::finalize): Set do_demangle_. Handle demangling
16619 style.
16620 * options.h (parse_optional_string): Declare.
16621 (struct One_option): Add optional_arg field. Update constructor.
16622 Update call constructor calls. Add takes_optional_argument
16623 function.
16624 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16625 (DEFINE_optional_string): Define.
16626 (General_options::demangle): Change from DEFINE_bool to
16627 DEFINE_optional_string.
16628 (General_options::no_demangle): New function.
16629 (General_options::do_demangle): New function.
16630 (General_options::set_do_demangle): New function.
16631 (General_options::execstack_status_): Move definition to end of
16632 class definition.
16633 (General_options::static_): Likewise.
16634 (General_options::do_demangle_): New field.
16635 * object.cc (big_endian>::get_symbol_location_info): Call
16636 Options::do_demangle, not Options::demangle.
16637 * symtab.cc (demangle): Likewise.
16638
cbb93e63
ILT
166392008-03-22 Ian Lance Taylor <iant@google.com>
16640
16641 * gold.h: Include <cstddef> and <sys/types.h>
16642 * options.h: Include <cstring>.
16643
ec531623
ILT
166442008-03-21 Ian Lance Taylor <iant@google.com>
16645
16646 * Added source code to GNU binutils.
752937aa 16647\f
b90efa5b 16648Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
16649
16650Copying and distribution of this file, with or without modification,
16651are permitted in any medium without royalty provided the copyright
16652notice and this notice are preserved.
16653
16654Local Variables:
16655mode: change-log
16656left-margin: 8
16657fill-column: 74
16658version-control: never
16659End:
This page took 1.162295 seconds and 4 git commands to generate.