completer.c (completion_list_add_name): Fix memory leak.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
07f107f3
WN
12015-02-11 Will Newton <will.newton@linaro.org>
2
3 PR gold/13321
4 * arm.cc (Target_arm::make_plt_section): Create an ARM
5 state mapping symbol at the start of the PLT.
6
e051a5b5
L
72015-02-09 H.J. Lu <hongjiu.lu@intel.com>
8
9 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
10 Replace two_file_shared_2.so with two_file_shared_1.so.
11 * testsuite/Makefile.in: Regenerated.
12
dddcc5b9
AM
132015-02-09 Alan Modra <amodra@gmail.com>
14
15 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
16 plugin_test_thin.a and defsym_test.
17 * testsuite/Makefile.in: Regenerate.
18
b39b8b9d
RÁE
192015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
20
21 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
22 body.
23
b66d1c52
CC
242015-02-04 Peter Collingbourne <pcc@google.com>
25
26 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
27 forwarding symbols when computing symbol resolution info for plugins.
28 * plugin.h (Plugin_manager::symtab): New method.
29 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
30
23081de0
CC
312015-02-03 Cary Coutant <ccoutant@google.com>
32 Peter Collingbourne <pcc@google.com>
33
34 PR gold/15660
35 * archive.cc (Thin_archive_object_unlocker): New class.
36 (Archive::include_member): Unlock external members of thin archives.
37 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
38 (plugin_test_2): Likewise.
39 (plugin_test_3): Likewise.
40 (plugin_test_4): Likewise.
41 (plugin_test_5): Likewise.
42 (plugin_test_6): Likewise.
43 (plugin_test_7): Likewise.
44 (plugin_test_8): Likewise.
45 (plugin_test_9): Likewise.
46 (plugin_test_10): Likewise.
47 (plugin_test_11): New test case.
48 * testsuite/Makefile.in: Regenerate.
49 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
50 file to decide whether to claim file.
51 (all_symbols_read_hook): Likewise.
52 * testsuite/plugin_test_1.sh: Adjust expected output.
53 * testsuite/plugin_test_2.sh: Likewise.
54 * testsuite/plugin_test_3.sh: Likewise.
55 * testsuite/plugin_test_6.sh: Likewise.
56 * testsuite/plugin_test_tls.sh: Likewise.
57 * testsuite/plugin_test_11.sh: New testcase.
58
592015-02-03 Cary Coutant <ccoutant@google.com>
60
61 * descriptors.cc (Descriptors::open): Set artificially-low limit for
62 file descriptors when debugging enabled. Add debug output.
63 (Descriptors::release): Add debug output.
64 (Descriptors::close_some_descriptor): Likewise.
65 (Descriptors::close_all): Likewise.
66 * fileread.cc (File_read::lock): Likewise.
67 (File_read::unlock): Likewise.
68
24dd5808
CC
692015-02-02 Cary Coutant <ccoutant@google.com>
70
71 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
72 executable output file.
73
fa89cc82
HS
742015-01-22 Han Shen <shenhan@google.com>
75
76 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
77 (Target_arm::do_plt_address_for_global): New method.
78 (Target_arm::do_plt_address_for_local): New method.
79 (Target_arm::rel_irelative_section): New method.
80 (Target_arm::make_data_plt): Add more parameters for plt ctor.
81 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
82 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
83 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
84 (Target_arm::Scan::check_non_pic): Add ifunc support.
85 (Target_arm::Scan::local): Add ifunc support.
86 (Target_arm::Scan::global): Add ifunc support.
87 (Target_arm::make_plt_section): New method.
88 (Target_arm::make_plt_entry): Change to call to make_plt_section.
89 (Target_arm::make_local_ifunc_plt_entry): New method.
90 (Target_arm::got_irelative_): New member.
91 (Target_arm::rel_irelative_): New member.
92 (Target_arm::got_section): Add creation for got_irelative_.
93 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
94 (Target_arm::Relocate::relocate): Properly set local ifunc address.
95 (Target_arm::do_dynsym_value): Properly set global ifunc address.
96 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
97 (Output_data_plt_arm::IRelative_data): New type.
98 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
99 (Output_data_plt_arm::add_entry): Add more parameters.
100 (Output_data_plt_arm::add_relocation): New method.
101 (Output_data_plt_arm::add_local_ifunc_entry): New method.
102 (Output_data_plt_arm::rel_irelative): New method.
103 (Output_data_plt_arm::entry_count): Modified.
104 (Output_data_plt_arm::address_for_global): New method.
105 (Output_data_plt_arm::address_for_local): New method.
23081de0 106gold/
fa89cc82
HS
107 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
108 (Output_data_plt_arm::insert_irelative_data): New method.
109 (Output_data_plt_arm::irelative_rel_): New member.
110 (Output_data_plt_arm::got_): New member.
111 (Output_data_plt_arm::got_irelative_): New member.
112 (Output_data_plt_arm::irelative_count_): New member.
113 (Output_data_plt_arm::IRelative_data_vec): New typedef.
114 (Output_data_plt_arm::irelative_data_vec_): New member.
115 (Output_data_plt_arm::do_write): Write out irelative entries.
116 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
117 more parameters to ctor.
118 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
119 more parameters to ctor.
120 * output.h (Output_data_reloc::add_local_relative): New method.
121 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
122
0f81d3f0
AM
1232015-01-29 Alan Modra <amodra@gmail.com>
124
125 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
126 and GOT_TLSGD to LE optimization.
127
65d92137
CC
1282015-01-28 Cary Coutant <ccoutant@google.com>
129
130 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
131 for undef TLS symbols.
132 (Target_x86_64::Relocate::relocate_tls): Likewise.
133 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
134
5485698a
CC
1352015-01-25 Cary Coutant <ccoutant@google.com>
136
137 * output.cc (Output_segment::set_section_addresses): Fix calculation
138 of size of relro segment.
139
b01a4b04
AM
1402015-01-22 Alan Modra <amodra@gmail.com>
141
142 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
143 condition for need of ifunc plt entry.
144 (Target_powerpc::Scan::global <got relocs>): Likewise.
145
3d0064a9
CC
1462015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
147
148 * mips.cc (reloc_high): Add r_sym.
149 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
150 reloc_high constructor.
151 (Mips_relocate_functions::relgot16_local): Likewise.
152 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
153 r_type to decide whether LO16 matches HI16.
154 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
155 rello16 and relgot16_local.
156
a5cd8f05
CC
1572015-01-09 Cary Coutant <ccoutant@google.com>
158
159 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
160 unless alignment is larger than page size.
161
4fc1b9d4
L
1622015-01-06 H.J. Lu <hongjiu.lu@intel.com>
163 Cary Coutant <ccoutant@google.com>
164
165 PR gold/17729
166 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
167 (DEFAULT_TARGET_X32): Set for x32.
168 * x86_64.cc (cmp_insn_32): New.
169 (lea_r10_insn_32): Likewise.
170 (lea_r11_insn_32): Likewise.
171 (cmp_insn_64): Likewise.
172 (lea_r10_insn_64): Likewise.
173 (lea_r11_insn_64): Likewise.
174 (Target_x86_64<size>::do_calls_non_split): Handle x32.
175 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
176 (check_DATA): Add split_x32 files.
177 (split_x32_[1234n].o): New targets.
178 (split_x32_[124]): New targets.
179 (split_x32_[1234r].stdout): New targets.
180 * testsuite/split_x32.sh: New file.
181 * testsuite/split_x32_1.s: Likewise.
182 * testsuite/split_x32_2.s: Likewise.
183 * testsuite/split_x32_3.s: Likewise.
184 * testsuite/split_x32_4.s: Likewise.
185 * testsuite/split_x32_n.s: Likewise.
186 * configure: Regenerated.
187 * testsuite/Makefile.in: Likewise.
188
e749cab8
L
1892015-01-06 H.J. Lu <hongjiu.lu@intel.com>
190
191 PR gold/17809
192 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
193 x32.
194
af759df0
AM
1952015-01-02 Alan Modra <amodra@gmail.com>
196
197 * version.cc (print_version): Just print current year.
198 * dwp.cc (print_version): Likewise.
199
b90efa5b
AM
2002015-01-01 Alan Modra <amodra@gmail.com>
201
202 Update year range in copyright notice of all files.
203
f12d1e8a
AM
2042014-12-25 Alan Modra <amodra@gmail.com>
205
206 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
207 new enums.
208 (Target_arm::merge_object_attributes, ): Likewise.
209
5c294fee
TG
2102014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
211
212 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
213 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
214 AEABI_VFP_args_vfp to check that.
215 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
216 value and replace hardcoded values by enum values.
217
e30880c2
CC
2182014-12-22 Cary Coutant <ccoutant@google.com>
219
220 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
221
bd040da1
L
2222014-12-20 H.J. Lu <hongjiu.lu@intel.com>
223
224 PR gold/14608
225 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
226 to "return i * i * 3;".
227
e02a4046
CC
2282014-12-16 Cary Coutant <ccoutant@google.com>
229
230 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
231 (Mapfile::print_output_data): Use current_data_size() to avoid
232 assert for sections requiring postprocessing; if address is not valid,
233 print 0.
234 (Mapfile::print_output_section): Use current_data_size(); print note
235 that addresses and sizes are before compression.
236
add6016b
L
2372014-12-14 H.J. Lu <hongjiu.lu@intel.com>
238
239 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
240 Cast current_group_size to unsigned long when reporting error.
241
0bf32ea9
JY
2422014-12-10 Jing Yu <jingyu@google.com>
243
244 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
245 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
246 Update error message.
247 (Target_aarch64::do_relax): Use absolute value of option
248 stub_group_size. Replace local variable with class member
249 stub_group_size_.
250
cbcb23fa
AM
2512014-12-04 Alan Modra <amodra@gmail.com>
252
253 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
254 addend of PLTREL24 reloc when not generating a plt stub. Make
255 max_branch_offset an "Address".
fbad6518 256 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
257 (Target_powerpc::Relocate::relocate): Likewise.
258
1611bc4a
AM
2592014-12-04 Alan Modra <amodra@gmail.com>
260
261 PR 17670
262 * symtab.cc (Symbol::set_undefined): Remove assertion.
263 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
264 on symbols defined in discarded sections, instead return false.
265 Rearrange params, update all callers.
266 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
267 branches to syms in discarded sections.
268 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
269 undefined and flag as discarded.
270 (Target_powerpc::Relocate::relocate): Localize variable.
271
4759c34e
L
2722014-12-03 H.J. Lu <hongjiu.lu@intel.com>
273
274 PR gold/17675
275 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
276 * testsuite/Makefile.in: Regenerated.
277
1f98a074
AM
2782014-12-03 Alan Modra <amodra@gmail.com>
279
280 PR 17566
281 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
282 when adding dynamic relocations against section symbols.
283
fb257835
DI
2842014-12-01 Dimitry Ivanov <dimitry@google.com>
285
286 * layout.cc (Layout::finish_dynamic_section): When '-z global'
287 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
288 * options.h (General_options): New -z option (global).
289
d8e60314
CC
2902014-12-01 Cary Coutant <ccoutant@google.com>
291
292 PR gold/17578
293 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
294 is given.
295 (Layout::create_executable_stack_info): Warn when -z noexecstack is
296 given but some inputs require executable stack.
297
982bbd97
CC
2982014-11-26 Cary Coutant <ccoutant@google.com>
299
300 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
301 .debug_str_offsets; strip .debug_gnu_pubnames and
302 .debug_gnu_pubtypes.
303 (lines_only_debug_sections): Strip all four new sections.
304
bb779192
HS
3052014-11-26 Jing Yu <jingyu@google.com>
306
307 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
308 register to be x0 when to relax TLSDESC_LD64_LO12.
309
a3e60ddb
AM
3102014-11-26 Alan Modra <amodra@gmail.com>
311
312 * powerpc.cc (struct Stub_table_owner): New.
313 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
314 unsigned int vector. Update all references.
315 (powerpc_relobj::set_stub_table): Take an unsigned int param
316 rather than a Stub_table. Update callers.
317 (Powerpc_relobj::clear_stub_table): New function.
318 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
319 stub_group_size_ vars.
320 (Target_powerpc::new_stub_table): Delete.
321 (max_branch_delta): New function, extracted from..
322 (Target_powerpc::Relocate::relocate): ..here..
323 (Target_powerpc::Branch_info::make_stub): ..and here. Return
324 status on whether stub created successfully.
325 (Stub_control::Stub_control): Add "no_size_errors" param. Move
326 default sizing to..
327 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
328 reduce on relax failure.
329 (Target_powerpc::group_sections): Add "no_size_errors" param.
330 Use stub_group_size_. Set up group info in a temp vector,
331 before building Stub_table vector. Account for input sections
332 possibly already converted to relaxed sections.
333 (Stub_table::init): Delete. Merge into..
334 (Stub_table::Stub_table): ..here.
335 (Stub_table::can_reach_stub): New function.
336 (Stub_table::add_plt_call_entry): Add "from" parameter and
337 return true iff stub could be reached.
338 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
339 param too.
340 (Stub_table::clear_stubs): Add "all" param.
341
a20605cf
AM
3422014-11-26 Alan Modra <amodra@gmail.com>
343
344 * powerpc.cc (Stub_control::set_output_and_owner): New function.
345 (Target_powerpc::group_sections): Use it.
346
43b64deb
CC
3472014-11-25 Cary Coutant <ccoutant@google.com>
348
349 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
350 (Binary_to_elf::write_symbol): Add st_size parameter.
351 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
352
c924eb67
CC
3532014-11-25 Cary Coutant <ccoutant@google.com>
354
355 PR gold/17639
356 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
357 (Sized_relobj_file::do_layout): Handle deferred sections properly
358 during GC pass 1. Don't add reloc sections to deferred list twice.
359 * object.h (Sized_relobj_file::is_deferred_layout): New function.
360 (Sized_relobj_file::is_deferred_layout_): New data member.
361
9d585188
L
3622014-11-21 H.J. Lu <hongjiu.lu@intel.com>
363
364 PR gold/17619
365 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
366 Check PC-relative offset overflow in PLT entry.
367
3ffaac20
AM
3682014-11-21 Alan Modra <amodra@gmail.com>
369
370 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
371 for undefined weaks.
372
0cfb0717
AM
3732014-11-20 Alan Modra <amodra@gmail.com>
374
375 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
376 from --stub-group-size parameter divided by 1024.
377 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
378 template parameter. Update all uses.
379 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
380 has_stub_value. Set for long branches. Don't report overflow for
381 branch to undefined weak symbols. Print info message on
382 overflowing branch to stub.
383
f9dffbf0
AM
3842014-11-20 Alan Modra <amodra@gmail.com>
385
386 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
387
e88ba8d5
L
3882014-11-13 H.J. Lu <hongjiu.lu@intel.com>
389
390 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
391 entry for R_X86_64_GOTPLT64.
392 (Target_x86_64<size>::Relocate::relocate): Update comments for
393 R_X86_64_GOTPLT64.
394
d37ffe25
ED
3952014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
396
397 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
398 * plugin.h: add lock definition
399
9726c3c1
HS
4002014-10-29 Han Shen <shenhan@google.com>
401 Jing Yu <jingyu@google.com>
402
403 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
404 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
405 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
406 Symbol::TLS_REF.
407 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
408 method.
409 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
410 (Target_aarch64::tls_ld_to_le): New method.
411 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
412 for 64bit targets.
413 (Output_data_plt_aarch64::irelative_rel_): New data member.
414 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
415 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
416 (Output_data_plt_aarch64::add_relocation): New method.
417 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
418 offset. Add got_irelative size to got size.
419 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
420 type string with the new typename.
421 (AArch64_relocate_functions::update_adr): Replace parameter x with
422 immed.
423 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
424 (AArch64_relocate_functions::reloc_common): New method.
425 (AArch64_relocate_funcsions::rela_general): Extract common part out
426 into reloc_common method.
427 (AArch64_relocate_functions::rela_general): Likewise.
428 (AArch64_relocate_functions::pcrela_general): Likewise.
429 (AArch64_relocate_functions::adr): New method.
430 (AArch64_relocate_functions::adrp): Calculate immed before calling
431 update_adr.
432 (AArch64_relocate_functions::adrp): Likewise.
433 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
434 comparing x to 0. Calculate immed from ~x when x < 0.
435 (Target_aarch64::optimize_tls_reloc): Add new cases for
436 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
437 TLSLD_MOVW_DTPREL_G0_NC.
438 (Target_aarch64::possible_function_pointer_reloc): Implement this
439 method.
440 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
441 comment.
442 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
443 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
444 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
445 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
446 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
447 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
448 (Target_aarch64::make_plt_entry): Call add_entry with two more
449 parameters.
450 (Target_aarch64::make_local_ifunc_plt_entry): New method.
451 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
452 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
453 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
454 (Target_aarch64::Relocate::relocate_tls): Add cases for
455 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
456 TLSLD_MOVW_DTPREL_G0_NC.
457 * testsuite/icf_safe_so_test.cc: Correct test comment.
458 * testsuite/icf_safe_test.sh: Add AArch64 arch.
459
80272b8c
AM
4602014-10-22 Alan Modra <amodra@gmail.com>
461
462 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
463 thread_starter.
464
998a69f4
AS
4652014-10-18 Andreas Schwab <schwab@linux-m68k.org>
466
467 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
468
aed56ec5
CC
4692014-10-17 Cary Coutant <ccoutant@google.com>
470
471 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
472 Add "typename" keyword.
473
bb779192 4742014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
475 Jing Yu <jingyu@google.com>
476
477 Patch for gold aarch64 backend to support relaxation.
478 * aarch64-reloc.def: Change format.
479 * aarch64.cc (class Reloc_stub): New class.
480 (class Stub_table): New class.
481 (class AArch64_relobj): New class.
482 (class AArch64_input_section): New class.
483 (class AArch64_output_section): New class.
484 (Target_aarch64::new_stub_table): New method.
485 (Target_aarch64::new_aarch64_input_section): New method.
486 (Target_aarch64::find_aarch64_input_section): New method.
487 (Target_aarch64::scan_section_for_stubs): New method.
488 (Target_aarch64::scan_reloc_section_for_stubs): New method.
489 (Target_aarch64::relocate_stub): New method.
490 (Target_aarch64::current_target): New method.
491 (Target_aarch64::do_make_elf_object): New method.
492 (Target_aarch64::do_may_relax): New method.
493 (Target_aarch64::do_relax): New method.
494 (Target_aarch64::group_sections): New method.
495 (Target_aarch64::scan_reloc_for_stub): New method.
496 (Target_aarch64::do_make_output_section): New method.
497 (Target_aarch64::stub_tables_): New data member.
498 (Target_aarch64::aarch64_input_section_map_): New data member.
499 (AArch64_relocate_functions::maybe_apply_stub): New method.
500
db4c9594
CC
5012014-09-30 Cary Coutant <ccoutant@google.com>
502
503 PR gold/17432
504 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
505
cd6da036
KC
5062014-09-30 Kito Cheng <kito@0xlab.org>
507
508 PR gold/13597
509 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
510 hash table before sysv-style hash table.
511
5f772412
ST
5122014-09-29 Sriraman Tallam <tmsriram@google.com>
513
514 * options.h (--pic-executable): Add negative to alias to -no-pie.
515
5efeedf6
CC
5162014-09-26 Cary Coutant <ccoutant@google.com>
517
518 PR gold/16773
519 * object.cc (Sized_relobj_file): Compute value of section symbols
520 for TLS sections the same as TLS symbols.
521
1707f183
CC
5222014-09-25 Cary Coutant <ccoutant@google.com>
523
524 PR gold/17432
525 * resolve.cc (Symbol_table::resolve): Override common placeholder
526 symbols, but adjust sizes.
527 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
528 symbols to common lists.
529
00cac886
AM
5302014-09-24 Alan Modra <amodra@gmail.com>
531
532 * po/POTFILES.in: Regenerate.
533
635aa30e
CC
5342014-09-23 Taiju Tsuiki <tzik@google.com>
535 Cary Coutant <ccoutant@google.com>
536
71b9b91b 537 PR gold/14860
635aa30e
CC
538 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
539 on input_sections_blocker.
540 * layout.cc (Write_sections_task::locks): Unblock
541 input_sections_blocker_.
542 * layout.h (Write_sections_task::Write_sections_task): Add
543 input_sections_blocker.
544 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
545 to DEPENDENCIES.
546 * testsuite/Makefile.in: Regenerate.
547
c0c71592
RÁE
5482014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
549
550 * testsuite/Makefile.am (plugin_test_10): New test.
551 * testsuite/Makefile.in: Regenerate
552 * testsuite/plugin_common_test_2.c (c1): Align to 8.
553 * testsuite/plugin_test_10.sh: New file.
554
6168c2a1
RÁE
5552014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
556
557 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
558 * resolve.cc (Symbol_table::resolve): Don't override common symbols
559 during the replacement phase.
560
3a531937
JY
5612014-09-17 Han Shen <shenhan@google.com>
562 Jing Yu <jingyu@google.com>
563
564 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
565 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
566 * aarch64.cc (Target_aarch64): Add data members
567 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
568 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
569 constructor.
570 (Target_aarch64::do_reloc_symbol_index): New method.
571 (Target_aarch64::do_reloc_addend): New method.
572 (Target_aarch64::add_tlsdesc_info): New method.
573 (Target_aarch64::do_dynsym_value): New method.
574 (Target_aarch64::do_make_data_plt): Add new parameters: got,
575 got_irelative. Pass them to Output_data_plt_aarch64_standard.
576 (Target_aarch64::make_data_plt): Add new parameters: got,
577 got_irelative. Pass them to do_make_data_plt.
578 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
579 (Target_aarch64::Relocate:tls_gd_to_le): New method.
580 (Target_aarch64::Relocate:tls_ie_to_le): New method.
581 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
582 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
583 (Target_aarch64::got_tlsdesc_section): New method.
584 (Target_aarch64::make_local_ifunc_plt_entry): New method.
585 (Target_aarch64::define_tls_base_symbol): New method.
586 (Target_aarch64::reserve_tlsdesc_entries): New method.
587 (Target_aarch64::got_mod_index_entry): New method.
588 (Target_aarch64::rela_tlsdesc_section): New method.
589 (Target_aarch64::rela_irelative_section): New method.
590 (Target_aarch64::Tlsdesc_info): New struct.
591 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
592 relocations and tlsdesc relocations.
593 (Target_aarch64::optimize_tls_reloc): Implement method.
594 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
595 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
596 in constructor.
597 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
598 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
599 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
600 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
601 (Output_data_plt_aarch64::rela_tlsdesc): New method.
602 (Output_data_plt_aarch64::rela_irelative): New method.
603 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
604 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
605 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
606 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
607 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
608 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
609 (Output_data_plt_aarch64_standard): New member variables:
610 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
611 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
612 New parameter: got, got_irelative.
613 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
614 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
615 (Output_data_plt_aarch64::do_write): Replace got_address with
616 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
617 (AArch64_relocate_functions::update_movnz): New method.
618 (AArch64_relocate_functions): Correct format.
619 (AArch64_relocate_functions::movnz): New method.
620 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
621 before the switch. Add new cases to switch.
00cac886 622 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
623 tlsgd tlsdesc cases.
624 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
625 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
626 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
627 Call reloc_name_in_error_message to print unsupported reloc.
628 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
629 make_data_plt.
630 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
631 relocs. Fill in some more dynamic tags.
632 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
633 Skip call tls_get_addr when tlsgd is relaxed.
634 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
635 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
636 tlsdesc->ie relaxation.
637
62661c93
SS
6382014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
639
640 * mips.cc (Target_mips_nacl): New class.
641 (Target_selector_mips_nacl): New class.
642 (target_selector_mips32): Rename from target_selector_mips32be and use
643 Target_selector_mips_nacl instead of Target_selector_mips.
644 (target_selector_mips32el): Rename from target_selector_mips32 and use
645 Target_selector_mips_nacl instead of Target_selector_mips.
646 (target_selector_mips64): Rename from target_selector_mips64be and use
647 Target_selector_mips_nacl instead of Target_selector_mips.
648 (target_selector_mips64el): Rename from target_selector_mips64 and use
649 Target_selector_mips_nacl instead of Target_selector_mips.
650 (Target_mips::mips_info): Add const attribute.
651
54674d38
CC
6522014-09-02 Cary Coutant <ccoutant@google.com>
653
654 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
655 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
656 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
657 (Sized_incr_dynobj::do_section_name): Likewise.
658 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
659 (Sized_incr_dynobj::do_section_name): Likewise.
660 * object.h (Object::section_name): Likewise.
661 (Object::do_section_name): Likewise.
662 (Sized_relobj_file::do_section_name): Likewise.
663 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
664 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
665
9860cbcf
CC
6662014-09-02 Cary Coutant <ccoutant@google.com>
667
668 PR gold/17005
669 * ehframe.cc (Fde::write): Add output_offset parameter.
670 (Cie::write): Likewise.
671 (Eh_frame::set_final_data_size): Account for offset within output
672 section.
673 (Eh_frame::do_sized_write): Likewise.
674 * ehframe.h (Fde::write): Add output_offset parameter.
675 (Cie::write): Likewise.
676 * output.cc (Output_section::Input_section_sort_entry): Remove
677 section_has_name_; add output_section_name parameter. Use
678 output section name for non-input sections.
679 (Output_section::Input_section_sort_entry::section_has_name): Remove.
680 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
681 (Output_section::Input_section_sort_compare): Remove logic for
682 sections without names.
683 (Output_section::Input_section_sort_init_fini_compare): Likewise.
684 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
685 Likewise.
686 (Output_section::Input_section_sort_section_name_compare): Likewise.
687
8e33481e
HS
6882014-08-29 Han Shen <shenhan@google.com>
689 Jing Yu <jingyu@google.com>
690
691 * aarch64-reloc-property.cc
692 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
693 reference reloc property in the table.
694 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
695 3 other entries.
696 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
697 2 new overloaded methods.
698 (Output_data_got_aarch64::do_write): Add code to write out
699 static relocs.
700 (class Output_data_got_aarch64::Static_reloc): New class to wrap
701 static relocs.
702 (Output_data_got_aarch64::static_relocs): New vector to
703 hold static relocs.
704 (Target_aarch64::TCB_SIZE): New const static memeber.
705 (Target_aarch64::tcb_size): New method.
706 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
707 (Target_aarch64::Relocate::relocate_tls): New method.
708 (Target_aarch64::Scan::local): Add code handling new reloc types.
709 (Target_aarch64::Scan::global): Add code handling new reloc types.
710
81233653
ST
7112014-08-13 Sriraman Tallam <tmsriram@google.com>
712
713 * options.h (-no-pie): Add option.
714
9363c7c3
JY
7152014-08-08 Jing Yu <jingyu@google.com>
716 Han Shen <shenhan@google.com>
717
718 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
719 (DEFFILES): add aarch64-reloc.def.
720 (TARGETSOURCES): Add aarch64-reloc-property.cc.
721 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
722 * Makefile.in: Regenerate.
723 * aarch64-reloc-property.cc: New file.
724 * aarch64-reloc-property.h: New file.
725 * aarch64-reloc.def: New file.
726 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
727 with tab to make the format consistent.
728 (Output_data_got_aarch64::symbol_table_): New method.
729 (Target_aarch64::do_plt_address_for_global): New method.
730 (Target_aarch64::do_plt_address_for_local): New method.
731 (Target_aarch64::do_select_as_default_target): New method.
732 (Target_aarch64::do_make_data_plt): New method.
733 (Target_aarch64::make_data_plt): New method.
734 (Output_data_plt_aarch64::has_irelative_section): New method.
735 (Output_data_plt_aarch64::address_for_global): New method.
736 (Output_data_plt_aarch64::address_for_local): New method.
737 (Output_data_plt_aarch64::irelative_rel_): New parameter.
738 (Output_data_plt_aarch64::add_entry): Implement contents.
739 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
740 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
741 the got_pov entry to plt0.
742 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
743 Implement contents.
744 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
745 (AArch64_howto): New struct.
746 (aarch64_howto[]): New static const array.
747 (AArch64_relocate_functions): New class.
748 (Target_aarch64::Scan::get_reference_flags): Remove method.
749 (Target_aarch64::Scan::local): Implement to support a few relocations.
750 (Target_aarch64::Scan::global): Implement to support a few relocations.
751 (Target_aarch64::make_plt_section): Implement contents.
752 (Target_aarch64::make_plt_entry): Implement contents.
753 (Target_aarch64::do_finalize_sections): Implement contents.
754 (Target_aarch64::Relocate::relocate): Implement a few relocations.
755 (Target_aarch64::relocate_section): Implement contents.
756
ad9fe6c1
AM
7572014-08-06 Alan Modra <amodra@gmail.com>
758
759 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
760
7cd4e5b7
AM
7612014-08-06 Alan Modra <amodra@gmail.com>
762
763 PR 13227
764 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
765
5ad9b0a7
ST
7662014-07-21 Sriraman Tallam <tmsriram@google.com>
767
768 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 769 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 770
e051745c
CC
7712014-07-08 Cary Coutant <ccoutant@google.com>
772
773 * expression.cc (struct Expression::Expression_eval_info): Add
774 new fields type_pointer, vis_pointer, and nonvis_pointer.
775 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
776 nonvis_pointer parameters. Adjust all calls.
777 (Symbol_expression::value): Update type, visibility, and nonvis bits
778 in caller.
779 * script.cc (Symbol_assignment::sized_finalize): Update type,
780 visibility, and remaining st_other bits for new symbol.
781 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
782 vis_pointer, and nonvis_pointer parameters.
783 * symtab.h (Symbol::set_type): New method.
784
785 * testsuite/Makefile.am (defsym_test): New test.
786 * testsuite/Makefile.in: Regenerate.
787 * testsuite/defsym_test.c: New file.
788 * testsuite/defsym_test.sh: New file.
789
f35c4853
CC
7902014-07-08 Cary Coutant <ccoutant@google.com>
791
792 PR gold/15639
793 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
794 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
795 (Sized_dynobj::base_read_symbols): ...new method.
796 * object.h (Sized_relobj_file::base_read_symbols): New method.
797 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
798 (Sized_relobj_file::base_read_symbols): ...new method.
799 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
800 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
801 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
802
2900af2d
AM
8032014-07-04 Alan Modra <amodra@gmail.com>
804
805 * po/POTFILES.in: Regenerate.
806
053a4d68
JY
8072014-07-02 Jing Yu <jingyu@google.com>
808
809 * aarch64.cc: New file
810 * Makefile.am (TARGETSOURCES): Add aarch64.cc
811 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
812 * Makefile.in: Regenerate.
813 * configure.tgt: Add entries for aarch64*.
814 * configure.ac: Likewise.
815 * configure: Likewise.
816
7b549045
AM
8172014-06-27 Alan Modra <amodra@gmail.com>
818
819 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
820
cb818dbf
CC
8212014-06-24 Cary Coutant <ccoutant@google.com>
822
823 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
824 sections.
825 (Dwo_file::sized_read_unit_index): Likewise.
826
9810d34d
SS
8272014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
828
829 * mips.cc: New file.
830 * Makefile.am (TARGETSOURCES): Add mips.cc
831 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
832 * configure.tgt: Add entries for mips*.
833 * configure.ac: Likewise.
834 * Makefile.in: Regenerate.
835 * configure: Likewise.
836
9baa787b
CC
8372014-06-09 Cary Coutant <ccoutant@google.com>
838
839 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
840 unit_length is within section bounds.
841
8f89af0a
CC
8422014-06-09 Cary Coutant <ccoutant@google.com>
843
844 PR gold/16980
845 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
846 map.
847
a47622ac
AM
8482014-06-07 Alan Modra <amodra@gmail.com>
849
850 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
851
4320c691
CC
8522014-06-06 Cary Coutant <ccoutant@google.com>
853
854 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
855 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
856 (Dwarf_pubnames_table::read_header): Likewise.
857 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
858 .debug_gnu_pubtypes.
859
270c9937
JB
8602014-06-05 Joel Brobecker <brobecker@adacore.com>
861
862 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
863 * Makefile.in, configure: Regenerate.
864
397998fc
AM
8652014-06-03 Alan Modra <amodra@gmail.com>
866
867 * powerpc.cc (addis_12_2): Define.
868 (Stub_table::do_write): Support fusion on ELFv2 stubs.
869
61f5c66f
AM
8702014-06-03 Alan Modra <amodra@gmail.com>
871
872 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
873 st_other output.
874
f6971787
AM
8752014-06-02 Alan Modra <amodra@gmail.com>
876
877 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
878 Only ignore relocs on ELFv1.
879 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
880
f6fb8322
CC
8812014-05-30 Cary Coutant <ccoutant@google.com>
882
883 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
884 * testsuite/Makefile.in: Regenerate.
885 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
886
c23dd342
L
8872014-05-27 H.J. Lu <hongjiu.lu@intel.com>
888
889 PR gold/16945
890 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
891 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
892
5fe7ffdc
AM
8932014-05-15 Alan Modra <amodra@gmail.com>
894
895 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
896 Compare FDE contents with DW_CFA_nop rather than 0.
897
a82bef93
ST
8982014-05-13 Sriraman Tallam <tmsriram@google.com>
899
900 * symtab.h (may_need_copy_reloc): Remove check for position independent
901 code.
902 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
903 position independence before pc absolute may_need_copy_reloc call.
904 Add check for executable output befor pc relative may_need_copy_reloc
905 call.
906 * i386.cc: Ditto.
907 * arm.cc: Ditto.
908 * sparc.cc: Ditto.
909 * tilegx.cc: Ditto.
910 * powerpc.cc: Add check for no position independence before
911 may_need_copy_reloc calls.
912 * testsuite/pie_copyrelocs_test.cc: New file.
913 * testsuite/pie_copyrelocs_shared_test.cc: New file.
914 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 915 * Makefile.in: Regenerate.
a82bef93 916
53c66605
ML
9172014-05-08 Martin Liška <mliska@suse.cz>
918
919 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
920
57b2284c
CC
9212014-05-06 Cary Coutant <ccoutant@google.com>
922
923 PR gold/16900
924 * i386.cc (Output_data_got_plt_i386): New class.
925 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
926 parameter. Change all callers.
927 (Output_data_plt_i386::layout_): Remove.
928 (Output_data_plt_i386::got_plt_): Change type.
929 (Target_i386::got_plt_): Change type. Change all references.
930 (Target_i386::got_section): Create instance of new class.
931 (Output_data_got_plt_i386::do_write): New function.
932 * x86_64.cc (Output_data_got_plt_x86_64): New class.
933 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
934 parameter. Change all callers.
935 (Output_data_plt_x86_64::layout_): Remove.
936 (Output_data_plt_x86_64::got_plt_): Change type.
937 (Target_x86_64::got_plt_): Change type. Change all references.
938 (Target_x86_64::got_section): Create instance of new class.
939 (Output_data_got_plt_x86_64::do_write): New function.
940 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
941 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
942 class.
943
6b97515d 9442014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 945
6b97515d
CC
946 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
947 if we have pubnames/pubtypes.
948
d1bddd3c
CC
9492014-05-02 Cary Coutant <ccoutant@google.com>
950
5fe7ffdc
AM
951 * defstd.cc (in_segment): Define __ehdr_start here...
952 * layout.cc (Layout::finalize): ...Instead of here. Set the
953 output segment when known.
954 * resolve.cc (Symbol::override_base_with_special): Remember
955 the original binding.
956 * symtab.cc (Symbol::set_output_segment): New function.
957 (Symbol::set_undefined): New function.
958 * symtab.h (Symbol::is_weak_undefined): Check original undef
959 binding.
960 (Symbol::is_strong_undefined): New function.
961 (Symbol::set_output_segment): New function.
962 (Symbol::set_undefined): New function.
963 * target-reloc.h (is_strong_undefined): Remove.
964 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
965 Check for hidden undefs.
966 (relocate_section): Call Symbol::is_strong_undefined.
967
968 * testsuite/Makefile.am (ehdr_start_test_1)
969 (ehdr_start_test_2, ehdr_start_test_3)
970 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
971 * testsuite/Makefile.in: Regenerate.
972 * testsuite/ehdr_start_def.cc: New source file.
973 * testsuite/ehdr_start_test.cc: New source file.
974 * testsuite/ehdr_start_test.t: New linker script.
975 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 976
7849f6d8
CC
9772014-04-23 Cary Coutant <ccoutant@google.com>
978
bf2cc635 979 PR gold/16870
7849f6d8
CC
980 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
981
99fd8cff
CC
9822014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
983
984 * layout.cc (Layout::include_section): Allow a target to decide
985 whether to include a section.
986 * target.h (Target::should_include_section): New function.
987 (Target::do_should_include_section): New function.
988
91f43acd
CC
9892014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
990
991 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
992 inline into ...
993 (Copy_relocs::emit): ... here.
994 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
995 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
996 (Copy_reloc_entry::entries_): Change from private to protected.
997
c4eb27e1
ST
9982014-04-02 Sriraman Tallam <tmsriram@google.com>
999
1000 * icf.cc (get_section_contents): Replace copies of reloc
1001 vectors with const references.
1002
ae447ddd
CC
10032014-04-02 Cary Coutant <ccoutant@google.com>
1004
1005 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
1006 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
1007 * configure: Regenerate.
1008 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
1009 -fno-use-linker-plugin.
1010 (LINK1, CXXLINK1): Add it to the link command.
1011 * testsuite/Makefile.in: Regenerate.
1012
fa47fa92
AM
10132014-03-12 Alan Modra <amodra@gmail.com>
1014
1015 * Makefile.in: Regenerate.
1016
9b12c500
CC
10172014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1018
1019 * symtab.h (Symbol::set_nonvis): New function.
1020
beacaa96
CC
10212014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1022
1023 * symtab.cc (Sized_symbol<32>::init_output_data):
1024 Instantiate the template.
1025 (Sized_symbol<64>::init_output_data): Likewise.
1026
800d9823
CC
10272014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1028
1029 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1030 adjust dynamic symbol value.
1031 * target.h (Target::adjust_dyn_symbol): New function.
1032 (Target::do_adjust_dyn_symbol): New function.
1033
918fc1f8 10342014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 1035
918fc1f8
CC
1036 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1037 Get the value of DYNAMIC_CUSTOM dynamic entry.
1038 * output.h (Output_data_dynamic::add_custom): New function.
1039 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1040 dynamic entry.
1041 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1042 * target.h (Target::dynamic_tag_custom_value): New function.
1043 (Target::do_dynamic_tag_custom_value): New function.
1044
98ff9231
CC
10452014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1046
1047 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1048 dynsym indexes.
1049 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1050 (Target::do_has_custom_set_dynsym_indexes): New function.
1051 (Target::set_dynsym_indexes): New function.
1052 (Target::do_set_dynsym_indexes): New function.
1053
b80eed39
AM
10542014-03-07 Alan Modra <amodra@gmail.com>
1055
1056 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1057 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1058 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1059 (Powerpc_relocate_functions::has_overflow_bitfield,
1060 overflowed): Use the above.
1061 (Target_powerpc::Relocate::relocate): Correct overflow checking
1062 for a number of relocations. Modify overflow test for 16-bit
1063 fields in instructions to signed/unsigned according to whether
1064 the field takes a signed or unsigned value.
1065
4b95cf5c
AM
10662014-03-05 Alan Modra <amodra@gmail.com>
1067
1068 Update copyright years.
1069
45965137
AM
10702014-03-05 Alan Modra <amodra@gmail.com>
1071
1072 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1073 R_PPC64_ADDR64_LOCAL.
1074 (Target_powerpc::Relocate::relocate): Likewise.
1075
2c80b753
AM
10762014-03-03 Alan Modra <amodra@gmail.com>
1077
1078 * dwp.cc (print_version): Update copyright year to current.
1079
c1c69e83
AM
10802014-02-10 Alan Modra <amodra@gmail.com>
1081
1082 * po/gold.pot: Regenerate.
1083
dd0c4e70
CC
10842014-02-06 Cary Coutant <ccoutant@google.com>
1085
1086 Fix problem where -u is ignored when a weak undef is seen.
1087
1088 * archive.cc (Library_base::should_include_member): Reorder
1089 code to check for -u option if a weak undef has already been seen.
1090 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1091 * testsuite/Makefile.in: Regenerate.
1092 * testsuite/weak_undef_file3.cc: New file.
1093 * testsuite/weak_undef_file4.cc: New file.
1094 * testsuite/weak_undef_test_2.cc: New file.
1095
1a221d3d
CC
10962014-02-05 Cary Coutant <ccoutant@google.com>
1097
1098 Fix issues with gold undefined symbol diagnostics.
1099
1100 PR binutils/15435
1101 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1102 check to here.
1103 * target-reloc.h (is_strong_undefined): New function.
1104 (relocate_section): Move undef vtable symbol check from here.
1105 Check for is_strong_undefined.
1106
e889f0a4 11072014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1108
e889f0a4
CC
1109 Fix problems with the --dynamic-list option.
1110
1111 PR gold/13577
1112 * options.cc (General_options::parse_dynamic_list):
1113 Set have_dynamic_list_.
1114 (General_options::General_options): Initialize have_dynamic_list_.
1115 (General_options::finalize): Turn off -Bsymbolic and
1116 -Bsymbolic-functions if --dynamic-list provided.
1117 * options.h (General_options::have_dynamic_list): New function.
1118 (General_options::have_dynamic_list_): New data member.
1119 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
1120 correctly.
5fe7ffdc 1121
e889f0a4
CC
1122 PR gold/16530
1123 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
1124 in --dynamic-list, mark it.
5fe7ffdc 1125
e889f0a4
CC
1126 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
1127 (dynamic_list_2): New test case.
1128 * testsuite/Makefile.in: Regenerate.
1129 * testsuite/dynamic_list_2.cc: New file.
1130 * testsuite/dynamic_list_2.t: New file.
1131 * testsuite/dynamic_list_lib1.cc: New file.
1132 * testsuite/dynamic_list_lib2.cc: New file.
1133 * testsuite/gc_dynamic_list_test.c: New file.
1134 * testsuite/gc_dynamic_list_test.sh: New file.
1135 * testsuite/gc_dynamic_list_test.t: New file.
1136
ec673e64
CC
11372014-01-28 Cary Coutant <ccoutant@google.com>
1138
1139 Add .gdb_index version 7 support.
1140
1141 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1142 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1143 debug sections.
1144 (Dwarf_ranges_table::read_ranges_table): Likewise.
1145 (Dwarf_pubnames_table::read_section): Check for GNU-style
1146 sections, and for compressed debug sections.
1147 (Dwarf_pubnames_table::read_header): Compute end address of table.
1148 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1149 for end of list by offset, not by offset == 0.
1150 (Dwarf_info_reader::do_read_string_table): Check for compressed
1151 debug sections.
1152 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1153 Initialize new data members.
1154 (Dwarf_pubnames_table::next_name): return flag_byte.
1155 (Dwarf_pubnames_table::end_of_table_): New data member.
1156 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1157 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1158 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1159 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1160 read skeleton type unit DIEs.
1161 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1162 (Gdb_index::do_write): Write flag_byte.
1163 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1164 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1165 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1166 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1167
221fd5d5
L
11682014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1169
1170 * version.cc (print_version): Update copyright year to 2014.
1171
6c09fb0b
ILT
11722013-12-19 Dimitry Andric <dimitry@andric.com>
1173
1174 * stringpool.cc (Stringpool_template::reserve): Add
1175 HAVE_UNORDERED_MAP case.
1176 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1177
8356f2d0
CC
11782013-12-18 Cary Coutant <ccoutant@google.com>
1179
1180 * configure.ac: Check for <unordered_set> and <unordered_map>.
1181 * config.in: Regenerate.
1182 * configure: Regenerate.
1183 * system.h: Use <unordered_set> and <unordered_map> if available.
1184
f2c7d7ee
RM
11852013-12-10 Roland McGrath <mcgrathr@google.com>
1186
1187 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1188 with $(INSTALL_PROGRAM_ENV).
1189 * Makefile.in: Regenerate.
1190
6632e8cc
CC
11912013-11-22 Cary Coutant <ccoutant@google.com>
1192
1193 * configure.ac: Add check for which library is needed for
1194 dlopen.
1195 * configure: Regenerate.
1196
0c075858
CC
11972013-11-22 Cary Coutant <ccoutant@google.com>
1198
1199 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1200 assembler.
1201 * testsuite/Makefile.in: Regenerate.
1202
f49fe902
L
12032013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1204
1205 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1206 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1207 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1208 (Target_x86_64<size>::Scan::local): Likewise.
1209 (Target_x86_64<size>::Scan::global): Likewise.
1210 (Target_x86_64<size>::Relocate::relocate): Likewise.
1211 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1212 Likewise.
1213 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1214 R_X86_64_PC32_BND.
1215
1216 * testsuite/Makefile.am (check_PROGRAMS): Add
1217 exception_x86_64_bnd_test.
1218 (exception_x86_64_bnd_test_SOURCES): New macro.
1219 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1220 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1221 (exception_x86_64_bnd_test_LDADD): Likewise.
1222 (exception_x86_64_bnd_1.o): New rule.
1223 (exception_x86_64_bnd_2.o): Likewise.
1224 * testsuite/Makefile.in: Regenerated.
1225
9055360d
AM
12262013-11-15 Alan Modra <amodra@gmail.com>
1227
1228 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1229 accessor.
1230 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1231 Only call ppc64_local_entry_offset for 64-bit. Restrict
1232 symval_for_branch lookup to ELFv1.
1233 (Stub_table::add_plt_call_entry): Use unsigned int off.
1234 (Output_data_glink::Address, invalid_address): New.
1235 (Output_data_glink::add_eh_frame): Move out of line. Add
1236 support for ELFv2.
1237 (Output_data_glink::add_global_entry, find_global_entry,
1238 global_entry_address): New functions.
1239 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1240 ge_size): New variables.
1241 (Output_data_glink::set_final_data_size): Add global entry
1242 stub sizing.
1243 (Output_data_glink::do_write): Write global entry stubs.
1244 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1245 parameter. Return true for ELFv2. Adjust callers.
1246 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1247 ELFv1. Similarly for ifunc and dynamic relocation processing
1248 specific to ELFv1. Recognize that symbols are defined on
1249 their plt entries for ELFv2.
1250 (Target_powerpc::symval_for_branch): Assert if called for
1251 ELFv2 or ppc32.
1252 (Target_powerpc::Relocate::relocate): Use global entry plt
1253 stub for symbol value if such exists on ELFv2.
1254 (Target_powerpc::Relocate::relocate): Don't call
1255 symval_for_branch when ELFv2. Do adjust for local entry
1256 offset when ELFv2.
1257 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1258 plt stub for ELFv2.
1259 (Target_powerpc::do_plt_address_for_global): Similarly.
1260
cafdd569
CC
12612013-11-14 Cary Coutant <ccoutant@google.com>
1262
1263 Revert patch -- this did not fix the problem, and there is
1264 no race there.
1265
1266 2013-11-14 Cary Coutant <ccoutant@google.com>
1267
1268 PR gold/14860
1269 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1270 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1271 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1272 updating fde_offsets_.
1273 (Eh_frame_hdr::lock_): New data member.
1274
94e49e16
CC
12752013-11-14 Cary Coutant <ccoutant@google.com>
1276
1277 * dwp.cc (Dwo_file_entry): New type.
1278 (File_list): Use Dwo_file_entry.
1279 (Dwo_file::verify): New function.
1280 (Dwo_file::verify_dwo_list): New function.
1281 (Dwo_file::sized_verify_dwo_list): New function.
1282 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1283 list.
1284 (Dwp_options): New enum type.
1285 (dwp_options): Add --verify-only.
1286 (usage): Likewise.
1287 (main): Likewise.
1288 * dwp.h (gold_info): Add declaration.
1289
7cdd7d57
CC
12902013-11-14 Cary Coutant <ccoutant@google.com>
1291
1292 PR gold/14860
1293 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1294 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1295 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1296 updating fde_offsets_.
1297 (Eh_frame_hdr::lock_): New data member.
1298
1d946cb3
CC
12992013-11-06 Cary Coutant <ccoutant@google.com>
1300
1301 PR gold/15758
1302 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1303 before reloc sections.
1304
4f65b40e
AM
13052013-11-04 Alan Modra <amodra@gmail.com>
1306
1307 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1308 (Symbol::needs_dynamic_reloc): Test new flag.
1309 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1310 (Target_powerpc::Scan::get_reference_flags): Add target param.
1311 Return FUNC_DESC_ABI for 64-bit ELFv1.
1312 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1313 call.
1314 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1315 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1316
908794a9
CC
13172013-10-31 Cary Coutant <ccoutant@google.com>
1318
1319 Restore support for dwp v2 DWARF package file format.
1320
1321 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1322 tu_length parameter. Adjust all callers.
1323 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1324 * dwp.cc: Include dwarf.h.
1325 (Section_bounds): New struct type.
1326 (Unit_set): New struct type.
1327 (Dwo_file::Dwo_file): Initialize new data member.
1328 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1329 Combine and rename to...
1330 (Dwo_file::read_unit_index): ...this.
1331 (Dwo_file::sized_read_compunit_index)
1332 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1333 (Dwo_file::sized_read_unit_index): ...this.
1334 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1335 parameters; add section_id parameter.
1336 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1337 (Dwo_file::add_unit_set): ...this.
1338 (Dwo_file::shndx_map_): Remove.
1339 (Dwo_file::sect_offsets_): New data member.
1340 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1341 (Dwp_output_file::add_section): Rename to...
1342 (Dwp_output_file::add_contribution): ...this.
1343 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1344 (Dwp_output_file::add_tu_set): Likewise.
1345 (Dwp_output_file::Contribution): New type.
1346 (Dwp_output_file::Section::contributions): New data member.
1347 (Dwp_output_file::Cu_or_tu_set): Remove.
1348 (Dwp_output_file::Section::Section): New ctor.
1349 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1350 (Dwp_output_file::Dwp_index::Section_table): New type.
1351 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1352 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1353 parameter.
1354 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1355 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1356 (Dwp_output_file::Dwp_index::section_table): New member function.
1357 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1358 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1359 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1360 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1361 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1362 (Dwp_output_file::Dwp_index::section_table_): New data member.
1363 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1364 (Dwp_output_file::add_output_section): New member function.
1365 (Dwp_output_file::write_new_section): New member function.
1366 (Dwp_output_file::write_contributions): New member function.
1367 (Dwp_output_file::section_id_map_): New data member.
1368 (class Dwo_id_info_reader): Remove.
1369 (class Unit_reader): New class.
1370 (get_dwarf_section_name): New function.
1371 (Dwo_file::read_executable): Adjust initializations of class data.
1372 (Dwo_file::read): Add support for v2 package file format.
1373 (Dwo_file::read_unit_index): Likewise.
1374 (Dwo_file::sized_read_unit_index): Likewise.
1375 (Dwo_file::copy_section): Likewise.
1376 (Dwo_file::add_unit_set): Likewise.
1377 (Dwp_output_file::add_output_section): Likewise.
1378 (Dwp_output_file::add_contribution): Likewise.
1379 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1380 for empty slot.
1381 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1382 file format.
1383 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1384 slot.
1385 (Dwp_output_file::initialize): Remove unused function.
1386 (Dwp_output_file::finalize): Add support for v2 package file format.
1387 (Dwp_output_file::write_index): Likewise.
1388 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1389 function prototype.
1390
2500c017
CC
13912013-10-31 Cary Coutant <ccoutant@google.com>
1392
1393 * configure.ac: Fix check for -fmerge-constants.
1394 * configure.ac: Regenerate.
1395
dd0845d7
RM
13962013-10-30 Roland McGrath <mcgrathr@google.com>
1397
1398 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1399 Correct 9-byte nop sequence to match what the assembler generates.
1400
b4f7960d
AM
14012013-10-30 Alan Modra <amodra@gmail.com>
1402
1403 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1404 ppc64_local_entry_offset, ppc64_local_entry_offset,
1405 do_read_symbols): New functions.
1406 (Powerpc_relobj::e_flags_, st_other_): New vars.
1407 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1408 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1409 (Powerpc_relobj::e_flags_): New var.
1410 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1411 and adjust for ELFv2.
1412 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1413 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1414 (Powerpc_dynobj::do_find_special_sections): Likewise.
1415 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1416 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1417 to ELFv2 local entry.
1418 (Target_powerpc::do_relax): No thread safe barriers needed for
1419 ELFv2.
1420 (Output_data_plt_powerpc::initial_plt_entry_size_,
1421 plt_entry_size): Delete. Replace all uses with
1422 first_plt_entry_offset() and plt_entry_size().
1423 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1424 reserved_size parm. Update callers.
1425 (Output_data_plt_powerpc::entry_count): Update.
1426 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1427 and use Target_powerpc::first_plt_entry_offset().
1428 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1429 rename to plt_entry_size.
1430 (Output_data_plt_powerpc::add_ifunc_entry,
1431 add_local_ifunc_entry): Adjust reloc for ELFv2.
1432 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1433 (glink_eh_frame_fde_64v2): New.
1434 (Stub_table::plt_call_size): Support ELFv2 sizing.
1435 (Output_data_glink::add_eh_frame): Use the new FDE.
1436 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1437 (Stub_table::do_write): Write ELFv2 stubs and glink.
1438 (Target_powerpc::Relocate::relocate): Replaces nop after call
1439 with ld 2,24(1) and adjust local offset destination for ELFv2.
1440
f9c6b907
AM
14412013-10-30 Alan Modra <amodra@gmail.com>
1442
1443 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1444 (Target_powerpc::Scan::global, local): Likewise.
1445 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1446 on all ppc64 @h and @ha relocs.
1447
e84fe78f
AM
14482013-10-14 Alan Modra <amodra@gmail.com>
1449
1450 * output.h (Output_data_got::add_constant): Tidy.
1451 (Output_data_got::add_constant_pair): New function.
1452 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1453 methods used so as to first call reserve_ent().
1454
679e4abf
RM
14552013-10-11 Roland McGrath <mcgrathr@google.com>
1456
44dcb735
RM
1457 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1458 add_got_entry and add_got_entry_pair.
1459
13323c49
RM
1460 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1461 (HAVE_PUBNAMES): Likewise.
1462 * configure: Regenerate.
1463
1496b446
RM
1464 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1465 * testsuite/Makefile.in: Regenerate.
1466
cc84c10b
RM
1467 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1468 Remove const from declaration.
1469 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1470 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1471 * output.h (Output_file_header): Remove const from member target_
1472 and corresponding constructor argument.
1473 * output.cc (Output_file_header::Output_file_header): Update prototype.
1474 (Output_file_header::do_sized_write): Use this->target_ in place
1475 of parameters()->target().
1476
52f66a2c
RM
1477 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1478
2b64b551
RM
1479 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1480 * configure: Regenerate.
1481 * Makefile.in: Regenerate.
1482 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1483 * testsuite/merge_string_literals_2.c: Likewise.
1484 * testsuite/Makefile.am
1485 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1486 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1487 literal -fmerge-constants.
1488 * testsuite/Makefile.in: Regenerate.
1489
43819297
RM
1490 * i386.cc (Target_i386): Remove unused member dynbss_.
1491 * arm.cc (Target_arm): Likewise.
1492 * powerpc.cc (Target_powerpc): Likewise.
1493 * sparc.cc (Target_sparc): Likewise.
1494 * tilegx.cc (Target_tilegx): Likewise.
1495 * x86_64.cc (Target_x86_64): Likewise.
1496 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1497 type_signature_, type_offset_.
1498 * plugin.h (Plugin_hook): Remove unused member layout_.
1499 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1500 mapfile_.
1501 (Read_member): Remove unused members input_objects_, symtab_,
1502 mapfile_, layout_.
1503 (Check_library): Remove unused member symtab_.
1504 * archive.h (Lib_group): Remove unused member lib_.
1505 * archive.cc (Lib_group::Lib_group): Update initializer.
1506 * incremental.h (Incremental_binary): Remove unused member target_.
1507 (Incremental_script_entry): Removed unused member script_.
1508 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1509 * icf.h (Icf): Remove unused member num_tracked_relocs.
1510
39d9ead7
RM
1511 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1512 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1513 its only use.
1514 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1515
679e4abf
RM
1516 * archive.h: Use struct rather than class for forward declaration
1517 of Read_symbols_data.
1518
54de2ea6
CC
15192013-10-07 Cary Coutant <ccoutant@google.com>
1520
1521 PR gold/16010
1522 * testsuite/Makefile.am (icf_test): Fix dependencies.
1523 (icf_safe_test): Likewise.
1524 (icf_safe_so_test): Likewise.
1525 (large_symbol_alignment): Add empty _LDADD rule.
1526 * testsuite/Makefile.in: Regenerate.
1527
b14016f0
L
15282013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1529
1530 PR gold/15927
1531 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1532 relocation for R_X86_64_32 on x32.
1533
eb426534
RM
15342013-08-27 Roland McGrath <mcgrathr@google.com>
1535
1536 * output.cc (Output_segment::set_section_addresses): Take new
1537 Target* argument. If target->isolate_execinstr() and the segment
1538 is executable and starts at a target->abi_pagesize() boundary,
1539 pad its end out to a target->abi_pagesize() boundary with code fill.
1540 * output.h (Output_segment::set_section_addresses): Update decl.
1541 * layout.h (Layout::check_output_data_for_reset_values): Take new
1542 argument RELAX_OUTPUTS.
1543 (Layout): New member relax_output_list_.
1544 (Layout::add_relax_output): New method.
1545 * layout.cc (Layout::Layout): Update constructor.
1546 (Layout::reset_relax_output): New method.
1547 (Layout::clean_up_after_relaxation): Call it.
1548 (Layout::prepare_for_relaxation): Update caller.
1549 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1550 Call reset_relax_output before re-processing segments for
1551 isolate_execinstr case.
1552 (Layout::write_data): Handle relax_output_list_.
1553 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1554 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1555
9aff4b7a
NC
15562013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1557
1558 PR binutils/15834
1559 * object.h: Fix typos.
1560
93f8221c
RM
15612013-08-16 Roland McGrath <mcgrathr@google.com>
1562
1563 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1564 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1565
e44c3715
CC
15662013-08-07 Cary Coutant <ccoutant@google.com>
1567
1568 Revert support for v2 DWP files:
1569
1570 2013-03-01 Cary Coutant <ccoutant@google.com>
1571
1572 Add dwp support for v2 DWARF package file format.
1573 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1574 tu_length parameter. Adjust all callers.
1575 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1576 * dwp.cc: Include dwarf.h.
1577 (Section_bounds): New struct type.
1578 (Unit_set): New struct type.
1579 (Dwo_file::Dwo_file): Initialize new data member.
1580 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1581 Combine and rename to...
1582 (Dwo_file::read_unit_index): ...this.
1583 (Dwo_file::sized_read_compunit_index)
1584 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1585 (Dwo_file::sized_read_unit_index): ...this.
1586 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1587 parameters; add section_id parameter.
1588 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1589 (Dwo_file::add_unit_set): ...this.
1590 (Dwo_file::shndx_map_): Remove.
1591 (Dwo_file::sect_offsets_): New data member.
1592 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1593 (Dwp_output_file::add_section): Rename to...
1594 (Dwp_output_file::add_contribution): ...this.
1595 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1596 (Dwp_output_file::add_tu_set): Likewise.
1597 (Dwp_output_file::Contribution): New type.
1598 (Dwp_output_file::Section::contributions): New data member.
1599 (Dwp_output_file::Cu_or_tu_set): Remove.
1600 (Dwp_output_file::Section::Section): New ctor.
1601 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1602 (Dwp_output_file::Dwp_index::Section_table): New type.
1603 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1604 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1605 parameter.
1606 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1607 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1608 (Dwp_output_file::Dwp_index::section_table): New member function.
1609 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1610 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1611 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1612 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1613 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1614 (Dwp_output_file::Dwp_index::section_table_): New data member.
1615 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1616 (Dwp_output_file::add_output_section): New member function.
1617 (Dwp_output_file::write_new_section): New member function.
1618 (Dwp_output_file::write_contributions): New member function.
1619 (Dwp_output_file::section_id_map_): New data member.
1620 (class Dwo_id_info_reader): Remove.
1621 (class Unit_reader): New class.
1622 (get_dwarf_section_name): New function.
1623 (Dwo_file::read_executable): Adjust initializations of class data.
1624 (Dwo_file::read): Add support for v2 package file format.
1625 (Dwo_file::read_unit_index): Likewise.
1626 (Dwo_file::sized_read_unit_index): Likewise.
1627 (Dwo_file::copy_section): Likewise.
1628 (Dwo_file::add_unit_set): Likewise.
1629 (Dwp_output_file::add_output_section): Likewise.
1630 (Dwp_output_file::add_contribution): Likewise.
1631 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1632 for empty slot.
1633 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1634 file format.
1635 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1636 slot.
1637 (Dwp_output_file::initialize): Remove unused function.
1638 (Dwp_output_file::finalize): Add support for v2 package file format.
1639 (Dwp_output_file::write_index): Likewise.
1640 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1641 function prototype.
1642
c6905c28
CC
16432013-07-31 Cary Coutant <ccoutant@google.com>
1644
1645 * object.cc (Sized_relobj::do_output_section_address): New function.
1646 (Sized_relobj): Instantiate explicitly.
1647 * object.h (Object::output_section_address): New function.
1648 (Object::do_output_section_address): New function.
1649 (Sized_relobj::do_output_section_address): New function.
1650 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1651
16522013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 1653 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
1654
1655 * parameters.cc (Parameters::entry): Return target-specific entry
1656 symbol name.
1657 * target.h (Target::entry_symbol_name): New function.
1658 (Target_info::entry_symbol_name): New data member.
1659
1660 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1661 * i386.cc (Target_i386::i386_info): Likewise.
1662 (Target_i386_nacl::i386_nacl_info): Likewise.
1663 * sparc.cc (Target_sparc::sparc_info): Likewise.
1664 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1665 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1666 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1667 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1668
234d4ab8
SA
16692013-07-22 Sterling Augustine <saugustine@google.com>
1670
1671 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1672 Convert parameter shndx to local variable. Add parameters symtab
1673 and symtab_size. Scan over section names. Find relocation
1674 section corresponding to current section. Create and initialize
1675 reloc_mapper_ and reloc_type_.
1676 (Dwarf_pubnames_table::read_header): Add assertion. Change
1677 unit_length to off_t. Initialize member unit_length_. Fill in field
1678 cu_offset_.
1679 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1680 Initialize new fields unit_length_ and cu_offset_.
1681 (Dwarf_pubnames_table::read_section): Update prototype.
1682 (Dwarf_pubnames_table::cu_offset): New member function.
1683 (Dwarf_pubnames_table::subsection_size): Likewise.
1684 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1685 New fields.
1686 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1687 member functions public.
1688 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1689 Update comment. Rework logic. Move repeated parts to...
1690 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1691 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1692 pubtypes_table_, and stmt_list_offset.
1693 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1694 Gdb_index::find_pubtype_offset,
1695 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1696 (Gdb_index::pubnames_read): Update prototype and rework logic.
1697 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1698 Forward declare.
1699 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1700 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1701 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1702 Gdb_index::map_pubtable_to_dies):
1703 Declare functions.
1704 (Gdb_index::pubnames_read): Update declaration.
1705 (Gdb_index::Pubname_offset_map): New type.
1706 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1707 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1708 Gdb_index::stmt_list_offset): Declare.
1709 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1710 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1711 Gdb_index::pubtypes_offset_): Remove.
1712
a3ed37d8
RM
17132013-07-19 Roland McGrath <mcgrathr@google.com>
1714
1715 * options.h (General_options): Add -Trodata-segment option.
1716 * parameters.cc (Parameters::check_rodata_segment): New function.
1717 (Parameters::set_target_once): Call it.
1718 * parameters.h (Parameters): Declare it (private member function).
1719 * layout.cc (load_seg_unusable_for_headers): New function, broken
1720 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1721 then validate rodata segment rather than text segment.
1722 (relaxation_loop_body): Call that.
1723 (is_text_segment): New function. Don't admit a non-executable
1724 segment if TARGET->isolate_execinstr().
1725 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1726
eb5b4ded
CC
17272013-07-15 Shawn Landden <shawnlandden@gmail.com>
1728
1729 PR gold/15070
1730 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1731 * nacl.h (Sniff_file::View::View): Request aligned view.
1732
4d5effb9
CC
17332013-07-11 Cary Coutant <ccoutant@google.com>
1734
1735 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1736 correct BRLT entry size.
1737
ba8ca3e7
AM
17382013-07-03 Alan Modra <amodra@gmail.com>
1739
1740 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1741 comment.
1742
267257d2
CC
17432013-07-01 Cary Coutant <ccoutant@google.com>
1744
1745 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1746 reloc_type_.
1747 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1748 (Dwarf_ranges_table::lookup_reloc): New function.
1749 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1750 reloc_type_.
1751 (Dwarf_ranges_table::lookup_reloc): New function.
1752 (Dwarf_ranges_table::reloc_type_): New data member.
1753
06f30c9d
CC
17542013-06-27 Jing Yu <jingyu@google.com>
1755
1756 PR gold/15662
1757 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1758 function.
1759 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1760 (Target_powerpc::do_relax): Call the above.
1761
a2d7bf59
AM
17622013-06-27 Cary Coutant <ccoutant@google.com>
1763
1764 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1765 on garbage collected .opd section.
1766
17672013-06-27 Alan Modra <amodra@gmail.com>
1768
1769 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1770 is non-zero.
1771 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1772 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1773
32364e50
CC
17742013-06-14 Cary Coutant <ccoutant@google.com>
1775
1776 * resolve.cc (Symbol::override_base): Don't override st_type
1777 from plugin placeholder symbols.
1778 (Symbol_table::resolve): Likewise.
1779 (Symbol_table::should_override): Don't complain about TLS mismatch
1780 if the TO symbol is a plugin placeholder.
1781 * testsuite/Makefile.am (plugin_test_tls): New test.
1782 * testsuite/Makefile.in: Regenerate.
1783 * testsuite/plugin_test_tls.sh: New test script.
1784 * testsuite/two_file_test_2_tls.cc: New test source.
1785 * testsuite/two_file_test_tls.cc: New test source.
1786
7fb47cc9
CC
17872013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1788
1789 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1790 the maximum segment alignment is larger than the page size.
1791 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1792 correctly aligns the symbols with large alignemnt.
1793 * testsuite/Makefile.in: Regenerate.
1794 * testsuite/large_symbol_alignment.cc: New file.
1795
6934001a
CC
17962013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1797 Sriraman Tallam <tmsriram@google.com>
1798
1799 * options.h (sort_section): New option.
1800 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1801 Rename from Input_section_sort_section_name_special_ordering_compare.
1802 (Input_section_sort_section_name_compare): New struct.
1803 * output.cc (Output_section::Input_section_sort_section_name_compare::
1804 operator()): New function.
1805 (Output_section::sort_attached_input_sections): Use new sort function
1806 for .text if --sort-section=name is specified.
1807 * layout.cc (Layout::make_output_section):
1808 Add sorting by name when --sort-section=name is specified.
1809 * testsuite/Makefile.am (text_section_grouping): Test option
1810 --sort-section=name.
1811 * testsuite/Makefile.in: Regenerate.
1812 * testsuite/section_sorting_name.cc: New file.
1813 * testsuite/section_sorting_name.sh: New file.
1814
93acabad
CC
18152013-05-21 Cary Coutant <ccoutant@google.com>
1816
1817 * symtab.h (Symbol::is_cxx_vtable): New function.
1818 * target-reloc.h (relocate_section): Check for vtable symbol.
1819 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1820 * testsuite/Makefile.in: Regenerate.
1821 * testsuite/missing_key_func.cc: New test source.
1822 * testsuite/missing_key_func.sh: New test script.
1823
60e8b3fc
CC
18242013-05-21 Cary Coutant <ccoutant@google.com>
1825
2b64b551
RM
1826 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1827 type of enclosing symbol.
1828 (Relocate_info::location): Check symbol type when describing symbol.
1829 * object.h (Symbol_location_info): Remove unused line_number;
1830 add enclosing_symbol_type.
1831 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 1832
9df9de2c
CC
18332013-05-13 Cary Coutant <ccoutant@google.com>
1834
2b64b551
RM
1835 * configure.ac: Export DEFAULT_TARGET.
1836 * configure: Regenerate.
1837 * Makefile.in: Regenerate.
1838 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1839 * testsuite/Makefile.in: Regenerate.
1840 * testsuite/debug_msg.sh: Delete duplicate tests.
1841 Don't check undef_int error message match for powerpc where the
1842 source file and line number aren't available.
9df9de2c 1843
bbc5ae17
RM
18442013-05-10 Roland McGrath <mcgrathr@google.com>
1845
1846 * options.h (General_options): Add --rosegment-gap option.
1847 * options.cc (finalize): --rosegment-gap implies --rosegment.
1848 * layout.cc (set_segment_offsets): Let user option override
1849 target->rosegment_gap().
1850
0c6e6c39
RM
18512013-05-10 Roland McGrath <mcgrathr@google.com>
1852
1853 * options.h (General_options): Remove leading space from help
1854 messages for -nostdlib and --rosegment.
1855
cde7cb01
MR
18562013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1857
1858 PR ld/15365
1859 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1860
f31ae5b8
AM
18612013-05-03 Alan Modra <amodra@gmail.com>
1862
1863 * merge.cc (Output_merge_string::do_add_input_section): Correct
1864 scan for number of strings. Rename vars to avoid shadowing.
1865 Include missing terminator in input_size_.
1866
d3a7cd45
L
18672013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1868
1869 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1870 Restore empty string handling.
1871
6ad3daba
CC
18722013-05-01 Cary Coutant <ccoutant@google.com>
1873
1874 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1875 uninitialized warning.
1876
e31908b6
CC
18772013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1878
1879 * output.cc (Output_section::add_merge_input_section): Allow
1880 to merge sections if the alignment is more than character size.
1881 * merge.h (Output_merge_string::Output_merge_string): Remove
1882 assert.
1883 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1884 only not-null strings. Check the alignment of strings.
1885 * stringpool.h
1886 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1887 alignment as the argument.
1888 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1889 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1890 Align non-zero length strings according to the addralign_.
1891 (Stringpool_template<Stringpool_char>::set_string_offsets):
1892 Updating offsets according to the given alignment.
1893 * testsuite/Makefile.am (text_section_grouping): Test if string
1894 literals are getting merged.
1895 * testsuite/Makefile.in: Regenerate.
1896 * testsuite/merge_string_literals_1.c: New file.
1897 * testsuite/merge_string_literals_2.c: Ditto.
1898 * testsuite/merge_string_literals.sh: Ditto.
1899
0e804863
ILT
19002013-04-26 Ian Lance Taylor <iant@google.com>
1901
1902 * target-reloc.h (relocate_section): If the reloc offset is out of
1903 range, pass VIEW as NULL to relocate.relocate.
1904 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1905 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1906 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1907 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1908 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1909 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1910
e7c5ea40
CC
19112013-04-26 Geoff Pike <gpike@chromium.org>
1912
1913 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1914 * layout.cc (Hash_task): New class.
1915 (Layout::queue_build_id_tasks): New function.
1916 (Layout::write_build_id): Handle single-thread portion of build ID
1917 computation. (In some cases, all of it is single-threaded.) Replace
1918 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1919 functionality in fewer lines of code.
1920 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1921 * options.h (General_options): make "--build-id" default to tree
1922 rather than sha1. Add two new options related to --build-id=tree:
1923 --build-id-chunk-size-for-treehash and
1924 --build-id-min-file-size-for-treehash.
1925 * Makefile.am: add testing of --build-id=tree and related new options
1926 (these tests will be invoked by "make check").
1927 * Makefile.in: Regenerate.
1928
49926cd0
AM
19292013-04-25 Alan Modra <amodra@gmail.com>
1930
1931 * configure.tgt: Add powerpcle and powerpc64le.
1932
a4034750
AM
19332013-04-22 Alan Modra <amodra@gmail.com>
1934
1935 PR gold/15355
1936 * layout.cc (Layout::segment_precedes): Allow more than one
1937 segment with the same type and flags.
1938
e79c84aa
CC
19392013-04-15 Cary Coutant <ccoutant@google.com>
1940
1941 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1942 allocate space in file for BSS sections.
1943
2199fbe7
CC
19442013-04-15 Cary Coutant <ccoutant@google.com>
1945
1946 * script-sections.cc (Orphan_output_section): Reset address
1947 to zero after each orphaned section for relocatable links.
1948
502e8a84
CC
19492013-04-15 Cary Coutant <ccoutant@google.com>
1950
a4034750
AM
1951 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1952 section starting address for relocatable link.
1953 * testsuite/Makefile.am (script_test_11): New test.
1954 * testsuite/Makefile.in: Regenerate.
1955 * testsuite/script_test_11.c: New source file.
1956 * testsuite/script_test_11.t: New linker script.
502e8a84 1957
0cfdc767
AM
19582013-04-13 Alan Modra <amodra@gmail.com>
1959
1960 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1961 owner when sections are not adjacent and exceed group size.
1962 (Target_powerpc::group_sections): Handle corner case.
1963 (Target_powerpc::Branch_info::make_stub): Handle case where
1964 stub table doesn't exist due to branches in non-exec sections.
1965 (Target_powerpc::Relocate::relocate): Likewise.
1966
6830ee24
AM
19672013-04-11 Alan Modra <amodra@gmail.com>
1968
1969 PR gold/15354
1970 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1971 .branch_lt to match bfd ld. Adjust comments throughout file.
1972
54a3d865
ILT
19732013-04-04 Ian Lance Taylor <iant@google.com>
1974
1975 GCC PR c++/56840
1976 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1977 sections before checking whether they are included in the link.
1978
9993ba11
ST
19792013-03-29 Sriraman Tallam <tmsriram@google.com>
1980
1981 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1982 object before calling the plugin claim_file handler. Pass the elf
1983 object of the archive to the plugin. Delete the elf object if the
1984 plugin claims the file.
1985
ebacd51e
AM
19862013-03-21 Alan Modra <amodra@gmail.com>
1987
1988 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1989 segment when omagic.
1990
117be58f
AM
19912013-03-21 Alan Modra <amodra@gmail.com>
1992
1993 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1994 comparison warning.
1995 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1996 uninitialized" warning.
1997
32e2b61d
AM
19982013-03-20 Alan Modra <amodra@gmail.com>
1999
2000 * symtab.h (Symbol::clear_version): New function.
2001 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
2002 is_needed by weak references. Clear version for symbols defined
2003 in as-needed objects that are not needed.
2004
b3ccdeb5
AM
20052013-03-15 Alan Modra <amodra@gmail.com>
2006
2007 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
2008 static and public. Add report_err param. Return false for data refs.
2009 (Target_powerpc::rela_dyn_section): New overloaded function.
2010 (Target_powerpc::plt_, iplt_): Elucidate.
2011 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2012 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2013 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2014 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2015 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2016 push_branch and make_plt_entry for ifunc syms when
2017 reloc_needs_plt_for_ifunc.
2018 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2019 for ifunc unless reloc_needs_plt_for_ifunc.
2020
ad3d8a2f
AM
20212013-03-15 Alan Modra <amodra@gmail.com>
2022
2023 * gc.h (gc_process_relocs): Don't look through function descriptors.
2024 * icf.cc (get_section_contents): Do so here instead.
2025
4d9aa155
AM
20262013-03-13 Alan Modra <amodra@gmail.com>
2027
2028 * powerpc.cc (is_branch_reloc): Forward declare.
2029 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2030 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2031 false for 64-bit, true for 32-bit non-branch relocs.
2032 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2033 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2034 nm output.
2035 (icf_safe_test): Generate linker map file as well as nm output.
2036 (icf_safe_so_test): Likewise.
2037 * testsuite/Makefile.in: Regenerate.
2038 * testsuite/icf_test.sh: Parse linker map file to determine
2039 section folding.
2040 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2041 * testsuite/icf_safe_so_test.sh: Likewise.
2042 (X86_32_or_ARM_specific_safe_fold): Merge into..
2043 (arch_specific_safe_fold): ..this.
2044 (X86_64_specific_safe_fold): Delete unused function.
2045
57420c20
AM
20462013-03-12 Alan Modra <amodra@gmail.com>
2047
2048 * gc.h (gc_process_relocs): Look through function descriptors
2049 to determine shndx, symvalue and addend used by ICF. Tidy
2050 variable duplication.
2051
dc3714f3
AM
20522013-03-11 Alan Modra <amodra@gmail.com>
2053
2054 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2055 * layout.cc (Layout_task_runner::run): ..to here.
2056 * symtab.h (struct Symbol_location): Extract from..
2057 (class Symbol_table): ..here.
2058 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2059 * target.h (class Target): Add function_location and
2060 do_function_location functions.
2061 (class Sized_target): Add do_function_location.
2062 * object.h (class Sized_relobj_file): Move find_shdr..
2063 (class Object): ..to here.
2064 * object.cc: Likewise. Update to suit. Instantiate.
2065 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
2066 * powerpc.cc (class Powerpc_dynobj): New.
2067 (Target_powerpc::do_function_location): New function.
2068 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2069 (Powerpc_dynobj::do_read_symbols): New function.
2070 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2071
956b03bb
ILT
20722013-03-08 Ian Lance Taylor <iant@google.com>
2073
2074 * options.cc (General_options::string_to_object_format): Accept
2075 "default".
2076
4bead2d5
AM
20772013-03-08 Alan Modra <amodra@gmail.com>
2078
2079 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2080 pointer to Post_fde.
2081 (struct Post_fde): Move definition to here..
2082 * ehframe.cc (struct Post_fde): ..from here.
2083 (Cie::write): Don't alloc Post_fde.
2084 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2085
02e60bf7
AM
20862013-03-07 Alan Modra <amodra@gmail.com>
2087
2088 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2089 relocation referencing .LC0.
2090 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2091
8343f03a
AM
20922013-03-07 Alan Modra <amodra@gmail.com>
2093
2094 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2095 always_inline. Add assembly for powerpc to avoid GOT.
2096
3366d57c
AM
20972013-03-07 Alan Modra <amodra@gmail.com>
2098
2099 * testsuite/script_test_10.sh: Don't test .bss section
2100 header number.
2101
6c77229c
AM
21022013-03-06 Alan Modra <amodra@gmail.com>
2103
2104 * powerpc.cc (class Powerpc_relobj): Move some member functions.
2105 (Target_powerpc::symval_for_branch): Add symtab param. Update
2106 all callers. Handle folded sections.
2107 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
2108 to Powerpc_relobj.
2109 (Global_symbol_visitor_opd::operator()): Likewise.
2110
a39e4af6
AM
21112013-03-04 Alan Modra <amodra@gmail.com>
2112
2113 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
2114 * testsuite/Makefile.in: Regenerate.
2115
d5834edb
CC
21162013-03-01 Cary Coutant <ccoutant@google.com>
2117
2118 Add dwp support for v2 DWARF package file format.
2119 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2120 tu_length parameter. Adjust all callers.
2121 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2122 * dwp.cc: Include dwarf.h.
2123 (Section_bounds): New struct type.
2124 (Unit_set): New struct type.
2125 (Dwo_file::Dwo_file): Initialize new data member.
2126 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2127 Combine and rename to...
2128 (Dwo_file::read_unit_index): ...this.
2129 (Dwo_file::sized_read_compunit_index)
2130 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2131 (Dwo_file::sized_read_unit_index): ...this.
2132 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2133 parameters; add section_id parameter.
2134 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2135 (Dwo_file::add_unit_set): ...this.
2136 (Dwo_file::shndx_map_): Remove.
2137 (Dwo_file::sect_offsets_): New data member.
2138 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2139 (Dwp_output_file::add_section): Rename to...
2140 (Dwp_output_file::add_contribution): ...this.
2141 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2142 (Dwp_output_file::add_tu_set): Likewise.
2143 (Dwp_output_file::Contribution): New type.
2144 (Dwp_output_file::Section::contributions): New data member.
2145 (Dwp_output_file::Cu_or_tu_set): Remove.
2146 (Dwp_output_file::Section::Section): New ctor.
2147 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2148 (Dwp_output_file::Dwp_index::Section_table): New type.
2149 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2150 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2151 parameter.
2152 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2153 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2154 (Dwp_output_file::Dwp_index::section_table): New member function.
2155 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2156 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2157 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2158 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2159 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2160 (Dwp_output_file::Dwp_index::section_table_): New data member.
2161 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2162 (Dwp_output_file::add_output_section): New member function.
2163 (Dwp_output_file::write_new_section): New member function.
2164 (Dwp_output_file::write_contributions): New member function.
2165 (Dwp_output_file::section_id_map_): New data member.
2166 (class Dwo_id_info_reader): Remove.
2167 (class Unit_reader): New class.
2168 (get_dwarf_section_name): New function.
2169 (Dwo_file::read_executable): Adjust initializations of class data.
2170 (Dwo_file::read): Add support for v2 package file format.
2171 (Dwo_file::read_unit_index): Likewise.
2172 (Dwo_file::sized_read_unit_index): Likewise.
2173 (Dwo_file::copy_section): Likewise.
2174 (Dwo_file::add_unit_set): Likewise.
2175 (Dwp_output_file::add_output_section): Likewise.
2176 (Dwp_output_file::add_contribution): Likewise.
2177 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2178 for empty slot.
2179 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2180 file format.
2181 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2182 slot.
2183 (Dwp_output_file::initialize): Remove unused function.
2184 (Dwp_output_file::finalize): Add support for v2 package file format.
2185 (Dwp_output_file::write_index): Likewise.
2186 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2187 function prototype.
2188
a68a081d
CC
21892013-03-01 Cary Coutant <ccoutant@google.com>
2190
2191 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2192 function into class definition in header file.
2193 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2194 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2195 New function.
2196 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2197
9d5781f8
AM
21982013-02-28 Alan Modra <amodra@gmail.com>
2199
2200 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2201 * target.cc (Target::do_plt_fde_location): New function.
2202 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2203 accessor function, and constructor param.
2204 (struct Post_fde, Post_fdes): Declare.
2205 (Cie::write): Add post_fdes param.
2206 * ehframe.cc (Fde::write): Use plt_fde_location.
2207 (struct Post_fde): Define.
2208 (Cie::write): Stash FDEs added post merge mapping.
2209 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2210 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2211 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2212 other FDEs.
2213 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2214 (Target_powerpc::has_glink): New function.
2215 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2216 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2217 glink_eh_frame_fde_32, default_fde): New data.
2218 (Stub_table::eh_frame_added_): New var.
2219 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2220 Make const.
2221 (Stub_table::add_eh_frame): New function.
2222 (Output_data_glink::add_eh_frame): New function.
2223 (Target_powerpc::make_glink_section): Call add_eh_frame.
2224
214383dd
ILT
22252013-02-15 Ian Lance Taylor <iant@google.com>
2226
2227 * options.h (DEFINE_uint64_alias): Define.
2228 (class General_options): Add -Ttext-segment as an alias for
2229 -Ttext.
2230
91c2b899
AM
22312013-02-15 Alan Modra <amodra@gmail.com>
2232
2233 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2234 (Stub_table::do_write): ..here, two places.
2235 (Stub_table::plt_call_size): Use it here too.
2236
20e2a8aa
ILT
22372013-02-11 Ian Lance Taylor <iant@google.com>
2238
2239 * descriptors.cc (Descriptors::close_all): New function.
2240 * descriptors.h (class Descriptors): Declare close_all.
2241 (close_all_descriptors): New inline function.
2242 * plugin.cc: Include "descriptors.h".
2243 (Plugin_manager::cleanup): Call close_all_descriptors.
2244
8952bc69
AM
22452013-02-06 Alan Modra <amodra@gmail.com>
2246
2247 * README: Update coding style link.
2248
29bd8b6b
CC
22492013-01-28 Cary Coutant <ccoutant@google.com>
2250
a4034750
AM
2251 * dwp.cc (File_list): New typedef.
2252 (Dwo_name_info_reader): New class.
2253 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2254 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2255 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2256 (Dwo_file::read_executable): New function.
2257 (Dwo_file::read): Move common setup code to ...
2258 (Dwo_file::make_object): ... here.
2259 (dwp_options): Add --exec/-e.
2260 (usage): Likewise.
2261 (main): Likewise.
29bd8b6b 2262
c6ac678d
ST
22632013-01-24 Sriraman Tallam <tmsriram@google.com>
2264
2265 * layout.cc (Layout::layout): Check for option text_reorder.
2266 (Layout::make_output_section): Ditto.
2267 * options.h (text_reorder): New option.
2268 * output.cc (Input_section_sort_compare): Remove special ordering
2269 of section names.
2270 (Output_section::
2271 Input_section_sort_section_name_special_ordering_compare::
2272 operator()): New function.
2273 (Output_section::sort_attached_input_sections): Use new sort function
2274 for .text.
2275 * output.h (Input_section_sort_section_name_special_ordering_compare):
2276 New struct.
2277 * testsuite/Makefile.am (text_section_grouping): Test option
2278 --no-text-reorder
2279 * testsuite/Makefile.in: Regenerate.
2280 * testsuite/text_section_grouping.sh: Check order of functions without
2281 default text reordering.
2282
50701cc1
MF
22832013-01-18 Mike Frysinger <vapier@gentoo.org>
2284
2285 * options.h (General_options): Change default to true for new_dtags.
2286
b1b00fcc
MF
22872013-01-18 Mike Frysinger <vapier@gentoo.org>
2288
2289 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2290 when enable_new_dtags is false. Only add DT_RUNPATH when
2291 enable_new_dtags is true.
2292
ec5b8187
AM
22932013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2294
2295 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2296 used in declaration and definition consistent.
2297 (Target_powerpc::symval_for_branch): Ditto.
2298
a880d4c4
ST
22992013-01-16 Sriraman Tallam <tmsriram@google.com>
2300
2301 * testsuite/plugin_final_layout.cc: Fix comment.
2302
7c381248
ST
23032013-01-16 Sriraman Tallam <tmsriram@google.com>
2304
2305 * layout.cc (Layout::layout): Do not do default sorting for
2306 text sections when section ordering is specified.
2307 (make_output_section): Ditto.
2308 * testsuite/plugin_final_layout.cc: Name the function sections
2309 to catch reordering issues.
2310
e2458743
AM
23112013-01-15 Alan Modra <amodra@gmail.com>
2312
2313 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2314 plt-thread-safe.
2315
431ed302
AM
23162013-01-15 Alan Modra <amodra@gmail.com>
2317
2318 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2319 * testsuite/Makefile.in: Regenerate.
2320
0ec6429b
AM
23212013-01-14 Alan Modra <amodra@gmail.com>
2322
2323 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2324 * testsuite/Makefile.in: Regenerate.
2325
0bf402d5
ILT
23262013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2327
36af3926 2328 PR bfd/14430
0bf402d5
ILT
2329 Fix mingw gold build with plugins enabled
2330 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2331 * configure.ac: Export DLOPEN_LIBS and add headers check.
2332 * plugin.cc: Handle non-dlfcn case.
2333 * Makefile.in: Regenerate.
2334 * config.in: Regenerate.
2335 * configure: Regenerate.
2336 * testsuite/Makefile.in: Regenerate.
2337
9e9143bc
ST
23382013-01-09 Sriraman Tallam <tmsriram@google.com>
2339
2340 * output.h (sort_attached_input_sections): Change to be public.
2341 * script-sections.cc
2342 (Output_section_definition::set_section_addresses): Sort
2343 attached input sections according to section order before linker
2344 script assigns section addresses.
2345 (Orphan_output_section::set_section_addresses): Sort
2346 attached input sections according to section order before linker
2347 script assigns section addresses.
2348 * Makefile.am (final_layout.sh): Use a simple linker script to
2349 check if section ordering still works.
2350 * Makefile.in: Regenerate.
2351
679af368
ILT
23522013-01-09 Ben Cheng <bccheng@google.com>
2353
2354 * arm.cc (Target_arm::attributes_accept_div): New function.
2355 (Target_arm::attributes_forbid_div): New function.
2356 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2357 attribute using the same new functions as what bfd/elf32_arm.c
2358 does.
2359
3136a00e
CC
23602013-01-07 Cary Coutant <ccoutant@google.com>
2361
2362 PR gold/14993
2363 * output.cc (Output_section::add_input_section): For incremental
2364 updates, don't track input sections that are allocated from patch
2365 space.
2366
f2a6224b
L
23672013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2368 Ian Lance Taylor <iant@google.com>
2369
2370 PR gold/14897
2371 * configure.ac (--enable-ld): Removed.
2372 (install_as_default): Set to yes only for --enable-gold=default
2373 or --disable-ld.
2374 * configure: Regenerated.
2375
4f46f626
L
23762013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2377
2378 * options.h (General_options): Add -fuse-ld= for GCC linker
2379 option compatibility.
2380
26e4ef59
CC
23812013-01-04 Cary Coutant <ccoutant@google.com>
2382
2383 * configure.ac: Fix typo restoring CXXFLAGS.
2384 * configure: Regenerate.
2385
3d587466
CC
23862013-01-04 Cary Coutant <ccoutant@google.com>
2387
4f46f626
L
2388 * testsuite/Makefile.am (CXXLINK_S): New macro.
2389 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2390 * testsuite/Makefile.in: Regenerate.
3d587466 2391
44db6695
L
23922013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2393
2394 * version.cc (print_version): Update copyright year to 2013.
2395
edcac0c1
ILT
23962012-12-20 Ian Lance Taylor <iant@google.com>
2397
2398 * layout.cc (Layout::special_ordering_of_input_section): New
2399 function.
2400 (Layout::layout): If input section requires special ordering, must
2401 sort input sections.
2402 (Layout::make_output_section): May sort .text input sections.
2403 (Layout::is_section_name_prefix_grouped): Remove.
2404 * layout.h (class Layout): Declare
2405 special_ordering_of_input_section. Don't declare
2406 is_section_name_prefix_grouped.
2407 * output.cc (Output_section::add_input_section): Revert last
2408 change.
2409 (Output_section::Input_section_sort::match_file_name): Don't crash
2410 if called on output section data.
2411 (Output_section::Input_section_sort_compare): Sort based on
2412 special ordering.
2413 (Output_section::Input_section_sort_section_order_index_compare):
2414 Revert last patch.
2415 (Output_section::sort_attached_input_sections): Likewise.
2416
28f2a4ac
ST
24172012-12-18 Sriraman Tallam <tmsriram@google.com>
2418
edcac0c1 2419 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2420 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2421 * output.cc (Output_section::add_input_section): Check if section
2422 name contains special prefix. Keep input sections to sort such
2423 sections.
2424 (Output_section::Input_section_sort_section_order_index_compare
2425 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2426 (Output_section::sort_attached_input_sections): Add condition to
2427 Input_section_entry constructor call.
28f2a4ac
ST
2428 * testsuite/Makefile.am (text_section_grouping): New test.
2429 * testsuite/Makefile.in: Regenerate.
2430 * testsuite/text_section_grouping.cc: New file.
2431 * testsuite/text_section_grouping.sh: New file.
2432
5bf135a7
NC
24332012-12-17 Nick Clifton <nickc@redhat.com>
2434
2435 * Makefile.am: Add copyright notice.
2436 * NEWS: Likewise.
2437 * README: Likewise.
2438 * configure.ac: Likewise.
2439 * ftruncate.c: Likewise.
2440 * Makefile.in: Regenerate.
2441
59965708
CC
24422012-12-14 Cary Coutant <ccoutant@google.com>
2443
a4034750
AM
2444 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2445 --no-as-needed flag.
2446 (exception_separate_shared_12_test): Likewise.
2447 (incremental_copy_test): Likewise.
2448 * testsuite/Makefile.in: Regenerate.
59965708 2449
2a77e2ab
CC
24502012-12-14 Cary Coutant <ccoutant@google.com>
2451
2452 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2453 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2454
e3deeb9c
AM
24552012-12-12 Alan Modra <amodra@gmail.com>
2456
2457 * powerpc.cc (class Track_tls): New.
2458 (class Relocate, class Scan): Inherit Track_tls.
2459 (Target_powerpc::Scan::local, global): Track tls optimization
2460 and avoid creating plt entry for __tls_get_addr if all uses
2461 are optimized away.
2462 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2463
d8f5a274
AM
24642012-12-12 Alan Modra <amodra@gmail.com>
2465
2466 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2467 Replace no_toc_optimize with toc_optimize.
2468 * output.h (Output_section::input_sections): Provide non-const variant.
2469 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2470 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2471 accessors.
2472 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2473 (class Sort_toc_sections): New.
2474 (Target_powerpc::do_finalize_sections): Sort toc sections.
2475 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2476
4c8a1de1
RM
24772012-12-10 Roland McGrath <mcgrathr@google.com>
2478
2479 * testsuite/binary_unittest.cc (read_all): New function.
2480 (Sized_binary_test): Use it instead of ::read.
2481 * fileread.cc (do_read): Don't assume pread always reads the whole
2482 amount in a single call.
2483
edc27beb
AM
24842012-12-10 Alan Modra <amodra@gmail.com>
2485
2486 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2487 Set EM_PPC64 or EM_PPC here.
2488 (Target_selector_powerpc::do_recognize): Delete.
2489
906b9150
AM
24902012-12-10 Alan Modra <amodra@gmail.com>
2491
2492 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2493 stub_table_.
2494 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2495
418c15ae
RM
24962012-12-07 Roland McGrath <mcgrathr@google.com>
2497
2498 * testsuite/binary_unittest.cc (Sized_binary_test):
2499 Use open_descriptor rather than ::open.
2500
decdd3bc
AM
25012012-12-07 Alan Modra <amodra@gmail.com>
2502
2503 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2504 typedef and invalid_address constant.
2505 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2506 instantiate constants.
2507
db399005
ILT
25082012-12-06 Roland McGrath <mcgrathr@google.com>
2509
2510 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2511 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2512 * aclocal.m4: Regenerate.
2513 * configure: Regenerate.
2514 * Makefile.in: Regenerate.
2515 * testsuite/Makefile.in: Regenerate.
2516
aba6bc71
AM
25172012-12-07 Alan Modra <amodra@gmail.com>
2518
2519 * options.h (General_options): Add no_toc_optimize.
2520 * powerpc.cc (ok_lo_toc_insn): New function.
2521 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2522
9e69ed50
AM
25232012-12-06 Alan Modra <amodra@gmail.com>
2524
2525 * options.h (General_options): Add plt_align, plt_static_chain,
2526 plt_thread_safe. Update stub_group_size help text.
2527 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2528 for new plt_thread_safe_ var.
2529 (use_plt_offset): Correct comments.
2530 (Target_powerpc::do_relax): Look for thread creation symbols to
2531 determine default plt_thread_safe value. Clear plt call stubs
2532 as well as branch stubs each iteration.
2533 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2534 insn constants.
2535 (l, hi, ha, write_insn): Move earlier.
2536 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2537 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2538 plt stubs too.
2539 (Stub_table::update_size): Adjust.
2540 (Stub_table::prev_size, set_prev_size): Delete.
2541 (Stub_table::stub_align): Let --plt-align affect result.
2542 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2543 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2544 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2545 (Stub_table::do_write): Support more stub variants.
2546
f43ba157
AM
25472012-12-04 Alan Modra <amodra@gmail.com>
2548
2549 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2550 (Target_powerpc::do_define_standard_symbols): New function.
2551
34171bc5
AM
25522012-12-03 Alan Modra <amodra@gmail.com>
2553
2554 * output.h: Formatting, whitespace.
2555
dc9589e9 25562012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2557
2558 * layout.h (Layout::get_executable_sections): Declare.
2559 * layout.cc (Layout::get_executable_sections): New function.
2560 * arm.cc (Target_arm::group_sections): Use it.
2561 (Arm_output_section::group_sections): Delete now redundant test.
2562 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2563 param to handle relative relocs.
2564 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2565 (Output_data_reloc::add_absolute): Adjust.
2566 (Output_data_reloc::add_relative): New function.
2567 (Output_data::reset_data_size): New function.
2568 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2569 (Output_section::set_addralign): New function.
2570 (Output_section::checkpoint_set_addralign): New function.
2571 (Output_section::clear_section_offsets_need_adjustment): New function.
2572 (Output_section::input_sections): Make public.
2573 * powerpc.cc (class Output_data_brlt_powerpc): New.
2574 (class Stub_table, class Stub_control): New.
2575 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2576 stub_table_, set_stub_table, stub_table): New vectors and accessor
2577 functions.
2578 (Target_powerpc::do_may_relax, do_relax, push_branch,
2579 new_stub_table, stub_tables, brlt_section, group_sections,
2580 add_branch_lookup_table, find_branch_lookup_table,
2581 write_branch_lookup_table, make_brlt_section): New functions.
2582 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2583 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2584 branch_info_): New vars.
2585 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2586 make call stubs here.
2587 (Output_data_glink): Remove all call stub handling from this class.
2588 (Target_powerpc::Scan::local, global): Save interesting branch
2589 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2590 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2591 functions on final link.
2592 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2593 Handle long branch destinations too.
2594 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2595 do_plt_address_for_local): Adjust lookup of plt call stubs.
2596
627b30b7
AM
25972012-11-30 Alan Modra <amodra@gmail.com>
2598
2599 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2600 relocs against protected symbols when building 32-bit shared libs.
2601
40b469d7
AM
26022012-11-30 Alan Modra <amodra@gmail.com>
2603
2604 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2605 param. Call got_section() to make .got. Update all callers
2606 and their callers and so on.
2607
bb66a627
AM
26082012-11-30 Alan Modra <amodra@gmail.com>
2609
2610 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2611 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2612 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2613 value if it already exists.
2614
d2cf1c6c
L
26152012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2616
2617 PR gold/14858
2618 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2619
edccdf7c
RM
26202012-11-14 Roland McGrath <mcgrathr@google.com>
2621
2622 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2623 than bfc instruction for data sandboxing.
2624
6febeb74
AM
26252012-11-08 Alan Modra <amodra@gmail.com>
2626
2627 * po/POTFILES.in: Regenerate.
2628
0a6f1bf2
AM
26292012-11-05 Alan Modra <amodra@gmail.com>
2630
2631 * configure.ac: Apply 2012-09-10 change to config.in here.
2632 * configure: Regenerate.
2633
26a4e9cb
AM
26342012-11-05 Alan Modra <amodra@gmail.com>
2635
2636 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2637 (struct Opd_ent): Use "Address" rather than "Offset".
2638 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2639 (Target_powerpc::got_section): Make public.
2640 (Target_powerpc::scan_relocs): Move code setting symbols..
2641 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2642 Create _SDA_BASE_ only when referenced.
2643
cc928013
RM
26442012-11-02 Roland McGrath <mcgrathr@google.com>
2645
2646 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2647 from last change.
2648
50ed5eb1
RM
26492012-11-01 Roland McGrath <mcgrathr@google.com>
2650
62fe925a
RM
2651 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2652 for offset_in_output_section parameter.
2653 (Sized_target::relocate_special_relocatable): Likewise.
2654 * arm.cc (Target_arm::relocate_relocs): Likewise.
2655 (Target_arm::relocate_special_relocatable): Likewise.
2656 * i386.cc (Target_i386::relocate_relocs): Likewise.
2657 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2658 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2659 * target-reloc.h (relocate_relocs): Likewise.
2660 * testsuite/testfile.cc (Target_test): Likewise.
2661 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2662 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2663
2664 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2665 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2666
2667 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2668 parameter, which is unused in the [!F_SETFD] case.
2669
50ed5eb1
RM
2670 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2671 SYMNDX to off_t before comparing it to this->data_size().
2672 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2673 * incremental.cc (Output_section_incremental_inputs::do_write):
2674 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2675
2cadc0bf
RM
2676 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2677
3bfcb652
NC
26782012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2679
2680 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2681 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2682 in EABI_VER5.
2683
c1a8d56e
CC
26842012-10-29 Cary Coutant <ccoutant@google.com>
2685
2686 * dwp.cc (usage): Add file and exit status parameters;
2687 add --help and --version options.
2688 (print_version): New function.
2689 (main): Add --help and --version options.
2690
b2490a7b
L
26912012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2692
2693 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2694 final_layout_sequence.txt.
2695 * testsuite/Makefile.in: Regenerated.
2696
aa543512
L
26972012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2698
2699 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2700 COMPILE generated by automake.
2701 (LINK1): Likewise.
2702 (CXXCOMPILE1): Likewise.
2703 (CXXLINK1): Likewise.
2704 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2705 (LINK): Likewise.
2706 (CXXCOMPILE): Likewise.
2707 (CXXLINK): Likewise.
2708 * testsuite/Makefile.in: Regenerated.
2709
d361fafb
L
27102012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2711
2712 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2713 on bad fwrite return.
2714
598c7410
L
27152012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2716
2717 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2718 on val.
2719
35c813e2
CC
27202012-10-23 Cary Coutant <ccoutant@google.com>
2721
2722 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2723 * testsuite/Makefile.in: Regenerate.
2724 * testsuite/dwp_test.h: New source file.
2725 * testsuite/dwp_test_1.cc: New source file.
2726 * testsuite/dwp_test_1.s: New source file.
2727 * testsuite/dwp_test_1.sh: New source file.
2728 * testsuite/dwp_test_1b.cc: New source file.
2729 * testsuite/dwp_test_1b.s: New source file.
2730 * testsuite/dwp_test_2.cc: New source file.
2731 * testsuite/dwp_test_2.s: New source file.
2732 * testsuite/dwp_test_2.sh: New source file.
2733 * testsuite/dwp_test_main.cc: New source file.
2734 * testsuite/dwp_test_main.s: New source file.
2735
77429909
CC
27362012-10-23 Cary Coutant <ccoutant@google.com>
2737
2738 * dwp.h: New header file.
2739 * dwp.cc: New source file.
2740 * gold.h: Move shared declarations to system.h.
2741 * system.h: New header file.
2742 * Makefile.am: Add dwp.
2743 * Makefile.in: Regenerate.
2744
ed5d6712
CC
27452012-10-23 Cary Coutant <ccoutant@google.com>
2746
2747 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2748 Dwarf_info_reader::read_from_pointer.
2749 (Dwarf_pubnames_table::read_header): Likewise.
2750 (Dwarf_pubnames_table::next_name): Likewise.
2751 (Dwarf_die::read_attributes): Likewise.
2752 (Dwarf_die::skip_attributes): Likewise.
2753 (Dwarf_info_reader::read_from_pointer): New function template.
2754 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2755 (Dwarf_pubnames_table): Likewise.
2756 (Dwarf_info_reader::read_from_pointer): New function template.
2757 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2758 Dwarf_pubnames_table ctor.
2759
8787852d
CC
27602012-10-23 Cary Coutant <ccoutant@google.com>
2761
2762 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2763 abbrev_shndx.
2764 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2765 abbrev_shndx_.
2766 (Dwarf_info_reader::set_abbrev_shndx): New method.
2767 (Dwarf_info_reader::abbrev_shndx_): New data member.
2768
9fc236f3
CC
27692012-10-23 Cary Coutant <ccoutant@google.com>
2770
2771 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2772 from object, not parameters.
2773 (Dwarf_info_reader::parse): Likewise.
2774 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2775 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2776 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2777 methods.
2778
effe8365
CC
27792012-10-23 Cary Coutant <ccoutant@google.com>
2780
2781 * fileread.cc (Input_file::Input_file): New constructor.
2782 * fileread.h (class Input_file): Add new constructor.
2783
1698990d
AM
27842012-10-18 Alan Modra <amodra@gmail.com>
2785
2786 PR gold/14727
2787 * object.cc (Relobj::is_section_name_included): Also match
2788 .sdata personality section.
2789
168a4726
AM
27902012-10-18 Alan Modra <amodra@gmail.com>
2791
2792 * target-reloc.h (class Default_comdat_behavior): New, package up..
2793 (get_comdat_behaviour): ..this.
2794 (relocate_section): Add Relocate_comdat_behavior template arg,
2795 adjust code to suit.
2796 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2797 (Target_arm::scan_reloc_section): Likewise.
2798 * i386.cc (Target_i386::relocate_section): Likewise.
2799 * sparc.cc (Target_sparc::relocate_section): Likewise.
2800 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2801 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2802 * powerpc.cc (class Relocate_comdat_behavior): New.
2803 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2804 gold::relocate_section with new template arg.
2805
acc276d8
AM
28062012-10-18 Alan Modra <amodra@gmail.com>
2807
2808 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2809 dynamic relocs for GOT_TPREL got entries, without symbol if
2810 resolving locally.
2811 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2812 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2813 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2814
e10f9870
AM
28152012-10-17 Alan Modra <amodra@gmail.com>
2816
2817 PR gold/14726
2818 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2819
ae034989
ST
28202012-10-16 Sriraman Tallam <tmsriram@google.com>
2821
2822 * layout.cc (Layout::include_section): Keep sections marked
2823 SHF_EXCLUDE when doing relocatable links.
2824
f3a0ed29
AM
28252012-10-16 Alan Modra <amodra@gmail.com>
2826
2827 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2828 (Target_powerpc::do_finalize_sections): Call it.
2829 (Output_data_save_res): New class and supporting functions.
2830 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2831 normal symbols defined in object files.
2832
c6de8ed4
AM
28332012-10-12 Alan Modra <amodra@gmail.com>
2834
2835 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2836 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2837 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2838 section if scan_opd_relocs not yet called.
2839 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2840
03e25981
AM
28412012-10-12 Alan Modra <amodra@gmail.com>
2842
2843 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2844 add_local_ifunc_entry): Revert last change.
2845 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2846
c9824451
AM
28472012-10-05 Alan Modra <amodra@gmail.com>
2848
2849 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2850 do_plt_address_for_global): New functions.
2851 (Output_data_got_powerpc::do_write): Don't segfault when linking
2852 statically.
2853 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2854 add_local_ifunc_entry): Return true on adding entry..
2855 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2856 glink->add_entry call. Remove unused symtab param. Adjust calls.
2857 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2858 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2859 set up symbols here.
2860 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2861 syms here. Do so even when no .iplt. Don't segfault when linking
2862 statically.
2863 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2864 new variants without reloc param.
2865 (Glink_sym_ent::Glink_sym_ent): Likewise.
2866 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2867 reloc when refs will resolve to plt call stub.
2868 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2869 R_PPC_PLTREL24 to resolve locally.
2870 (Target_powerpc::Scan::global): Correct ifunc handling.
2871 (Target_powerpc::Relocate::relocate): Correct local sym glink
2872 lookup. Don't destroy "value" when we have a plt call stub,
2873 and when checking plt call validity.
2874 (Target_powerpc::do_dynsym_value): Simplify.
2875
19fec8c1
AM
28762012-10-05 Alan Modra <amodra@gmail.com>
2877
2878 * i386.cc (Output_data_plt_i386::address_for_global,
2879 address_for_local): Add plt offset to returned value. Adjust uses.
2880 * sparc.cc (Output_data_plt_sparc::address_for_global,
2881 address_for_local): Likewise.
2882 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2883 address_for_local): Likewise.
2884 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2885 address_for_local): Likewise.
2886 * target.h (Target::plt_address_for_global, plt_address_for_local):
2887 Update comment.
2888 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2889 (Output_data_got::Got_entry::write): Nor here.
2890 * output.h: Comment fix.
2891
e867b647
WL
28922012-10-02 Jiong Wang <jiwang@tilera.com>
2893
2894 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2895 global_offset_table_ value for larget got.
2896 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2897
e5d5f5ed
AM
28982012-09-29 Alan Modra <amodra@gmail.com>
2899
2900 * powerpc.cc (Target_powerpc::iplt_): New output section.
2901 (Target_powerpc::iplt_section, make_iplt_section,
2902 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2903 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2904 Target_powerpc::plt_entry_count): Count iplt entries too.
2905 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2906 reloc section in constructor. New params.
2907 (Target_powerpc::make_plt_section): Create reloc section here instead.
2908 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2909 functions.
2910 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2911 (Output_data_glink::add_entry, find_entry): New functions to
2912 deal with local syms.
2913 (Glink_sym_ent): Add support for local syms.
2914 (Output_data_glink::do_write): Handle ifunc plt entries.
2915 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2916 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2917 (Target_powerpc::Relocate::relocate): Likewise.
2918 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2919
ec4dbad3
AM
29202012-09-25 Alan Modra <amodra@gmail.com>
2921
2922 * object.h (Sized_relobj_file::adjust_local_symbol,
2923 do_adjust_local_symbol): New functions.
2924 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2925 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2926 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2927 and irregular opd entry spacing.
2928 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2929 (Global_symbol_visitor_opd): New functor.
2930 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2931 on deleted opd entries.
2932
5c0b3823
WL
29332012-09-15 Jiong Wang <jiwang@tilera.com>
2934
2935 * tilegx.cc: New file.
2936 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2937 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2938 * configure.tgt: Add entries for tilegx*.
2939 * configure.ac: Likewise.
2940 * Makefile.in: Rebuild.
2941 * configure: Likewise.
2942 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2943 tilegx.
2944
bfdfa4cd
AM
29452012-09-13 Alan Modra <amodra@gmail.com>
2946
2947 * target-reloc.h (scan_relocs): Call scan.local for relocs
2948 against symbols in discarded sections. Pass is_discarded
2949 param.
2950 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2951 Add is_discarded param.
2952 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2953 is_discarded to flag opd entry as discarded. Don't emit dyn
2954 relocs on such entries.
2955 (Target_powerpc::Scan::global): Similarly detect and handle
2956 such opd entries.
2957 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2958 opd_ent_. Update all uses.
2959 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2960 (Target_powerpc::relocate_section): Zero out discarded opd
2961 entry relocs.
2962
d77a0555
ILT
29632012-09-12 Ian Lance Taylor <iant@google.com>
2964
2965 PR gold/14570
2966 * output.cc: Rename Output_data_got template parameter from size
2967 to got_size for all functions. Compile all variants of
2968 Output_data_got.
2969 (Output_data_got::Got_entry::write): Correct use of size for
2970 symbol value. Use local_is_tls rather than casting to
2971 Sized_relobj_file.
2972 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2973 (class Sized_relobj_file): Add do_local_is_tls.
2974 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2975
815a1205
AM
29762012-09-11 Alan Modra <amodra@gmail.com>
2977
2978 PR gold/14566
2979 * layout.cc (Layout::set_segment_offsets): When using
2980 common-page-size alignment, ensure we are on a new max-page-size
2981 page.
2982 * output.cc (Output_segment::set_section_addresses): Use
2983 abi_pagesize, not common_pagesize for relro boundary.
2984 (Output_segment::set_offset): Likewise.
2985
bd73a62d
AM
29862012-09-11 Alan Modra <amodra@gmail.com>
2987
2988 * output.h (Output_data_got::add_global_tls, add_local_tls,
2989 add_local_tls_pair): New functions.
2990 (Output_data_got::add_local_pair_with_rel): Remove second
2991 reloc param. Expand comment.
2992 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2993 use_plt_or_tls_offset_, similarly for constructor param.
2994 (Output_data_got::Got_entry::write): Add got_index param.
2995 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2996 add_local_tls_pair): New functions.
2997 (Output_data_got::Got_entry::write): Handle tls symbols
2998 with use_plt_or_tls_offset_ set specially.
2999 (Output_data_got::add_local_pair_with_rel): Only one reloc.
3000 (Output_data_got::do_write): Replace iterator with index, pass
3001 index to entry write function.
3002 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
3003 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
3004 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
3005 call.
3006 * i386.cc (Target_i386::Scan::local): Likewise.
3007 * sparc.cc (Target_sparc::Scan::local): Likewise.
3008 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
3009 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
3010 do_tls_offset_for_global): New functions.
3011 (Target_powerpc::Scan::local): Correct TLS relocations and got
3012 entry values.
3013 (Target_powerpc::Scan::global): Don't emit unnecessary
3014 dynamic relocations on TLS GOT entries.
3015
00716ab1
AM
30162012-09-10 Matthias Klose <doko@ubuntu.com>
3017
3018 * config.in: Disable sanity check for kfreebsd.
3019
c891b3f9
SA
30202012-09-10 Sterling Augustine <saugustine@google.com>
3021
3022 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3023 (Gdb_index::pubtypes_read): New parameter.
3024 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3025 to calls.
3026 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3027 pubtypes_object_.
3028
e81fea4d
AM
30292012-09-09 Alan Modra <amodra@gmail.com>
3030
3031 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3032 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3033 * gc.h (gc_process_relocs): Call target gc_add_reference.
3034 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3035 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3036 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3037 unnecessary cast.
3038 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3039 to cater for when we don't need code offset. Update use.
3040 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3041 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3042 set_opd_valid): New functions.
3043 (Target_powerpc::do_gc_add_reference): New function.
3044 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3045 stashed refs.
3046 (Target_powerpc::do_gc_mark_symbol): New function.
3047
d2d60eef
CC
30482012-09-06 Cary Coutant <ccoutant@google.com>
3049
3050 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3051 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3052 (Dwarf_die::skip_attributes): Likewise.
3053 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3054 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3055 (main): Call it.
3056 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3057
32ed4573
L
30582012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3059
3060 * testsuite/script_test_3.t: Add .got.plt output section
3061 statement.
3062 * testsuite/script_test_4.t: Likewise.
3063
f4baf0d4
AM
30642012-09-05 Alan Modra <amodra@gmail.com>
3065
3066 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
3067 update all uses and lose "enum" when using type.
3068
864a1b56
AM
30692012-09-05 Alan Modra <amodra@gmail.com>
3070
3071 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3072 * configure: Regenerate.
3073 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3074 (plugin_final_layout.stdout): Likewise.
3075 (memory_test): Set page sizes to 0x1000.
3076 * testsuite/Makefile.in: Regenerate.
3077 * testsuite/discard_locals_test.sh: Add FIXME comment.
3078 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3079 * testsuite/pr14265.t: Add .got output section statement.
3080 * testsuite/script_test_2.t: Likewise.
3081 * testsuite/script_test_3.t: Likewise.
3082 * testsuite/script_test_4.t: Likewise.
3083 * testsuite/script_test_5.t: Likewise.
3084 * testsuite/script_test_6.t: Likewise.
3085 * testsuite/script_test_7.t: Likewise.
3086 * testsuite/script_test_9.t: Likewise.
3087
3ea0a085
AM
30882012-09-05 Alan Modra <amodra@gmail.com>
3089
3090 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3091 (Powerpc_relocate_functions::Status): New typedef.
3092 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3093 (Target_powerpc::Scan::local): Handle REL64.
3094 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3095 for REL32 and REL64.
3096 (Target_powerpc::symval_for_branch): New function, extracted from..
3097 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3098 checks. Report overflow errors.
3099
7404fe1b
AM
31002012-09-05 Alan Modra <amodra@gmail.com>
3101
3102 * object.h (Sized_relobj_file::emit_relocs): Delete.
3103 (Sized_relobj_file::emit_relocs_reltype): Delete.
3104 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
3105 relocate_relocs for --emit-relocs.
3106 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
3107 * output.h: Update comment.
3108 (Output_segment::first_section): New function.
3109 (Output_segment::first_section_load_address): Use first_section.
3110 * output.cc (Output_segment::first_section): New function extracted..
3111 (Output_segment::first_section_load_address): ..from here. Delete.
3112 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
3113 * target.h (Sized_target::relocate_for_relocatable): Likewise.
3114 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
3115 adjust call to target.h function.
3116 * i386.cc (Target_i386): Likewise.
3117 * sparc.cc (Target_sparc): Likewise.
3118 * x86_64.cc (Target_x86_64): Likewise.
3119 * powerpc.cc (Target_powerpc): Likewise.
3120 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
3121 first tls section has section symbol for optimised local dynamic
3122 output relocs.
3123 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
3124 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
3125 optimised tls code.
3126 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
3127 Rename to relocate_relocs. Update error message.
3128
957564c9
AS
31292012-09-04 Andreas Schwab <schwab@linux-m68k.org>
3130
3131 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
3132 --just-symbols.
3133
dd93cd0a
AM
31342012-08-31 Alan Modra <amodra@gmail.com>
3135
3136 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3137 (Powerpc_relobj::toc_base_offset): New stub function.
3138 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3139 got_mod_index_offset to tlsld_got_offset. Update all refs.
3140 (Target_powerpc::Relocate::enum skip_tls): New.
3141 (Target_powerpc::call_tls_get_addr_): New var.
3142 (Target_powerpc::is_branch_reloc): Move to file scope.
3143 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3144 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3145 New functions.
3146 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3147 (powerpc_info): Correct common_pagesize for ppc64.
3148 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3149 (Powerpc_relocate_functions): Add overflow check enums and functions.
3150 Add non-shift version of rela, rela_ua. Delete all rel public
3151 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3152 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3153 addr16_ha3, addr14 functions.
3154 (Output_data_got_powerpc::add_constant_pair): New function.
3155 (Output_data_got_powerpc::got_base_offset): Likewise.
3156 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3157 (instruction constants): Sort, add some more.
3158 (Output_data_glink::do_write): Add and use Address typedef. Use
3159 object->toc_base_offset() stub for 64-bit.
3160 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3161 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3162 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3163 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3164 Always treat .opd relocs as against locally defined symbol.
3165 Correct condition for RELATIVE relocs.
3166 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3167 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3168 for 32-bit syms with a plt entry. Correct ppc64 toc base
3169 calculations. Handle TLS relocs, and more. Add overflow
3170 checking and adjust for Powerpc_relocate_functions changes.
3171 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3172 Reinstate --emit-relocs code with FIXME.
3173
a1373b60
AM
31742012-08-30 Alan Modra <amodra@gmail.com>
3175
3176 * layout.cc (Layout::set_segment_offsets): Set p_align to
3177 abi_pagesize, not common_pagesize.
3178 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3179 to determine whether file header can go in segment.
3180
703d02da
AM
31812012-08-30 Alan Modra <amodra@gmail.com>
3182
3183 * output.h (Output_reloc::Output_reloc <output section>): Add
3184 is_relative param. Adjust calls.
3185 (Output_reloc::add_output_section_relative): New functions.
3186 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3187 is_relative.
3188 (Output_reloc::symbol_value): Handle SECTION_CODE.
3189
16164a6b
ST
31902012-08-24 Sriraman Tallam <tmsriram@google.com>
3191
3192 * gold.cc (queue_middle_tasks): Call layout again when unique
3193 segments for sections is desired.
3194 * layout.cc (Layout::Layout): Initialize new members.
3195 (Layout::get_output_section_flags): New function.
3196 (Layout::choose_output_section): Call get_output_section_flags.
3197 (Layout::layout): Make output section for mapping to a unique segment.
3198 (Layout::insert_section_segment_map): New function.
3199 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 3200 output sections marked so.
16164a6b
ST
3201 (Layout::segment_precedes): Check for unique segments when sorting.
3202 * layout.h (Layout::Unique_segment_info): New struct.
3203 (Layout::Section_segment_map): New typedef.
3204 (Layout::insert_section_segment_map): New function.
3205 (Layout::get_output_section_flags): New function.
3206 (Layout::is_unique_segment_for_sections_specified): New function.
3207 (Layout::set_unique_segment_for_sections_specified): New function.
3208 (Layout::unique_segment_for_sections_specified_): New member.
3209 (Layout::section_segment_map_): New member.
3210 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3211 Rename is_gc_pass_one to is_pass_one.
3212 Rename is_gc_pass_two to is_pass_two.
3213 Rename is_gc_or_icf to is_two_pass.
3214 Check for which pass based on whether symbols data is present.
3215 Make it two pass when unique segments for sections is desired.
3216 * output.cc (Output_section::Output_section): Initialize new
3217 members.
3218 * output.h (Output_section::is_unique_segment): New function.
3219 (Output_section::set_is_unique_segment): New function.
3220 (Output_section::is_unique_segment_): New member.
3221 (Output_section::extra_segment_flags): New function.
3222 (Output_section::set_extra_segment_flags): New function.
3223 (Output_section::extra_segment_flags_): New member.
3224 (Output_section::segment_alignment): New function.
3225 (Output_section::set_segment_alignment): New function.
3226 (Output_section::segment_alignment_): New member.
3227 (Output_segment::Output_segment): Initialize is_unique_segment_.
3228 (Output_segment::is_unique_segment): New function.
3229 (Output_segment::set_is_unique_segment): New function.
3230 (Output_segment::is_unique_segment_): New member.
3231 * plugin.cc (allow_unique_segment_for_sections): New function.
3232 (unique_segment_for_sections): New function.
3233 (Plugin::load): Add new functions to transfer vector.
3234 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3235 * Makefile.in: Regenerate.
3236 * testsuite/plugin_final_layout.sh: Check if unique segment
3237 functionality works.
3238 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3239 are available.
3240 (allow_unique_segment_for_sections): New global.
3241 (unique_segment_for_sections): New global.
3242 (claim_file_hook): Call allow_unique_segment_for_sections.
3243 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 3244
1e2bee4f
CC
32452012-08-22 Cary Coutant <ccoutant@google.com>
3246
3247 * layout.cc (Layout::include_section): Don't assert on GROUP
3248 sections with --emit-relocs.
3249
1d5dfe78
CC
32502012-08-21 Cary Coutant <ccoutant@google.com>
3251
3252 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3253 if --export-dynamic-symbol names an undef symbol.
3254
c9269dff
AM
32552012-08-18 Alan Modra <amodra@gmail.com>
3256
3257 * powerpc.cc: Formatting and white space.
3258 (Powerpc_relobj): Rename got2_section_ to special_.
3259 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3260 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3261 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3262 (Target_powerpc): Add Address typedef and invalid_address. Use
3263 throughout.
3264 (Target_powerpc::is_branch_reloc): New function.
3265 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3266 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3267 for dst_mask, value and addend.
3268 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3269 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3270 (Output_data_glink::do_write): Correct toc base. Don't try to use
3271 uint16_t for 24-bit offset. Use get_output_section_offset and
3272 check return.
3273 (Target_powerpc::Scan::local): Handle more relocs.
3274 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3275 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3276 Plug in toc restoring insn after plt calls. Translate branches
3277 to function descriptor symbols to corresponding entry point.
3278 (Target_powerpc::relocate_for_relocatable): Check return from
3279 get_output_section_offset.
3280 * symtab.h: Comment typo.
3281
b1759dce
ILT
32822012-08-14 Ian Lance Taylor <iant@google.com>
3283
3284 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3285 unsupported_relocal_local to call unsupported_reloc_global.
3286
b9b2ae8b
NC
32872012-08-14 Nick Clifton <nickc@redhat.com>
3288
3289 PR ld/14265
3290 * script-sections.cc (Sections_element::output_section_name): Add
3291 keep return parameter.
3292 (Output_section_element::match_name): Add keep return parameter.
3293 Return the value of the keep_ member.
3294 * script-sections.h (class Output_section): Update
3295 output_section_name prototype.
3296 * layout.cc (Layout::keep_input_section): New public member
3297 function.
3298 (Layout::choose_output_section): Pass keep parameter to
3299 output_section_name.
3300 * layout.h (class Layout): Add keep_input_section.
3301 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3302 sections.
3303 * testsuite/Makefile.am: Add a test.
3304 * testsuite/Makefile.in: Regenerate.
3305 * testsuite/pr14265.c: Source file for the test.
3306 * testsuite/pr14265.t: Linker script for the test.
3307 * testsuite/pr14265.sh: Shell script for the test.
3308
921b5322
AM
33092012-08-14 Alan Modra <amodra@gmail.com>
3310
3311 * target.h (Target::output_section_name): New function.
3312 (Target::do_output_section_name): New function.
3313 * layout.cc (Layout::choose_output_section): Call the above.
3314 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3315
6ce78956
AM
33162012-08-14 Alan Modra <amodra@gmail.com>
3317
3318 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3319 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3320 for replace_constant call.
3321 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3322 (Output_data_glink::do_print_to_mapfile): New function.
3323 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3324 (Target_powerpc::Relocate::relocate): Likewise.
3325
d1a8cabd
AM
33262012-08-14 Alan Modra <amodra@gmail.com>
3327
3328 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3329 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3330 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3331 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3332 all references to shndx_. Handle special case for R_PPC_PLTREL24
3333 here.
3334 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3335 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3336 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3337 here.
3338 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3339 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3340
d83ce4e3
AM
33412012-08-12 Alan Modra <amodra@gmail.com>
3342
3343 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3344 (glink insn constants): Use uint32_t.
3345 (Output_data_glink::add_entry): Use insert, not [] operator.
3346
cf43a2fe
AM
33472012-08-11 Alan Modra <amodra@gmail.com>
3348
3349 * object.h (Sized_relobj_file::find_shdr): New function.
3350 (Sized_relobj_file::find_special_sections): New function.
3351 * object.cc (Sized_relobj_file::find_shdr): New function.
3352 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3353 (Sized_relobj_file::find_special_sections): New function, split out..
3354 (Sized_relobj_file::do_read_symbols): ..from here.
3355 * output.h (Output_data_got::replace_constant): New function.
3356 (Output_data_got::num_entries): New function.
3357 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3358 (Output_data_got::got_offset): Protected rather than private.
3359 (Output_data_got::replace_got_entry): New function.
3360 * output.cc (Output_data_got::replace_got_entry): New function.
3361 * powerpc.cc (class Powerpc_relobj): New.
3362 (class Powerpc_relocate_functions): Delete all psymval variants or
3363 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3364 Implement _ha functions using corresponding _hi function.
3365 (Powerpc_relobj::find_special_sections): New function.
3366 (Target_powerpc::do_make_elf_object): New function.
3367 (class Output_data_got_powerpc): New.
3368 (class Output_data_glink): New.
3369 (class Powerpc_scan_relocatable_reloc): New.
3370 Many more changes througout file.
3371
3c892704
NC
33722012-08-09 Nick Clifton <nickc@redhat.com>
3373
3374 * po/vi.po: Updated Vietnamese translation.
3375
82435b3b
ILT
33762012-08-07 Ian Lance Taylor <iant@google.com>
3377
3378 * layout.cc (Layout::add_target_dynamic_tags): If
3379 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3380 plt_rel.
3381
a6dc81d2
NC
33822012-07-30 Nick Clifton <nickc@redhat.com>
3383
3384 * po/gold.pot: Updated template.
3385 * po/es.po: Updated Spanish translation.
3386
f1415016
CC
33872012-07-18 Cary Coutant <ccoutant@google.com>
3388
3389 PR gold/14344
3390 * configure.ac: Add check for -gpubnames support.
3391 * configure: Regenerate.
3392 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3393 support; force -gno-pubnames.
3394 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3395 support.
3396 (gdb_index_test_4): New test.
3397 * testsuite/Makefile.in: Regenerate.
3398 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3399 * testsuite/gdb_index_test_2.sh: Likewise.
3400 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3401 * testsuite/gdb_index_test_4.sh: New script.
3402 * testsuite/gdb_index_test_comm.sh: New script with common code;
3403 don't look for space after colon.
3404
b7fd7c37
ST
34052012-07-16 Sriraman Tallam <tmsriram@google.com>
3406
3407 * gold.cc (queue_middle_tasks): Update function order only after
3408 deferred objects due to plugins are processed.
3409
1f3212db
ILT
34102012-07-11 Ian Lance Taylor <iant@google.com>
3411
3412 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3413 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3414 (Target_arm::scan_reloc_for_stub): Likewise.
3415 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3416 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3417 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3418 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3419 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3420
81c82a68
ILT
34212012-07-10 Dodji Seketeli <dodji@redhat.com>
3422 Ian Lance Taylor <iant@google.com>
3423
3424 PR gold/14309
3425 * configure.ac: Test whether std::tr1::hash<off_t> works.
3426 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3427 needed.
3428 * output.h (class Output_fill): Add virtual destructor.
3429 * configure, config.in: Rebuild.
3430
eabc84f4
RM
34312012-06-22 Roland McGrath <mcgrathr@google.com>
3432
3433 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3434
370e30b6
RÁE
34352012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3436
3437 * plugin.cc (Plugin::load): Handle position independent executables.
3438
fb1b895d
CC
34392012-06-06 Cary Coutant <ccoutant@google.com>
3440
3441 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3442 add .debug_macro.
3443 (lines_only_debug_sections): Likewise.
3444 (gdb_fast_lookup_sections): New static array.
3445 (is_gdb_debug_section): Rename formal parameter.
3446 (is_lines_only_debug_section): Likewise.
3447 (is_gdb_fast_lookup_section): New function.
3448 (Layout::include_section): Check for ".zdebug_" prefix; pass
3449 section name suffix to is_gdb_debug_section, et al.; check for
3450 fast-lookup sections when building .gdb_index.
3451 * options.h (--strip-debug-gdb): Update GDB version number.
3452
7c0640fa
CC
34532012-06-06 Cary Coutant <ccoutant@google.com>
3454
3455 * configure.ac: Add check for fallocate.
3456 * configure: Regenerate.
3457 * config.in: Regenerate.
3458
3459 * options.h (class General_options): Add --mmap-output-file and
3460 --posix-fallocate options.
3461 * output.cc: (posix_fallocate): Remove; replace with...
3462 (gold_fallocate): New function.
3463 (Output_file::map_no_anonymous): Call gold_fallocate.
3464 (Output_file::map): Check --mmap-output-file option.
3465
2a49eb69
DK
34662012-06-05 Jing Yu <jingyu@google.com>
3467
3468 * gold.h (textdomain): Add do {} to empty while(0).
3469 (bindtextdomain): Likewise.
3470
fad072ac
CC
34712012-06-04 Cary Coutant <ccoutant@google.com>
3472
3473 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3474 has_dynsym_index.
3475
8cc69fb6
ST
34762012-05-25 Sriraman Tallam <tmsriram@google.com>
3477
3478 * symtab.cc (Symbol_table::define_special_symbol):
3479 Initialize *poldsym to prevent uninitialized variable errors.
3480
1be75daa
CC
34812012-05-23 Cary Coutant <ccoutant@google.com>
3482
3483 * layout.cc (Layout::section_name_mapping): Add rules to handle
3484 exact match on .data.rel.ro.local or .data.rel.ro.
3485 (Layout::output_section_name): Check for exact matches.
3486
9b689de0
CC
34872012-05-23 Cary Coutant <ccoutant@google.com>
3488
3489 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3490 more carefully.
3491
b24fdbf5
CC
34922012-05-22 Cary Coutant <ccoutant@google.com>
3493
3494 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3495 object before exporting symbol.
3496
e550e1a2
L
34972012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3498
3499 * testsuite/tls_test.cc: Include "config.h" first.
3500 * testsuite/tls_test_c.c: Likewise.
3501
df7b86aa
NC
35022012-05-17 Daniel Richard G. <skunk@iskunk.org>
3503 Nick Clifton <nickc@redhat.com>
3504
3505 PR 14072
3506 * configure.in: Add check that sysdep.h has been included before
3507 any system header files.
3508 * configure: Regenerate.
3509 * config.in: Regenerate.
3510
1007b503
CC
35112012-05-14 Cary Coutant <ccoutant@google.com>
3512
3513 * layout.cc (Layout::make_output_section): Mark .tdata section
3514 as RELRO.
3515 * testsuite/relro_test.cc: Add a TLS variable.
3516
fd885f3a
L
35172012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3518
3519 PR gold/14091
3520 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3521 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3522 R_X86_64_64.
3523
80f5885c
CC
35242012-05-08 Cary Coutant <ccoutant@google.com>
3525
3526 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3527 (lines_only_debug_sections): Likewise.
3528
2e702c99
RM
35292012-05-02 Roland McGrath <mcgrathr@google.com>
3530
3531 * nacl.cc: New file.
3532 * nacl.h: New file.
3533 * Makefile.am (CCFILES, HFILES): Add them.
3534 * Makefile.in: Regenerate.
3535 * i386.cc (Output_data_plt_i386_nacl): New class.
3536 (Output_data_plt_i386_nacl_exec): New class.
3537 (Output_data_plt_i386_nacl_dyn): New class.
3538 (Target_i386_nacl): New class.
3539 (Target_selector_i386_nacl): New class.
3540 (target_selector_i386): Use it instead of Target_selector_i386.
3541 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3542 (Target_x86_64_nacl): New class.
3543 (Target_selector_x86_64_nacl): New class.
3544 (target_selector_x86_64, target_selector_x32): Use it instead of
3545 Target_selector_x86_64.
3546 * arm.cc (Output_data_plt_arm_nacl): New class.
3547 (Target_arm_nacl): New class.
3548 (Target_selector_arm_nacl): New class.
3549 (target_selector_arm, target_selector_armbe): Use it instead of
3550 Target_selector_arm.
3551
3552 * target-select.cc (select_target): Take new Input_file* and off_t
3553 arguments, pass them on to recognize method of selector.
3554 * object.cc (make_elf_sized_object): Update caller.
3555 * parameters.cc (parameters_force_valid_target): Likewise.
3556 * incremental.cc (make_sized_incremental_binary): Likewise.
3557 * target-select.h: Update decl.
3558 (Target_selector::recognize): Take new Input_file* argument,
3559 pass it on to do_recognize.
3560 (Target_selector::do_recognize): Take new Input_file* argument.
3561 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3562 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3563 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3564 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3565
3566 * target.h (Target::Target_info): New members isolate_execinstr
3567 and rosegment_gap.
3568 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3569 * arm.cc (Target_arm::arm_info): Update initializer.
3570 * i386.cc (Target_i386::i386_info): Likewise.
3571 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3572 * sparc.cc (Target_sparc::sparc_info): Likewise.
3573 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3574 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3575 * layout.cc (Layout::attach_allocated_section_to_segment):
3576 Take new const Target* argument. If target->isolate_execinstr(), act
3577 like --rosegment.
3578 (Layout::find_first_load_seg): Take new const Target* argument;
3579 if target->isolate_execinstr(), reject PF_X segments.
3580 (Layout::relaxation_loop_body): Update caller.
3581 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3582 reset file offset to zero when we hit LOAD_SEG, and then do a second
3583 loop over the segments before LOAD_SEG to reassign offsets after
3584 addresses have been determined. Handle target->rosegment_gap().
3585 (Layout::attach_section_to_segment): Take new const Target* argument;
3586 pass it to attach_allocated_section_to_segment.
3587 (Layout::make_output_section): Update caller.
3588 (Layout::attach_sections_to_segments): Take new const Target* argument;
3589 pass it to attach_section_to_segment.
3590 * gold.cc (queue_middle_tasks): Update caller.
3591 * layout.h (Layout): Update method decls with new arguments.
3592
3593 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3594 Target_info pointer to use.
3595 (Target_arm::do_make_data_plt): New virtual method.
3596 (Target_arm::make_data_plt): New method that calls it.
3597 (Target_arm::make_plt_entry): Use it.
3598 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3599 for the section alignment.
3600 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3601 method.
3602 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3603 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3604 method.
3605 (Output_data_plt_arm::get_plt_entry_size): Call it.
3606 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3607 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3608 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3609 method.
3610 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3611 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3612 method instead of sizeof(plt_entry).
3613 (Output_data_plt_arm::add_entry): Likewise.
3614 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3615 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3616 than static method.
3617 (Target_arm::plt_entry_size): Likewise.
3618 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3619 Move to ...
3620 (Output_data_plt_arm_standard): ... here, new class.
3621 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3622 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3623 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3624
3625 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3626 Take additional argument for the PLT entry size.
3627 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3628 Use get_plt_entry_size method rather than plt_entry_size variable.
3629 (Output_data_plt_x86_64::reserve_slot): Likewise.
3630 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3631 (Output_data_plt_x86_64::add_entry): Likewise.
3632 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3633 (Output_data_plt_x86_64::address_for_global): Likewise.
3634 (Output_data_plt_x86_64::address_for_local): Likewise.
3635 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3636 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3637 Make method non-static.
3638 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3639 method.
3640 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3641 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3642 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3643 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3644 virtual method.
3645 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3646 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3647 virtual method.
3648 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3649 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3650 virtual method.
3651 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3652 (Output_data_plt_x86_64::plt_entry_size)
3653 (Output_data_plt_x86_64::first_plt_entry)
3654 (Output_data_plt_x86_64::plt_entry)
3655 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3656 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3657 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3658 (Output_data_plt_x86_64_standard): ... here, new class.
3659 (Target_x86_64::Target_x86_64): Take optional argument for the
3660 Target_info pointer to use.
3661 (Target_x86_64::do_make_data_plt): New virtual method.
3662 (Target_x86_64::make_data_plt): New method to call it.
3663 (Target_x86_64::init_got_plt_for_update): Use that.
3664 Call this->plt_->add_eh_frame method here.
3665 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3666 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3667 rather than static method.
3668 (Target_x86_64::plt_entry_size): Likewise.
3669 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3670 rather than plt_entry_size variable. Move guts of PLT filling to...
3671 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3672 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3673 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3674
3675 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3676 additional argument for the section alignment.
3677 Don't do add_eh_frame_for_plt here.
3678 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3679 non-static. Use get_plt_entry_size method rather than plt_entry_size
3680 variable.
3681 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3682 method.
3683 (Output_data_plt_i386::get_plt_entry_size): Call it.
3684 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3685 (Output_data_plt_i386::add_eh_frame): New method to call it.
3686 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3687 method.
3688 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3689 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3690 method.
3691 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3692 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3693 method instead of plt_entry_size.
3694 (Output_data_plt_i386::plt_entry_size)
3695 (Output_data_plt_i386::plt_eh_frame_fde_size)
3696 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3697 (Output_data_plt_i386_standard): ... here, new class.
3698 (Output_data_plt_i386_exec): New class.
3699 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3700 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3701 (Output_data_plt_i386::exec_plt_entry): Move to ...
3702 (Output_data_plt_i386_exec::plt_entry): ... here.
3703 (Output_data_plt_i386_dyn): New class.
3704 (Output_data_plt_i386::first_plt_entry): Move to ...
3705 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3706 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3707 (Output_data_plt_i386_dyn::plt_entry): ... here.
3708 (Target_i386::Target_i386): Take optional argument for the Target_info
3709 pointer to use.
3710 (Target_i386::do_make_data_plt): New virtual method.
3711 (Target_i386::make_data_plt): New method to call it.
3712 (Target_i386::make_plt_section): Use that.
3713 Call this->plt_->add_eh_frame method here.
3714 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3715 rather than plt_entry_size variable.
3716 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3717 (Output_data_plt_i386::address_for_local): Likewise.
3718 (Output_data_plt_i386::do_write): Likewise.
3719 Move guts of PLT filling to...
3720 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3721 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3722 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3723 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3724
b9b9f2ee
CC
37252012-05-01 Cary Coutant <ccoutant@google.com>
3726
3727 * dwarf_reader.cc (Dwarf_die::read_attributes)
3728 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3729 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3730 * reduced_debug_output.cc
3731 (Output_reduced_debug_info_section::get_die_end): Remove
3732 DW_FORM_GNU_ref_index. Add default case.
3733
57923f48
MW
37342012-04-26 Mark Wielaard <mjw@redhat.com>
3735
3736 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3737 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3738 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3739 DW_AT_high_pc as offset from DW_AT_low_pc.
3740
3741 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3742 * testsuite/Makefile.in: Regenerate.
3743 * testsuite/gdb_index_test_3.c: New test source file.
3744 * testsuite/gdb_index_test_3.sh: New test source file.
3745
2c54b4f4
ILT
37462012-04-25 Ian Lance Taylor <iant@google.com>
3747
3748 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3749 pointer.
3750 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3751 as a class, not a struct.
3752 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3753 (Target_arm::apply_cortex_a8_workaround): Likewise.
3754 * gc.h: Declare Reloc_types as a struct, not a class.
3755 * object.h: Declare Symbols_data as a struct.
3756 * reloc.h: Declare Read_relocs_data as a struct.
3757 * target.h: Declare Relocate_info as a struct.
3758
a5a5f7a3
DM
37592012-04-24 David S. Miller <davem@davemloft.net>
3760
3761 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3762 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3763 and R_SPARC_WPLT30.
3764
f038d496
CC
37652012-04-24 Cary Coutant <ccoutant@google.com>
3766
3767 * incremental-dump.cc (find_input_containing_global): Replace
3768 magic number with symbolic constant.
3769 (dump_incremental_inputs): Update version number.
3770 * incremental.cc (Output_section_incremental_inputs): Update version
3771 number; import symbolic constants from Incremental_inputs_reader.
3772 (Incremental_inputs::create_data_sections): Align relocations
3773 section correctly for 64-bit targets.
3774 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3775 constants; add padding.
3776 (Output_section_incremental_inputs::write_header): Add assert for
3777 header_size.
3778 (Output_section_incremental_inputs::write_input_files): Add assert
3779 for input_entry_size.
3780 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3781 add assert for object_info_size, input_section_entry_size,
3782 global_sym_entry_size.
3783 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3784 for data structure sizes; use them.
3785 (Incremental_input_entry_reader): Import symbolic constants from
3786 Incremental_inputs_reader; use them.
3787
a4d85145
DM
37882012-04-23 David S. Miller <davem@davemloft.net>
3789
3790 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3791 and elf_flags_set_.
3792 (Target_sparc::Target_sparc): Initialize new fields.
3793 (Target_sparc::do_make_elf_object): New function.
3794 (Target_sparc::do_adjust_elf_header): New function.
3795
1d509098
CC
37962012-04-23 Cary Coutant <ccoutant@google.com>
3797
3798 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3799 CU range table of gdb index.
3800
7ebeff7f
DM
38012012-04-20 David S. Miller <davem@davemloft.net>
3802
3803 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3804 instead of false.
3805
13cf9988
DM
38062012-04-16 David S. Miller <davem@davemloft.net>
3807
2a1079e8
DM
3808 * sparc.cc (Target_sparc::got_address): New function.
3809 (Sparc_relocate_functions::gdop_hix22): New function.
3810 (Sparc_relocate_functions::gdop_lox10): New function.
3811 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3812 relocs.
3813 (Target_sparc::Scan::local): Likewise if the global symbol is not
3814 preemptible and is not IFUNC.
3815 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3816 transformations for local and non-preemptible non-IFUNC global
3817 symbols.
3818
0bc964fc
DM
3819 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3820 writing out 64-bit part of ranges.
3821
661d7a80
DM
3822 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3823 -fpic and -fpie respectively.
3824 * Makefile.in: Regenerate.
3825
8c2bf391
DM
3826 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3827 (Target_sparc::Target_sparc): Initialize new field.
3828 (Target_sparc::do_plt_section_for_global): New function.
3829 (Target_sparc::do_plt_section_for_local): New function.
3830 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3831 (Target_sparc::make_plt_section): New function, broken out of
3832 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3833 (Target_sparc::make_plt_entry): Call make_plt_section.
3834 (Target_sparc::make_local_ifunc_plt_entry): New function.
3835 (Target_sparc::rela_ifunc_section): New function.
3836 (Target_sparc::plt_section): Remove const.
3837 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3838 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3839 and ifunc_count_ fields.
3840 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3841 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3842 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3843 (Output_data_plt_sparc::rela_ifunc): New function.
3844 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3845 (Output_data_plt_sparc::has_ifunc_section): New function.
3846 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3847 (Output_data_plt_sparc::address_for_global): New function.
3848 (Output_data_plt_sparc::address_for_local): New function.
3849 (Output_data_plt_sparc::plt_index_to_offset): New function.
3850 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3851 and entry_count.
3852 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3853 entry_count.
3854 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3855 R_SPARC_JMP_IREL to switch.
3856 (Target_sparc::Scan::check_non_pic): Likewise.
3857 (Target_sparc::Scan::local): Handle IFUNC symbols.
3858 (Target_sparc::Scan::local): Likewise.
3859 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3860 and plt_address_for_local.
3861 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3862 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3863
13cf9988
DM
3864 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3865 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3866 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3867 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3868 global relocs too.
3869 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3870 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3871 calls.
3872 * sparc.cc (Target_sparc::Scan::global): Likewise.
3873 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3874
31821be0
CC
38752012-04-16 Cary Coutant <ccoutant@google.com>
3876
3877 * archive.cc (Library_base::should_include_member): Check for
3878 --export-dynamic-symbol.
3879 * options.h (class General_options): Add --export-dynamic-symbol.
3880 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3881 --export-dynamic-symbol.
3882 (Symbol_table::gc_mark_undef_symbols): Likewise.
3883 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3884
2615994e
DM
38852012-04-12 David S. Miller <davem@davemloft.net>
3886
3887 * sparc.cc (Reloc::wdisp10): New relocation method.
3888 (Reloc::h34): Likewise.
3889 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3890 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3891 R_SPARC_WDISP10.
3892 (Target_sparc::Scan::local): Likewise.
3893 (Target_sparc::Scan::global): Likewise.
3894 (Target_sparc::Relocate::relocate): Likewise.
3895
6782735d
CC
38962012-04-09 Cary Coutant <ccoutant@google.com>
3897
3898 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3899 low_pc == 0.
3900
8c7a0b00
ILT
39012012-04-06 Ian Lance Taylor <iant@google.com>
3902
3903 * timer.cc: #include <unistd.h>.
3904
58797674
RM
39052012-04-06 Roland McGrath <mcgrathr@google.com>
3906
3907 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3908 * config.in: Regenerate.
3909 * configure: Regenerate.
3910
44350750
NC
39112012-04-05 Nick Clifton <nickc@redhat.com>
3912
3913 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3914 (AM_LC_MESSAGES): Add.
3915 * aclocal.m4: Regenerate.
3916 * config.in: Regenerate.
3917 * configure: Regenerate.
3918
c1027032
CC
39192012-03-21 Cary Coutant <ccoutant@google.com>
3920
3921 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3922 * Makefile.in: Regenerate.
3923 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3924 (Sized_elf_reloc_mapper::symbol_section): New function.
3925 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3926 (make_elf_reloc_mapper): New function.
3927 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3928 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3929 (Dwarf_abbrev_table::do_get_abbrev): New function.
3930 (Dwarf_ranges_table::read_ranges_table): New function.
3931 (Dwarf_ranges_table::read_range_list): New function.
3932 (Dwarf_pubnames_table::read_section): New function.
3933 (Dwarf_pubnames_table::read_header): New function.
3934 (Dwarf_pubnames_table::next_name): New function.
3935 (Dwarf_die::Dwarf_die): New function.
3936 (Dwarf_die::read_attributes): New function.
3937 (Dwarf_die::skip_attributes): New function.
3938 (Dwarf_die::set_name): New function.
3939 (Dwarf_die::set_linkage_name): New function.
3940 (Dwarf_die::attribute): New function.
3941 (Dwarf_die::string_attribute): New function.
3942 (Dwarf_die::int_attribute): New function.
3943 (Dwarf_die::uint_attribute): New function.
3944 (Dwarf_die::ref_attribute): New function.
3945 (Dwarf_die::child_offset): New function.
3946 (Dwarf_die::sibling_offset): New function.
3947 (Dwarf_info_reader::check_buffer): New function.
3948 (Dwarf_info_reader::parse): New function.
3949 (Dwarf_info_reader::do_parse): New function.
3950 (Dwarf_info_reader::do_read_string_table): New function.
3951 (Dwarf_info_reader::lookup_reloc): New function.
3952 (Dwarf_info_reader::get_string): New function.
3953 (Dwarf_info_reader::visit_compilation_unit): New function.
3954 (Dwarf_info_reader::visit_type_unit): New function.
3955 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3956 Sized_elf_reloc_mapper.
3957 (Sized_dwarf_line_info::symbol_section): Remove function.
3958 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3959 (Sized_dwarf_line_info::read_line_mappings): Remove object
3960 parameter, adjust callers.
3961 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3962 * dwarf_reader.h: Include <sys/types.h>.
3963 (class Track_relocs): Remove forward declaration.
3964 (class Elf_reloc_mapper): New class.
3965 (class Sized_elf_reloc_mapper): New class.
3966 (class Dwarf_abbrev_table): New class.
3967 (class Dwarf_range_list): New class.
3968 (class Dwarf_ranges_table): New class.
3969 (class Dwarf_pubnames_table): New class.
3970 (class Dwarf_die): New class.
3971 (class Dwarf_info_reader): New class.
3972 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3973 (Sized_dwarf_line_info::symbol_section): Remove member function.
3974 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3975 base class.
3976 * gdb-index.cc: New source file.
3977 * gdb-index.h: New source file.
3978 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3979 and .debug_types sections, call Layout::add_to_gdb_index.
3980 (Sized_relobj_incr::do_section_name): Implement.
3981 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3982 return type; Implement.
3983 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3984 return type.
3985 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3986 parameter list and return type.
3987 (Sized_incr_dynobj::do_section_contents): Likewise.
3988 * layout.cc: Include gdb-index.h.
3989 (Layout::Layout): Initialize gdb_index_data_.
3990 (Layout::init_fixed_output_section): Check for .gdb_index section.
3991 (Layout::add_to_gdb_index): New function. Instantiate.
3992 * layout.h: Add forward declaration for class Gdb_index.
3993 (Layout::add_to_gdb_index): New member function.
3994 (Layout::gdb_index_data_): New data member.
3995 * main.cc: Include gdb-index.h.
3996 (main): Print statistics for gdb index.
3997 * object.cc (Object::section_contents): Move code into
3998 do_section_contents.
3999 (need_decompressed_section): Check for sections needed when building
4000 gdb index.
4001 (build_compressed_section_map): Likewise.
4002 (Sized_relobj_file::do_read_symbols): Need local symbols when building
4003 gdb index.
4004 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
4005 sections; call Layout::add_to_gdb_index.
4006 (Sized_relobj_file::do_decompressed_section_contents): Call
4007 do_section_contents directly.
4008 * object.h (Object::do_section_contents): Adjust parameter list and
4009 return type.
4010 (Object::do_decompressed_section_contents): Call do_section_contents
4011 directly.
4012 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4013 return type.
4014 * options.h (class General_options): Add --gdb-index option.
4015 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4016 list and return type.
4017 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4018 * reloc.h (Track_relocs::checkpoint): New function.
4019 (Track_relocs::reset): New function.
4020
4021 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4022 New test cases.
4023 * testsuite/Makefile.in: Regenerate.
4024 * testsuite/gdb_index_test.cc: New test source file.
4025 * testsuite/gdb_index_test_1.sh: New test source file.
4026 * testsuite/gdb_index_test_2.sh: New test source file.
4027
647f1574
DK
40282012-03-19 Doug Kwan <dougkwan@google.com>
4029
4030 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 4031 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
4032 __exidx_start and __exidx_end. Make symbol table parameter
4033 anonymous as it is not used.
4034 * gold.cc (queue_middle_tasks): Call target hook to define any
4035 target-specific symbols.
4036 * target.h (Target::define_standard_symbols): New method.
4037 (Target::do_define_standard_symbols): Same.
4038 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4039 * testsuite/Makefile.in: Regenerate.
4040 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4041 and __exidx_end.
4042 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4043 relocations are generated for __exidx_start and __exidx_end.
4044
7c6109da
DK
40452012-03-16 Doug Kwan <dougkwan@google.com>
4046
4047 * testsuite/Makefile.am: Disable test initpri3b.
4048 * testsuite/Makefile.in: Regenerate.
4049
7b8957f8
DK
40502012-03-15 Doug Kwan <dougkwan@google.com>
4051
4052 * arm.cc (Target_arm::got_section): Make .got section read-only
4053 if -z now is given.
4054
14dc9ef7
ILT
40552012-03-15 Ian Lance Taylor <iant@google.com>
4056
4057 PR gold/13850
4058 * layout.cc (Layout::make_output_section): Correctly mark
4059 SHT_INIT_ARRAY, et. al., as relro.
4060
fa40b62a
DK
40612012-03-14 Doug Kwan <dougkwan@google.com>
4062
4063 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
4064 dynamic relocations for protected symbols in shared objects.
4065
fd325007
ILT
40662012-03-13 Ian Lance Taylor <iant@google.com>
4067
4068 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4069 keep the larger alignment.
4070
e8dd54e1
CC
40712012-03-12 Cary Coutant <ccoutant@google.com>
4072
4073 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4074 handling of DW_LNE_define_file.
4075
feb5f3b0
CC
40762012-03-12 Cary Coutant <ccoutant@google.com>
4077
4078 * reduced_debug_output.cc
4079 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4080 codes to switch.
4081
a1fb4256
CC
40822012-02-29 Cary Coutant <ccoutant@google.com>
4083
4084 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4085
5dd8762a
CC
40862012-02-29 Cary Coutant <ccoutant@google.com>
4087
4088 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4089 Call Object::decompressed_section_contents.
4090 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4091 New dtor.
4092 (Sized_dwarf_line_info::buffer_start_): New data member.
4093 * merge.cc (Output_merge_data::do_add_input_section): Call
4094 Object::decompressed_section_contents.
4095 (Output_merge_string::do_add_input_section): Likewise.
4096 * object.cc (need_decompressed_section): New function.
4097 (build_compressed_section_map): Decompress sections needed later.
4098 (Sized_relobj_file::do_decompressed_section_contents): New function.
4099 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4100 * object.h (Object::decompressed_section_contents): New function.
4101 (Object::discard_decompressed_sections): New function.
4102 (Object::do_decompressed_section_contents): New function.
4103 (Object::do_discard_decompressed_sections): New function.
4104 (Compressed_section_info): New type.
4105 (Compressed_section_map): Include decompressed section contents.
4106 (Sized_relobj_file::do_decompressed_section_contents): New function.
4107 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4108
7b5de7ee
CC
41092012-02-16 Cary Coutant <ccoutant@google.com>
4110
4111 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
4112 * testsuite/Makefile.in: Regenerate.
4113
f9fa4a63
CC
41142012-02-14 Cary Coutant <ccoutant@google.com>
4115
4116 * options.cc (General_options::finalize): Disallow -pie and -static.
4117
2c175ebc
DK
41182012-02-03 Doug Kwan <dougkwan@google.com>
4119
4120 * arm.cc (Arm_relocate_functions::abs8,
4121 Arm_relocate_functions::abs16): Use
4122 Bits::has_signed_unsigned_overflow32.
4123 (Arm_relocate_functions::thm_abs8): Correct range of
4124 overflow check.
4125 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
4126 in assertions.
4127
90cff06f
DK
41282012-02-02 Doug Kwan <dougkwan@google.com>
4129
4130 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
4131 position independent outputs, not just shared objects.
4132
63887f3d
L
41332012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4134
4135 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4136 * configure: Regenerated.
4137
bef2b434
ILT
41382012-01-27 Ian Lance Taylor <iant@google.com>
4139
4140 * reloc.h (Bits): New class with static functions, copied from
4141 namespace utils in arm.cc.
4142 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4143 instead.
4144
c335b55d
L
41452012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4146
4147 * incremental.cc (write_info_blocks): Correct relocation offset.
4148
41194d9f
L
41492012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4150
4151 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4152 (Relocate::tls_gd_to_le): Likewise.
4153
1bae613c
L
41542012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4155
4156 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4157
24482ca0
L
41582012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4159
4160 * configure.ac: Check if -mcmodel=medium works.
4161 * configure: Regenerated.
4162
c2c7840a
CC
41632012-01-24 Cary Coutant <ccoutant@google.com>
4164
4165 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4166 definition and ...
4167 (read_unsigned_LEB_128_x): ... this new function.
4168 (read_signed_LEB_128): Replaced with inline definition and ...
4169 (read_signed_LEB_128_x): ... this new function.
4170 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4171 (read_unsigned_LEB_128): Add inline definition.
4172 (read_signed_LEB_128_x): New function.
4173 (read_signed_LEB_128): Add inline definition.
4174 * testsuite/Makefile.am (leb128_unittest): New unit test.
4175 * testsuite/Makefile.in: Regenerate.
4176 * testsuite/leb128_unittest.cc: New unit test.
4177
833de760 41782012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
4179
4180 PR gold/13617
4181 * i386.cc (Target_i386::do_code_fill): When using a jmp
4182 instruction, pad with nop instructions.
4183 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4184
618d6666
L
41852012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4186
4187 * x86_64.cc (gc_process_relocs): Add typename on types used in
4188 template.
4189 (scan_relocs): Likewise.
4190 (relocate_section): Likewise.
4191 (apply_relocation): Likewise.
4192
3660ff06
L
41932012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4194
4195 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4196 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4197 under x32.
4198
fc51264f
L
41992012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4200
4201 * x86_64.cc: Initial support for x32.
4202
dd74ae06
CC
42032012-01-03 Cary Coutant <ccoutant@google.com>
4204
4205 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4206 Use abstract base class for GOT.
4207 * gold/output.h (class Output_data_got_base): New abstract base class.
4208 (class Output_data_got): Derive from new base class, adjust ctors.
4209 (Output_data_got::reserve_slot): Make virtual; rename to
4210 do_reserve_slot; Adjust callers.
4211 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4212 pointer to abstract base class.
4213 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4214
83896202
ILT
42152011-12-18 Ian Lance Taylor <iant@google.com>
4216
4217 * object.h (Relobj::local_symbol_value): New function.
4218 (Relobj::local_plt_offset): New function.
4219 (Relobj::local_has_got_offset): New function.
4220 (Relobj::local_got_offset): New function.
4221 (Relobj::set_local_got_offset): New function.
4222 (Relobj::do_local_symbol_value): New pure virtual function.
4223 (Relobj::do_local_plt_offset): Likewise.
4224 (Relobj::do_local_has_got_offset): Likewise.
4225 (Relobj::do_local_got_offset): Likewise.
4226 (Relobj::do_set_local_got_offset): Likewise.
4227 (Sized_relobj::do_local_has_got_offset): Rename from
4228 local_has_got_offset.
4229 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4230 (Sized_relobj::do_set_local_got_offset): Rename from
4231 set_local_got_offset.
4232 (Sized_relobj_file::do_local_plt_offset): Rename from
4233 local_plt_offset.
4234 (Sized_relobj_file::do_local_symbol_value): New function.
4235 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4236 local_plt_offset.
4237 * output.cc (Output_data_got::Got_entry::write): Change object to
4238 Relobj. Use local_symbol_value.
4239 (Output_data_got::add_global_with_rel): Change rel_dyn to
4240 Output_data_reloc_generic*. Use add_global_generic.
4241 (Output_data_got::add_global_with_rela): Remove. Change all
4242 callers to use add_global_with_rel.
4243 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4244 Output_data_reloc_generic*. Use add_global_generic.
4245 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4246 callers to use add_global_pair_with_rel.
4247 (Output_data_got::add_local): Change object to Relobj*.
4248 (Output_data_got::add_local_plt): Likewise.
4249 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4250 change rel_dyn to Output_data_reloc_generic*. Use
4251 add_local_generic.
4252 (Output_data_got::add_local_with_rela): Remove. Change all
4253 callers to use all_local_with_rel.
4254 (Output_data_got::add_local_pair_with_rel): Change object to
4255 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4256 add_output_section_generic.
4257 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4258 callers to use add_local_pair_with_rel.
4259 (Output_data_got::reserve_local): Change object to Relobj*.
4260 * output.h: (class Output_data_reloc_generic): Add pure virtual
4261 declarations for add_global_generic, add_local_generic,
4262 add_output_section_generic.
4263 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4264 functions for Output_data_reloc_generic. Update declarations for
4265 changes listed in output.cc.
4266 (class Output_data_got): Change template parameter to got_size.
4267 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4268 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4269 function.
4270 (Sized_relobj_incr::do_local_plt_offset): New function.
4271 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4272 add_global_generic.
4273
76677ad0
CC
42742011-12-17 Cary Coutant <ccoutant@google.com>
4275
4276 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4277 * resolve.cc (Symbol_table::resolve): Likewise.
4278 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4279 arrays.
4280 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4281
8b8dd8d5
ILT
42822011-12-16 Ian Lance Taylor <iant@google.com>
4283
4284 * output.h (Output_data_reloc_generic::add): Only call
4285 add_dynamic_reloc if this is a dynamic reloc section.
4286
d55525b9
L
42872011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4288
4289 PR gold/13505
4290 * target-reloc.h (apply_relocation): Replace <64, false> with
4291 <size, big_endian>.
4292
ff81c7c1
NC
42932011-11-25 Nick Clifton <nickc@redhat.com>
4294
4295 * po/it.po: New Italian translation.
4296
628f39be
SA
42972011-11-17 Sterling Augustine <saugustine@google.com>
4298
4299 * script.cc (script_include_directive): Implement.
4300 (read_script_file): New local variables name and search_path. Update
4301 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4302 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4303 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4304
98ef3ea4
SA
43052011-11-11 Sterling Augustine <saugustine@google.com>
4306
4307 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4308 (file_or_sections_cmd): Likewise.
4309
f4a8b6d7
DK
43102011-11-11 Doug Kwan <dougkwan@google.com>
4311
4312 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4313 if --just-symbols is given.
4314
29ab395d
DK
43152011-11-10 Doug Kwan <dougkwan@google.com>
4316
4317 PR gold/13362
4318 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4319 when processing data relocs.
4320 * reloc.h (Relocate_functions::rel_unaligned): New method.
4321 (Relocate_functions::pcrel_unaligned): Ditto.
4322 (Relocate_functions::rel32_unaligned): Ditto.
4323 (Relocate_functions::pcrel32_unaligned): Ditto.
4324
2c339f71
DK
43252011-11-09 Doug Kwan <dougkwan@google.com>
4326
4327 PR gold/13362
4328 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4329 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4330 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4331 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4332 (Relocate_functions::rel_unaligned): New.
4333 (Relocate_functions::rel32_unaligned): New.
4334 * target-reloc.h (relocate_for_relocatable): Add code to handle
4335 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4336 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4337 arm_unaligned_reloc_r): New targets.
4338 * testsuite/Makefile.in: Regenerate.
4339 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4340 linking.
4341
3f3cddf1
ILT
43422011-11-02 Ian Lance Taylor <iant@google.com>
4343
4344 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4345 NATIVE_LINKER.
4346 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4347 * options.cc (General_options::finalize): Use library search path
4348 from configure script if specified. If not native and no sysroot,
4349 only search TOOLLIBDIR.
4350 * options.h (Search_directory::Search_directory): Change name to
4351 const std::string&.
4352 (General_options::add_to_library_path_with_sysroot): Change arg to
4353 const std::string&.
4354 * configure, Makefile.in, config.in: Rebuild.
4355
a8e2273b
ILT
43562011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4357
4358 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4359 we are working around the ARM1176 Erratum.
4360 * options.h (General_options::fix_arm1176): Add option.
4361 * testsuite/Makefile.am: Add testcases, and keep current ones
4362 working.
4363 * testsuite/Makefile.in: Regenerate.
4364 * testsuite/arm_fix_1176.s: New file.
4365 * testsuite/arm_fix_1176.sh: Likewise.
4366
cd6eab1c
ILT
43672011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4368
4369 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4370 may_use_blx_.
4371 (Target_arm::may_use_blx): Remove method.
4372 (Target_arm::set_may_use_blx): Likewise.
4373 (Target_arm::may_use_v4t_interworking): New method.
4374 (Target_arm::may_use_v5t_interworking): Likewise.
4375 (Target_arm::may_use_blx_): Remove member variable.
4376 (Arm_relocate_functions::arm_branch_common): Check for v5T
4377 interworking.
4378 (Arm_relocate_functions::thumb_branch_common): Likewise.
4379 (Reloc_stub::stub_type_for_reloc): Likewise.
4380 (Target_arm::do_finalize_sections): Correct interworking checks.
4381 * testsuite/Makefile.am: Add new tests.
4382 * testsuite/Makefile.in: Regenerate.
4383 * testsuite/arm_farcall_arm_arm.s: New test.
4384 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4385 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4386 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4387 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4388 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4389 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4390 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4391
286adcf4
CC
43922011-10-31 Cary Coutant <ccoutant@google.com>
4393
4394 PR gold/13023
4395 * expression.cc (Expression::eval_with_dot): Add
4396 is_section_dot_assignment parameter.
4397 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4398 absolute and assigning to dot within a section.
4399 * script-sections.cc
4400 (Output_section_element_assignment::set_section_addresses): Pass
4401 dot_section to set_if_absolute.
4402 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4403 as is_section_dot_assignment flag to eval_with_dot.
4404 (Output_section_element_dot_assignment::set_section_addresses):
4405 Likewise.
4406 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4407 parameter. Also set value if relative to dot_section; set the
4408 symbol's output_section.
4409 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4410 parameter. Adjust all callers.
4411 (Expression::eval_maybe_dot): Likewise.
4412 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4413 Adjust all callers.
4414 * testsuite/script_test_2.t: Test assignment of an absolute value
4415 to dot within an output section element.
4416
9634ed06
CC
44172011-10-31 Cary Coutant <ccoutant@google.com>
4418
4419 * options.h (class General_options): Add --[no-]gnu-unique options.
4420 * symtab.cc (Symbol_table::sized_write_globals): Convert
4421 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4422
de4101c7
CC
44232011-10-31 Cary Coutant <ccoutant@google.com>
4424
4425 PR gold/13359
4426 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4427 unnecessary assertion.
4428 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4429
7257cc92
ST
44302011-10-31 Sriraman Tallam <tmsriram@google.com>
4431
4432 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4433 gc_mark_symbol.
4434 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4435 gc_mark_symbol.
4436 Change to just keep the section associated with symbol.
4437 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4438 they are externally visible and --export-dynamic is turned on.
4439 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4440
bfc34b3f
ILT
44412011-10-19 Ian Lance Taylor <iant@google.com>
4442
4443 PR gold/13163
4444 * script-sections.cc
4445 (Output_section_element_dot_assignment::needs_output_section): New
4446 function.
4447
ea0d8c47
ILT
44482011-10-19 Ian Lance Taylor <iant@google.com>
4449
4450 PR gold/13204
4451 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4452 --section-start option was seen.
4453 * options.h (General_options::any_section_start): New function.
4454
abd242a9
DM
44552011-10-18 David S. Miller <davem@davemloft.net>
4456
4457 PR binutils/13301
4458 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4459 member to track relocation locations that have moved during TLS
4460 reloc optimizations.
4461 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4462 (Target_sparc::Relocate::relocate): Adjust view down by 4
4463 bytes if it matches reloc_adjust_addr_.
4464 (Target_sparc::Relocate::relocate_tls): Always move the
4465 __tls_get_addr call delay slot instruction forward 4 bytes when
4466 performing relaxation.
4467
bab9090f
CC
44682011-10-18 Cary Coutant <ccoutant@google.com>
4469
4470 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4471 (Output_file::map_no_anonymous): Check for non-zero
4472 return code from posix_fallocate.
4473
f7c5b166
CC
44742011-10-17 Cary Coutant <ccoutant@google.com>
4475
4476 PR gold/13245
4477 * plugin.cc (is_visible_from_outside): Check for symbols
4478 referenced from dynamic objects.
4479 * resolve.cc (Symbol_table::resolve): Don't count references
4480 from dynamic objects as references from real ELF files.
4481 * testsuite/plugin_test_2.sh: Adjust expected result.
4482
b490c0bb
CC
44832011-10-17 Cary Coutant <ccoutant@google.com>
4484
4485 * gold.cc: Include timer.h.
4486 (queue_middle_tasks): Stamp time.
4487 (queue_final_tasks): Likewise.
4488 * main.cc (main): Store timer in parameters. Print timers
4489 for each pass.
4490 * parameters.cc (Parameters::Parameters): Initialize timer_.
4491 (Parameters::set_timer): New function.
4492 (set_parameters_timer): New function.
4493 * parameters.h (Parameters::set_timer): New function.
4494 (Parameters::timer): New function.
4495 (Parameters::timer_): New data member.
4496 (set_parameters_timer): New function.
4497 * timer.cc (Timer::stamp): New function.
4498 (Timer::get_pass_time): New function.
4499 * timer.h (Timer::stamp): New function.
4500 (Timer::get_pass_time): New function.
4501 (Timer::pass_times_): New data member.
4502
f475cf7b
CC
45032011-10-17 Cary Coutant <ccoutant@google.com>
4504
4505 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4506 task for members of lib groups.
4507
cdd7e244
CC
45082011-10-17 Cary Coutant <ccoutant@google.com>
4509
4510 PR gold/13288
4f95c8b4 4511 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
4512 (File_read::make_view): Move bounds check (replace with assert)...
4513 (File_read::find_or_make_view): ... to here.
4514
dfb45471
CC
45152011-10-12 Cary Coutant <ccoutant@google.com>
4516
4f95c8b4 4517 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
4518 ::read returns less than requested size.
4519
53bbcc1b
CC
45202011-10-10 Cary Coutant <ccoutant@google.com>
4521
4f95c8b4 4522 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
4523 Initialize defined_count_.
4524 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4525 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4526 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4527 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4528 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4529 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4530 member.
4531 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4532 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4533 Return zeroes instead of internal error.
4534
397b129b
CC
45352011-10-10 Cary Coutant <ccoutant@google.com>
4536
4537 PR gold/13249
4f95c8b4 4538 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4539 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4540 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4541 (Output_reloc::type_): Adjust size of bit field.
4542 (Output_reloc::use_plt_offset_): New bit field.
4543 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4544 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4545 flag. Adjust all callers.
4f95c8b4 4546 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4547 creating RELATIVE relocations.
4548
d5698657
NC
45492011-10-10 Nick Clifton <nickc@redhat.com>
4550
4551 * po/es.po: Updated Spanish translation.
4552 * po/fi.po: Updated Finnish translation.
4553
6a59a5c2
DN
45542011-10-03 Diego Novillo <dnovillo@google.com>
4555
4556 * options.cc (parse_uint): Fix dereference of RETVAL.
4557
f0558624
ST
45582011-09-29 Sriraman Tallam <tmsriram@google.com>
4559
4560 * layout.h (section_order_map_): New member.
4561 (get_section_order_map): New member function.
4562 * output.cc (Output_section::add_input_section): Check for patterns
4563 only when --section-ordering-file is specified.
4564 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4565 output_sections have been formed.
4566 * layout.cc (Layout_Layout): Initialize section_order_map_.
4567 * plugin.cc (update_section_order): Store order in order_map. Do not
4568 update the order.
4569 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4570 * testsuite/Makefile.in: Regenerate.
4571 * testsuite/plugin_section_order.c: New file.
4572 * testsuite/plugin_final_layout.cc: New file.
4573 * testsuite/plugin_final_layout.sh: New file.
4574
a7dac153
CC
45752011-09-29 Cary Coutant <ccoutant@google.com>
4576
4f95c8b4 4577 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4578 Check for NULL.
4f95c8b4 4579 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4580 symbols during incremental update.
4581 (Symbol_table::add_from_dynobj): Likewise.
4582
eebd87a5
ILT
45832011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4584 Ian Lance Taylor <iant@google.com>
4585
4586 * symtab.cc (Symbol_table::define_special_symbol): Always
4587 canonicalize version string.
4588
403a3331
CC
45892011-09-26 Cary Coutant <ccoutant@google.com>
4590
4f95c8b4
CC
4591 * gold.cc (queue_initial_tasks): Move option checks ...
4592 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
4593 some options; make others fatal.
4594
235061c2
CC
45952011-09-26 Cary Coutant <ccoutant@google.com>
4596
4597 gcc PR lto/47247
4598 * plugin.cc (get_symbols_v2): New function.
4599 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4600 (is_referenced_from_outside): New function.
4601 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4602 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4603 (get_symbols): Pass version parameter.
4604 (get_symbols_v2): New function.
4605 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4606 parameter.
4607 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4608 (onload): Add LDPT_GET_SYMBOLS_V2.
4609 (all_symbols_read_hook): Use get_symbols_v2; check for
4610 LDPR_PREVAILING_DEF_IRONLY_EXP.
4611 * testsuite/plugin_test_3.sh: Update expected results.
4612
dc87f620
ILT
46132011-09-23 Simon Baldwin <simonb@google.com>
4614
4615 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4616 configuration options.
4617 * configure: Regenerate.
4618 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4619 * Makefile.in: Regenerate.
4620 * testsuite/Makefile.in: Regenerate.
4621
a8279f82
ST
46222011-09-19 Sriraman Tallam <tmsriram@google.com>
4623
4624 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4625
0c9350c8
CC
46262011-09-19 Cary Coutant <ccoutant@google.com>
4627
4628 * incremental.cc (can_incremental_update): Fix typo in comment.
4629 * incremental.h (can_incremental_update): Likewise.
4630
aa06ae28
CC
46312011-09-18 Cary Coutant <ccoutant@google.com>
4632
4633 * incremental.cc (can_incremental_update): New function.
4634 * incremental.h (can_incremental_update): New function.
4635 * layout.cc (Layout::init_fixed_output_section): Call it.
4636 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4637 * object.cc (Sized_relobj_file::do_layout): Call
4638 can_incremental_update.
4639
ebb300b2
CC
46402011-09-13 Cary Coutant <ccoutant@google.com>
4641
4642 * configure.ac: Check for glibc support for gnu_indirect_function
4643 support with static linking, setting automake conditional
4644 IFUNC_STATIC.
4645 * Makefile.in: Regenerate.
4646 * configure: Regenerate.
4647
4648 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4649 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4650 for IFUNC_STATIC.
4651 * testsuite/Makefile.in: Regenerate.
4652
1206d0d5
CC
46532011-09-13 Cary Coutant <ccoutant@google.com>
4654
4655 * incremental.cc (Sized_relobj_incr::do_layout): Call
4656 report_comdat_group for kept comdat sections.
4657 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4658 * testsuite/Makefile.in: Regenerate.
4659 * testsuite/incr_comdat_test_1.cc: New source file.
4660 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4661 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4662 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4663
40b29874
ILT
46642011-09-13 Ian Lance Taylor <iant@google.com>
4665
4666 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4667 variable external_symbols_offset.
4668
1b045aac
ILT
46692011-09-12 Ian Lance Taylor <iant@google.com>
4670
4671 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4672 triggered if object has no symbols.
4673
24c6c55a
DM
46742011-09-09 David S. Miller <davem@davemloft.net>
4675
4676 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4677 (Output_fill_debug_line::do_write): Likewise.
4678
66570254
CC
46792011-08-29 Cary Coutant <ccoutant@google.com>
4680
4681 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4682 casts to match formatting specs.
4683 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4684
8ea8cd50
CC
46852011-08-26 Cary Coutant <ccoutant@google.com>
4686
4687 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4688 remaining hole size when allocating.
4689 (Layout::make_output_section): Set fill methods for debug sections.
4690 * layout.h (Free_list::Free_list_node): Move from private to
4691 public.
4692 (Free_list::set_min_hole_size): New function.
4693 (Free_list::begin, Free_list::end): New functions.
4694 (Free_list::min_hole_): New data member.
4695 * output.cc: Include dwarf.h.
4696 (Output_fill_debug_info::do_minimum_hole_size): New function.
4697 (Output_fill_debug_info::do_write): New function.
4698 (Output_fill_debug_line::do_minimum_hole_size): New function.
4699 (Output_fill_debug_line::do_write): New function.
4700 (Output_section::Output_section): Initialize new data member.
4701 (Output_section::set_final_data_size): Ensure patch space is larger
4702 than minimum hole size.
4703 (Output_section::do_write): Fill holes in debug sections.
4704 * output.h (Output_fill): New class.
4705 (Output_fill_debug_info): New class.
4706 (Output_fill_debug_line): New class.
4707 (Output_section::set_free_space_fill): New function.
4708 (Output_section::free_space_fill_): New data member.
4709 * testsuite/Makefile.am (incremental_test_3): Add
4710 --incremental-patch option.
4711 (incremental_test_4): Likewise.
4712 (incremental_test_5): Likewise.
4713 (incremental_test_6): Likewise.
4714 (incremental_copy_test): Likewise.
4715 (incremental_common_test_1): Likewise.
4716 * testsuite/Makefile.in: Regenerate.
4717
7cf80422
NC
47182011-08-26 Nick Clifton <nickc@redhat.com>
4719
4720 * po/es.po: Updated Spanish translation.
4721
c3f7b0e5
CC
47222011-08-01 Cary Coutant <ccoutant@google.com>
4723
4724 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4725 * gold/testsuite/Makefile.in: Regenerate.
4726 * gold/testsuite/justsyms_exec.c: New source file.
4727 * gold/testsuite/justsyms_lib.c: New source file.
4728
9590bf25
CC
47292011-08-01 Cary Coutant <ccoutant@google.com>
4730
4731 * layout.cc (Layout::set_segment_offsets): Don't realign text
4732 segment if -Ttext was specified.
4733 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4734 file type.
4735 * object.h (Sized_relobj_file::e_type): New function.
4736 (Sized_relobj_file::e_type_): New data member.
4737 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4738 base address for ET_EXEC files.
4739 * target.cc (Target::do_make_elf_object_implementation): Allow
4740 ET_EXEC files with --just-symbols option.
4741
dcd8d12e
CC
47422011-07-28 Cary Coutant <ccoutant@google.com>
4743
4744 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4745 Add thread_number parameter.
4746 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4747 * workqueue-threads.cc
4748 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4749 current thread if its thread number is greater than desired thread
4750 count.
4751 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4752 Add thread_number parameter.
4753 (Workqueue::should_cancel_thread): Likewise.
4754 (Workqueue::find_runnable_or_wait): Pass thread_number to
4755 should_cancel_thread.
4756 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4757 parameter.
4758
804eb480
ST
47592011-07-22 Sriraman Tallam <tmsriram@google.com>
4760
4761 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4762 only after checking if it cannot be forced local.
4763 * symtab.h (is_externally_visible): Check if the symbol is not forced
4764 local.
4765
f1ddb600
ILT
47662011-07-15 Ian Lance Taylor <iant@google.com>
4767
4768 * options.h (class General_options): Add --print-output-format.
4769 Move -EL next to -EB, for better --help output.
4770 * target-select.cc: Include <cstdio>, "options.h", and
4771 "parameters.h".
4772 (Target_selector::do_target_bfd_name): New function.
4773 (print_output_format): New function.
4774 * target-select.h (class Target_selector): Update declarations.
4775 (Target_selector::target_bfd_name): New function.
4776 (print_output_format): Declare.
4777 * main.cc: Include "target-select.h".
4778 (main): Handle --print-output-format.
4779 * gold.cc: Include "target-select.h".
4780 (queue_initial_tasks): Handle --print-output-format when there are
4781 no input files.
4782 * parameters.cc (parameters_force_valid_target): Give a better
4783 error message if -EB/-EL does not match target.
4784 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4785 function.
4786
7d172687
ILT
47872011-07-15 Ian Lance Taylor <iant@google.com>
4788
4789 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4790 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4791 (Output_data_plt_i386::do_write): Write address of .dynamic
4792 section to first entry in .got.plt section.
4793 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4794 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4795 Initialize layout_.
4796 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4797 section to first entry in .got.plt section.
4798 * layout.h (Layout::dynamic_section): New function.
4799
e9552f7e
ST
48002011-07-13 Sriraman Tallam <tmsriram@google.com>
4801
4802 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4803 to claim_file call.
4804 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4805 input_section_position_, and input_section_glob_.
4806 (read_layout_from_file): Call function section_ordering_specified.
4807 * layout.h (is_section_ordering_specified): New function.
4808 (section_ordering_specified): New function.
4809 (section_ordering_specified_): New boolean member.
4810 * main.cc(main): Call load_plugins after layout object is defined.
4811 * output.cc (Output_section::add_input_section): Use
4812 function section_ordering_specified to check if section ordering is
4813 needed.
4814 * output.cc (Output_section::add_relaxed_input_section): Use
4815 function section_ordering_specified to check if section ordering is
4816 needed.
4817 (Output_section::update_section_layout): New function.
4818 (Output_section::sort_attached_input_sections): Check if input section
4819 must be reordered.
4820 * output.h (Output_section::update_section_layout): New function.
4821 * plugin.cc (get_section_count): New function.
4822 (get_section_type): New function.
4823 (get_section_name): New function.
4824 (get_section_contents): New function.
4825 (update_section_order): New function.
58797674 4826 (allow_section_ordering): New function.
e9552f7e
ST
4827 (Plugin::load): Add the new interfaces to the transfer vector.
4828 (Plugin_manager::load_plugins): New parameter.
4829 (Plugin_manager::all_symbols_read): New parameter.
4830 (Plugin_manager::claim_file): New parameter. Save the elf object for
4831 unclaimed objects.
4832 (Plugin_manager::get_elf_object): New function.
4833 (Plugin_manager::get_view): Change to directly use the bool to check
4834 if get_view is called from claim_file_hook.
4835 * plugin.h (input_objects): New function
4836 (Plugin__manager::load_plugins): New parameter.
4837 (Plugin_manager::claim_file): New parameter.
4838 (Plugin_manager::get_elf_object): New function.
4839 (Plugin_manager::in_claim_file_handler): New function.
4840 (Plugin_manager::in_claim_file_handler_): New member.
4841 (layout): New function.
4842 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4843 handler with an extra parameter. Make the elf object before calling
4844 claim_file handler.
4845 * testsuite/plugin_test.c (get_section_count): New function pointer.
4846 (get_section_type): New function pointer.
4847 (get_section_name): New function pointer.
4848 (get_section_contents): New function pointer.
4849 (update_section_order): New function pointer.
4850 (allow_section_ordering): New function pointer.
4851 (onload): Check if the new interfaces exist.
4852
9446efde
ILT
48532011-07-13 Ian Lance Taylor <iant@google.com>
4854
4855 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4856 relro section.
4857 * x86_64.cc (Target_x86_64::got_section): Likewise.
4858 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4859 (relro_now_test_SOURCES): New variable.
4860 (relro_now_test_DEPENDENCIES): New variable.
4861 (relro_now_test_LDFLAGS): New variable.
4862 (relro_now_test_LDADD): New variable.
4863 (relro_now_test.so): New target.
4864 * testsuite/Makefile.in: Rebuild.
4865
07aa62f2
ILT
48662011-07-12 Ian Lance Taylor <iant@google.com>
4867
4868 PR gold/12980
4869 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4870 GLOB_DAT relocation rather than a RELATIVE relocation for a
4871 protected symbol when creating a shared library.
4872 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4873 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4874 * testsuite/protected_main_1.cc (main): Test that protected
4875 function has same address.
4876
e2153196
ILT
48772011-07-11 Ian Lance Taylor <iant@google.com>
4878
4879 PR gold/12979
4880 * options.h (class General_options): Add -Bgroup.
4881 * options.cc (General_options::finalize): If -Bgroup is set,
4882 default to --unresolved-symbols=report-all.
4883 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4884 * target-reloc.h (issue_undefined_symbol_error): Handle
4885 --unresolved-symbols=report-all.
4886
6daf5215
ILT
48872011-07-08 Ian Lance Taylor <iant@google.com>
4888
4889 PR gold/11985
4890 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4891 if linker script discards key sections.
4892 (Layout::create_dynamic_symtab): Likewise.
4893 (Layout::assign_local_dynsym_offsets): Likewise.
4894 (Layout::sized_create_version_sections): Likewise.
4895 (Layout::create_interp): Likewise.
4896 (Layout::finish_dynamic_section): Likewise.
4897 (Layout::set_dynamic_symbol_size): Likewise.
4898
beabb2c6
ILT
48992011-07-08 Ian Lance Taylor <iant@google.com>
4900
4901 PR gold/12386
4902 * options.h (class General_options): Add --unresolved-symbols.
4903 * target-reloc.h (issue_undefined_symbol_error): Check
4904 --unresolved-symbols. Add comments.
4905
9c16daf1
ILT
49062011-07-08 Ian Lance Taylor <iant@google.com>
4907
4908 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4909 expression more complex.
4910
191f1a2d
ILT
49112011-07-08 Ian Lance Taylor <iant@google.com>
4912
4913 PR gold/11317
4914 * target-reloc.h (issue_undefined_symbol_error): New inline
4915 function, broken out of relocate_section.
4916 (relocate_section): Call issue_undefined_symbol_error.
4917 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4918 there is no TLS segment if we are about to issue an undefined
4919 symbol error.
4920 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4921
62855347
ILT
49222011-07-08 Ian Lance Taylor <iant@google.com>
4923
4924 PR gold/12279
4925 * resolve.cc (Symbol_table::should_override): Add fromtype
4926 parameter. Change all callers. Give error when linking together
4927 TLS and non-TLS symbol.
4928 (Symbol_table::should_override_with_special): Add fromtype
4929 parameter. Change all callers.
4930 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4931 there is no TLS segment if we have reported some errors.
4932 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4933
67181c72
ILT
49342011-07-08 Ian Lance Taylor <iant@google.com>
4935
4936 PR gold/12372
4937 * target.h (Target::plt_address_for_global): New function.
4938 (Target::plt_address_for_local): New function.
4939 (Target::plt_section_for_global): Remove.
4940 (Target::plt_section_for_local): Remove.
4941 (Target::do_plt_address_for_global): New virtual function.
4942 (Target::do_plt_address_for_local): New virtual function.
4943 (Target::do_plt_section_for_global): Remove.
4944 (Target::do_plt_section_for_local): Remove.
4945 (Target::register_global_plt_entry): Add Symbol_table and Layout
4946 parameters.
4947 * output.cc (Output_data_got::Got_entry::write): Use
4948 plt_address_for_global and plt_address_for_local.
4949 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4950 address of output section.
4951 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4952 got_irelative_, and irelative_count_ fields. Update
4953 declarations.
4954 (Output_data_plt_i386::has_irelative_section): New function.
4955 (Output_data_plt_i386::entry_count): Add irelative_count_.
4956 (Output_data_plt_i386::set_final_data_size): Likewise.
4957 (class Target_i386): Add got_irelative_ and rel_irelative_
4958 fields. Update declarations.
4959 (Target_i386::Target_i386): Initialize new fields.
4960 (Target_i386::do_plt_address_for_global): New function replacing
4961 do_plt_section_for_global.
4962 (Target_i386::do_plt_address_for_local): New function replacing
4963 do_plt_section_for_local.
4964 (Target_i386::got_section): Create got_irelative_.
4965 (Target_i386::rel_irelative_section): New function.
4966 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4967 fields. Don't define __rel_iplt_{start,end}.
4968 (Output_data_plt_i386::add_entry): Add symtab and layout
4969 parameters. Change all callers. Use different PLT and GOT for
4970 IFUNC symbols.
4971 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4972 layout parameters. Change all callers. Use different PLT and
4973 GOT.
4974 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4975 (Output_data_plt_i386::rel_irelative): New function.
4976 (Output_data_plt_i386::address_for_global): New function.
4977 (Output_data_plt_i386::address_for_local): New function.
4978 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4979 IRELATIVE GOT when changing IFUNC GOT entries.
4980 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4981 reloc.
4982 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4983 if we didn't create an IRELATIVE GOT.
4984 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4985 plt_address_for_local.
4986 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4987 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4988 got_irelative_, and irelative_count_ fields. Update
4989 declarations.
4990 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4991 Initialize new fields. Remove symtab parameter. Change all
4992 callers.
4993 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4994 irelative_count_.
4995 (Output_data_plt_x86_64::has_irelative_section): New function.
4996 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4997 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4998 fields. Update declarations.
4999 (Target_x86_64::Target_x86_64): Initialize new fields.
5000 (Target_x86_64::do_plt_address_for_global): New function replacing
5001 do_plt_section_for_global.
5002 (Target_x86_64::do_plt_address_for_local): New function replacing
5003 do_plt_section_for_local.
5004 (Target_x86_64::got_section): Create got_irelative_.
5005 (Target_x86_64::rela_irelative_section): New function.
5006 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
5007 all callers. Don't create __rel_iplt_{start,end}.
5008 (Output_data_plt_x86_64::add_entry): Add symtab and layout
5009 parameters. Change all callers. Use different PLT and GOT for
5010 IFUNC symbols.
5011 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5012 layout parameters. Change all callers. Use different PLT and
5013 GOT.
5014 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5015 parameters. Change all callers. Use different PLT and GOT for
5016 IFUNC symbols.
5017 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5018 (Output_data_plt_x86_64::rela_irelative): New function.
5019 (Output_data_plt_x86_64::address_for_global): New function.
5020 (Output_data_plt_x86_64::address_for_local): New function.
5021 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5022 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5023 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5024 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5025 parameters.
5026 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5027 reloc.
5028 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5029 symbols if we didn't create an IRELATIVE GOT.
5030 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5031 plt_address_for_local.
5032 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5033 * testsuite/ifuncvar1.c: New test file.
5034 * testsuite/ifuncvar2.c: New test file.
5035 * testsuite/ifuncvar3.c: New test file.
5036 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5037 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5038 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5039 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5040 * testsuite/Makefile.in: Rebuild.
5041
33c15b45
CC
50422011-07-07 Cary Coutant <ccoutant@google.com>
5043
5044 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5045 (two_file_test_1_ndebug.o): Likewise.
5046 (two_file_test_1b_ndebug.o): Likewise.
5047 (two_file_test_2_ndebug.o): Likewise.
5048 (two_file_test_main_ndebug.o): Likewise.
5049 (incremental_test_2): Link with no-debug versions.
5050
f48b5fb7
CC
50512011-07-06 Cary Coutant <ccoutant@google.com>
5052
5053 * gold/incremental.cc
5054 (Output_section_incremental_inputs::write_info_blocks): Check for
5055 hidden and internal symbols.
5056
221597a5
CC
50572011-07-06 Cary Coutant <ccoutant@google.com>
5058
5059 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5060 Check disposition for startup file.
5061 (Incremental_inputs::report_command_line): Ignore
5062 --incremental-startup-unchanged option.
5063 * options.cc (General_options::parse_incremental_startup_unchanged):
5064 New function.
5065 (General_options::General_options): Initialize new data member.
5066 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
5067 (General_options): Add --incremental-startup-unchanged option.
5068 (General_options::incremental_startup_disposition): New function.
5069 (General_options::incremental_startup_disposition_): New data member.
5070
e24719f6
CC
50712011-07-06 Cary Coutant <ccoutant@google.com>
5072
5073 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5074 input file index to Script_info ctor.
5075 (Sized_incremental_binary::do_file_has_changed): Find the
5076 command-line argument for files named in scripts.
5077 * incremental.h (Script_info::Script_info): New ctor
5078 with input file index.
5079 (Script_info::input_file_index): New function.
5080 (Script_info::input_file_index_): New data member.
5081 (Incremental_binary::get_library): Add const.
5082 (Incremental_binary::get_script_info): Add const.
5083 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5084 * testsuite/Makefile.am (incremental_test_5): New test case.
5085 (incremental_test_6): New test case.
5086 * testsuite/Makefile.in: Regenerate.
5087
8f7c81e8
CC
50882011-07-06 Cary Coutant <ccoutant@google.com>
5089
5090 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5091 debug output when command lines differ.
5092
9fbd3822
CC
50932011-07-06 Cary Coutant <ccoutant@google.com>
5094
5095 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5096 --incremental-patch option.
5097 * layout.cc (Free_list::allocate): Extend allocation beyond original
5098 end if enabled.
5099 (Layout::make_output_section): Mark sections that should get
5100 patch space.
5101 * options.cc (parse_percent): New function.
5102 * options.h (parse_percent): New function.
5103 (DEFINE_percent): New macro.
5104 (General_options): Add --incremental-patch option.
5105 * output.cc (Output_section::Output_section): Initialize new data
5106 members.
5107 (Output_section::add_input_section): Print section name when out
5108 of patch space.
5109 (Output_section::add_output_section_data): Likewise.
5110 (Output_section::set_final_data_size): Add patch space when
5111 doing --incremental-full.
5112 (Output_section::do_reset_address_and_file_offset): Remove patch
5113 space.
5114 (Output_segment::set_section_list_addresses): Print debug output
5115 only if --incremental-update.
5116 * output.h (Output_section::set_is_patch_space_allowed): New function.
5117 (Output_section::is_patch_space_allowed_): New data member.
5118 (Output_section::patch_space_): New data member.
5119 * parameters.cc (Parameters::incremental_full): New function.
5120 * parameters.h (Parameters::incremental_full): New function
5121 * testsuite/Makefile.am (incremental_test_2): Add test for
5122 --incremental-patch option.
5123 * testsuite/Makefile.in: Regenerate.
5124 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
5125 (t18): Remove function body.
5126
f6cccc2c
DK
51272011-07-05 Doug Kwan <dougkwan@google.com>
5128
5129 PR gold/12771
5130 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
5131 Arm_Address type for relocation result.
5132 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
5133 overflow check.
5134 (Arm_relocate_functions::abs32): Use unaligned access.
5135 (Arm_relocate_functions::rel32): Ditto.
5136 (Arm_relocate_functions::prel31): Ditto.
5137 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5138 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5139 static data relocations.
5140 * testsuite/Makefile.in: Regnerate.
5141 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5142
28a13fec
ILT
51432011-07-05 Ian Lance Taylor <iant@google.com>
5144
5145 PR gold/12392
5146 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5147 symbols if necessary.
5148 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5149
24d47b34
ILT
51502011-07-05 Ian Lance Taylor <iant@google.com>
5151
5152 PR gold/12952
5153 * resolve.cc (Symbol::override_base_with_special): Simply override
5154 version with special symbol version, ignoring previous version.
5155
41f9cbbe
ILT
51562011-07-05 Ian Lance Taylor <iant@google.com>
5157
5158 * object.cc (Sized_relobj_file::include_section_group): Add
5159 information to comment about signature location.
5160
886288f1
ILT
51612011-07-02 Ian Lance Taylor <iant@google.com>
5162
5163 PR gold/12957
5164 * options.h (class General_options): Add -f and -F.
5165 * options.cc (General_options::finalize): Fatal error if -f/-F
5166 are used without -shared.
5167 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5168
ae3a6d4f
ILT
51692011-07-02 Ian Lance Taylor <iant@google.com>
5170
5171 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5172
21131061
ILT
51732011-07-01 Ian Lance Taylor <iant@google.com>
5174
5175 PR gold/12525
5176 PR gold/12952
5177 * resolve.cc (Symbol::override_base_with_special): Don't override
5178 the version if the overriding symbol has a different name.
5179 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5180 all callers. If we give an error about an undefined version,
5181 define the base version if necessary.
5182 * dynobj.h (class Versions): Update declaration.
5183 * testsuite/weak_alias_test_5.cc: New file.
5184 * testsuite/weak_alias_test.script: New file.
5185 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5186 and versioned_alias have the right value, and call t2.
5187 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5188 weak_alias_test_5.so.
5189 (weak_alias_test_LDADD): Likewise.
5190 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5191 * testsuite/Makefile.in: Rebuild.
5192
611062c0
ILT
51932011-07-01 Ian Lance Taylor <iant@google.com>
5194
5195 PR gold/12525
5196 * options.h (class General_options): Support -z notext.
5197 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5198 -Wl,-z,notext.
5199 (two_file_shared_nonpic.so): Likewise.
5200 (two_file_shared_mixed.so): Likewise.
5201 (two_file_shared_mixed_1.so): Likewise.
5202 (weak_undef_lib_nonpic.so): Likewise.
5203 (alt/weak_undef_lib_nonpic.so): Likewise.
5204 (tls_test_shared_nonpic.so): Likewise.
5205 * testsuite/Makefile.in: Rebuild.
5206
328c7c2f
ILT
52072011-07-01 Ian Lance Taylor <iant@google.com>
5208
5209 PR gold/12525
5210 * configure.ac: Test whether static linking works, setting
5211 the automake conditional HAVE_STATIC.
5212 * testsuite/Makefile.am: Disable tests using -static if
5213 HAVE_STATIC is not true.
5214 * configure, testsuite/Makefile.in: Rebuild.
5215
02d7cd44
ILT
52162011-07-01 Ian Lance Taylor <iant@google.com>
5217
5218 PR gold/12525
5219 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5220 Assert if we see DW_EH_PE_indirect.
5221 * target.h (Target::ehframe_datarel_base): New function.
5222 (Target::do_ehframe_datarel_base): New target function.
5223 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5224 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5225 function.
5226
07a60597
ILT
52272011-07-01 Ian Lance Taylor <iant@google.com>
5228
5229 PR gold/12571
5230 * options.h (class General_options): Add
5231 --ld-generated-unwind-info.
5232 * ehframe.cc (Fde::write): Add address parameter. Change all
5233 callers. If associated with PLT, fill in address and size.
5234 (Cie::set_output_offset): Only add merge mapping if there is an
5235 object.
5236 (Cie::write): Add address parameter. Change all callers.
5237 (Eh_frame::add_ehframe_for_plt): New function.
5238 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5239 input_offset_ fields into union u_, with new plt field.
5240 (Fde::Fde): Adjust for new union field.
5241 (Fde::Fde) [Output_data version]: New constructor.
5242 (Fde::add_mapping): Only add merge mapping if there is an object.
5243 (class Cie): Update declarations.
5244 (class Eh_frame): Declare add_ehframe_for_plt.
5245 * layout.cc (Layout::layout_eh_frame): Break out code into
5246 make_eh_frame_section, and call it.
5247 (Layout::make_eh_frame_section): New function.
5248 (Layout::add_eh_frame_for_plt): New function.
5249 * layout.h (class Layout): Update declarations.
5250 * merge.cc (Merge_map::add_mapping): Add assertion.
5251 * i386.cc: Include "dwarf.h".
5252 (class Output_data_plt_i386): Make first_plt_entry,
5253 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5254 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5255 and plt_eh_frame_fde.
5256 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5257 boundary. Call add_eh_frame_for_plt if appropriate.
5258 * x86_64.cc: Include "dwarf.h".
5259 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5260 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5261 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5262 and plt_eh_frame_fde.
5263 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5264 appropriate.
5265
14788a3f
ILT
52662011-06-29 Ian Lance Taylor <iant@google.com>
5267
5268 PR gold/12629
5269 * object.cc (Sized_relobj_file::layout_section): Change shdr
5270 parameter to be const.
5271 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5272 out of do_layout.
5273 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5274 appropriate. Call layout_eh_frame_section.
5275 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5276 sections.
5277 * object.h (class Sized_relobj_file): Update declarations.
5278
6c21fce1
ILT
52792011-06-29 Ian Lance Taylor <iant@google.com>
5280
37e41b03 5281 PR gold/12652
6c21fce1
ILT
5282 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5283 modifier.
5284 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5285
4d5e4e62
ILT
52862011-06-29 Ian Lance Taylor <iant@google.com>
5287
5288 PR gold/12675
5289 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5290 SHT_X86_64_UNWIND.
5291 * layout.cc (Layout::layout_eh_frame): Likewise.
5292
886f533a
ILT
52932011-06-29 Ian Lance Taylor <iant@google.com>
5294
5295 PR gold/12695
5296 * layout.cc (Layout::symtab_section_shndx): New function.
5297 * layout.h (class Layout): Declare symtab_section_shndx.
5298 * output.cc (Output_section::write_header): Call it.
5299
f3ae1b28
ILT
53002011-06-29 Ian Lance Taylor <iant@google.com>
5301
5302 PR gold/12818
5303 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5304 symbols which are not used in a relocation.
5305
aecf301f
ILT
53062011-06-28 Ian Lance Taylor <iant@google.com>
5307
5308 PR gold/12898
5309 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5310 script create indistinguishable segments.
5311 (Layout::set_segment_offsets): Use stable_sort when sorting
5312 segments. Pass this to Compare_segments constructor.
5313 * layout.h (class Layout): Make segment_precedes non-static.
5314 (class Compare_segments): Change from struct to class. Add
5315 layout_ field. Add constructor.
5316 * script-sections.cc
5317 (Script_sections::attach_sections_using_phdrs_clause): Rename
5318 local orphan to is_orphan. Don't report failure to put empty
5319 section in segment. On attachment failure, report name of
5320 section, and attach to first PT_LOAD segment.
5321
03ef7571
ILT
53222011-06-28 Ian Lance Taylor <iant@google.com>
5323
5324 PR gold/12934
5325 * target-select.cc (Target_selector::Target_selector): Add
5326 emulation parameter. Change all callers.
5327 (select_target_by_bfd_name): Rename from select_target_by_name.
5328 Change all callers.
5329 (select_target_by_emulation): New function.
5330 (supported_emulation_names): New function.
5331 * target-select.h (class Target_selector): Add emulation_ field.
5332 Update declarations.
5333 (Target_selector::recognize_by_bfd_name): Rename from
5334 recognize_by_name. Change all callers.
5335 (Target_selector::supported_bfd_names): Rename from
5336 supported_names. Change all callers.
5337 (Target_selector::recognize_by_emulation): New function.
5338 (Target_selector::supported_emulations): New function.
5339 (Target_selector::emulation): New function.
5340 (Target_selector::do_recognize_by_bfd_name): Rename from
5341 do_recognize_by_name. Change all callers.
5342 (Target_selector::do_supported_bfd_names): Rename from
5343 do_supported_names. Change all callers.
5344 (Target_selector::do_recognize_by_emulation): New function.
5345 (Target_selector::do_supported_emulations): New function.
5346 (select_target_by_bfd_name): Change name in declaration.
5347 (select_target_by_emulation): Declare.
5348 (supported_emulation_names): Declare.
5349 * parameters.cc (parameters_force_valid_target): Try to find
5350 target based on emulation from -m option.
5351 * options.h (class General_options): Change doc string for -m.
5352 * options.cc (help): Print emulations.
5353 (General_options::parse_V): Likewise.
5354 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5355 Add emulation parameter. Change all callers.
5356
200b2bb9
ILT
53572011-06-28 Ian Lance Taylor <iant@google.com>
5358
5359 * target.h (class Target): Add osabi_ field.
5360 (Target::osabi): New function.
5361 (Target::set_osabi): New function.
5362 (Target::Target): Initialize osabi_.
5363 (Target::do_adjust_elf_header): Make pure virtual.
5364 (Sized_target::do_adjust_elf_header): Declare.
5365 * target.cc (Sized_target::do_adjust_elf_header): New function.
5366 (class Sized_target): Instantiate all versions.
5367 * freebsd.h (class Target_freebsd): Remove.
5368 (Target_selector_freebsd::do_recognize): Call set_osabi on
5369 Target.
5370 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5371 (Target_selector_freebsd::set_osabi): Remove.
5372 * i386.cc (class Target_i386): Inherit from Sized_target rather
5373 than Target_freebsd.
5374 * x86_64.cc (class Target_x86_64): Likewise.
5375
b3ce541e
ILT
53762011-06-28 Ian Lance Taylor <iant@google.com>
5377
5378 * target.h (Target::can_check_for_function_pointers): Rewrite.
5379 Make non-virtual.
5380 (Target::can_icf_inline_merge_sections): Likewise.
5381 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5382 (Target::Target_info): Add can_icf_inline_merge_sections field.
5383 (Target::do_can_check_for_function_pointers): New virtual
5384 function.
5385 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5386 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5387 from can_check_for_function_pointers, move in file.
5388 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5389 section_may_have_icf_unsafe_poineters, move in file.
5390 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5391 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5392 Rename from can_check_for_function_pointers, move in file.
5393 (Target_i386::can_icf_inline_merge_sections): Remove.
5394 (Target_i386::i386_info): Initialize
5395 can_icf_inline_merge_sections.
5396 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5397 Initialize can_icf_inline_merge_sections.
5398 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5399 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5400 Rename from can_check_for_function_pointers, move in file.
5401 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5402 (Target_x86_64::x86_64_info): Initialize
5403 can_icf_inline_merge_sections.
5404 * testsuite/testfile.cc (Target_test::test_target_info):
5405 Likewise.
5406 * icf.cc (get_section_contents): Correct formatting.
5407
6d1c4efb
ILT
54082011-06-27 Ian Lance Taylor <iant@google.com>
5409
5410 * symtab.cc (Symbol::versioned_name): New function.
5411 (Symbol_table::add_to_final_symtab): Use versioned_name when
5412 appropriate.
5413 (Symbol_table::sized_write_symbol): Likewise.
5414 * symtab.h (class Symbol): Declare versioned_name.
5415 * stringpool.h (class Stringpool_template): Add variant of add
5416 which takes a std::basic_string.
5417 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5418 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5419 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5420 (ver_test_12.o): New target.
5421 * testsuite/Makefile.in: Rebuild.
5422
57eb9b50
DK
54232011-06-27 Doug Kwan <dougkwan@google.com>
5424
5425 * arm.cc (Arm_relocate_functions::thm_jump8,
5426 Arm_relocate_functions::thm_jump11): Use a wider signed
5427 type to compute offset.
5428 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5429 arm_thm_jump8.
5430 * testsuite/Makefile.in: Regenerate.
5431 * testsuite/arm_branch_in_range.sh: Check test results of
5432 arm_thm_jump11 and arm_thm_jump8.
5433 * testsuite/arm_thm_jump11.s: New test source file.
5434 * testsuite/arm_thm_jump11.t: New linker script.
5435 * testsuite/arm_thm_jump8.s: New test source file.
5436 * testsuite/arm_thm_jump8.t: New linker script.
5437
487b39df
ILT
54382011-06-24 Ian Lance Taylor <iant@google.com>
5439
5440 * layout.cc: Include "object.h".
5441 (ctors_sections_in_init_array): New static variable.
5442 (Layout::is_ctors_in_init_array): New function.
5443 (Layout::layout): Add entry to ctors_sections_in_init_array if
5444 appropriate.
5445 * layout.h (class Layout): Declare is_ctors_in_init_array.
5446 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5447 is_ctors_reverse_view is set.
5448 (Sized_relobj_file::write_sections): Add layout parameter. Change
5449 all callers. Set is_ctors_reverse_view field of View_size.
5450 (Sized_relobj_file::reverse_words): New function.
5451 * object.h (Sized_relobj_file::View_size): Add
5452 is_ctors_reverse_view field.
5453 (class Sized_relobj_file): Update declarations.
5454 * testsuite/initpri3.c: New test.
5455 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5456 initpri3b.
5457 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5458 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5459 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5460 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5461 * testsuite/Makefile.in: Rebuild.
5462
472076e4
CC
54632011-06-24 Cary Coutant <ccoutant@google.com>
5464
5465 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5466 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5467 (debug_msg_cdebug.err): New targets.
5468 * testsuite/Makefile.in: Regenerate.
5469 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5470 Fix checks for link with shared library.
5471
a60af0db
DK
54722011-06-24 Doug Kwan <dougkwan@google.com>
5473
5474 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5475 skip empty text sections.
5476 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5477
5393d741
ILT
54782011-06-22 Ian Lance Taylor <iant@google.com>
5479
5480 PR gold/12910
5481 * options.h (class General_options): Add --ctors-in-init-array.
5482 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5483 friends as SHT_PROGBITS for merging sections.
5484 (Layout::layout): Remove special handling of .init_array and
5485 friends. Don't sort if doing relocatable link. Sort for .ctors
5486 and .dtors if ctors_in_init_array.
5487 (Layout::make_output_section): Force correct section types for
5488 .init_array and friends. Don't sort if doing relocatable link,
5489 Don't sort .ctors and .dtors if ctors_in_init_array.
5490 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5491 (Layout::output_section_name): Add relobj parameter. Change all
5492 callers. Handle .ctors. and .dtors. in code rather than table.
5493 Handle .ctors and .dtors if ctors_in_init_array.
5494 (Layout::match_file_name): New function, moved from output.cc.
5495 * layout.h (class Layout): Update declarations.
5496 * output.cc: Include "layout.h".
5497 (Input_section_sort_entry::get_priority): New function.
5498 (Input_section_sort_entry::match_file_name): Just call
5499 Layout::match_file_name.
5500 (Output_section::Input_section_sort_init_fini_compare::operator()):
5501 Handle .ctors and .dtors. Sort by explicit priority rather than
5502 by name.
5503 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5504 * testsuite/initpri2.c: New test.
5505 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5506 (check_PROGRAMS): Add initpri2.
5507 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5508 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5509 * configure, testsuite/Makefile.in: Rebuild.
5510
e1f74f98
ILT
55112011-06-19 Ian Lance Taylor <iant@google.com>
5512
5513 PR gold/12880
5514 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5515 .interp section to a PT_INTERP segment even if we have seen a
5516 --dynamic-linker option. Don't do it if we have seen a PHDRS
5517 clause in a linker script.
5518 (Layout::finalize): Don't create a .interp section if we've
5519 already create a PT_INTERP segment.
5520 (Layout::create_interp): Always call choose_output_section (revert
5521 patch of 2011-06-17). Don't create PT_INTERP segment.
5522 * script-sections.cc
5523 (Script_sections::create_note_and_tls_segments): Add a .interp
5524 section to a PT_INTERP segment even if we have seen a
5525 --dynamic-linker option.
5526
766f91bb
ILT
55272011-06-18 Ian Lance Taylor <iant@google.com>
5528
5529 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5530 merely because a non-PT_LOAD segment has a dynamic reloc.
5531
0d212c3a
ILT
55322011-06-18 Ian Lance Taylor <iant@google.com>
5533
5534 * layout.cc (Layout::finish_dynamic_section): Don't create
5535 DT_FLAGS entry if not needed.
5536
911a5072
ILT
55372011-06-18 Ian Lance Taylor <iant@google.com>
5538
5539 PR gold/12745
5540 * layout.cc (Layout::layout_eh_frame): Correct handling of
5541 writable .eh_frame section.
5542
534b4e5f
ILT
55432011-06-17 Ian Lance Taylor <iant@google.com>
5544
5545 PR gold/12893
5546 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5547 symbol is redefined with the exact same object and value.
5548
10b4f102
ILT
55492011-06-17 Ian Lance Taylor <iant@google.com>
5550
5551 PR gold/12880
5552 * layout.h (class Layout): Add interp_segment_ field.
5553 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5554 (Layout::attach_allocated_section_to_segment): If making shared
5555 library, put .interp section in PT_INTERP segment.
5556 (Layout::finalize): Also call create_interp if -dynamic-linker
5557 option was used.
5558 (Layout::create_interp): Assert that there is no PT_INTERP
5559 segment. If not using a SECTIONS clause, use make_output_section.
5560 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5561 * script-sections.cc
5562 (Script_sections::create_note_and_tls_segments): If making shared
5563 library, put .interp section in PT_INTERP segment.
5564
a29b0dad
ILT
55652011-06-17 Ian Lance Taylor <iant@google.com>
5566
e588ea8d
ILT
5567 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5568 when making a shared library.
5569
55702011-06-17 Ian Lance Taylor <iant@google.com>
5571
5572 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5573 parameter. Change all callers. Don't issue warning about PC32
5574 against locally defined symbol.
a29b0dad 5575
9d3b0698
ILT
55762011-06-16 Ian Lance Taylor <iant@google.com>
5577
5578 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5579 occurs in same object.
5580
85b0f90c
AM
55812011-06-14 Alan Modra <amodra@gmail.com>
5582
5583 * po/POTFILES.in: Regenerate.
5584
a94907d9
ILT
55852011-06-09 Ian Lance Taylor <iant@google.com>
5586
5587 * script-sections.cc
5588 (Orphan_output_section::set_section_addresses): For a relocatable
5589 link set address to 0.
5590
4fb3a1c3
CC
55912011-06-09 Cary Coutant <ccoutant@google.com>
5592
5593 PR gold/12804
5594 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5595 used with --compress-debug-sections.
5596 * gold/object.cc (Sized_relobj_file::do_layout): Report
5597 uncompressed size of compressed input sections.
5598
61220854
CC
55992011-06-08 Cary Coutant <ccoutant@google.com>
5600
5601 PR gold/12804
5602 * testsuite/two_file_test_2_v1.cc: Change initialization of
5603 v2 to keep it in .data.
5604
e6455dfb
CC
56052011-06-07 Cary Coutant <ccoutant@google.com>
5606
5607 * common.cc (Symbol_table::do_allocate_commons_list): Call
5608 gold_fallback.
5609 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5610 (Errors::fallback): New function.
5611 (gold_fallback): New function.
5612 * errors.h (Errors::fallback): New function.
5613 * gold.cc (gold_exit): Change status parameter to enum; adjust
5614 all callers.
5615 (queue_initial_tasks): Call gold_fallback.
5616 * gold.h: Include cstdlib.
5617 (Exit_status): New enum type.
5618 (gold_exit): Change status parameter to enum.
5619 (gold_fallback): New function.
5620 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5621 (Layout::create_symtab_sections): Likewise.
5622 (Layout::create_shdrs): Likewise.
5623 * main.cc (main): Adjust call to gold_exit.
5624 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5625 (Output_data_got::add_got_entry_pair): Likewise.
5626 (Output_section::add_input_section): Likewise.
5627 (Output_section::add_output_section_data): Likewise.
5628 (Output_segment::set_section_list_addresses): Likewise.
5629 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5630
fb0e076f
CC
56312011-06-07 Cary Coutant <ccoutant@google.com>
5632
5633 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5634 for incremental links.
5635 * output.cc (Output_segment::set_section_list_addresses): Remove
5636 FIXME and test for TLS or BSS.
5637
a5ee4d5d
CC
56382011-06-07 Cary Coutant <ccoutant@google.com>
5639
5640 * testsuite/Makefile.am: Add incremental_copy_test,
5641 incremental_common_test_1.
5642 * testsuite/Makefile.in: Regenerate.
5643 * testsuite/common_test_1_v1.c: New source file.
5644 * testsuite/common_test_1_v2.c: New source file.
5645 * testsuite/copy_test_v1.cc: New source file.
5646
5146f448
CC
56472011-06-07 Cary Coutant <ccoutant@google.com>
5648
5649 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5650 update, allocate common from bss section's free list.
5651 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5652 linker-defined symbols.
5653 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5654 Skip GOT and PLT entries that are no longer referenced.
5655 (Output_section_incremental_inputs::write_info_blocks): Mark
5656 linker-defined symbols.
5657 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5658 * output.cc (Output_section::allocate): New function.
5659 * output.h (Output_section::allocate): New function.
5660 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5661 linker-defined symbols.
5662 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5663 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5664 (Symbol::init_base_output_data): Likewise.
5665 (Symbol::init_base_output_segment): Likewise.
5666 (Symbol::init_base_constant): Likewise.
5667 (Sized_symbol::init_output_data): Likewise.
5668 (Sized_symbol::init_output_segment): Likewise.
5669 (Sized_symbol::init_constant): Likewise.
5670 (Symbol_table::do_define_in_output_data): Likewise.
5671 (Symbol_table::do_define_in_output_segment): Likewise.
5672 (Symbol_table::do_define_as_constant): Likewise.
5673 * symtab.h (Symbol::is_predefined): New function.
5674 (Symbol::init_base_output_data): Add is_predefined parameter.
5675 (Symbol::init_base_output_segment): Likewise.
5676 (Symbol::init_base_constant): Likewise.
5677 (Symbol::is_predefined_): New data member.
5678 (Sized_symbol::init_output_data): Add is_predefined parameter.
5679 (Sized_symbol::init_output_segment): Likewise.
5680 (Sized_symbol::init_constant): Likewise.
5681 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5682
26d3c67d
CC
56832011-06-07 Cary Coutant <ccoutant@google.com>
5684
5685 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5686 instead of emit_copy_reloc.
5687 (Copy_relocs::emit_copy_reloc): Refactor.
5688 (Copy_relocs::make_copy_reloc): New function.
5689 (Copy_relocs::add_copy_reloc): Remove.
5690 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5691 section.
5692 (Copy_relocs::make_copy_reloc): New function.
5693 (Copy_relocs::add_copy_reloc): Remove.
5694 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5695 unchanged input files.
5696 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5697 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5698 Reserve BSS space for COPY relocations.
5699 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5700 (Output_section_incremental_inputs::write_info_blocks): Record
5701 whether a symbol is copied from a shared object.
5702 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5703 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5704 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5705 (Incremental_input_entry_reader::get_output_symbol_index): Add
5706 is_copy parameter.
5707 (Incremental_binary::emit_copy_relocs): New function.
5708 (Incremental_binary::do_emit_copy_relocs): New function.
5709 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5710 new data member.
5711 (Sized_incremental_binary::add_copy_reloc): New function.
5712 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5713 (Sized_incremental_binary::Copy_reloc): New struct.
5714 (Sized_incremental_binary::Copy_relocs): New typedef.
5715 (Sized_incremental_binary::copy_relocs_): New data member.
5716 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5717 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5718 * target.h (Sized_target::emit_copy_reloc): New function.
5719 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5720
7cdb37d9
CC
57212011-06-02 Cary Coutant <ccoutant@google.com>
5722
5723 PR gold/12163
5724 * gold/archive.cc (Archive::Archive): Initialize new data member.
5725 (Archive::include_all_members): Return if archive has already been
5726 included.
5727 * gold/archive.h (Archive::include_all_members_): New data member.
5728
cc643b88
NC
57292011-06-02 Nick Clifton <nickc@redhat.com>
5730
5731 * dynobj.h: Fix spelling mistake in comment.
5732 * output.cc: Likewise.
5733
f62a3ca7 57342011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 5735 Asier Llano
f62a3ca7
DK
5736
5737 PR gold/12826
cc643b88 5738 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
5739 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5740 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5741 redundant arm_exidx_test.so.
5742 * testsuite/Makefile.in: Regenerate.
5743 (check_SCRIPTS): Add pr12826.sh
5744 (check_DATA): Add pr12826.stdout
5745 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5746 * testsuite/pr12826.sh: New file.
5747 * testsuite/pr12826_1.s: Ditto.
5748 * testsuite/pr12826_1.s: Ditto.
5749
8dbe1edc
ILT
57502011-05-30 Ian Lance Taylor <iant@google.com>
5751
5752 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5753 sections.
5754
c49875be
ILT
57552011-05-29 Ian Lance Taylor <iant@google.com>
5756
5757 PR gold/12804
5758 * testsuite/Makefile.am: Use different file name for two_file_test
5759 temporary file for each incremental test.
5760 * testsuite/Makefile.in: Rebuild.
5761
69d53f7a
ILT
57622011-05-29 Ian Lance Taylor <iant@google.com>
5763
5764 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5765 binary input file is empty.
5766
41d0ab5f
ILT
57672011-05-27 Ian Lance Taylor <iant@google.com>
5768
5769 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5770 (ver_test_9.so): Likewise.
5771 * testsuite/Makefile.in: Rebuild.
5772
89d8a36b
CC
57732011-05-26 Cary Coutant <ccoutant@google.com>
5774
5775 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5776 * incremental.cc (Incremental_inputs::report_input_section): Fix
5777 comment, indentation.
5778 (Incremental_inputs::report_comdat_group): New function.
5779 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5780 of data for incremental input file entry.
5781 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5782 group count, COMDAT group signatures.
5783 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5784 an unchanged input file.
5785 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5786 Initialize new data member.
5787 (Incremental_object_entry::add_comdat_group): New function.
5788 (Incremental_object_entry::get_comdat_group_count): New function.
5789 (Incremental_object_entry::get_comdat_signature_key): New function.
5790 (Incremental_object_entry::groups_): New data member.
5791 (Incremental_inputs::report_comdat_group): New function.
5792 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5793 data for incremental input file entry.
5794 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5795 (Incremental_input_entry_reader::get_input_section): Adjust size of
5796 data for incremental input file entry.
5797 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5798 (Incremental_input_entry_reader::get_comdat_group_signature): New
5799 function.
5800 * object.cc (Sized_relobj::include_section_group): Report kept
5801 COMDAT groups for incremental links.
5802
1706a06f
ILT
58032011-05-24 David Meyer <pdox@google.com>
5804
5805 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5806 with name parameter. Add found_name parameter.
5807 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5808 * dirsearch.h (class Dirsearch): Update declaration.
5809
a10ae760
ILT
58102011-05-24 Ian Lance Taylor <iant@google.com>
5811
5812 * archive.cc (Library_base::should_include_member): Pull in object
5813 from archive if it defines the entry symbol.
5814 * parameters.cc (Parameters::entry): New function.
5815 * parameters.h (class Parameters): Declare entry.
5816 * output.h (class Output_file_header): Remove entry_ field.
5817 * output.cc (Output_file_header::Output_file_header): Remove entry
5818 parameter. Change all callers.
5819 (Output_file_header::entry): Use parameters->entry.
5820 * gold.cc (queue_middle_tasks): Likewise.
5821 * plugin.cc (Plugin_hook::run): Likewise.
5822
aa92d6ed
CC
58232011-05-24 Cary Coutant <ccoutant@google.com>
5824
5825 * gold.cc (queue_initial_tasks): Pass incremental base filename
5826 to Output_file::open_base_file; don't print error message.
5827 * incremental-dump.cc (main): Adjust call to
5828 Output_file::open_for_modification.
5829 * incremental-dump.cc (main): Likewise.
5830 * incremental.cc (Incremental_inputs::report_command_line):
5831 Ignore --incremental-base option when comparing command lines.
5832 Ignore parameter when given as separate argument.
5833 * options.h (class General_options): Add --incremental-base.
5834 * output.cc (Output_file::Output_file):
5835 (Output_file::open_base_file): Add base_name and writable parameters;
5836 read base file into new file; print error message here.
5837 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5838 callers.
5839 * output.h (Output_file::open_for_modification): Rename to...
5840 (Output_file::open_base_file): ...this; add base_name and
5841 writable parameters; adjust all callers.
5842 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5843 callers.
5844 * testsuite/Makefile.am (incremental_test_4): Test
5845 --incremental-base.
5846 * testsuite/Makefile.in: Regenerate.
5847
2eedd706
CC
58482011-05-24 Cary Coutant <ccoutant@google.com>
5849
5850 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5851 incremental_test_4.
5852 * testsuite/Makefile.in: Regenerate.
5853 * testsuite/two_file_test_1_v1.cc: New test source file.
5854 * testsuite/two_file_test_1b_v1.cc: New test source file.
5855 * testsuite/two_file_test_2_v1.cc: New test source file.
5856
0f1c85a6
CC
58572011-05-24 Cary Coutant <ccoutant@google.com>
5858
5859 * dynobj.h (Dynobj::do_dynobj): New function.
5860 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5861 flag and soname for shared objects.
5862 * incremental.cc (Incremental_inputs::report_object): Make
5863 either Incremental_object_entry or Incremental_dynobj_entry; add
5864 soname to string table.
5865 (Incremental_inputs::report_input_section): Add assertion.
5866 (Output_section_incremental_inputs::set_final_data_size): Adjust
5867 type of input file entry for shared libraries; adjust size of
5868 shared library info entry.
5869 (Output_section_incremental_inputs::write_input_files): Write
5870 as_needed flag for shared libraries.
5871 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5872 of input file entry for shared libraries; write soname.
5873 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5874 soname from incremental info.
5875 * incremental.h (enum Incremental_input_flags): Add
5876 INCREMENTAL_INPUT_AS_NEEDED.
5877 (Incremental_input_entry::Incremental_input_entry): Initialize new
5878 data member.
5879 (Incremental_input_entry::set_as_needed): New function.
5880 (Incremental_input_entry::as_needed): New function.
5881 (Incremental_input_entry::do_dynobj_entry): New function.
5882 (Incremental_input_entry::as_needed_): New data member.
5883 (Incremental_object_entry::Incremental_object_entry): Don't check
5884 for shared library.
5885 (Incremental_object_entry::do_type): Likewise.
5886 (class Incremental_dynobj_entry): New class.
5887 (Incremental_input_entry_reader::as_needed): New function.
5888 (Incremental_input_entry_reader::get_soname): New function.
5889 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5890 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5891 size of shared library info entry.
58797674 5892 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
5893 incremental link when adding DT_NEEDED entries.
5894 * object.h (Object::Object): Initialize new data member.
5895 (Object::dynobj): New function.
5896 (Object::set_as_needed): New function.
5897 (Object::as_needed): New function.
5898 (Object::do_dynobj): New function.
5899 (Object::as_needed_): New data member.
5900
6fa2a40b
CC
59012011-05-24 Cary Coutant <ccoutant@google.com>
5902
5903 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5904 info; adjust display of GOT entries.
5905 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5906 vector of input objects; remove file_status_.
5907 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5908 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5909 got_plt reader; call target hooks to reserve GOT entries.
5910 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5911 of input file info header and GOT info entry.
5912 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5913 relocation info.
5914 (Got_plt_view_info::got_descriptor): Remove.
5915 (Got_plt_view_info::sym_index): New data member.
5916 (Got_plt_view_info::input_index): New data member.
5917 (Local_got_offset_visitor::visit): Write input file index.
5918 (Global_got_offset_visitor::visit): Write 0 for input file index.
5919 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5920 with sym_index and input_index.
5921 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5922 incremental info GOT entry; replace got_descriptor with input_index.
5923 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5924 map from input file index to object.
5925 (Sized_relobj_incr::do_layout): Replace direct data member reference
5926 with accessor function.
5927 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5928 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5929 Adjust size of input file info header.
5930 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5931 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5932 (Incremental_input_entry_reader::get_input_section): Adjust size of
5933 input file info header.
5934 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5935 of incremental info GOT entry.
5936 (Incremental_got_plt_reader::get_got_desc): Remove.
5937 (Incremental_got_plt_reader::get_got_symndx): New function.
5938 (Incremental_got_plt_reader::get_got_input_index): New function.
5939 (Sized_incremental_binary::Sized_incremental_binary): Remove
5940 file_status_; add input_objects_.
5941 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5942 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5943 (Sized_incremental_binary::file_is_unchanged): Remove.
5944 (Sized_incremental_binary::set_input_object): New function.
5945 (Sized_incremental_binary::input_object): New function.
5946 (Sized_incremental_binary::file_status_): Remove.
5947 (Sized_incremental_binary::input_objects_): New data member.
5948 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5949 references.
5950 (Sized_relobj_incr::invalid_address): Move to base class.
5951 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5952 class.
5953 (Sized_relobj_incr::do_output_section_offset): Likewise.
5954 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5955 (Sized_relobj_incr::section_offsets_): Likewise.
5956 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5957 function.
5958 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5959 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5960 with accessor function.
5961 (Sized_relobj_file::do_layout): Likewise.
5962 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5963 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5964 (Sized_relobj_file::compute_final_local_value): Replace refs to
5965 section_offsets_ with accessor function.
5966 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5967 * object.h (Relobj::Relobj): Initialize new data members.
5968 (Relobj::add_dyn_reloc): New function.
5969 (Relobj::first_dyn_reloc): New function.
5970 (Relobj::dyn_reloc_count): New function.
5971 (Relobj::first_dyn_reloc_): New data member.
5972 (Relobj::dyn_reloc_count_): New data member.
5973 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5974 references.
5975 (Sized_relobj::Address): New typedef.
5976 (Sized_relobj::invalid_address): Move here from child class.
5977 (Sized_relobj::Sized_relobj): Initialize new data members.
5978 (Sized_relobj::sized_relobj): New function.
5979 (Sized_relobj::is_output_section_offset_invalid): Move here from
5980 child class.
5981 (Sized_relobj::get_output_section_offset): Likewise.
5982 (Sized_relobj::local_has_got_offset): Likewise.
5983 (Sized_relobj::local_got_offset): Likewise.
5984 (Sized_relobj::set_local_got_offset): Likewise.
5985 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5986 (Sized_relobj::clear_got_offsets): New function.
5987 (Sized_relobj::section_offsets): Move here from child class.
5988 (Sized_relobj::do_output_section_offset): Likewise.
5989 (Sized_relobj::do_set_section_offset): Likewise.
5990 (Sized_relobj::Local_got_offsets): Likewise.
5991 (Sized_relobj::local_got_offsets_): Likewise.
5992 (Sized_relobj::section_offsets_): Likewise.
5993 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5994 references.
5995 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5996 class.
5997 (Sized_relobj_file::sized_relobj): New function
5998 (Sized_relobj_file::local_has_got_offset): Move to base class.
5999 (Sized_relobj_file::local_got_offset): Likewise.
6000 (Sized_relobj_file::set_local_got_offset): Likewise.
6001 (Sized_relobj_file::get_output_section_offset): Likewise.
6002 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
6003 (Sized_relobj_file::do_output_section_offset): Likewise.
6004 (Sized_relobj_file::do_set_section_offset): Likewise.
6005 (Sized_relobj_file::Local_got_offsets): Likewise.
6006 (Sized_relobj_file::local_got_offsets_): Likewise.
6007 (Sized_relobj_file::section_offsets_): Likewise.
6008 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
6009 (all constructors).
6010 (set_needs_dynsym_index): Convert relobj to derived class pointer.
6011 (Output_reloc::get_symbol_index): Likewise.
6012 (Output_reloc::local_section_offset): Likewise.
6013 (Output_reloc::get_address): Likewise.
6014 (Output_reloc::symbol_value): Likewise.
6015 (Output_data_got::reserve_slot): Move to class definition.
6016 (Output_data_got::reserve_local): New function.
6017 (Output_data_got::reserve_slot_for_global): Remove.
6018 (Output_data_got::reserve_global): New function.
6019 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6020 (all constructors, two instantiations).
6021 (Output_reloc::get_relobj): New function (two instantiations).
6022 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6023 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6024 (Output_data_reloc::add_global): Adjust type of relobj.
6025 (Output_data_reloc::add_global_relative): Likewise.
6026 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6027 (Output_data_reloc::add_local): Likewise.
6028 (Output_data_reloc::add_local_relative): Likewise.
6029 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6030 (Output_data_reloc::add_local_section): Likewise.
6031 (Output_data_reloc::add_output_section): Likewise.
6032 (Output_data_reloc::add_absolute): Likewise.
6033 (Output_data_reloc::add_target_specific): Likewise.
6034 (Output_data_got::reserve_slot): Move definition here.
6035 (Output_data_got::reserve_local): New function.
6036 (Output_data_got::reserve_global): New function.
6037 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6038 section_offsets_ with accessor function.
6039 (Sized_relobj_file::write_sections): Likewise.
6040 (Sized_relobj_file::do_relocate_sections): Likewise.
6041 * target.h (Sized_target::reserve_local_got_entry): New function.
6042 (Sized_target::reserve_global_got_entry): New function.
6043 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6044 (Target_x86_64::reserve_global_got_entry): New function.
6045 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6046
4829d394
CC
60472011-05-23 Cary Coutant <ccoutant@google.com>
6048
6049 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6050 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6051 bit when checking got_type.
6052 * incremental.cc (Sized_incremental_binary::setup_readers):
6053 Store symbol table and string table locations; initialize bit vector
6054 of file status flags.
6055 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6056 unchanged files.
6057 (Sized_incremental_binary::do_process_got_plt): New function.
6058 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6059 (Output_section_incremental_inputs::set_final_data_size): Record
6060 file index for each input file.
6061 (Output_section_incremental_inputs::write_got_plt): Store file index
6062 instead of input entry offset for each GOT entry.
6063 * incremental.h
6064 (Incremental_input_entry::Incremental_input_entry): Initialize new
6065 data member.
6066 (Incremental_input_entry::set_offset): Store file index.
6067 (Incremental_input_entry::get_file_index): New function.
6068 (Incremental_input_entry::file_index_): New data member.
6069 (Incremental_binary::process_got_plt): New function.
6070 (Incremental_binary::do_process_got_plt): New function.
6071 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6072 data members.
6073 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6074 (Sized_incremental_binary::set_file_is_unchanged): New function.
6075 (Sized_incremental_binary::file_is_unchanged): New function.
6076 (Sized_incremental_binary::do_process_got_plt): New function.
6077 (Sized_incremental_binary::file_status_): New data member.
6078 (Sized_incremental_binary::main_symtab_loc_): New data member.
6079 (Sized_incremental_binary::main_strtab_loc_): New data member.
6080 * output.cc (Output_data_got::Got_entry::write): Add case
6081 RESERVED_CODE.
6082 (Output_data_got::add_global): Call add_got_entry.
6083 (Output_data_got::add_global_plt): Likewise.
6084 (Output_data_got::add_global_with_rel): Likewise.
6085 (Output_data_got::add_global_with_rela): Likewise.
6086 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6087 (Output_data_got::add_global_pair_with_rela): Likewise.
6088 (Output_data_got::add_local): Call add_got_entry.
6089 (Output_data_got::add_local_plt): Likewise.
6090 (Output_data_got::add_local_with_rel): Likewise.
6091 (Output_data_got::add_local_with_rela): Likewise.
6092 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6093 (Output_data_got::add_local_pair_with_rela): Likewise.
6094 (Output_data_got::reserve_slot): New function.
6095 (Output_data_got::reserve_slot_for_global): New function.
6096 (Output_data_got::add_got_entry): New function.
6097 (Output_data_got::add_got_entry_pair): New function.
6098 (Output_section::add_output_section_data): Edit FIXME.
6099 * output.h
6100 (Output_section_data_build::Output_section_data_build): New
6101 constructor with size parameter.
6102 (Output_data_space::Output_data_space): Likewise.
6103 (Output_data_got::Output_data_got): Initialize new data member; new
6104 constructor with size parameter.
6105 (Output_data_got::add_constant): Call add_got_entry.
6106 (Output_data_got::reserve_slot): New function.
6107 (Output_data_got::reserve_slot_for_global): New function.
6108 (class Output_data_got::Got_entry): Add RESERVED_CODE.
6109 (Output_data_got::add_got_entry): New function.
6110 (Output_data_got::add_got_entry_pair): New function.
6111 (Output_data_got::free_list_): New data member.
6112 * target.h (Sized_target::init_got_plt_for_update): New function.
6113 (Sized_target::register_global_plt_entry): New function.
6114 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
6115 Initialize new data member; call init; add constructor with PLT count.
6116 (Output_data_plt_x86_64::init): New function.
6117 (Output_data_plt_x86_64::add_relocation): New function.
6118 (Output_data_plt_x86_64::reserve_slot): New function.
6119 (Output_data_plt_x86_64::free_list_): New data member.
6120 (Target_x86_64::init_got_plt_for_update): New function.
6121 (Target_x86_64::register_global_plt_entry): New function.
6122 (Output_data_plt_x86_64::add_entry): Allocate from free list for
6123 incremental updates.
6124 (Output_data_plt_x86_64::add_relocation): New function.
6125 * testsuite/object_unittest.cc (Object_test): Set default options.
6126
ec69d6da
ILT
61272011-05-16 Ian Lance Taylor <iant@google.com>
6128
6129 * options.h (class General_options): Make -i a synonym for -r.
6130
732e31de
ILT
61312011-05-16 Ian Lance Taylor <iant@google.com>
6132
6133 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6134
403676b5
CC
61352011-05-10 Cary Coutant <ccoutant@google.com>
6136
6137 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6138 strip_all (-s).
6139
5b7b7d6e
ILT
61402011-05-06 Ian Lance Taylor <iant@google.com>
6141
6142 * layout.cc (Layout::layout): If the output section flags change,
6143 update the ordering.
6144
f0f9babf
CC
61452011-04-25 Cary Coutant <ccoutant@google.com>
6146
6147 * incremental-dump.cc (dump_incremental_inputs): Print local
6148 symbol info for each input file.
6149 * incremental.cc
6150 (Output_section_incremental_inputs::set_final_data_size): Add local
6151 symbol info to input file entries in incremental info.
6152 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6153 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6154 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6155 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6156 implementation.
6157 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6158 (Sized_incr_relobj::do_relocate): Write the local symbols.
6159 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6160 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6161 Adjust size of input file header.
6162 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6163 (Incremental_inputs_reader::get_local_symbol_count): New function.
6164 (Incremental_inputs_reader::get_input_section): Adjust size of input
6165 file header.
6166 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6167 (Sized_incr_relobj::This): New typedef.
6168 (Sized_incr_relobj::sym_size): New const data member.
6169 (Sized_incr_relobj::Local_symbol): New struct.
6170 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6171 (Sized_incr_relobj::do_local_symbol_offset): New function.
6172 (Sized_incr_relobj::local_symbol_count_): New data member.
6173 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6174 (Sized_incr_relobj::local_symbol_index_): New data member.
6175 (Sized_incr_relobj::local_symbol_offset_): New data member.
6176 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6177 (Sized_incr_relobj::local_symbols_): New data member.
6178 * object.h (Relobj::output_local_symbol_count): New function.
6179 (Relobj::local_symbol_offset): New function.
6180 (Relobj::do_output_local_symbol_count): New function.
6181 (Relobj::do_local_symbol_offset): New function.
6182 (Sized_relobj::do_output_local_symbol_count): New function.
6183 (Sized_relobj::do_local_symbol_offset): New function.
6184
d0a9ace3
ILT
61852011-04-22 Vladimir Simonov <sv@sw.ru>
6186
6187 * descriptors.cc (set_close_on_exec): New function.
6188 (Descriptors::open): Use set_close_on_exec.
6189 * output.cc (S_ISLNK): Define if not defined.
6190
94a3fc8b
CC
61912011-04-22 Cary Coutant <ccoutant@google.com>
6192
6193 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6194 global symbol map.
6195 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6196 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6197 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6198 relocations.
6199 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6200 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6201 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6202 * incremental.h
6203 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6204 function.
6205 (Incremental_binary::apply_incremental_relocs): New function.
6206 (Incremental_binary::do_apply_incremental_relocs): New function.
6207 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6208 data member.
6209 (Sized_incremental_binary::add_global_symbol): New function.
6210 (Sized_incremental_binary::global_symbol): New function.
6211 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6212 (Sized_incremental_binary::symbol_map_): New data member.
6213 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6214 * target.h (Sized_target::apply_relocation): New function.
6215 * target-reloc.h (apply_relocation): New function.
6216 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6217
c87e4302
DK
62182011-04-22 Doug Kwan <dougkwan@google.com>
6219
6220 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6221 flag of a SHT_ARM_EXIDX section.
2e702c99 6222 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
6223 * testsuite/Makefile.in: Regenerate.
6224 * testsuite/arm_exidx_test.s: New file.
6225 * testsuite/arm_exidx_test.sh: Same.
6226
e7782cf6
CC
62272011-04-20 Cary Coutant <ccoutant@google.com>
6228
6229 PR gold/12689
6230 * archive.h (Incremental_archive_entry::Archive_member):
6231 Initialize arg_serial_ (second constructor).
6232
308ecdc7
ILT
62332011-04-17 Ian Lance Taylor <iant@google.com>
6234
6235 * object.cc (Relocate_info::location): Simplify location string.
6236 * errors.cc (Errors::error_at_location): Don't print program
6237 name.
6238 (Errors::warning_at_location): Likewise.
6239 (Errors::undefined_symbol): Likewise.
6240 * testsuite/debug_msg.sh: Update accordingly.
6241
bec5b579
CC
62422011-04-14 Cary Coutant <ccoutant@google.com>
6243
6244 * gold/layout.cc (Layout::symtab_section_offset): New function.
6245 * gold/layout.h (Layout::symtab_section_offset): New function.
6246 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6247
88597d34
ILT
62482011-04-12 Ian Lance Taylor <iant@google.com>
6249
6250 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6251 with MREMAP_MAYMOVE.
6252 * output.h (class Output_file): Add map_is_allocated_ field.
6253 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6254 not available, provide stubs. If mremap is not available, #define
6255 it to gold_mremap.
6256 (MREMAP_MAYMOVE): Define if not defined.
6257 (Output_file::Output_file): Initialize map_is_allocated_.
6258 (Output_file::resize): Check map_is_allocated_.
6259 (Output_file::map_anonymous): If mmap fails, use malloc.
6260 (Output_file::unmap): Don't do anything for an anonymous map.
6261 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6262 is not available, provide stubs.
6263 (File_read::View::~View): Use free rather than delete[].
6264 (File_read::make_view): Use malloc rather than new[]. If mmap
6265 fails, use malloc.
6266 (File_read::find_or_make_view): Use malloc rather than new[].
6267 * gold.h: Remove HAVE_REMAP code.
6268 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6269 exists. Rename mremap to gold_mremap. If mmap is not available
6270 don't do anything.
6271 * configure, config.in: Rebuild.
6272
11e361bc
ILT
62732011-04-11 Ian Lance Taylor <iant@google.com>
6274
6275 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6276 initialize local variable v.
6277
cdc29364
CC
62782011-04-11 Cary Coutant <ccoutant@google.com>
6279
6280 * archive.cc (Archive::include_member): Adjust call to
6281 report_object.
6282 (Add_archive_symbols::run): Track argument serial numbers.
6283 (Lib_group::include_member): Likewise.
6284 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6285 * archive.h (Incremental_archive_entry::Archive_member):
6286 Initialize arg_serial_.
6287 (Archive_member::arg_serial_): New data member.
6288 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6289 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6290 incremental link.
6291 (Sized_dynobj::do_for_all_local_got_entries): New function.
6292 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6293 function.
6294 * fileread.cc (get_mtime): New function.
6295 * fileread.h (get_mtime): New function.
6296 * gold.cc (queue_initial_tasks): Check for incremental update.
6297 (process_incremental_input): New function.
6298 (queue_middle_tasks): Don't force valid target for incremental
6299 update.
6300 * incremental-dump.cc (find_input_containing_global): Adjust
6301 size of symbol info entry.
6302 (dump_incremental_inputs): Dump argument serial number and
6303 in_system_directory flag; bias shndx by 1; print symbol names
6304 when dumping per-file symbol lists; use new symbol info readers.
6305 * incremental.cc
6306 (Output_section_incremental_inputs:update_data_size): New function.
6307 (Sized_incremental_binary::setup_readers): Setup input readers
6308 for each input file; build maps for files added from libraries
6309 and scripts.
6310 (Sized_incremental_binary::check_input_args): New function.
6311 (Sized_incremental_binary::do_check_inputs): Build map of argument
6312 serial numbers to input arguments.
6313 (Sized_incremental_binary::do_file_has_changed): Rename
6314 do_file_is_unchanged to this; compare file modification times.
6315 (Sized_incremental_binary::do_init_layout): New function.
6316 (Sized_incremental_binary::do_reserve_layout): New function.
6317 (Sized_incremental_binary::do_get_input_reader): Remove.
6318 (Sized_incremental_binary::get_symtab_view): New function.
6319 (Incremental_checker::can_incrementally_link_output_file): Remove.
6320 (Incremental_inputs::report_command_line): Exclude --debug options.
6321 (Incremental_inputs::report_archive_begin): Add parameter; track
6322 argument serial numbers; don't put input file entry for archive
6323 before archive members.
6324 (Incremental_inputs::report_archive_end): Put input file entry
6325 for archive after archive members.
6326 (Incremental_inputs::report_object): Add parameter; track argument
6327 serial numbers and in_system_directory flag.
6328 (Incremental_inputs::report_script): Add parameter; track argument
6329 serial numbers.
6330 (Output_section_incremental_inputs::set_final_data_size): Adjust
6331 size of symbol info entry; check for forwarding symbols.
6332 (Output_section_incremental_inputs::write_input_files): Write
6333 in_system_directory flag and argument serial number.
6334 (Output_section_incremental_inputs::write_info_blocks): Map section
6335 indices between incremental info and original input file; store
6336 input section index for each symbol.
6337 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6338 change operator() to visit().
6339 (class Global_got_offset_visitor): Likewise.
6340 (class Global_symbol_visitor_got_plt):
6341 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6342 classes.
6343 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6344 (Sized_incr_relobj::do_read_symbols): New function.
6345 (Sized_incr_relobj::do_layout): New function.
6346 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6347 (Sized_incr_relobj::do_add_symbols): New function.
6348 (Sized_incr_relobj::do_should_include_member): New function.
6349 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6350 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6351 (Sized_incr_relobj::do_section_size): New function.
6352 (Sized_incr_relobj::do_section_name): New function.
6353 (Sized_incr_relobj::do_section_contents): New function.
6354 (Sized_incr_relobj::do_section_flags): New function.
6355 (Sized_incr_relobj::do_section_entsize): New function.
6356 (Sized_incr_relobj::do_section_address): New function.
6357 (Sized_incr_relobj::do_section_type): New function.
6358 (Sized_incr_relobj::do_section_link): New function.
6359 (Sized_incr_relobj::do_section_info): New function.
6360 (Sized_incr_relobj::do_section_addralign): New function.
6361 (Sized_incr_relobj::do_initialize_xindex): New function.
6362 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6363 (Sized_incr_relobj::do_read_relocs): New function.
6364 (Sized_incr_relobj::do_gc_process_relocs): New function.
6365 (Sized_incr_relobj::do_scan_relocs): New function.
6366 (Sized_incr_relobj::do_count_local_symbols): New function.
6367 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6368 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6369 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6370 (Sized_incr_relobj::do_relocate): New function.
6371 (Sized_incr_relobj::do_set_section_offset): New function.
6372 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6373 (Sized_incr_dynobj::do_read_symbols): New function.
6374 (Sized_incr_dynobj::do_layout): New function.
6375 (Sized_incr_dynobj::do_add_symbols): New function.
6376 (Sized_incr_dynobj::do_should_include_member): New function.
6377 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6378 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6379 (Sized_incr_dynobj::do_section_size): New function.
6380 (Sized_incr_dynobj::do_section_name): New function.
6381 (Sized_incr_dynobj::do_section_contents): New function.
6382 (Sized_incr_dynobj::do_section_flags): New function.
6383 (Sized_incr_dynobj::do_section_entsize): New function.
6384 (Sized_incr_dynobj::do_section_address): New function.
6385 (Sized_incr_dynobj::do_section_type): New function.
6386 (Sized_incr_dynobj::do_section_link): New function.
6387 (Sized_incr_dynobj::do_section_info): New function.
6388 (Sized_incr_dynobj::do_section_addralign): New function.
6389 (Sized_incr_dynobj::do_initialize_xindex): New function.
6390 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6391 (make_sized_incremental_object): New function.
6392 (Incremental_library::copy_unused_symbols): New function.
6393 (Incremental_library::do_for_all_unused_symbols): New function.
6394 * incremental.h (enum Incremental_input_flags): New type.
6395 (class Incremental_checker): Remove.
6396 (Incremental_input_entry::Incremental_input_entry): Add argument
6397 serial number.
6398 (Incremental_input_entry::arg_serial): New function.
6399 (Incremental_input_entry::set_is_in_system_directory): New function.
6400 (Incremental_input_entry::is_in_system_directory): New function.
6401 (Incremental_input_entry::arg_serial_): New data member.
6402 (Incremental_input_entry::is_in_system_directory_): New data member.
6403 (class Script_info): Move here from script.h.
6404 (Script_info::Script_info): Add filename parameter.
6405 (Script_info::filename): New function.
6406 (Script_info::filename_): New data member.
6407 (Incremental_script_entry::Incremental_script_entry): Add argument
6408 serial number.
6409 (Incremental_object_entry::Incremental_object_entry): Likewise.
6410 (Incremental_object_entry::add_input_section): Build list of input
6411 sections with map to original shndx.
6412 (Incremental_object_entry::get_input_section_index): New function.
6413 (Incremental_object_entry::shndx_): New data member.
6414 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6415 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6416 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6417 serial number.
6418 (Incremental_inputs::report_archive_begin): Likewise.
6419 (Incremental_inputs::report_object): Likewise.
6420 (Incremental_inputs::report_script): Likewise.
6421 (class Incremental_global_symbol_reader): New class.
6422 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6423 and store flags and input file type.
6424 (Incremental_input_entry_reader::arg_serial): New function.
6425 (Incremental_input_entry_reader::type): Extract type from flags.
6426 (Incremental_input_entry_reader::is_in_system_directory): New function.
6427 (Incremental_input_entry_reader::get_input_section_count): Call
6428 accessor function for type.
6429 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6430 function for type; adjust size of global symbol entry.
6431 (Incremental_input_entry_reader::get_global_symbol_count): Call
6432 accessor function for type.
6433 (Incremental_input_entry_reader::get_object_count): Likewise.
6434 (Incremental_input_entry_reader::get_object_offset): Likewise.
6435 (Incremental_input_entry_reader::get_member_count): Likewise.
6436 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6437 (Incremental_input_entry_reader::get_member_offset): Likewise.
6438 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6439 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6440 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6441 (Incremental_input_entry_reader::get_global_symbol_reader): New
6442 function.
6443 (Incremental_input_entry_reader::get_output_symbol_index): New
6444 function.
6445 (Incremental_input_entry_reader::type_): Remove.
6446 (Incremental_input_entry_reader::flags_): New data member.
6447 (Incremental_inputs_reader::input_file_offset): New function.
6448 (Incremental_inputs_reader::input_file_index): New function.
6449 (Incremental_inputs_reader::input_file): Call input_file_offset.
6450 (Incremental_inputs_reader::input_file_at_offset): New function.
6451 (Incremental_relocs_reader::get_r_type): Reformat.
6452 (Incremental_relocs_reader::get_r_shndx): Reformat.
6453 (Incremental_relocs_reader::get_r_offset): Reformat.
6454 (Incremental_relocs_reader::data): New function.
6455 (Incremental_binary::Incremental_binary): Initialize new data members.
6456 (Incremental_binary::check_inputs): Add cmdline parameter.
6457 (Incremental_binary::file_is_unchanged): Remove.
6458 (Input_reader::arg_serial): New function.
6459 (Input_reader::get_unused_symbol_count): New function.
6460 (Input_reader::get_unused_symbol): New function.
6461 (Input_reader::do_arg_serial): New function.
6462 (Input_reader::do_get_unused_symbol_count): New function.
6463 (Input_reader::do_get_unused_symbol): New function.
6464 (Incremental_binary::input_file_count): New function.
6465 (Incremental_binary::get_input_reader): Change signature to use
6466 index instead of filename.
6467 (Incremental_binary::file_has_changed): New function.
6468 (Incremental_binary::get_input_argument): New function.
6469 (Incremental_binary::get_library): New function.
6470 (Incremental_binary::get_script_info): New function.
6471 (Incremental_binary::init_layout): New function.
6472 (Incremental_binary::reserve_layout): New function.
6473 (Incremental_binary::output_file): New function.
6474 (Incremental_binary::do_check_inputs): New function.
6475 (Incremental_binary::do_file_is_unchanged): Remove.
6476 (Incremental_binary::do_file_has_changed): New function.
6477 (Incremental_binary::do_init_layout): New function.
6478 (Incremental_binary::do_reserve_layout): New function.
6479 (Incremental_binary::do_input_file_count): New function.
6480 (Incremental_binary::do_get_input_reader): Change signature.
6481 (Incremental_binary::input_args_map_): New data member.
6482 (Incremental_binary::library_map_): New data member.
6483 (Incremental_binary::script_map_): New data member.
6484 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6485 new data members.
6486 (Sized_incremental_binary::output_section): New function.
6487 (Sized_incremental_binary::inputs_reader): Add const.
6488 (Sized_incremental_binary::symtab_reader): Add const.
6489 (Sized_incremental_binary::relocs_reader): Add const.
6490 (Sized_incremental_binary::got_plt_reader): Add const.
6491 (Sized_incremental_binary::get_symtab_view): New function.
6492 (Sized_incremental_binary::Inputs_reader): New typedef.
6493 (Sized_incremental_binary::Input_entry_reader): New typedef.
6494 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6495 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6496 (Sized_incremental_binary::do_file_has_changed): New function.
6497 (Sized_incremental_binary::do_init_layout): New function.
6498 (Sized_incremental_binary::do_reserve_layout): New function.
6499 (Sized_input_reader::Inputs_reader): Remove.
6500 (Sized_input_reader::Input_entry_reader): Remove.
6501 (Sized_input_reader::do_arg_serial): New function.
6502 (Sized_input_reader::do_get_unused_symbol_count): New function.
6503 (Sized_input_reader::do_get_unused_symbol): New function.
6504 (Sized_incremental_binary::do_input_file_count): New function.
6505 (Sized_incremental_binary::do_get_input_reader): Change signature;
6506 use index instead of filename.
6507 (Sized_incremental_binary::section_map_): New data member.
6508 (Sized_incremental_binary::input_entry_readers_): New data member.
6509 (class Sized_incr_relobj): New class.
6510 (class Sized_incr_dynobj): New class.
6511 (make_sized_incremental_object): New function.
6512 (class Incremental_library): New class.
6513 * layout.cc (Free_list::num_lists): New static data member.
6514 (Free_list::num_nodes): New static data member.
6515 (Free_list::num_removes): New static data member.
6516 (Free_list::num_remove_visits): New static data member.
6517 (Free_list::num_allocates): New static data member.
6518 (Free_list::num_allocate_visits): New static data member.
6519 (Free_list::init): New function.
6520 (Free_list::remove): New function.
6521 (Free_list::allocate): New function.
6522 (Free_list::dump): New function.
6523 (Free_list::print_stats): New function.
6524 (Layout_task_runner::run): Resize output file for incremental updates.
6525 (Layout::Layout): Initialize new data members.
6526 (Layout::set_incremental_base): New function.
6527 (Layout::init_fixed_output_section): New function.
6528 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6529 incremental updates.
6530 (Layout::create_gold_note): Do not create gold note section for
6531 incremental updates.
6532 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6533 for incremental updates.
6534 (Layout::set_section_offsets): For incremental updates, allocate space
6535 from free list.
6536 (Layout::create_symtab_sections): Layout with offsets relative to
6537 start of section; for incremental updates, allocate space from free
6538 list.
6539 (Layout::create_shdrs): For incremental updates, allocate space from
6540 free list.
6541 (Layout::finish_dynamic_section): For incremental updates, do not
6542 check --as-needed (fixed in subsequent patch).
6543 * layout.h (class Free_list): New class.
6544 (Layout::set_incremental_base): New function.
6545 (Layout::incremental_base): New function.
6546 (Layout::init_fixed_output_section): New function.
6547 (Layout::allocate): New function.
6548 (Layout::incremental_base_): New data member.
6549 (Layout::free_list_): New data member.
6550 * main.cc (main): Print Free_list statistics.
6551 * object.cc (Relobj::finalize_incremental_relocs): Add
6552 clear_counts parameter; clear counts only when clear_counts is set.
6553 (Sized_relobj::Sized_relobj): Initialize new base class.
6554 (Sized_relobj::do_layout): Don't report special sections.
6555 (Sized_relobj::do_for_all_local_got_entries): New function.
6556 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6557 symtab_off to all symbol table offsets.
6558 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6559 * object.h (class Got_offset_list): Move to top of file.
6560 (Object::Object): Allow case where input_file == NULL.
6561 (Object::~Object): Likewise.
6562 (Object::input_file): Assert that input_file != NULL.
6563 (Object::lock): Allow case where input_file == NULL.
6564 (Object::unlock): Likewise.
6565 (Object::is_locked): Likewise.
6566 (Object::token): Likewise.
6567 (Object::release): Likewise.
6568 (Object::is_incremental): New function.
6569 (Object::get_mtime): New function.
6570 (Object::for_all_local_got_entries): New function.
6571 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6572 (Object::set_is_in_system_directory): New function.
6573 (Object::is_in_system_directory): New function.
6574 (Object::do_is_incremental): New function.
6575 (Object::do_get_mtime): New function.
6576 (Object::do_for_all_local_got_entries): New function.
6577 (Object::is_in_system_directory_): New data member.
6578 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6579 (class Sized_relobj_base): New class.
6580 (class Sized_relobj): Derive from Sized_relobj_base.
6581 (class Sized_relobj::Symbols): Redeclare from base class.
6582 (class Sized_relobj::local_got_offset_list): Remove.
6583 (class Sized_relobj::Output_sections): Redeclare from base class.
6584 (class Sized_relobj::do_for_all_local_got_entries): New function.
6585 (class Sized_relobj::write_local_symbols): Add offset parameter.
6586 (class Sized_relobj::local_symbol_offset_): Update comment.
6587 (class Sized_relobj::local_dynsym_offset_): Update comment.
6588 * options.cc (Input_arguments::add_file): Remove const.
6589 * options.h (Input_file_argument::Input_file_argument):
6590 Initialize arg_serial_ (all constructors).
6591 (Input_file_argument::set_arg_serial): New function.
6592 (Input_file_argument::arg_serial): New function.
6593 (Input_file_argument::arg_serial_): New data member.
6594 (Input_arguments::Input_arguments): Initialize file_count_.
6595 (Input_arguments::add_file): Remove const.
6596 (Input_arguments::number_of_input_files): New function.
6597 (Input_arguments::file_count_): New data member.
6598 (Command_line::number_of_input_files): Call
6599 Input_arguments::number_of_input_files.
6600 * output.cc (Output_segment_headers::Output_segment_headers):
6601 Set current size.
6602 (Output_section::Input_section::current_data_size): New function.
6603 (Output_section::Output_section): Initialize new data members.
6604 (Output_section::add_input_section): Don't do merge sections for
6605 an incremental link; allocate space from free list for an
6606 incremental update.
6607 (Output_section::add_output_section_data): Allocate space from
6608 free list for an incremental update.
6609 (Output_section::update_data_size): New function.
6610 (Output_section::set_fixed_layout): New function.
6611 (Output_section::reserve): New function.
6612 (Output_segment::set_section_addresses): Remove const.
6613 (Output_segment::set_section_list_addresses): Remove const; allocate
6614 space from free list for an incremental update.
6615 (Output_segment::set_offset): Adjust size of RELRO segment for an
6616 incremental update.
6617 * output.h (Output_data::current_data_size): Move here from
6618 child classes.
6619 (Output_data::pre_finalize_data_size): New function.
6620 (Output_data::update_data_size): New function.
6621 (Output_section_headers::update_data_size): new function.
6622 (Output_section_data_build::current_data_size): Move to Output_data.
6623 (Output_data_strtab::update_data_size): New function.
6624 (Output_section::current_data_size): Move to Output_data.
6625 (Output_section::set_fixed_layout): New function.
6626 (Output_section::has_fixed_layout): New function.
6627 (Output_section::reserve): New function.
6628 (Output_section::update_data_size): New function.
6629 (Output_section::has_fixed_layout_): New data member.
6630 (Output_section::free_list_): New data member.
6631 (Output_segment::set_section_addresses): Remove const.
6632 (Output_segment::set_section_list_addresses): Remove const.
6633 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6634 New function.
6635 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6636 New function.
6637 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6638 parameter when calling Add_symbols constructor; store argument
6639 serial number for members of a lib group.
6640 (Add_symbols::locks): Allow case where token == NULL.
6641 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6642 (Read_member::~Read_member): New function.
6643 (Read_member::is_runnable): New function.
6644 (Read_member::locks): New function.
6645 (Read_member::run): New function.
6646 (Check_script::~Check_script): New function.
6647 (Check_script::is_runnable): New function.
6648 (Check_script::locks): New function.
6649 (Check_script::run): New function.
6650 (Check_library::~Check_library): New function.
6651 (Check_library::is_runnable): New function.
6652 (Check_library::locks): New function.
6653 (Check_library::run): New function.
6654 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6655 (Add_symbols::library_): New data member.
6656 (class Read_member): New class.
6657 (class Check_script): New class.
6658 (class Check_library): New class.
6659 * reloc.cc (Read_relocs::is_runnable): Allow case where
6660 token == NULL.
6661 (Read_relocs::locks): Likewise.
6662 (Scan_relocs::locks): Likewise.
6663 (Relocate_task::locks): Likewise.
6664 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6665 to clear counters.
6666 (Sized_relobj::incremental_relocs_scan): Fix comment.
6667 (Sized_relobj::do_relocate): Pass output file offset to
6668 write_local_symbols.
6669 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6670 from class declaration.
6671 * script.cc (read_input_script): Allocate Script_info; pass
6672 argument serial number to report_script.
6673 * script.h (class Script_info): Move to incremental.h.
6674 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6675 * symtab.h (Symbol_table::add_from_incrobj): New function.
6676 (Symbol_table::set_file_offset): New function.
6677
b961d0d7
CC
66782011-04-05 Cary Coutant <ccoutant@google.com>
6679
6680 * incremental-dump.cc (dump_incremental_inputs): Change signature
6681 to take a Sized_incremental_binary; change caller. Use readers
6682 in Sized_incremental_binary.
6683 * incremental.cc
6684 (Sized_incremental_binary::find_incremental_inputs_sections):
6685 Rename do_find_incremental_inputs_sections to this.
6686 (Sized_incremental_binary::setup_readers): New function.
6687 (Sized_incremental_binary::do_check_inputs): Check
6688 has_incremental_info_ flag; move setup code to setup_readers;
6689 use input readers.
6690 (Sized_incremental_binary::do_file_is_unchanged): New function.
6691 (Sized_incremental_binary::do_get_input_reader): New function.
6692 * incremental.h (class Incremental_binary): Move to end of file.
6693 (Incremental_binary::file_is_unchanged): New function.
6694 (Incremental_binary::do_file_is_unchanged): New function.
6695 (Incremental_binary::Input_reader): New class.
6696 (Incremental_binary::get_input_reader): New function.
6697 (class Sized_incremental_binary): Move to end of file.
6698 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6699 input section reader classes.
6700 (Sized_incremental_binary::has_incremental_info): New function.
6701 (Sized_incremental_binary::inputs_reader): New function.
6702 (Sized_incremental_binary::symtab_reader): New function.
6703 (Sized_incremental_binary::relocs_reader): New function.
6704 (Sized_incremental_binary::got_plt_reader): New function.
6705 (Sized_incremental_binary::do_file_is_unchanged): New function.
6706 (Sized_incremental_binary::Sized_input_reader): New class.
6707 (Sized_incremental_binary::get_input_reader): New function.
6708 (Sized_incremental_binary::find_incremental_inputs_sections):
6709 Rename do_find_incremental_inputs_sections to this.
6710 (Sized_incremental_binary::setup_readers): New function.
6711 (Sized_incremental_binary::has_incremental_info_): New data member.
6712 (Sized_incremental_binary::inputs_reader_): New data member.
6713 (Sized_incremental_binary::symtab_reader_): New data member.
6714 (Sized_incremental_binary::relocs_reader_): New data member.
6715 (Sized_incremental_binary::got_plt_reader_): New data member.
6716 (Sized_incremental_binary::current_input_file_): New data member.
6717
a869183f
PP
67182011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6719
6720 PR gold/12640
6721 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6722 violation.
6723
67242011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
6725
6726 * archive.cc (Archive::include_member): Adjust call to report_object.
6727 (Add_archive_symbols::run): Add script_info to call to
6728 report_archive_begin.
6729 (Lib_group::include_member): Adjust call to report_object.
6730 (Add_lib_group_symbols::run): Adjust call to report_object.
6731 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6732 blocks. Add object count for script input files.
6733 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6734 script_info parameter; change all callers.
6735 (Incremental_inputs::report_object): Add script_info parameter;
6736 change all callers.
6737 (Incremental_inputs::report_script): Store backpointer to
6738 incremental info entry.
6739 (Output_section_incremental_inputs::set_final_data_size): Record
6740 additional information for scripts.
6741 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6742 * incremental.h (Incremental_script_entry::add_object): New function.
6743 (Incremental_script_entry::get_object_count): New function.
6744 (Incremental_script_entry::get_object): New function.
6745 (Incremental_script_entry::objects_): New data member; adjust
6746 constructor.
6747 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6748 (Incremental_inputs::report_object): Add script_info parameter.
6749 (Incremental_inputs_reader::get_object_count): New function.
6750 (Incremental_inputs_reader::get_object_offset): New function.
6751 * options.cc (Input_arguments::add_file): Return reference to
6752 new input argument.
6753 * options.h (Input_argument::set_script_info): New function.
6754 (Input_argument::script_info): New function.
6755 (Input_argument::script_info_): New data member; adjust all
6756 constructors.
6757 (Input_file_group::add_file): Return reference to new input argument.
6758 (Input_file_lib::add_file): Likewise.
6759 (Input_arguments::add_file): Likewise.
6760 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6761 * script.cc (Parser_closure::Parser_closure): Add script_info
6762 parameter; adjust all callers.
6763 (Parser_closure::script_info): New function.
6764 (Parser_closure::script_info_): New data member.
6765 (read_input_script): Report scripts earlier to incremental info.
6766 (script_add_file): Set script_info in Input_argument.
6767 (script_add_library): Likewise.
6768 * script.h (Script_options::Script_info): Rewrite class.
6769
a869183f 67702011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
6771
6772 * archive.cc (Library_base::should_include_member): Move
6773 method here from class Archive.
6774 (Archive::Archive): Initialize base class.
6775 (Archive::should_include_member): Move to base class.
6776 (Archive::do_for_all_unused_symbols): New function.
6777 (Add_archive_symbols::run): Remove redundant access to
6778 incremental_inputs.
6779 (Lib_group::Lib_group): Initialize base class.
6780 (Lib_group::do_filename): New function.
6781 (Lib_group::include_member): Pass pointer to Lib_group to
6782 report_object.
6783 (Lib_group::do_for_all_unused_symbols): New function.
6784 (Add_lib_group_symbols::run): Report archive information for
6785 incremental links.
6786 * archive.h (class Library_base): New base class.
6787 (class Archive): Derive from Library_base.
6788 (Archive::filename): Move to base class.
6789 (Archive::set_incremental_info): Likewise.
6790 (Archive::incremental_info): Likewise.
6791 (Archive::Should_include): Likewise.
6792 (Archive::should_include_member): Likewise.
6793 (Archive::Armap_entry): Remove.
6794 (Archive::Unused_symbol_iterator): Remove.
6795 (Archive::unused_symbols_begin): Remove.
6796 (Archive::unused_symbols_end): Remove.
6797 (Archive::do_filename): New function.
6798 (Archive::do_get_mtime): New function.
6799 (Archive::do_for_all_unused_symbols): New function.
6800 (Archive::task_): Move to base class.
6801 (Archive::incremental_info_): Likewise.
6802 (class Lib_group): Derive from Library_base.
6803 (Lib_group::do_filename): New function.
6804 (Lib_group::do_get_mtime): New function.
6805 (Lib_group::do_for_all_unused_symbols): New function.
6806 (Lib_group::task_): Move to base class.
6807 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6808 function.
6809 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6810 function.
6811 * incremental.cc (Incremental_inputs::report_archive_begin):
6812 Use Library_base; call library's get_mtime; add incremental inputs
6813 entry before members.
6814 (class Unused_symbol_visitor): New class.
6815 (Incremental_inputs::report_archive_end): Use Library_base; use
6816 visitor class to record unused symbols; don't add incremental inputs
6817 entry after members.
6818 (Incremental_inputs::report_object): Use Library_base.
6819 * incremental.h
6820 (Incremental_archive_entry::Incremental_archive_entry): Remove
6821 unused Archive parameter.
6822 (Incremental_inputs::report_archive_begin): Use Library_base.
6823 (Incremental_inputs::report_archive_end): Likewise.
6824 (Incremental_inputs::report_object): Likewise.
6825 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6826 function.
6827 * object.h (Object::for_all_global_symbols): New function.
6828 (Object::do_for_all_global_symbols): New function.
6829 (Sized_relobj::do_for_all_global_symbols): New function.
6830 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6831 function.
6832 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6833 function.
6834
61ab3e40
ILT
68352011-03-27 Ian Lance Taylor <iant@google.com>
6836
6837 * archive.cc (Archive::interpret_header): Return -1 if something
6838 goes wrong. Change callers accordingly.
6839
30e1f9e6
CC
68402011-03-25 Cary Coutant <ccoutant@google.com>
6841
6842 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6843 * testsuite/Makefile.in: Regenerate.
6844
9370ce59 68452011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
6846
6847 * plugin.cc (get_view): New.
6848 (Plugin::load): Pass get_view to the plugin.
6849 (Plugin_manager::get_view): New.
6850
9312bb0a
ILT
68512011-03-21 Ian Lance Taylor <iant@google.com>
6852
6853 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 6854 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 6855
7e12ba9e
ST
68562011-03-21 Sriraman Tallam <tmsriram@google.com>
6857
6858 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6859 Change == to -eq.
6860 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6861 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6862 Change == to -eq.
6863 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6864 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6865
fd7a005d
ILT
68662011-03-14 Ian Lance Taylor <iant@google.com>
6867
6868 * script-sections.cc (Sort_output_sections::script_compare):
6869 Rename from is_before, change return type.
6870 (Sort_output_sections::operator()): Adjust accordingly.
6871
ed16fd1b
ILT
68722011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6873
6874 PR gold/12572
6875 * testsuite/odr_violation2.cc: Add comment to make all error line
6876 numbers double digits.
6877 * testsuite/debug_msg.sh: Adjust expected errors.
6878
71ff8986
ILT
68792011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6880
6881 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6882 but mark earlier ones as non-canonical
6883 (offset_to_iterator): Update search target and example
6884 (do_addr2line): Return extra lines in a vector*
6885 (format_file_lineno): Extract from do_addr2line
6886 (one_addr2line): Add vector* out-param
6887 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6888 when a lineno entry appeared last for its instruction
6889 (Dwarf_line_info): Add vector* out-param
6890 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6891 * symtab.cc (Odr_violation_compare): Include the lineno in the
6892 comparison again.
6893 (linenos_from_loc): New. Combine the canonical line for an
6894 address with its other lines.
6895 (True_if_intersect): New. Helper functor to make
6896 std::set_intersection a query.
6897 (detect_odr_violations): Compare sets of lines instead of just
6898 one line for each function. This became less deterministic, but
6899 has fewer false positives.
6900 * symtab.h: Declarations.
6901 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6902 mix an optimized and non-optimized object in the same binary
6903 (odr_violation2.so): Same.
6904 * testsuite/Makefile.in: Regenerate from Makefile.am.
6905 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6906 * testsuite/debug_msg.sh: Update line numbers and add
6907 assertions.
6908 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6909 non-optimized context.
6910 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6911 isn't inlined, and use OdrDerived in an optimized context.
6912 * testsuite/odr_header1.h: Defines OdrDerived, where
6913 optimization will change the
6914 first-instruction-in-the-destructor's file and line number.
6915 * testsuite/odr_header2.h: Defines OdrBase.
6916
a19fefdc
ILT
69172011-03-09 Ian Lance Taylor <iant@google.com>
6918
6919 * fileread.cc (File_read::clear_views): Don't delete the whole
6920 file view.
6921
ecb351e9
ILT
69222011-03-08 Ian Lance Taylor <iant@google.com>
6923
6924 PR gold/12525
6925 * fileread.cc: #include <climits>.
6926 (GOLD_IOV_MAX): Define.
6927 (File_read::read_multiple): Limit number of entries by iov_max.
6928 * fileread.h (class File_read): Always set max_readv_entries to
6929 128.
6930
b821d13c
ILT
69312011-03-07 Ian Lance Taylor <iant@google.com>
6932
6933 PR gold/12525
6934 * options.h (class General_options): Add -dy and -dn.
6935
89243142
CC
69362011-03-02 Cary Coutant <ccoutant@google.com>
6937
6938 * testsuite/script_test_9.t: Add TLS segment.
6939
d0773f31
ILT
69402011-03-02 Simon Baldwin <simonb@google.com>
6941
6942 * configure.ac: Add check for gnu_indirect_function support in
6943 the toolchain building binutils.
6944 * configure: Rebuild.
6945
9370ce59 69462011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
6947
6948 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6949 plugin only symbols.
6950 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6951 in plugin files as not needed in the symbol table.
6952
4cf7a849
ST
69532011-02-11 Sriraman Tallam <tmsriram@google.com>
6954
6955 * output.cc (Output_section::add_input_section): Delay fill
6956 generation for section ordering.
6957
b578bd7d
ILT
69582011-02-09 Ian Lance Taylor <iant@google.com>
6959
6960 PR gold/12316
6961 * object.h (class Sized_relobj): Remove clear_local_symbols.
6962 * reloc.cc (Sized_relobj::do_relocate): Don't call
6963 clear_local_symbols.
6964
9370ce59 69652011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
6966
6967 * plugin.cc (is_visible_from_outside): Return true for symbols
6968 in the -u option.
6969
55382fb7
ILT
69702011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6971
6972 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6973 filename.
6974
4e271fff
ST
69752011-02-02 Sriraman Tallam <tmsriram@google.com>
6976
6977 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 6978 to std::string.
4e271fff 6979 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 6980 section_name to be std::string.
4e271fff
ST
6981 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6982
d433c3ac
ILT
69832011-01-25 Ian Lance Taylor <iant@google.com>
6984
6985 * script.cc (script_add_extern): Rewrite to use
6986 add_symbol_reference.
6987
880473a6
DK
69882011-01-25 Doug Kwan <dougkwan@google.com>
6989
d433c3ac 6990 * icf.cc (get_section_contents): Always lock section's object.
880473a6 6991
f30f86fa
ILT
69922011-01-24 Ian Lance Taylor <iant@google.com>
6993
6994 * options.h (class General_options): Accept
6995 --no-detect-odr-violations.
6996
8e51a0b9
ILT
69972011-01-24 Ian Lance Taylor <iant@google.com>
6998
6999 * version.cc (version_string): Bump to 1.11.
7000
0f3b89d8
ILT
70012011-01-24 Ian Lance Taylor <iant@google.com>
7002
7003 * plugin.cc (class Plugin_rescan): Define new class.
7004 (Plugin_manager::claim_file): Set any_claimed_.
7005 (Plugin_manager::save_archive): New function.
7006 (Plugin_manager::save_input_group): New function.
7007 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
7008 necessary.
7009 (Plugin_manager::new_undefined_symbol): New function.
7010 (Plugin_manager::rescan): New function.
7011 (Plugin_manager::rescannable_defines): New function.
7012 (Plugin_manager::add_input_file): Set any_added_.
7013 * plugin.h (class Plugin_manager): define new fields rescannable_,
7014 undefined_symbols_, any_claimed_, and any_added_. Declare
7015 Plugin_rescan as friend. Declare new functions.
7016 (Plugin_manager::Rescannable): Define type.
7017 (Plugin_manager::Rescannable_list): Define type.
7018 (Plugin_manager::Undefined_symbol_list): Define type.
7019 (Plugin_manager::Plugin_manager): Initialize new fields.
7020 * archive.cc (Archive::defines_symbol): New function.
7021 (Add_archive_symbols::run): Pass archive to plugins if any.
7022 * archive.h (class Archive): Declare defines_symbol.
7023 * readsyms.cc (Input_group::~Input_group): New function.
7024 (Finish_group::run): Pass input_group to plugins if any.
7025 * readsyms.h (class Input_group): Declare destructor.
7026 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7027 any.
7028
3bb951e5
ILT
70292011-01-10 Ian Lance Taylor <iant@google.com>
7030
7031 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7032 section as relro.
7033 (Layout::set_segment_offsets): Reset increase_relro before calling
7034 set_section_addresses a second time.
7035
0aa45fac
CC
70362011-01-04 Cary Coutant <ccoutant@google.com>
7037
7038 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7039 sections before NOBITS sections.
7040
0db46eb4
L
70412011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7042
7043 * version.cc (print_version): Update copyright to 2011.
7044
829c9745
CC
70452010-12-23 Cary Coutant <ccoutant@google.com>
7046
7047 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7048 of OS to this->add. Add OD parameter to second form of the function.
7049
7500420b
ILT
70502010-12-20 Ian Lance Taylor <iant@google.com>
7051
7052 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7053 second of two consecutive entries with same offset.
7054
f8e9a930
RW
70552010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7056
7057 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7058 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7059 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7060 to avoid unneeded links against $(LDADD).
7061 * testsuite/Makefile.in: Regenerate.
7062
2fbb4320
ILT
70632010-12-15 Ian Lance Taylor <iant@google.com>
7064
7065 PR gold/12324
7066 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
7067 for R_X86_64_32 and R_X86_64_PC32.
7068 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7069 ver_matching_def_pic.o.
7070 (ver_matching_def_pic.o): New target.
7071
fedb228d
RW
70722010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7073
7074 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7075 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7076 Move definition before File_read::View member definitions.
7077 (File_read::View::~View): Initialize and hold lock before
7078 updating current_mapped_bytes.
7079
9b547ce6
RW
70802010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7081
7082 * dwarf_reader.cc: Remove outdated comment.
7083 * gold-threads.cc: Fix typo in error message.
7084 * archive.cc: Fix typos in comments.
7085 * archive.h: Likewise.
7086 * arm-reloc-property.cc: Likewise.
7087 * arm-reloc-property.h: Likewise.
7088 * arm-reloc.def: Likewise.
7089 * arm.cc: Likewise.
7090 * attributes.h: Likewise.
7091 * cref.cc: Likewise.
7092 * ehframe.cc: Likewise.
7093 * fileread.h: Likewise.
7094 * gold.h: Likewise.
7095 * i386.cc: Likewise.
7096 * icf.cc: Likewise.
7097 * incremental.h: Likewise.
7098 * int_encoding.cc: Likewise.
7099 * layout.h: Likewise.
7100 * main.cc: Likewise.
7101 * merge.h: Likewise.
7102 * object.cc: Likewise.
7103 * object.h: Likewise.
7104 * options.cc: Likewise.
7105 * readsyms.cc: Likewise.
7106 * reduced_debug_output.cc: Likewise.
7107 * reloc.cc: Likewise.
7108 * script-sections.cc: Likewise.
7109 * sparc.cc: Likewise.
7110 * symtab.h: Likewise.
7111 * target-reloc.h: Likewise.
7112 * target.cc: Likewise.
7113 * target.h: Likewise.
7114 * timer.cc: Likewise.
7115 * timer.h: Likewise.
7116 * x86_64.cc: Likewise.
7117
83e17bd5
CC
71182010-12-09 Cary Coutant <ccoutant@google.com>
7119
7120 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
7121 stack.
7122 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
7123 parameter; change all callers.
7124 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
7125 * options.h (warn_execstack): New option.
7126
017257f8
DK
71272010-12-07 Doug Kwan <dougkwan@google.com>
7128
7129 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
7130 like function call relocations.
7131
c20cbc06
ILT
71322010-12-07 Ian Lance Taylor <iant@google.com>
7133
7134 * archive.cc (Archive::get_elf_object_for_member): Permit
7135 punconfigured to be NULL.
7136 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7137 (Archive::include_member): Pass NULL to get_elf_object_for_member
7138 if we searched for the archive and this is the first included
7139 object.
7140
4dbfafcc
ILT
71412010-12-01 Ian Lance Taylor <iant@google.com>
7142
7143 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7144 track_relocs_type_ field.
7145 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7146 Set track_relocs_type_.
7147 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7148 contents when using RELA relocs.
7149 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7150 reloc_map_.
7151 * reloc.cc (Track_relocs::next_addend): New function.
7152 * reloc.h (class Track_relocs): Declare next_addend.
7153
e5e19edd
ILT
71542010-12-01 Ian Lance Taylor <iant@google.com>
7155
7156 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7157 virtual destructor.
7158
9a5ce24c
ILT
71592010-12-01 Ian Lance Taylor <iant@google.com>
7160
7161 * README: Update compilers known to work and fail.
7162
c7791212
NC
71632010-11-23 Matthias Klose <doko@ubuntu.com>
7164
7165 * configure.in: For --enable-gold, handle value `default' instead of
7166 `both*'. Always install ld as ld.bfd, install as ld if gold is
7167 not the default.
7168 * configure: Regenerate.
7169
0ad220c9
DK
71702010-11-18 Doug Kwan <dougkwan@google.com>
7171
7172 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7173 and right_alignment to be zero. Store result alignment only if it is
7174 greater than existing alignment.
7175
ab8056e0
CC
71762010-11-16 Cary Coutant <ccoutant@google.com>
7177
7178 PR gold/12220
7179 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7180 Check for ".zdebug_line".
7181
fd064a5b
CC
71822010-11-16 Doug Kwan <dougkwan@google.com>
7183 Cary Coutant <ccoutant@google.com>
7184
7185 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7186 by reference; adjust all callers.
7187 * output.cc (Output_segment::set_section_addresses): Adjust references
7188 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7189 list is empty.
7190 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7191 end at page boundary.
7192
6fc6ea19
CC
71932010-11-16 Cary Coutant <ccoutant@google.com>
7194
7195 PR gold/12220
7196 * layout.cc (Layout::choose_output_section): Transform names of
7197 compressed sections even when using a script with a SECTIONS clause.
7198 (Layout::output_section_name): Remove code to transform
7199 compressed debug section names.
7200 * output.cc (Output_section::add_input_section): Use uncompressed
7201 section size when tracking input sections.
7202
95a2c8d6
RS
72032010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7204
7205 * symtab.h (Symbol::NON_PIC_REF): Remove.
7206 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7207 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7208 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7209 (Symbol::use_plt_offset): Take a flags argument and pass it
7210 directly to needs_dynamic_reloc. Restrict check for undefined
7211 weak symbols to function calls.
7212 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7213 (Target_arm::Scan::global): Use it.
7214 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7215 (Target_arm::Relocate::relocate): Likewise.
7216 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7217 parameter with an r_type parameter. Use get_reference_flags
7218 to get the flags.
7219 (Target_arm::Relocate::relocate): Update accordingly.
7220 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7221 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7222 (Target_i386::Scan::global): Likewise.
7223 (Target_i386::Relocate::relocate): Likewise.
7224 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7225 parameter with an r_type parameter. Use get_reference_flags
7226 to get the flags.
7227 (Target_i386::Relocate::relocate): Update accordingly.
7228 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7229 (Target_powerpc::Scan::global): Use it.
7230 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7231 (Target_powerpc::Relocate::relocate): Likewise.
7232 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7233 (Target_sparc::Scan::global): Use it.
7234 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7235 (Target_sparc::Relocate::relocate): Likewise.
7236 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7237 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7238 (Target_x86_64::Scan::global): Likewise.
7239 (Target_x86_64::Relocate::relocate): Likewise.
7240
f625ae50
DK
72412010-11-08 Doug Kwan <dougkwan@google.com>
7242 Cary Coutant <ccoutant@google.com>
7243
7244 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7245 (Arm_exidx_merge_section::section_contents_): New data member.
7246 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7247 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 7248 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
7249 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7250 in parameters instead of calling Object::section_contents without
7251 locking.
7252 (Arm_output_section::group_section): New parameter TASK. Pass it
7253 to callees that need locking objects.
7254 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7255 to lock EXIDX input sections. Fix a formatting issue. Call
7256 Arm_exidx_merged_section::build_contents to create merged section
7257 contents.
7258 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7259 to lock object of stub table owner.
7260 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7261 TEXT_SIZE to initialize data member TEXT_SIZE_.
7262 (Arm_exidx_input_section::addralign): Fix typo in comment.
7263 (Arm_exidx_input_section::text_size): New method.
7264 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7265 that require locking objects. Lock objects before scanning for stubs
7266 and updating local symbols.
7267 (Arm_input_section<big_endian>::init): Copy contents of original
7268 input section.
2e702c99 7269 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
7270 original input section instead of calling Object::section_contents
7271 without locking.
7272 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7273 size without calling Object::section_size().
7274 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7275 for size. Allocate a buffer for merged EXIDX entries.
7276 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7277 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7278 building code to Arm_exidx_merged_section::build_contetns. Write
7279 out contetns in buffer instead of building it on the fly.
7280 (Arm_relobj::make_exidx_input_section): Also pass text section size
7281 to Arm_exidx_input_section constructor.
7282 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7283 (Arm_dynobj::do_read_symbols): Fix memory leak.
7284 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7285 * target.h: (class Task): Add forward declaration.
7286 (Target::relax): Add new parameter TASK and pass it to
7287 Target::do_relax().
7288 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7289
5f9bcf58
CC
72902010-11-05 Cary Coutant <ccoutant@google.com>
7291
7292 PR gold/10708
7293 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7294 object when reading from the file.
7295 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7296 second layout pass.
7297 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7298 when reading section contents.
7299 (get_section_contents): Likewise.
7300 (icf::find_identical_sections): Likewise.
7301 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7302 object when reading from the file.
7303 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7304 the object when doing deferred section layout.
7305
e597fa08
NC
73062010-11-03 Nick Clifton <nickc@redhat.com>
7307
7308 PR gold/12001
7309 * script.h (class Symbol_assignment: name): New member. Returns
7310 the name of the symbol.
7311 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7312 Returns true if the given symbol name is on the list of
7313 assignments wating to be processed.
7314 * archive.cc (should_incldue_member): If the symbol is undefined,
7315 check to see if it is on the list of symbols pending assignment.
7316
3f9a3278
ILT
73172010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7318
7319 * script-sections.cc (Script_sections::find_memory_region): Check
7320 for a NULL output section pointer.
7321
d06fb4d1
DK
73222010-10-29 Doug Kwan <dougkwan@google.com>
7323
7324 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7325 Output_section::add_relaxed_input_section.
7326 * output.cc (Output_section::add_relaxed_input_section): Add new
7327 arguments LAYOUT and NAME. Set section order index.
7328 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7329 Copy section order index.
7330 * output.h (Output_section::add_relaxed_input_section): Add new
7331 arguments LAYOUT and NAME.
7332
90e24de5
ILT
73332010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7334
7335 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7336 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7337 * testsuite/Makefile.in: Regenerate.
7338
c9484ea5
DK
73392010-10-20 Doug Kwan <dougkwan@google.com>
7340
7341 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7342 without SHF_LINK_ORDER flags.
7343 * layout.cc (Layout::choose_output_section): Do not filter
7344 SHF_LINK_ORDER flag in a relocatable link.
7345
5bc2f5be
CC
73462010-10-17 Cary Coutant <ccoutant@google.com>
7347
7348 * output.h (Output_segment::set_section_addresses): Change function
7349 signature. Update all callers.
7350 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7351 sections.
7352 (Output_segment::set_section_addresses): Align after last TLS
7353 section. Add padding before last relro section instead of after.
7354
0c91cf04
DK
73552010-10-17 Doug Kwan <dougkwan@google.com>
7356
7357 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7358 GOT output section to be writable.
7359
8c21d9d3
CC
73602010-10-14 Cary Coutant <ccoutant@google.com>
7361
7362 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7363 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7364 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7365 mode.
7366 * incremental.cc (report_command_line): Ignore all forms of
7367 --incremental.
7368 * layout.cc (Layout::Layout): Check parameters for incremental link
7369 mode.
7370 * options.cc (General_options::parse_incremental): New function.
7371 (General_options::parse_no_incremental): New function.
7372 (General_options::parse_incremental_full): New function.
7373 (General_options::parse_incremental_update): New function.
7374 (General_options::incremental_mode_): New data member.
7375 (General_options::finalize): Check incremental_mode_.
7376 * options.h (General_options): Update help text for --incremental.
7377 Add --no-incremental, --incremental-full, --incremental-update.
7378 (General_options::Incremental_mode): New enum type.
7379 (General_options::incremental_mode): New function.
7380 (General_options::incremental_mode_): New data member.
7381 * parameters.cc (Parameters::incremental_mode_): New data member.
7382 (Parameters::set_options): Set incremental_mode_.
7383 (Parameters::set_incremental_full): New function.
7384 (Parameters::incremental): New function.
7385 (Parameters::incremental_update): New function.
7386 (set_parameters_incremental_full): New function.
7387 * parameters.h (Parameters::set_incremental_full): New function.
7388 (Parameters::incremental): New function.
7389 (Parameters::incremental_update): New function.
7390 (Parameters::incremental_mode_): New data member.
7391 (set_parameters_incremental_full): New function.
7392 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7393 incremental link mode.
7394 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7395 (Sized_relobj::do_relocate_sections): Likewise.
7396 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7397 option.
7398 * testsuite/Makefile.in: Regenerate.
7399 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7400
bb32aa18 74012010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7402
7403 * script-sections.h (class Script_sections): Make
7404 Sections_elements typedef public.
7405 * script-sections.cc (class Sort_output_sections): Add elements_
7406 field. Add constructor which sets it; change all callers.
7407 (Sort_output_sections::is_before): New function.
7408 (Sort_output_sections::operator()): Call is_before.
7409 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7410 conditional.
7411 * testsuite/script_test_10.sh: New test. Test script section
7412 order.
7413 * testsuite/script_test_10.t: Likewise.
7414 * testsuite/script_test_10.s: Likewise.
7415 * testsuite/Makefile.am: Wrap the cross linker tests and the
7416 common tests into NATIVE_OR_CROSS_LINKER.
7417 (check_SCRIPTS): Add script_test_10.sh.
7418 (check_DATA): Add script_test_10.stdout.
7419 (script_test_10.o, script_test_10): New targets.
7420 (script_test_10.stdout): New target.
7421 * configure, testsuite/Makefile.in: Regenerate.
7422
3cef7179
ILT
74232010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7424
7425 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7426 error for the deprecated relocations.
7427 (Target_arm::Scan::global): Likewise.
7428 (Target_arm::Relocate::relocate): Likewise.
7429
7411e9a8
RS
74302010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7431
7432 * fileread.cc (Input_file::find_file): Initialize *found_name
7433 and *namep when using the fallback search for case 4.
7434
6a9da32a
CC
74352010-10-11 Cary Coutant <ccoutant@google.com>
7436
7437 * options.h (class General_options): Redefine -z lazy as an alias for
7438 the negation of -z now.
7439
ac897c20
ILT
74402010-10-11 Ian Lance Taylor <iant@google.com>
7441
7442 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7443 binding.
7444
ea5cae92
NC
74452010-10-06 Nick Clifton <nickc@redhat.com>
7446
7447 * script-sections.cc(class Memory_region): Remove
7448 current_lma_offset_ field. Rename current_vma_offset_ to
7449 current_offset_. Add last_section_ field.
7450 (Memory_region::get_current_vma_address): Rename to
7451 get_current_address.
7452 (Memory_region::get_current_lma_address): Delete.
7453 (Memory_region::increment_vma_offset): Rename to
7454 increment_offset.
7455 (Memory_region::increment_lma_offset): Delete.
7456 (Memory_region::attributes_compatible): New method. Returns
7457 true if the provided section is compatible with the region.
7458 (Memory_region::get_last_section): New method. Returns the last
7459 section to use the region.
7460 (Memory_region::set_last_section): New method. Stores the last
7461 section to use the region.
7462 (Script_sections::block_in_region): New method. Returns true if
7463 a block of memory is contained within a region.
7464 (Script_sections::find_memory_region): New method. Locates a
7465 memory region to be used to set a VMA or LMA address.
7466 (Output_section_definition::set_section_addresses): Add code to
7467 check for addresses set by memory regions.
7468 (Output_segment::set_section_addresses): Remove memory region
7469 walking code.
7470 (Script_sections::create_segment): Add a warning if a header
7471 segment is created outside of any region.
7472 * script-sections.h (class Script_sections): Add prototypes for
7473 find_memory_region and block_in_region methods.
7474 * testsuite/memory_test.s: Use .long instead of .word.
7475 * testsuite/memory_test.t: Add some more output sections.
7476 * testsuite/memory_test.sh: Update expected output.
7477
a9bfd952
DK
74782010-10-02 Doug Kwan <dougkwan@google.com>
7479
7480 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7481 defintion to symtab.h
7482 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7483 declaration to defintion.
7484
bacff3ab
NC
74852010-10-01 Nick Clifton <nickc@redhat.com>
7486
7487 * expression.cc (eval): Replace dummy argument with NULL.
7488 (eval_maybe_dot): Check for a NULL result section pointer.
7489 (Symbol_expression::value): Likewise.
7490 (Dot_expression::value): Likewise.
7491 (BINARY_EXPRESSION): Likewise.
7492 (Max_expression::value): Likewise.
7493 (Min_expression::value): Likewise.
7494 (Absolute_expression::value): Likewise.
7495 (Addr_expression::value_from_output_section): Likewise.
7496 (Loaddddr_expression::value_from_output_section): Likewise.
7497 (Segment_start_expression::value): Likewise.
7498 * script-sections.cc
7499 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7500 argument with NULL.
7501 (Sections_elememt_dot_assignment::set_section_addresses):
7502 Likewise.
7503 (Output_data_expression::do_write_to_buffer): Likewise.
7504 (Output_section_definition::finalize_symbols): Likewise.
7505 (Output_section_definition::set_section_addresses): Likewise.
7506
f81bc8b5
DK
75072010-09-30 Doug Kwan <dougkwan@google.com>
7508
7509 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7510
c95e9f27
ST
75112010-09-28 Sriraman Tallam <tmsriram@google.com>
7512
7513 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 7514 function.
c95e9f27
ST
7515 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7516 virtual function.
7517 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7518 virtual function.
7519 * icf.cc (get_section_contents): Inline merge sections only when
7520 target allows it.
7521
3cac54d2
RW
75222010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7523
7524 * configure: Regenerate.
7525
2904037a
ILT
75262010-09-17 Ian Lance Taylor <iant@google.com>
7527
7528 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7529 * testsuite/Makefile.am (memory_test.o): New target.
7530 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7531 memory_test.t.
7532 * testsuite/Makefile.in: Rebuild.
2904037a 7533
bca7fb63
DK
75342010-09-17 Doug Kwan <dougkwan@google.com>
7535
7536 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7537 defintion if relocation uses GOT entries of the symbol.
7538 * testsuite/icf_safe_test.sh: Fix test.
7539 * testsuite/icf_safe_so_test.sh: Fix test.
7540
4ef28648
CC
75412010-09-16 Cary Coutant <ccoutant@google.com>
7542
7543 * script_sections.cc (class Memory_region): Remove "NULL" from
7544 vector initializations.
7545
793990de
CC
75462010-09-15 Cary Coutant <ccoutant@google.com>
7547
7548 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7549 Resolve forwarding symbols.
7550
81e015e2
DK
75512010-09-15 Doug Kwan <dougkwan@google.com>
7552
7553 * gold/testsuite/script_test_3.t: Add ARM special sections.
7554 * gold/testsuite/script_test_4.t: Same.
7555 * gold/testsuite/script_test_5.t: Same.
7556 * gold/testsuite/script_test_6.t: Same.
7557 * gold/testsuite/script_test_7.t: Same.
7558 * gold/testsuite/script_test_7.t: Same.
7559 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7560
36171d64
CC
75612010-09-14 Cary Coutant <ccoutant@google.com>
7562
7563 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7564 (Target_x86_64::Relocate::relocate_tls): Replace check for
7565 saw_tls_block_reloc_ with test for executable section.
7566
d89051bd
CC
75672010-09-12 Cary Coutant <ccoutant@google.com>
7568
7569 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7570 position-independent executables to shared libraries need dynamic
7571 relocations.
7572 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7573 position-independent executables.
7574 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7575 * testsuite/Makefile.in: Regenerate.
7576
fca41f0f
NC
75772010-09-10 Nick Clifton <nickc@redhat.com>
7578
7579 PR gold/11997
7580 * testsuite/memory_test.t: Discard any sections that are not
7581 needed.
7582
6695e4b3
L
75832010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7584
7585 PR gold/11996
7586 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7587 "This::" to work around a bug in gcc 4.2.
7588
7589 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7590
0f72bf6f
RÁE
75912010-09-09 Rafael Espindola <espindola@google.com>
7592
7593 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7594 sections with different PF_X flags in the same segment.
7595 (Layout::find_first_load_seg): Search all segments to find the first
7596 one.
7597 * options.h (rosegment): New.
7598
75992010-09-08 Rafael Espindola <espindola@google.com>
a6577478 7600
05a79166 7601 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 7602
aa98ff75
DK
76032010-09-08 Doug Kwan <dougkwan@google.com>
7604
7605 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7606 (Arm_relobj::do_relocate_sections): Add new parameter for output
7607 file to match the parent.
7608 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7609 of local symbols instead of input values. Update code to track
7610 changes in gold::relocate_section.
7611 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7612 (Sized_relobj::compute_final_local_value_internal): New methods.
7613 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7614 body into private version of Sized_relobj::compute_final_local_value.
7615 Call the inline method.
7616 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7617 merged symbol value if there is one.
7618 (Symbol_value::has_output_value): New method defintiion.
7619 (Sized_relobj::Compute_final_local_value_status): New enum type.
7620 (Sized_relobj::compute_final_local_value): New methods.
7621 (Sized_relobj::compute_final_local_value_internal): New methods.
7622 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7623 and arm_cortex_a8.sh.
7624 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7625 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7626 New tests.
7627 * Makefile.in: Regenerate.
7628 * testsuite/arm_bl_out_of_range.s: Update test.
7629 * testsuite/thumb_bl_out_of_range.s: Ditto.
7630 * testsuite/thumb_blx_out_of_range.s: Ditto.
7631 * testsuite/arm_branch_out_of_range.sh: New file.
7632 * testsuite/arm_cortex_a8.sh: Ditto.
7633 * testsuite/arm_cortex_a8_b.s: Ditto.
7634 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7635 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7636 * testsuite/arm_cortex_a8_bl.s: Ditto.
7637 * testsuite/arm_cortex_a8_blx.s: Ditto.
7638 * testsuite/arm_cortex_a8_local.s: Ditto.
7639 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7640 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7641
05a79166
L
76422010-09-08 Rafael Espindola <espindola@google.com>
7643
7644 * Makefile.am (memory_test.stdout): Run readelf with -W.
7645 * Makefile.in: Regenerate.
7646 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7647 64 bit output.
7648
33dbc701
RÁE
76492010-09-08 Rafael Espindola <espindola@google.com>
7650
7651 * script-sections.cc (Script_sections::add_memory_region): Convert
7652 field precision to int.
7653 * script.cc (script_set_section_region, script_set_section_region):
7654 Convert field precision to int.
7655
731ca54a
RÁE
76562010-09-08 Rafael Espindola <espindola@google.com>
7657
7658 * arm.cc (do_finalize_sections): Create the __exidx_start and
7659 __exdix_end symbols even when the section is missing.
7660
7f8cd844
NC
76612010-09-08 Nick Clifton <nickc@redhat.com>
7662
7663 * README: Remove claim that MEMORY is not supported.
7664 * expression.cc (script_exp_function_origin)
7665 (script_exp_function_length): Move from here to ...
7666 * script.cc: ... here.
7667 (script_set_section_region, script_add_memory)
7668 (script_parse_memory_attr, script_include_directive): New
7669 functions.
7670 * script-sections.cc
7671 (class Memory_region): New class.
7672 (class Output_section_definition): Add set_memory_region,
7673 set_section_vma, set_section_lma and get_section_name methods.
7674 (class Script_Sections): Add add_memory_region,
7675 find_memory_region, find_memory_region_origin,
7676 find_memory_region_length and set_memory_region methods.
7677 Have set_section_addresses method walk the list of set memory
7678 regions.
7679 Extend the print methos to display memory regions.
7680 * script-sections.h: Add prototypes for new methods.
7681 Add enum for MEMORY region attributes.
7682 * yyscript.y: Add support for parsing MEMORY regions.
7683 * script-c.h: Add prototypes for new functions.
7684 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7685 * testsuite/Makefile.in: Regenerate.
7686 * testsuite/memory_test.sh: New script.
7687 * testsuite/memory_test.s: New assembler source file.
7688 * testsuite/memory_test.t: New linker script.
7689
a4649286
DK
76902010-08-27 Doug Kwan <dougkwan@google.com>
7691
7692 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7693 reference override an existing dynamic weak reference.
7694 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7695 * testsuite/Makefile.in: Regenerate.
7696 * testsuite/dyn_weak_ref.sh: New file.
7697 * testsuite/dyn_weak_ref_1.c: Ditto.
7698 * testsuite/dyn_weak_ref_2.c: Ditto.
7699
b56648ad
ILT
77002010-08-27 Ian Lance Taylor <iant@google.com>
7701
7702 * incremental.h (class Incremental_input_entry): Add virtual
7703 destructor.
7704
809313cb
ILT
77052010-08-27 Ian Lance Taylor <iant@google.com>
7706
7707 * testsuite/start_lib_test_3.c: Mark t3 as used.
7708
11e32464
NC
77092010-08-27 Nick Clifton <nickc@redhat.com>
7710
7711 * options.cc (version_script): Fix small typo in previous
7712 whitespace tidyup.
7713
ca09d69a
NC
77142010-08-25 Nick Clifton <nickc@redhat.com>
7715
7716 * archive.cc: Formatting fixes: Remove whitespace between
7717 typename and following asterisk. Remove whitespace between
7718 function name and opening parenthesis.
7719 * archive.h: Likewise.
7720 * arm.cc: Likewise.
7721 * attributes.cc: Likewise.
7722 * attributes.h: Likewise.
7723 * common.cc: Likewise.
7724 * copy-relocs.cc: Likewise.
7725 * dirsearch.h: Likewise.
7726 * dynobj.cc: Likewise.
7727 * ehframe.cc: Likewise.
7728 * ehframe.h: Likewise.
7729 * expression.cc: Likewise.
7730 * fileread.cc: Likewise.
7731 * fileread.h: Likewise.
7732 * gc.h: Likewise.
7733 * gold-threads.cc: Likewise.
7734 * gold.cc: Likewise.
7735 * i386.cc: Likewise.
7736 * icf.h: Likewise.
7737 * incremental-dump.cc: Likewise.
7738 * incremental.cc: Likewise.
7739 * layout.cc: Likewise.
7740 * layout.h: Likewise.
7741 * main.cc: Likewise.
7742 * merge.cc: Likewise.
7743 * merge.h: Likewise.
7744 * object.cc: Likewise.
7745 * object.h: Likewise.
7746 * options.cc: Likewise.
7747 * options.h: Likewise.
7748 * output.cc: Likewise.
7749 * output.h: Likewise.
7750 * plugin.cc: Likewise.
7751 * plugin.h: Likewise.
7752 * powerpc.cc: Likewise.
7753 * reloc.cc: Likewise.
7754 * script-c.h: Likewise.
7755 * script-sections.cc: Likewise.
7756 * script.cc: Likewise.
7757 * stringpool.cc: Likewise.
7758 * symtab.cc: Likewise.
7759 * symtab.h: Likewise.
7760 * target.cc: Likewise.
7761 * timer.cc: Likewise.
7762 * timer.h: Likewise.
7763 * version.cc: Likewise.
7764 * x86_64.cc: Likewise.
7765
b8fa8750
NC
77662010-08-24 Nick Clifton <nickc@redhat.com>
7767
7768 PR 11899
7769 * layout.cc (segment_precedes): Sort segments by their physical
7770 addresses, if they have been set.
7771
9919d93b
CC
77722010-08-23 Cary Coutant <ccoutant@google.com>
7773
7774 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7775 symbols data.
7776 (Lib_group::include_member): Unlock object after deleting its
7777 symbols data.
7778 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7779 the bug fixed here.
7780
97b4be1c
CC
77812010-08-19 Neil Vachharajani <nvachhar@google.com>
7782 Cary Coutant <ccoutant@google.com>
7783
7784 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7785 constructor, and set_blocker.
7786 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7787 readsyms_blocker_.
7788 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7789 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7790 * testsuite/Makefile.am (start_lib_test): New test case.
7791 * testsuite/Makefile.in: Regenerate.
7792 * testsuite/start_lib_test_main.c: New file.
7793 * testsuite/start_lib_test_1.c: New file.
7794 * testsuite/start_lib_test_2.c: New file.
7795 * testsuite/start_lib_test_3.c: New file.
7796
dd0b1884
ILT
77972010-08-19 Ian Lance Taylor <iant@google.com>
7798
7799 * Makefile.in: Rebuild with automake 1.11.1.
7800 * aclocal.m4: Likewise.
7801 * testsuite/Makefile.in: Likewise.
7802
7223e9ca
ILT
78032010-08-19 Ian Lance Taylor <iant@google.com>
7804
7805 PR 10893
7806 * i386.cc (class Output_data_plt_i386): Update declarations.
7807 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7808 local_ifuncs_ fields.
7809 (Target_i386::do_plt_section_for_global): New function.
7810 (Target_i386::do_plt_section_for_local): New function.
7811 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7812 parameter; change all callers. Initialize global_ifuncs_ and
7813 local_ifuncs_. If doing a static link define __rel_iplt_start and
7814 __rel_iplt_end.
7815 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7816 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7817 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7818 symbols.
7819 (Target_i386::make_plt_section): New function, broken out of
7820 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7821 (Target_i386::make_plt_entry): Call make_plt_section.
7822 (Target_i386::make_local_ifunc_plt_entry): New function.
7823 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7824 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7825 R_386_IRELATIVE to switch.
7826 (Target_i386::Scan::global): Likewise.
7827 (Target_i386::Relocate::relocate): Likewise.
7828 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7829 switch.
7830 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7831 (Target_x86_64::do_plt_section_for_global): New function.
7832 (Target_x86_64::do_plt_section_for_local): New function.
7833 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7834 parameter; change all callers. If doing a static link define
7835 __rela_iplt_start and __rela_iplt_end.
7836 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7837 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7838 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7839 to point to .plt.
7840 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7841 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7842 switch.
7843 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7844 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7845 R_X86_64_IRELATIVE to switch.
7846 (Target_x86_64::Scan::global): Likewise.
7847 (Target_x86_64::Relocate::relocate): Likewise.
7848 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7849 switch.
7850 * target.h (class Target): Add plt_section_for_global and
7851 plt_section_for_local functions. Add do_plt_section_for_global
7852 and do_plt_section_for_local virtual functions.
7853 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7854 clarifying comments.
7855 (Symbol::use_plt_offset): Handle IFUNC symbol.
7856 * object.cc (Sized_relobj::Sized_relobj): Initialize
7857 local_plt_offsets_.
7858 (Sized_relobj::local_has_plt_offset): New function.
7859 (Sized_relobj::local_plt_offset): New function.
7860 (Sized_relobj::set_local_plt_offset): New function.
7861 (Sized_relobj::do_count): Handle IFUNC symbol.
7862 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7863 a bit away from input_shndx_ field. Add set_is_func_symbol and
7864 is_ifunc_symbol functions.
7865 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7866 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7867 local_plt_offsets_ field.
7868 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7869 * output.h (class Output_section_data): Add non-const
7870 output_section function.
7871 (class Output_data_got): Update declarations.
7872 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7873 Add use_plt_offset parameter to global and local constructors.
7874 Change all callers. Change local_sym_index_ field to 31 bits.
7875 Change GSYM_CODE and CONSTANT_CODE accordingly.
7876 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7877 doing a static link don't set sh_link field.
7878 (Output_data_got::Got_entry::write): Use PLT offset if
7879 appropriate.
7880 (Output_data_got::add_global_plt): New function.
7881 (Output_data_got::add_local_plt): New function.
7882 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7883 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7884 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7885 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7886 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7887 IFUNC conditional.
7888 * testsuite/ifunc-sel.h: New file.
7889 * testsuite/ifuncmain1.c: New file.
7890 * testsuite/ifuncmain1vis.c: New file.
7891 * testsuite/ifuncmod1.c: New file.
7892 * testsuite/ifuncdep2.c: New file.
7893 * testsuite/ifuncmain2.c: New file.
7894 * testsuite/ifuncmain3.c: New file.
7895 * testsuite/ifuncmod3.c: New file.
7896 * testsuite/ifuncmain4.c: New file.
7897 * testsuite/ifuncmain5.c: New file.
7898 * testsuite/ifuncmod5.c: New file.
7899 * testsuite/ifuncmain6pie.c: New file.
7900 * testsuite/ifuncmod6.c: New file.
7901 * testsuite/ifuncmain7.c: New file.
7902 * configure, testsuite/Makefile.in: Rebuild.
7903
56f75c03
ILT
79042010-08-18 Ian Lance Taylor <iant@google.com>
7905
7906 * incremental.cc
7907 (Output_section_incremental_inputs::write_input_files): Add cast
7908 to avoid signed/unsigned comparison warning.
7909 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7910
55455f89
CC
79112010-08-12 Cary Coutant <ccoutant@google.com>
7912
7913 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7914
e2054bcb
ILT
79152010-08-13 Ian Lance Taylor <iant@google.com>
7916
7917 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7918
74f67560
DK
79192010-08-12 Cary Coutant <ccoutant@google.com>
7920 Doug Kwan <dougkwan@google.com>
7921
7922 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7923 defintion overrides non-weak undef, remember that the original undef
7924 is not weak.
7925 * symtab.cc (Symbol_table::sized_write_global): For undef without
7926 an original weak binding, set binding to global in output.
7927 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7928 * testsuite/Makefile.in: Regenerate.
7929 * testsuite/strong_ref_weak_def.sh: New file.
7930 * testsuite/strong_ref_weak_def_1.c: Ditto.
7931 * testsuite/strong_ref_weak_def_2.c: Ditto.
7932
d1238d12
CC
79332010-08-12 Cary Coutant <ccoutant@google.com>
7934
7935 * testsuite/incremental_test.sh: Rewrite.
7936 * testsuite/incremental_test_1.c: Rewrite.
7937 * testsuite/incremental_test_2.c: Rewrite.
7938
0e70b911
CC
79392010-08-12 Cary Coutant <ccoutant@google.com>
7940
7941 * arm.cc (Target_arm::got_size): Add const.
7942 (Target_arm::got_entry_count): New function.
7943 (Target_arm::plt_entry_count): New function.
7944 (Target_arm::first_plt_entry_offset): New function.
7945 (Target_arm::plt_entry_size): New function.
7946 (Output_data_plt_arm::entry_count): New function.
7947 (Output_data_plt_arm::first_plt_entry_offset): New function.
7948 (Output_data_plt_arm::get_plt_entry_size): New function.
7949 * i386.cc (Target_i386::got_size): Add const.
7950 (Target_i386::got_entry_count): New function.
7951 (Target_i386::plt_entry_count): New function.
7952 (Target_i386::first_plt_entry_offset): New function.
7953 (Target_i386::plt_entry_size): New function.
7954 (Output_data_plt_i386::entry_count): New function.
7955 (Output_data_plt_i386::first_plt_entry_offset): New function.
7956 (Output_data_plt_i386::get_plt_entry_size): New function.
7957 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7958 find_incremental_inputs_sections. Dump incremental_got_plt section.
7959 * incremental.cc: Include target.h.
7960 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7961 parameter. Adjust all callers. Find incremental_got_plt section.
7962 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7963 section.
7964 (Output_section_incremental_inputs::set_final_data_size): Calculate
7965 size of incremental_got_plt section.
7966 (Output_section_incremental_inputs::do_write): Write the
7967 incremental_got_plt section.
7968 (Got_plt_view_info): New struct.
7969 (Local_got_offset_visitor): New class.
7970 (Global_got_offset_visitor): New class.
7971 (Global_symbol_visitor_got_plt): New class.
7972 (Output_section_incremental_inputs::write_got_plt): New function.
7973 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7974 Add parameter. Adjust all callers.
7975 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7976 (Incremental_inputs::got_plt_section): New function.
7977 (Incremental_inputs::got_plt_section_): New data member.
7978 (Incremental_got_plt_reader): New class.
7979 * layout.cc (Layout::create_incremental_info_sections): Add the
7980 incremental_got_plt section.
7981 * object.h (Got_offset_list::get_list): New function.
7982 (Got offset_list::for_all_got_offsets): New function.
7983 (Sized_relobj::local_got_offset_list): New function.
7984 * powerpc.cc (Target_powerpc::got_size): Add const.
7985 (Target_powerpc::got_entry_count): New function.
7986 (Target_powerpc::plt_entry_count): New function.
7987 (Target_powerpc::first_plt_entry_offset): New function.
7988 (Target_powerpc::plt_entry_size): New function.
7989 (Output_data_plt_powerpc::entry_count): New function.
7990 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7991 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7992 * sparc.cc (Target_sparc::got_size): Add const.
7993 (Target_sparc::got_entry_count): New function.
7994 (Target_sparc::plt_entry_count): New function.
7995 (Target_sparc::first_plt_entry_offset): New function.
7996 (Target_sparc::plt_entry_size): New function.
7997 (Output_data_plt_sparc::entry_count): New function.
7998 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7999 (Output_data_plt_sparc::get_plt_entry_size): New function.
8000 * symtab.h (Symbol::got_offset_list): New function.
8001 (Symbol_table::for_all_symbols): New function.
8002 * target.h (Sized_target::got_entry_count): New function.
8003 (Sized_target::plt_entry_count): New function.
8004 (Sized_target::plt_entry_size): New function.
8005 * x86_64.cc (Target_x86_64::got_size): Add const.
8006 (Target_x86_64::got_entry_count): New function.
8007 (Target_x86_64::plt_entry_count): New function.
8008 (Target_x86_64::first_plt_entry_offset): New function.
8009 (Target_x86_64::plt_entry_size): New function.
8010 (Output_data_plt_x86_64::entry_count): New function.
8011 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8012 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8013
09ec0418
CC
80142010-08-12 Cary Coutant <ccoutant@google.com>
8015
8016 * archive.cc: Include incremental.h.
8017 (Archive::Archive): Initialize incremental_info_.
8018 (Archive::include_member): Record archive members in incremental info.
8019 (Add_archive_symbols::run): Record begin and end of an archive in
8020 incremental info.
8021 (Lib_group::include_member): Record objects in incremental info.
8022 * archive.h (Incremental_archive_entry): Forward declaration.
8023 (Archive::set_incremental_info): New member function.
8024 (Archive::incremental_info): New member function.
8025 (Archive::Unused_symbol_iterator): New class.
8026 (Archive::unused_symbols_begin): New member function.
8027 (Archive::unused_symbols_end): New member function.
8028 (Archive::incremental_info_): New data member.
8029 * incremental-dump.cc (find_input_containing_global): New function.
8030 (dump_incremental_inputs): Dump new incremental info sections.
8031 * incremental.cc: Include symtab.h.
8032 (Output_section_incremental_inputs): New class.
8033 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8034 new incremental info sections.
8035 (Sized_incremental_binary::do_check_inputs): Likewise.
8036 (Incremental_inputs::report_archive): Remove.
8037 (Incremental_inputs::report_archive_begin): New function.
8038 (Incremental_inputs::report_archive_end): New function.
8039 (Incremental_inputs::report_object): New function.
8040 (Incremental_inputs::finalize_inputs): Remove.
8041 (Incremental_inputs::report_input_section): New function.
8042 (Incremental_inputs::report_script): Rewrite.
8043 (Incremental_inputs::finalize): Do nothing but finalize string table.
8044 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8045 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8046 (Incremental_inputs::create_data_sections): New function.
8047 (Incremental_inputs::relocs_entsize): New function.
8048 (Output_section_incremental_inputs::set_final_data_size): New function.
8049 (Output_section_incremental_inputs::do_write): New function.
8050 (Output_section_incremental_inputs::write_header): New function.
8051 (Output_section_incremental_inputs::write_input_files): New function.
8052 (Output_section_incremental_inputs::write_info_blocks): New function.
8053 (Output_section_incremental_inputs::write_symtab): New function.
8054 * incremental.h (Incremental_script_entry): Forward declaration.
8055 (Incremental_object_entry): Forward declaration.
8056 (Incremental_archive_entry): Forward declaration.
8057 (Incremental_inputs): Forward declaration.
8058 (Incremental_inputs_header_data): Remove.
8059 (Incremental_inputs_header): Remove.
8060 (Incremental_inputs_header_write): Remove.
8061 (Incremental_inputs_entry_data): Remove.
8062 (Incremental_inputs_entry): Remove.
8063 (Incremental_inputs_entry_write): Remove.
8064 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
8065 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
8066 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8067 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
8068 Likewise.
8069 (Incremental_input_entry): New class.
8070 (Incremental_script_entry): New class.
8071 (Incremental_object_entry): New class.
8072 (Incremental_archive_entry): New class.
8073 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8074 (Incremental_inputs::report_inputs): Remove.
8075 (Incremental_inputs::report_archive): Remove.
8076 (Incremental_inputs::report_archive_begin): New function.
8077 (Incremental_inputs::report_archive_end): New function.
8078 (Incremental_inputs::report_object): Change prototype.
8079 (Incremental_inputs::report_input_section): New function.
8080 (Incremental_inputs::report_script): Change prototype.
8081 (Incremental_inputs::get_reloc_count): New function.
8082 (Incremental_inputs::set_reloc_count): New function.
8083 (Incremental_inputs::create_data_sections): New function.
8084 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8085 (Incremental_inputs::inputs_section): New function.
8086 (Incremental_inputs::symtab_section): New function.
8087 (Incremental_inputs::relocs_section): New function.
8088 (Incremental_inputs::get_stringpool): Add const.
8089 (Incremental_inputs::command_line): Add const.
8090 (Incremental_inputs::inputs): Remove.
8091 (Incremental_inputs::command_line_key): New function.
8092 (Incremental_inputs::input_file_count): New function.
8093 (Incremental_inputs::input_files): New function.
8094 (Incremental_inputs::relocs_entsize): New function.
8095 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8096 (Incremental_inputs::finalize_inputs): Remove.
8097 (Incremental_inputs::Input_info): Remove.
8098 (Incremental_inputs::lock_): Remove.
8099 (Incremental_inputs::inputs_): Change type.
8100 (Incremental_inputs::inputs_map_): Remove.
8101 (Incremental_inputs::current_object_entry_): New data member.
8102 (Incremental_inputs::inputs_section_): New data member.
8103 (Incremental_inputs::symtab_section_): New data member.
8104 (Incremental_inputs::relocs_section_): New data member.
8105 (Incremental_inputs::reloc_count_): New data member.
8106 (Incremental_inputs_reader): New class.
8107 (Incremental_symtab_reader): New class.
8108 (Incremental_relocs_reader): New class.
8109 * layout.cc (Layout::finalize): Move finalization of incremental info
8110 and creation of incremental info sections to follow finalization of
8111 symbol table. Set offsets for postprocessing sections.
8112 (Layout::create_incremental_info_sections): Call
8113 Incremental_inputs::create_data_sections. Add incremental symtab
8114 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
8115 sections to layout after input sections.
8116 * layout.h (struct Timespec): Forward declaration.
8117 (Layout::incremental_inputs): Add const.
8118 (Layout::create_incremental_info_sections): Add parameter.
8119 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
8120 * object.cc: Include incremental.h.
8121 (Relobj::finalize_incremental_relocs): New function.
8122 (Sized_relobj::do_layout): Record input sections in incremental info.
8123 * object.h (Object::output_section): New function.
8124 (Object::output_section_offset): Moved from Relobj.
8125 (Object::get_incremental_reloc_base): New function.
8126 (Object::get_incremental_reloc_count): New function.
8127 (Object::do_output_section): New function.
8128 (Object::do_output_section_offset): Moved from Relobj.
8129 (Object::do_get_incremental_reloc_base): New function.
8130 (Object::do_get_incremental_reloc_count): New function.
8131 (Object::Object): Initialize new data members.
8132 (Relobj::output_section): Renamed do_output_section and moved to
8133 protected.
8134 (Relobj::output_section_offset): Moved to Object.
8135 (Relobj::do_get_incremental_reloc_base): New function.
8136 (Relobj::do_get_incremental_reloc_count): New function.
8137 (Relobj::allocate_incremental_reloc_counts): New function.
8138 (Relobj::count_incremental_reloc): New function.
8139 (Relobj::finalize_incremental_relocs): New function.
8140 (Relobj::next_incremental_reloc_index): New function.
8141 (Relobj::reloc_counts_): New data member.
8142 (Relobj::reloc_bases_): New data member.
8143 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8144 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8145 (Sized_relobj::incremental_relocs_scan): New function.
8146 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8147 (Sized_relobj::incremental_relocs_write): New function.
8148 (Sized_relobj::incremental_relocs_write_reltype): New function.
8149 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8150 incremental link.
8151 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8152 archives and object files elsewhere.
8153 (Add_symbols::run): Report object files here.
8154 (Finish_group::run): Report end of archive at end of group.
8155 * reloc.cc: Include layout.h, incremental.h.
8156 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8157 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8158 (Sized_relobj::incremental_relocs_scan): New function.
8159 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8160 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8161 (Sized_relobj::incremental_relocs_write): New function.
8162 (Sized_relobj::incremental_relocs_write_reltype): New function.
8163 * script.cc (read_input_script): Rewrite test for incremental link.
8164 Change call to Incremental_inputs::report_script.
8165 * symtab.h (Symbol_table::first_global_index): New function.
8166 (Symbol_table::output_count): New function.
8167
ce0d1972
DK
81682010-08-12 Doug Kwan <dougkwan@google.com>
8169
8170 * arm.cc (Target_arm::merge_object_attributes): Check command line
8171 options --no-wchar-size-warning and --no-enum-size-warning.
8172 * options.h (General_options): Add ld-compatible options
8173 --no-enum-size-warning and --no-wchar-size-warning.
8174
6e5710ce
ILT
81752010-08-04 Ian Lance Taylor <iant@google.com>
8176
8177 * x86_64.cc (Target_x86_64::Scan::local): Use
8178 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8179 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8180 (Target_x86_64::Scan::global): Likewise.
8181 (Target_x86_64::Relocate::relocate): Likewise.
8182 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8183 Likewise.
8184
fef830db
CC
81852010-08-03 Cary Coutant <ccoutant@google.com>
8186
8187 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8188 to reserve space in merged_strings vector. Keep total input size
8189 for stats.
8190 (Output_merge_string::do_print_merge_stats): Print total input size.
8191 * merge.h (Output_merge_string): Add input_size_ field.
8192 * stringpool.cc (Stringpool_template::string_length): Move
8193 implementations out of Stringpool_template class and place in
8194 stringpool.h.
8195 * stringpool.h (string_length): Move out of Stringpool_template.
8196
1e3811b0
ILT
81972010-08-03 Ian Lance Taylor <iant@google.com>
8198
8199 PR 11712
8200 * layout.cc (relaxation_loop_body): If address of load segment is
8201 set, adjust address to include headers if possible.
8202
7af0c620
ILT
82032010-08-03 Ian Lance Taylor <iant@google.com>
8204
8205 * version.cc (version_string): Bump to 1.10.
8206
22f0da72
ILT
82072010-08-03 Ian Lance Taylor <iant@google.com>
8208
8209 PR 11805
8210 * layout.h (enum Output_section_order): Define.
8211 (class Layout): Update declarations.
8212 * layout.cc (Layout::get_output_section): Add order parameter.
8213 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8214 is_first_non_relro parameters. Change all callers.
8215 (Layout::choose_output_section): Likewise.
8216 (Layout::add_output_section_data): Likewise.
8217 (Layout::make_output_section): Likewise. Set order.
8218 (Layout::default_section_order): New function.
8219 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8220 * output.cc (Output_section::Output_section): Initialize order_.
8221 Don't initialize deleted fields.
8222 (Output_segment::Output_segment): Don't initialize deleted
8223 fields.
8224 (Output_segment::add_output_section_to_load): New function
8225 replacing add_output_section. Change all callers to call this or
8226 add_output_section_to_nonload.
8227 (Output_segment::add_output_section_to_nonload): New function.
8228 (Output_segment::remove_output_section): Rewrite.
8229 (Output_segment::add_initial_output_data): Likewise.
8230 (Output_segment::has_any_data_sections): Likewise.
8231 (Output_segment::is_first_section_relro): Likewise.
8232 (Output_segment::maximum_alignment): Likewise.
8233 (Output_segment::has_dynamic_reloc): New function replacing
8234 dynamic_reloc_count. Change all callers.
8235 (Output_segment::has_dynamic_reloc_list): New function replacing
8236 dynamic_reloc_count_list. Change all callers.
8237 (Output_segment::set_section_addresses): Rewrite.
8238 (Output_segment::set_offset): Rewrite.
8239 (Output_segment::find_first_and_last_list): Remove.
8240 (Output_segment::set_tls_offsets): Rewrite.
8241 (Output_segment::first_section_load_address): Likewise.
8242 (Output_segment::output_section_count): Likewise.
8243 (Output_segment::section_with_lowest_load_address): Likewise.
8244 (Output_segment::write_section_headers): Likewise.
8245 (Output_segment::print_sections_to_map): Likewise.
8246 * output.h (class Output_data): Remove dynamic_reloc_count_
8247 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8248 (Output_data::add_dynamic_reloc): Rewrite.
8249 (Output_data::has_dynamic_reloc): New function.
8250 (Output_data::dynamic_reloc_count): Remove.
8251 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8252 is_last_relro_, is_first_non_relro_, is_interp_,
8253 is_dynamic_linker_section_ fields. Add order and set_order
8254 functions. Remove is_relro_local, set_is_relro_local,
8255 is_last_relro, set_is_last_relro, is_first_non_relro,
8256 set_is_first_non_relro functions, is_interp, set_is_interp,
8257 is_dynamic_linker_section, and set_is_dynamic_linker_section
8258 functions.
8259 (class Output_segment): Change Output_data_list from std::list to
8260 std:;vector. Add output_lists_ field. Remove output_data_ and
8261 output_bss_ fields. Update declarations.
8262
3ff2ccb0
ILT
82632010-08-02 Ian Lance Taylor <iant@google.com>
8264
8265 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8266 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8267 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8268
88a4108b
ILT
82692010-08-02 Ian Lance Taylor <iant@google.com>
8270
8271 PR 11855
8272 * script.cc (Script_options::Script_options): Initialize
8273 symbol_definitions_ and symbol_references_.
8274 (Script_options::add_symbol_assignment): Update
8275 symbol_definitions_ and symbol_references_.
8276 (Script_options::add_symbol_reference): New function.
8277 (script_symbol): New function.
8278 * script.h (class Script_options): Add symbol_definitions_ and
8279 symbol_references_ fields.
8280 (Script_options::referenced_const_iterator): New type.
8281 (Script_options::referenced_begin): New function.
8282 (Script_options::referenced_end): New function.
8283 (Script_options::is_referenced): New function.
8284 (Script_options::any_unreferenced): New function.
8285 * script-c.h (script_symbol): Declare.
8286 * yyscript.y (exp): Call script_symbol.
8287 * symtab.cc: Include "script.h".
8288 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8289 Change all callers. Check symbols referenced by scripts.
8290 (Symbol_table::add_undefined_symbols_from_command_line): Add
8291 layout parameter. Change all callers.
8292 (Symbol_table::do_add_undefined_symbols_from_command_line):
8293 Likewise. Break out loop body. Check symbols referenced by
8294 scripts.
8295 (Symbol_table::add_undefined_symbol_from_command_line): New
8296 function broken out of
8297 do_add_undefined_symbols_from_command_line.
8298 * symtab.h (class Symbol_table): Update declarations.
8299 * archive.cc: Include "layout.h".
8300 (Archive::should_include_member): Add layout parameter. Change
8301 all callers. Check for symbol mentioned in expression.
8302 * archive.h (class Archive): Update declaration.
8303 * object.cc (Sized_relobj::do_should_include_member): Add layout
8304 parameter.
8305 * object.h (Object::should_include_member): Add layout parameter.
8306 Change all callers.
8307 (Object::do_should_include_member): Add layout parameter.
8308 (class Sized_relobj): Update declaration.
8309 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8310 parameter.
8311 * dynobj.h (class Sized_dynobj): Update declaration.
8312 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8313 layout parameter.
8314 * plugin.h (class Sized_pluginobj): Update declaration.
8315
5f1ab67a
ILT
83162010-08-02 Ian Lance Taylor <iant@google.com>
8317
8318 PR 11866
8319 * output.cc (Output_segment::set_offset): Search for the first and
8320 last sections rather than assuming that the list is in order.
8321 (Output_segment::find_first_and_last_list): New function.
8322 * output.h (class Output_segment): Update declarations.
8323 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8324 (relro_strip_test_SOURCES): New variable.
8325 (relro_strip_test_DEPENDENCIES): New variable.
8326 (relro_strip_test_LDFLAGS): New variable.
8327 (relro_strip_test_LDADD): New variable.
8328 (relro_strip_test.so): New target.
8329
a8df5856
ILT
83302010-08-02 Ian Lance Taylor <iant@google.com>
8331
8332 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8333 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8334 (Target_i386::got_tlsdesc_section): New function.
8335 (Target_i386::got_section): Create space for GOT entries for
8336 TLSDESC relocations.
8337 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8338 R_386_TLS_GOTDESC.
8339 (Target_i386::Scan::global): Likewise.
8340 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8341 using TLSDESC GOT.
8342 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8343 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8344 (Target_x86_64::got_tlsdesc_section): New function.
8345 (Target_x86_64::got_section): Create space for GOT entries for
8346 TLSDESC relocations.
8347 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8348 R_386_TLS_GOTDESC.
8349 (Target_x86_64::Scan::global): Likewise.
8350 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8351 using TLSDESC GOT.
8352
0c10a0a6
ILT
83532010-08-02 Ian Lance Taylor <iant@google.com>
8354
8355 * testsuite/final_layout.sh: Use dc to convert from hex to
8356 decimal.
8357
41cbeecc
ST
83582010-07-29 Sriraman Tallam <tmsriram@google.com>
8359
8360 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8361 paramter to the call to gold::gc_process_relocs.
8362 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8363 paramter to the call to gold::gc_process_relocs.
8364 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8365 parameter to the call to gold::gc_process_relocs.
8366 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8367 template parameter to the call to gold::gc_process_relocs.
8368 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8369 paramter to the call to gold::gc_process_relocs.
8370 * gc.h (get_embedded_addend_size): New function.
8371 (gc_process_relocs): Save the size of the reloc for use by ICF.
8372 * icf.cc (get_section_contents): Get the addend from the text section
8373 for SHT_REL relocation sections.
8374 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8375 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8376 * int_encoding.h (read_from_pointer): New overloaded function.
8377 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8378 * testsuite/icf_sht_rel_addend_test.sh: New file.
8379 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8380 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8381
6ea55b82
RW
83822010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8383
8384 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8385 * Makefile.in: Regenerate.
8386 * testsuite/Makefile.in: Regenerate.
8387
9691462b
ILT
83882010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8389
8390 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8391 * gold/testsuite/debug_msg.cc: Likewise.
8392 * gold/testsuite/odr_violation1.cc
8393 * gold/testsuite/odr_violation2.cc
8394
76897331
CC
83952010-07-21 Cary Coutant <ccoutant@google.com>
8396
8397 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8398 string, and length fields.
8399 (Output_merge_string::Merged_strings_list): New type.
8400 (Output_merge_string::Merged_strings_lists): New typedef.
8401 (Output_merge_string): Replace merged_strings_ with
8402 merged_strings_lists_.
8403 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8404 Merged_strings_list per input object and section. Don't store pointer
8405 to the string. Don't store length with each merged string entry.
8406 (Output_merge_string::finalize_merged_data): Loop over list of merged
8407 strings lists. Recompute length of each merged string.
8408
78384e8f
CC
84092010-07-15 Cary Coutant <ccoutant@google.com>
8410
8411 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8412 here.
8413
783659f9
ILT
84142010-07-14 Ian Lance Taylor <iant@google.com>
8415
8416 * descriptors.cc (Descriptors::open): Report correct name in error
8417 message.
8418
131687b4
DK
84192010-07-13 Doug Kwan <dougkwan@google.com>
8420
8421 * arm.cc (Arm_input_section::Arm_input_section): For a
8422 SHT_ARM_EXIDX section, always keeps the input sections.
8423 (Arm_input_section::set_exidx_section_link): New method.
8424 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8425 has_errors_ to false.
8426 (Arm_exidx_input_section::has_errors,
8427 Arm_exidx_input_section::set_has_errors): New methods.
8428 (Arm_exidx_input_section::has_errors_): New data member.
8429 (Arm_relobj::get_exidx_shndx_list): New method.
8430 (Arm_output_section::append_text_sections_to_list): Do not skip
8431 section without SHF_EXECINSTR.
8432 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8433 errors.
2e702c99 8434 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8435 section header. Make error messages more verbose. Check for
8436 a non-executable section linked to an EXIDX section.
8437 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8438 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8439 check that there is no deferred EXIDX section if we exit early.
8440 Instead of not making an EXIDX section in case of an error, make one
8441 and set the has_errors flag of it.
8442 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8443 in a relocatable link.
8444 (Target_arm::do_relax): Look for the EXIDX output section instead of
8445 assuming that it is called .ARM.exidx.
2e702c99 8446 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8447 section list. Do not check for SHF_EXECINSTR section flags but
8448 skip any input section with errors.
8449 * output.cc (Output_section::Output_section): Initialize
8450 always_keeps_input_sections_ to false.
8451 (Output_section::add_input_section): Check for
8452 always_keeps_input_sections_.
8453 * output.h (Output_section::always_keeps_input_sections,
8454 Output_section::set_always_keeps_input_sections): New methods.
8455 (Output_section::always_keeps_input_sections): New data member.
8456
69517287
RÁE
84572010-07-13 Rafael Espindola <espindola@google.com>
8458
8459 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8460 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8461
82742395
ILT
84622010-07-13 Philip Herron <herron.philip@googlemail.com>
8463 Ian Lance Taylor <iant@google.com>
8464
8465 * output.h (Output_section_lookup_maps::add_merge_section):
8466 Correct check of whether value was inserted.
8467 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8468 (Output_section_lookup_maps::add_relaxed_input_section):
8469 Likewise.
8470 * arm.cc (Target_arm::got_section): Remove used local os.
8471 * i386.cc (Target_i386::got_section): Likewise.
8472 * x86_64.cc (Target_x86_64::got_section): Likewise.
8473 * sparc.cc (Target_sparc::got_section): Likewise.
8474 (Target_sparc::relocate): Remove unused local have_got_offset.
8475 * powerpc.cc (Target_powerpc::relocate): Likewise.
8476
f2d707b5
ILT
84772010-07-13 Ian Lance Taylor <iant@google.com>
8478
241531d6
ILT
8479 * compressed_output.cc (zlib_decompress): Fix signature in
8480 !HAVE_ZLIB_H case.
8481
f2d707b5
ILT
8482 * archive.cc (Archive::include_member): Unlock an external member
8483 of a thin archive. Don't bother to delete an object we know is
8484 NULL.
8485
a2e47362
CC
84862010-07-12 Cary Coutant <ccoutant@google.com>
8487
8488 * compressed_output.cc (zlib_decompress): New function.
8489 (get_uncompressed_size): New function.
8490 (decompress_input_section): New function.
8491 * compressed_output.h (get_uncompressed_size): New function.
8492 (decompress_input_section): New function.
8493 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8494 Handle compressed debug sections.
8495 * layout.cc (is_compressed_debug_section): New function.
8496 (Layout::output_section_name): Map compressed section names to
8497 canonical names.
8498 * layout.h (is_compressed_debug_section): New function.
8499 (is_debug_info_section): Recognize compressed debug sections.
8500 * merge.cc: Include compressed_output.h.
8501 (Output_merge_data::do_add_input_section): Handle compressed
8502 debug sections.
8503 (Output_merge_string::do_add_input_section): Handle compressed
8504 debug sections.
8505 * object.cc: Include compressed_output.h.
8506 (Sized_relobj::Sized_relobj): Initialize new data members.
8507 (build_compressed_section_map): New function.
8508 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8509 * object.h (Object::section_is_compressed): New method.
8510 (Object::do_section_is_compressed): New method.
8511 (Sized_relobj::Compressed_section_map): New type.
8512 (Sized_relobj::do_section_is_compressed): New method.
8513 (Sized_relobj::compressed_sections_): New data member.
8514 * output.cc (Output_section::add_input_section): Handle compressed
8515 debug sections.
8516 * reloc.cc: Include compressed_output.h.
8517 (Sized_relobj::write_sections): Handle compressed debug sections.
8518
ce279a62
CC
85192010-07-08 Cary Coutant <ccoutant@google.com>
8520
8521 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8522 weak when resolving to a dynamic def.
8523 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8524 for weak undef/dynamic def cases. Adjust callers.
8525 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8526 undef_binding_weak_.
8527 (Symbol_table::sized_write_globals): Adjust symbol binding.
8528 (Symbol_table::sized_write_symbol): Add binding parameter.
8529 * symtab.h (Symbol::set_undef_binding): New method.
8530 (Symbol::is_undef_binding_weak): New method.
8531 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8532 (Symbol_table::should_override): Add new parameter.
8533 (Symbol_table::sized_write_symbol): Add new parameter.
8534
8535 * testsuite/weak_undef_file1.cc: Add new test case.
8536 * testsuite/weak_undef_file2.cc: Fix header comment.
8537 * testsuite/weak_undef_test.cc: Add new test case.
8538
b2286c10
DK
85392010-06-29 Doug Kwan <dougkwan@google.com>
8540
8541 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8542 Initialize USE_SYMBOL_.
8543 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8544 definition.
8545 (Arm_reloc_property::uses_symbol_): New data member declaration.
8546 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8547 uses symbol value and symbol is undefined but not weakly undefined.
8548
4802450a
RÁE
85492010-06-28 Rafael Espindola <espindola@google.com>
8550
8551 * plugin.cc (Plugin::load): Use dlerror.
8552
e5ca47ba
ILT
85532010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8554
8555 * symtab.cc (detect_odr_violations): When reporting an ODR
8556 violation, report an object where the symbol is defined.
8557
8a75a161
DK
85582010-06-25 Doug Kwan <dougkwan@google.com>
8559
8560 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8561 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8562 definition.
8563 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8564 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8565 target hook to detect function points.
8566 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8567 * icf.h (Icf::check_section_for_function_pointers): Change type of
8568 parameter SECTION_NAME to const reference to std::string. Use
8569 target hook to determine if section may have unsafe pointers.
8570 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8571 method definition.
8572
42218b9f
RÁE
85732010-06-21 Rafael Espindola <espindola@google.com>
8574
8575 * fileread.cc (Input_file::find_fie): New
8576 (Input_file::open): Use Input_file::find_fie.
8577 * fileread.h (Input_file::find_fie): New
8578 * plugin.cc (set_extra_library_path): New.
8579 (Plugin::load): Add set_extra_library_path to the transfer vector.
8580 (Plugin_manager::set_extra_library_path): New.
8581 (Plugin_manager::add_input_file): Use the extra search path if set.
8582 (set_extra_library_path(): New.
8583 * plugin.h (Plugin_manager): Add set_extra_library_path and
8584 extra_search_path_.
8585
a0506cca
CC
85862010-06-19 Cary Coutant <ccoutant@google.com>
8587
8588 * layout.cc (gdb_sections): Add .debug_types.
8589 (lines_only_debug_sections): Likewise.
8590
6508b958
RÁE
85912010-06-18 Rafael Espindola <espindola@google.com>
8592
8593 * plugin.cc (add_input_file,add_input_library)
8594 (Plugin_manager::add_input_file): Make filename arguments const.
8595 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8596 const.
8597
3e235302
DK
85982010-06-16 Doug Kwan <dougkwan@google.com>
8599
8600 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8601 .ARM.attributes section if we have not merged any input
8602 attributes sections.
8603
106e8a6c
DK
86042010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8605
8606 * arm.cc: Allow combining objects with no EABI version
8607 information.
8608
91ff43fe
RÁE
86092010-06-15 Rafael Espindola <espindola@google.com>
8610
8611 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8612
68ed838c
ILT
86132010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8614
8615 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8616 (struct iovec): Correct !HAVE_READV definition.
8617
f3a2388f
CC
86182010-06-10 Cary Coutant <ccoutant@google.com>
8619
8620 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8621 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8622 reloc sections.
8623 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8624
8625 PR 11683
8626 * symtab.h (Symbol::is_placeholder): New member function.
8627 * target-reloc.h (relocate_section): Check for placeholder symbols.
8628
8629 * testsuite/Makefile.am (plugin_test_8): New test.
8630 (plugin_test_9): New test.
8631 * testsuite/Makefile.in: Regenerate.
8632
e1df38aa
NC
86332010-06-09 Nick Clifton <nickc@redhat.com>
8634
8635 * yyscript.y (input_list_element): Allow strings prefixed with
8636 the '-' character. Treat these as libraries.
8637 * script.cc (script_add_library): New function. Adds a library
8638 specified by "-l<name>" found in an input script.
8639 * script-c.h: Add prototype for script_add_library.
8640
25bbe950
DK
86412010-06-07 Doug Kwan <dougkwan@google.com>
8642
8643 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8644 Restrict stub-group size to be within long conditional branch
8645 range when working around cortex-A8 erratum.
8646
0f32ea4c
ILT
86472010-06-07 Damien Diederen <dd@crosstwine.com>
8648
8649 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8650 #ifdef typo.
8651
8fe2a369
ST
86522010-06-03 Sriraman Tallam <tmsriram@google.com>
8653
8654 PR gold/11658
8655 * output.cc
8656 (Output_section::Input_section_sort_entry::compare_section_ordering):
8657 Change to return non-zero correctly.
8658 (Output_section::Input_section_sort_section_order_index_compare
8659 ::operator()): Change to fix ambiguity in comparisons.
8660
6e9ba2ca
ST
86612010-06-01 Sriraman Tallam <tmsriram@google.com>
8662
8663 * gold.h (is_wildcard_string): New function.
8664 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8665 (Layout::layout_eh_frame): Ditto.
8666 (Layout::find_section_order_index): New method.
8667 (Layout::read_layout_from_file): New method.
8668 * layout.h (Layout::find_section_order_index): New method.
8669 (Layout::read_layout_from_file): New method.
8670 (Layout::input_section_position_): New private member.
8671 (Layout::input_section_glob_): New private member.
8672 * main.cc (main): Call read_layout_from_file here.
8673 * options.h (--section-ordering-file): New option.
8674 * output.cc (Output_section::input_section_order_specified_): New
8675 member.
8676 (Output_section::Output_section): Initialize new member.
8677 (Output_section::add_input_section): Add new parameter.
8678 Keep input sections when --section-ordering-file is used.
8679 (Output_section::set_final_data_size): Sort input sections when
8680 section ordering file is specified.
8681 (Output_section::Input_section_sort_entry): Add new parameter.
8682 Check sorting type.
8683 (Output_section::Input_section_sort_entry::compare_section_ordering):
8684 New method.
8685 (Output_section::Input_section_sort_compare::operator()): Change to
8686 consider section_order_index.
8687 (Output_section::Input_section_sort_init_fini_compare::operator()):
8688 Change to consider section_order_index.
8689 (Output_section::Input_section_sort_section_order_index_compare
8690 ::operator()): New method.
8691 (Output_section::sort_attached_input_sections): Change to sort
8692 according to section order when specified.
e1df38aa
NC
8693 (Output_section::add_input_section<32, true>): Add new parameter.
8694 (Output_section::add_input_section<64, true>): Add new parameter.
8695 (Output_section::add_input_section<32, false>): Add new parameter.
8696 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
8697 * output.h (Output_section::add_input_section): Add new parameter.
8698 (Output_section::input_section_order_specified): New
8699 method.
8700 (Output_section::set_input_section_order_specified): New method.
8701 (Input_section::Input_section): Initialize section_order_index_.
8702 (Input_section::section_order_index): New method.
8703 (Input_section::set_section_order_index): New method.
8704 (Input_section::section_order_index_): New member.
8705 (Input_section::Input_section_sort_section_order_index_compare): New
8706 struct.
8707 (Output_section::input_section_order_specified_): New member.
8708 * script-sections.cc (is_wildcard_string): Delete and move modified
8709 method to gold.h.
8710 (Output_section_element_input::Output_section_element_input): Modify
8711 call to is_wildcard_string.
8712 (Output_section_element_input::Input_section_pattern
8713 ::Input_section_pattern): Ditto.
8714 (Output_section_element_input::Output_section_element_input): Ditto.
8715 * testsuite/Makefile.am (final_layout): New test case.
8716 * testsuite/Makefile.in: Regenerate.
8717 * testsuite/final_layout.cc: New file.
8718 * testsuite/final_layout.sh: New file.
8719
3537c84b
RÁE
87202010-06-01 Rafael Espindola <espindola@google.com>
8721
8722 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8723
105b6afd
RÁE
87242010-06-01 Rafael Espindola <espindola@google.com>
8725
8726 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8727 visibility of symbols.
8728
29e11421
DK
87292010-05-27 Doug Kwan <dougkwan@google.com>
8730
8731 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8732 from start of output section instead of address for a local symbol
8733 in a merged or relaxed section when doing a relocatable link.
8734
5e0f337e
RÁE
87352010-05-26 Rafael Espindola <espindola@google.com>
8736
703d02da 8737 PR 11604
5e0f337e
RÁE
8738 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8739 adding sections the garbage collector removed.
8740 * gold/testsuite/Makefile.am: Add test.
8741 * gold/testsuite/Makefile.in: Regenerate.
8742 * gold/testsuite/plugin_test_7.sh: New.
8743 * gold/testsuite/plugin_test_7_1.c: New.
8744 * gold/testsuite/plugin_test_7_2.c: New.
8745
f4187277
RÁE
87462010-05-26 Rafael Espindola <espindola@google.com>
8747
8748 * script-sections.cc (Output_section_definition::set_section_addresses):
8749 Check for --section-start.
8750
5c388529
DK
87512010-05-26 Doug Kwan <dougkwan@google.com>
8752
8753 * arm.cc (Arm_scan_relocatable_relocs): New class.
8754 (Target_arm::relocate_special_relocatable): New method.
8755 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8756 (Arm_relocate_functions::thumb_branch_common): Same.
8757 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8758 instead of Default_scan_relocatable_relocs.
8759 * target-reloc.h (relocate_for_relocatable): Let target handle
8760 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8761 * target.h (Sized_target::relocate_special_relocatable): New method.
8762
bca1c3ae
ILT
87632010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8764
8765 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8766
0439c796
DK
87672010-05-23 Doug Kwan <dougkwan@google.com>
8768
8769 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8770 instead of a cast.
8771 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8772 with a direct branch, not a conditional branch, to a stub.
8773 * merge.cc (Output_merge_base::record_input_section): New method
8774 defintion.
8775 (Output_merge_data::do_add_input_section): Record input section if
8776 keeps-input-sections flag is set.
8777 (Output_merge_string::do_add_input_section): Ditto.
8778 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8779 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8780 INPUT_SECTIONS_.
8781 (Output_merge_base::keeps_input_sections,
8782 Output_merge_base::set_keeps_input_sections,
8783 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8784 method definitions.
8785 (Output_merge_base::Input_sections): New type declaration.
8786 (Output_merge_base::input_sections_begin,
8787 Output_merge_base::input_sections_end,
8788 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8789 (Output_merge_base::bool keeps_input_sections_,
8790 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8791 Output_merge_base::input_sections_): New data members.
8792 (Output_merge_data::do_set_keeps_input_sections): New method
8793 defintion.
8794 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8795 * output.cc (Output_section::Input_section::relobj): Move method
8796 defintion from class declaration to here and handle merge sections.
8797 (Output_section::Input_section::shndx): Ditto.
8798 (Output_section::Output_section): Remove initializations of removed
8799 data members and initialize new data member LOOKUP_MAPS_.
8800 (Output_section::add_input_section): Set keeps-input-sections flag
8801 for a newly created merge output section as appropriate. Adjust code
8802 to use Output_section_lookup_maps class.
8803 (Output_section::add_relaxed_input_section): Adjst code for lookup
8804 maps code refactoring.
2e702c99 8805 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
8806 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8807 class. If adding input section to a newly created merge output
8808 section fails, remove the new merge section.
8809 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 8810 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 8811 (Output_section::find_merge_section): Ditto.
0439c796 8812 (Output_section::build_lookup_maps): New method defintion.
2e702c99 8813 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
8814 Output_section_lookup_maps class.
8815 (Output_section::get_input_sections): Export merge sections. Adjust
8816 code to use Output_section_lookup_maps class.
8817 (Output_section:::add_script_input_section): Adjust code to use
8818 Output_section_lookup_maps class. Update lookup maps for merge
8819 sections also.
8820 (Output_section::discard_states): Use Output_section_lookup_maps.
8821 (Output_section::restore_states): Same.
8822 * output.h (Merge_section_properties): Move class defintion out of
8823 Output_section.
8824 (Output_section_lookup_maps): New class.
8825 (Output_section::Input_section::is_merge_section): New method
8826 defintion.
8827 (Output_section::Input_section::relobj): Move defintion out of class
8828 defintion. Declare method only.
8829 (Output_section::Input_section::shndx): Ditto.
8830 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 8831 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
8832 (Output_section::Merge_section_by_properties_map,
8833 Output_section::Output_section_data_by_input_section_map,
8834 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8835 Remove types.
2e702c99 8836 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
8837 KEEPS_INPUT_SECTIONS.
8838 (Output_section::build_lookup_maps): New method declaration.
8839 (Output_section::merge_section_map_,
8840 Output_section::merge_section_by_properties_map_,
8841 Output_section::relaxed_input_section_map_,
8842 Output_section::is_relaxed_input_section_map_valid_): Remove data
8843 members.
8844 (Output_section::lookup_maps_): New data member.
8845
76295588
L
88462010-05-21 Doug Kwan <dougkwan@google.com>
8847
8848 PR gold/11619
8849 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8850 avoid a compilation error.
8851
d103a984
RÁE
88522010-05-19 Rafael Espindola <espindola@google.com>
8853
8854 * script-sections.cc (Output_section_definition::allocate_to_segment):
8855 Update the phdrs_list even when the output section is NULL.
8856 * testsuite/Makefile.am: Add test.
8857 * testsuite/Makefile.in: Regenerate.
8858 * testsuite/script_test_9.cc: New.
8859 * testsuite/script_test_9.sh: New.
8860 * testsuite/script_test_9.t: New.
8861
6625d24e
DK
88622010-05-19 Doug Kwan <dougkwan@google.com>
8863
8864 * arm.cc (Arm_input_section::original_size): New method.
8865 (Arm_input_section::do_addralign): Add a cast.
8866 (Arm_input_section::do_output_offset): Remove static cast.
8867 (Arm_input_section::original_addralign,
8868 Arm_input_section::original_size_): Change type to uint32_t.
8869 (Arm_input_section::init): Add safe casts for section alignment
8870 and size.
8871 (Arm_input_section::set_final_data_size): Do not set address and
8872 offset of stub table.
8873 (Arm_output_section::fix_exidx_coverage): Change use of of
8874 Output_section::Simple_input_section to that of
8875 Output_section::Input_section.
8876 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8877 except for the first pass.
8878 * output.cc (Output_section::get_input_sections): Change type of
8879 input_sections to std::list<Input_section>.
8880 (Output_section::add_script_input_section): Rename from
8881 Output_section::add_simple_input_section. Change type of SIS
8882 parameter from Simple_input_section to Input_section.
8883 * output.h (Output_section::Simple_input_section): Remove class.
8884 (Output_section::Input_section): Change class visibility to public.
8885 (Output_section::Input_section::addralign): Use stored alignments
8886 for special input sections if set.
8887 (Output_section::Input_section::set_addralign): New method.
8888 (Output_section::get_input_sections): Change parameter type from
8889 list of Simple_input_section to list of Input_section.
8890 (Output_section::add_script_input_section): Rename from
8891 Output_section::add_simple_input_section. Change first parameter's
8892 type from Simple_input_section to Input_section and remove the
8893 second and third parameters.
8894 * script-sections.cc (Input_section::Input_section_list): Change
8895 type to list of Output_section::Input_section/
8896 (Input_section_info::Input_section_info): Change parameter type of
8897 INPUT_SECTION to Output_section::Input_section.
8898 (Input_section_info::input_section): Change return type.
8899 (Input_section_info::input_section_): Change type to
8900 Output_section::Input_section.
8901 (Output_section_element_input::set_section_addresses): Adjust code
8902 to use Output_section::Input_section instead of
8903 Output_section::Simple_input_section. Adjust code for renaming
8904 of Output_section::add_simple_input_section.
8905 (Orphan_output_section::set_section_addresses): Ditto.
8906
e1e82ea4
RW
89072010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8908
8909 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8910 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8911
91e75c8a
RÁE
89122010-05-18 Rafael Espindola <espindola@google.com>
8913
8914 * options.cc (General_options::finalize): Handle -nostdlib.
8915 * options.h (nostdlib): New option.
8916 * script.cc (script_add_search_dir): Handle -nostdlib.
8917
da59ad79
DK
89182010-05-12 Doug Kwan <dougkwan@google.com>
8919
8920 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8921 attributes section only if there no attributes section after merging.
8922 (Target_arm::merge_object_attributes): Move value of
e1df38aa 8923 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
8924 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8925 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8926 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8927 and arm_attr_merge_7.stdout.
8928 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8929 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8930 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8931 arm_attr_merge_7b.o): New rules.
8932 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8933 arm_attr_merge_7
8934 * testsuite/Makefile.in: Regenerate.
8935 * testsuite/arm_attr_merge.sh: New file.
8936 * testsuite/arm_attr_merge_[67][ab].s: Same.
8937
3e01a7fd
NC
89382010-05-05 Nick Clifton <nickc@redhat.com>
8939
8940 * po/es.po: Updated Spanish translation.
8941
7ad2014a
L
89422010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8943
8944 * Makefile.am (install-exec-local): Properly install gold as
8945 default cross linker.
8946 * Makefile.in: Regenerated.
8947
4fda8867
NC
89482010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8949 Nick Clifton <nickc@redhat.com>
8950
8951 * configure.ac (install_as_default): Define and set to false
8952 unless --enable-gold or --enable-gold=both/gold has been
8953 specified.
8954 * configure: Regenerate.
8955
8956 * Makefile.am (install-exec-local): Install the executable as
8957 'ld.gold'. If install_as_default is true then also install it as
8958 'ld'.
8959 * Makefile.in: Regenerated.
8960
bd288ea2
ILT
89612010-04-24 Ian Lance Taylor <iant@google.com>
8962
8963 * layout.cc (Layout::layout_reloc): In relocatable link don't
8964 combine reloc sections for grouped sections.
8965
ef38fd8a
ST
89662010-04-23 Sriraman Tallam <tmsriram@google.com>
8967
8968 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8969 sections that are not ordinary to icf.
8970 * icf.cc (get_section_contents): Handle relocation pointing to section
8971 with no object or shndx information.
8972 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8973 * testsuite/Makefile.in: Regenerate.
8974 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8975 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8976
f6973bdc
ILT
89772010-04-22 Ian Lance Taylor <iant@google.com>
8978
8979 * expression.cc (Expression::Expression_eval_info): Add
8980 result_alignment_pointer field.
8981 (Expression::eval_with_dot): Add result_alignment_pointer
8982 parameter. Change all callers.
8983 (Expression::eval_maybe_dot): Likewise.
8984 (class Binary_expression): Add alignment_pointer parameter to
8985 left_value and right_value. Change all callers.
8986 (BINARY_EXPRESSION): Set result alignment.
8987 (class Trinary_expression): Add alignment_pointer parameter to
8988 arg2_value and arg3_value. Change all callers.
8989 (Trinary_cond::value): Set result alignment.
8990 (Max_expression::value, Min_expression::value): Likewise.
8991 (Align_expression::value): Likewise.
8992 * script-sections.cc (class Sections_element): Add dot_alignment
8993 parameter to set_section_addresses virtual function. Update
8994 instantiations.
8995 (class Output_section_element): Likewise.
8996 (Script_sections::create_segments): Add dot_alignment parameter.
8997 Change all callers.
8998 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8999 (Script_sections::set_phdrs_clause_addresses): Likewise.
9000 * script-sections.h: Update declarations.
9001 * script.h: Update declarations.
9002 * output.h (Output_segment::set_minimum_p_align): Don't decrease
9003 min_p_align.
9004 * testsuite/script_test_3.t: Set large alignment.
9005 * testsuite/script_test_3.sh: Make sure that at least one LOAD
9006 segment has expected alignment.
9007
9c9c98a5
NC
90082010-04-22 Nick Clifton <nickc@redhat.com>
9009
9010 * po/gold.pot: Updated by the Translation project.
9011 * po/vi.po: Updated Vietnamese translation.
9012
2253bfba
L
90132010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9014
9015 * testsuite/Makefile.am (check_PROGRAMS): Add
9016 icf_virtual_function_folding_test.
9017 * testsuite/Makefile.in: Regenerated.
9018
85fdf906
AH
90192010-04-15 Andrew Haley <aph@redhat.com>
9020
9021 * options.h (merge_exidx_entries): New option.
9022 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9023 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9024 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9025 (Target_arm::merge_exidx_entries): New function.
9026 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9027 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9028 to Arm_exidx_fixup constructor.
9029 Add new arg, merge_exidx_entries.
9030 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9031 Arm_output_section::fix_exidx_coverage.
9032
ce97fa81
ST
90332010-04-18 Sriraman Tallam <tmsriram@google.com>
9034
9035 * icf.cc (get_section_contents): Check for preemptible functions.
9036 Ignore addend when appropriate.
9037 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9038 section folded.
9039 (add_from_relobj): Check for section folded.
9040 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9041 * symtab.h (should_add_dynsym_entry): Add new parameter.
9042 * target-reloc.h (scan_relocs): Check for section folded.
9043 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9044 Check reloc types for function pointers in shared objects.
9045 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9046 case.
9047 (icf_preemptible_functions_test): New test case.
9048 (icf_string_merge_test): New test case.
9049 * testsuite.Makefile.in: Regenerate.
9050 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9051 bar_glob. Refactor code.
9052 * testsuite/icf_preemptible_functions_test.cc: New file.
9053 * testsuite/icf_preemptible_functions_test.sh: New file.
9054 * testsuite/icf_string_merge_test.cc: New file.
9055 * testsuite/icf_string_merge_test.sh: New file.
9056 * testsuite/icf_virtual_function_folding_test.cc: New file.
9057 * testsuite/icf_virtual_function_folding_test.sh: New file.
9058
04ceb17c
DK
90592010-04-14 Doug Kwan <dougkwan@google.com>
9060
9061 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
9062 for local symbol recounting if we remove a section due to ICF.
9063 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
9064 there are no regular objects in input.
9065
153e7da4
DK
90662010-04-13 Doug Kwan <dougkwan@google.com>
9067
9068 * arm.cc (Arm_input_section::set_final_data_size): Compute
9069 accurate final data size instead of using current data size.
9070
4dbd9faf
DK
90712010-04-09 Doug Kwan <dougkwan@google.com>
9072
9073 * layout.cc (Layout::choose_output_section): Handle script section
9074 types.
9075 (Layout::make_output_section_for_script): Add section type parameter.
9076 Handle script section types.
9077 * layout.h (Layout::make_output_section_for_script): Add section
9078 type parameter.
9079 * output.cc (Output_section::Output_section): Initialize data member
9080 is_noload_.
9081 (Output_section::do_reset_address_and_file_offset): Do not set address
9082 to 0 if section is a NOLOAD section.
9083 * output.h (Output_section::is_noload): New method.
9084 (Output_section::set_is_noload): Ditto.
9085 (Output_section::is_noload_): New data member.
9086 * script-c.h (Script_section_type): New enum type.
9087 (struct Parser_output_section_header): Add new file section_type.
9088 * script-sections.cc (Sections_element::output_section_name): Add
9089 parameter for returning script section type.
9090 (Output_section_definition::output_section_name): Ditto.
9091 (Output_section_definition::section_type)P; New method.
9092 (Output_section_definiton::script_section_type_name): Ditto.
9093 (Output_section_definition::script_section_type_): New data member.
9094 (Output_section_definition::Output_section_definition): Initialize
9095 data member Output_section_definition::script_section_type_.
9096 (Output_section_definition::create_sections): Pass script section type
9097 to Layout::make_output_section_for_script.
9098 (Output_section_definition::output_section_name): Return script
9099 section type to caller.
9100 (Output_section_definition::set_section_address): Do not advance
9101 dot value and load address if section type is NOLOAD. Set address
9102 of NOLOAD sections regardless of section flags.
9103 (Output_section_definition::print): Print section type if it is
9104 not SCRIPT_SECTION_TYPE_NONE.
9105 (Output_section_definition::section_type): New method.
9106 (Output_section_definition::script_section_type_name): Ditto.
9107 (Script_sections::output_section_name): Add new parameter
9108 PSECTION_TYPE for returning script section type. Pass it to
9109 section elements. Handle discard sections.
9110 (Sort_output_sections::operator()): Handle NOLOAD sections.
9111 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 9112 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
9113 returning script section type.
9114 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
9115 INFO and NOLOAD.
9116 * yyscript.y (union): Add new field SECTION_TYPE.
9117 (COPY, DSECT, INFO, NOLOAD): New tokens.
9118 (opt_address_and_section_type): Change type to output_section_header.
9119 (section_type): New non-terminal
9120 (section_header): Handle section type.
2253bfba 9121 (opt_address_and_section_type): Return section type value.
4dbd9faf 9122
721ea635
L
91232010-04-09 H.J. Lu <hongjiu.lu@intel.com>
9124
9125 * testsuite/plugin_common_test_1.c (foo): Add prototype.
9126 * testsuite/plugin_common_test_2.c (foo): Likewise.
9127
6bf924b0
DK
91282010-04-08 Doug Kwan <dougkwan@google.com>
9129
9130 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
9131 Output_merge_data.
9132 * output.cc (Output_section::add_merge_input_section): Simplify
9133 code and return status of Output_merge_base::add_input_section.
e1df38aa 9134 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
9135 returns true.
9136
24af6f92
DK
91372010-04-07 Doug Kwan <dougkwan@google.com>
9138
9139 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9140 if section is marked as containing instructions but has no mapping
9141 symbols.
9142 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9143 correct section index.
9144 (Arm_relobj::find_linked_text_section): Ditto.
9145
00698fc5
CC
91462010-04-07 Cary Coutant <ccoutant@google.com>
9147
9148 * archive.cc (include_member): Destroy Read_symbols_data object before
9149 releasing file.
9150 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9151 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9152 (Read_symbols_data::~Read_symbols_data) New destructor.
9153 (Section_relocs::Section_relocs) New constructor.
9154 (Section_relocs::~Section_relocs) New destructor.
9155 (Read_relocs_data::Read_relocs_data) New constructor.
9156 (Read_relocs_data::~Read_relocs_data) New destructor.
9157 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9158 pointers to NULL after deleting.
9159
7296d933
DK
91602010-04-07 Doug Kwan <dougkwan@google.com>
9161
9162 * arm.cc: Replace "endianity" with "endianness" in comments.
9163 (Arm_exidx_cantunwind): Ditto.
9164 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9165 (Arm_relobj::merge_flags_and_attributes): New method.
9166 (Arm_relobj::merge_flags_and_attributes_): New data member.
9167 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9168 (Arm_relobj::scan_sections_for_stubs): Ditto.
9169 (Arm_relobj::do_read_symbols): Check to see if we really want to
9170 merge processor-specific flags and attributes. Exit early if
9171 an object is empty except for section names and the undefined symbol.
9172 (Target_arm::do_finalize_sections): Move check for ELF format to
9173 Arm_relobj::do_read_symbols. Merge processor specific flags and
9174 attributes from a regular object only when we have determined that
9175 it is aapropriate. Do not create an .ARM.attributes section in
9176 output if there is no regular input object.
9177 (Target_arm::merge_processor_specific_flags): Check
9178 --warn-mismatch before printing any error.
9179 (Target_arm::merge_object_attributes): Ditto.
9180 * gold.cc (queue_middle_tasks): Handle the case in which there is
9181 no regular object in input.
9182 * options.cc (General_options::parse_EB): New method.
9183 (General_options::parse_EL): Same.
9184 (General_options::General_options): Initialize endianness_.
9185 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9186 New options.
9187 (General_options::Endianness): New enum.
9188 (General_options::endianness): New method.
9189 (General_options::endianness_): New data member.
9190 * parameters.cc (Parameters::set_options): Check target endianness.
9191 (Parameters::set_target_once): Ditto.
9192 (Parameters::check_target_endianness): New method.
9193 (parameters_force_valid_target): If either -EL or -EB is specified,
9194 use it to define endianness of default target.
9195 * parameters.h (Parameters::check_target_endianness): New method
9196 declaration.
9197 * target.h (class Target): Change "endianity" to "endianness"
9198 in comments.
9199
efc8d4f2
RW
92002010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9201
9202 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9203 * configure: Regenerate.
9204 * Makefile.in: Regenerate.
9205 * testsuite/Makefile.in: Regenerate.
9206
be234d88
CC
92072010-04-06 Cary Coutant <ccoutant@google.com>
9208
9209 gcc PR lto/42757
9210 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9211 prevailing definitions of common symbols.
9212 * testsuite/plugin_test_6.sh: New test case.
9213 * testsuite/plugin_common_test_1.c: New test case.
9214 * testsuite/plugin_common_test_2.c: New test case.
9215 * testsuite/Makefile.am (plugin_test_6): New test case.
9216 * testsuite/Makefile.in: Regenerate.
9217
bd32c6bd
NC
92182010-04-06 Nick Clifton <nickc@redhat.com>
9219
9220 * po/vi.po: New Vietnamese translation.
9221
323c532f
DK
92222010-03-30 Doug Kwan <dougkwan@google.com>
9223
9224 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9225
4fcd97eb
DK
92262010-03-25 Doug Kwan <dougkwan@google.com>
9227
9228 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9229 to avoid a conversion warning on a 32-bit host.
9230
4ebf39db
ILT
92312010-03-24 Ian Lance Taylor <iant@google.com>
9232
9233 * testsuite/script_test_3.t: Add a TLS segment.
9234 * testsuite/Makefile.am (check_PROGRAMS): Add
9235 tls_phdrs_script_test.
9236 (tls_phdrs_script_test_SOURCES): Define.
9237 (tls_phdrs_script_test_DEPENDENCIES): Define.
9238 (tls_phdrs_script_test_LDFLAGS): Define.
9239 (tls_phdrs_script_test_LDADD): Define.
9240 * testsuite/Makefile.in: Rebuild.
9241
4a599bdd
CC
92422010-03-23 Cary Coutant <ccoutant@google.com>
9243
9244 * fileread.cc (find_or_make_view): Fix comment.
9245
6c93b22c
ILT
92462010-03-23 Ian Lance Taylor <iant@google.com>
9247
9248 * script-sections.cc (class Orphan_section_placement): Define
9249 PLACE_TLS and PLACE_TLS_BSS.
9250 (Orphan_section_placement::Orphan_section_placement): Initialize
9251 new places.
9252 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9253 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9254 (tls_script_test_SOURCES): Define.
9255 (tls_script_test_DEPENDENCIES): Define.
9256 (tls_script_test_LDFLAGS): Define.
9257 (tls_script_test_LDADD): Define.
9258 * testsuite/Makefile.in: Rebuild.
9259
a2c7281b
DK
92602010-03-22 Doug Kwan <dougkwan@google.com>
9261
9262 * arm.cc (Arm_relocate_functions::abs8,
9263 Arm_relocate_functions::abs16): Use correct check for overflow
9264 specified in the ARM ELF specs.
9265 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9266 target of a BLX instruction specially.
9267 (Reloc_stub::stub_type_for_reloc): Ditto.
9268 (Relocate::relocate): Use symbolic names instead of numeric relocation
9269 codes to report error.
9270 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9271 workaround.
9272 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9273 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9274 thumb2_blx_out_of_range.stdout
9275 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9276 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9277 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9278 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9279 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9280 thumb2_blx_in_range, thumb2_blx_in_range.o,
9281 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9282 thumb2_blx_out_of_range.o): New rules.
2e702c99 9283 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
9284 thumb2_blx_in_range and thumb2_blx_out_of_range.
9285 * testsuite/Makefile.in: Regenerate.
9286 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9287 * testsuite/thumb_blx_in_range.s: New file.
9288 * testsuite/thumb_blx_out_of_range.s: New file.
9289
b0193076
RÁE
92902010-03-22 Rafael Espindola <espindola@google.com>
9291
9292 * archive.cc (Should_include): Move to archive.h.
9293 (should_include_member): Make it a member of Archive.
9294 (Lib_group): New.
9295 (Add_lib_group_symbols): New.
9296 * archive.h: Include options.h.
9297 (Archive_member): Moved from Archive.
9298 (Should_include): Moved from archive.cc.
9299 (Lib_group): New.
9300 (Add_lib_group_symbols): New.
9301 * dynobj.cc (do_should_include_member): New.
9302 * dynobj.h (do_should_include_member): New.
9303 * gold.cc (queue_initial_tasks): Update call to queue.
9304 * main.cc (main): Print lib group stats.
9305 * object.cc (do_should_include_member): New.
9306 * object.h: Include archive.h.
9307 (Object::should_include_member): New.
9308 (Object::do_should_include_member): New.
9309 (Sized_relobj::do_should_include_member): New.
9310 * options.cc (General_options::parse_start_lib): New.
9311 (General_options::parse_end_lib): New.
9312 (Input_arguments::add_file): Handle lib groups.
9313 (Input_arguments::start_group): Check we are not in a lib.
9314 (Input_arguments::start_lib): New.
9315 (Input_arguments::end_lib): New.
9316 * options.h (General_options): Add start_lib and end_lib.
9317 (Input_argument::lib_): New.
9318 (Input_argument::lib): New.
9319 (Input_argument::is_lib): New.
9320 (Input_file_lib): New.
9321 (Input_arguments::in_lib_): New.
9322 (Input_arguments::in_lib): New.
9323 (Input_arguments::start_lib): New.
9324 (Input_arguments::end_lib_): New.
9325 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9326 in unused members as preempted.
9327 (Sized_pluginobj::do_should_include_member): New.
9328 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9329 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9330 return the blocker.
9331 (Read_symbols::do_whole_lib_group): New.
9332 (Read_symbols::do_lib_group): New.
9333 (Read_symbols::do_read_symbols): Handle lib groups.
9334 (Read_symbols::get_name): Handle lib groups.
9335 * readsyms.h (Read_symbols): Add an archive member pointer.
9336 (Read_symbols::do_whole_lib_group): New.
9337 (Read_symbols::do_lib_group): New.
9338 (Read_symbols::member_): New.
9339 * script.cc (read_input_script): Update call to queue_soon.
9340
d099120c
DK
93412010-03-19 Doug Kwan <dougkwan@google.com>
9342
9343 * arm.cc (Stub_table::Stub_table): Initialize new data members
9344 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9345 (Stub_table::add_reloc_stub): Assign stub offset and update
9346 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9347 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9348 New data members.
2e702c99 9349 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9350 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9351 instead of going over all reloc stubs.
2e702c99 9352 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9353 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9354 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9355 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9356 Stringpool_template::offset_.
9357 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9358 Stringpool_template::offset_ to zero.
9359
1aa37384
DK
93602010-03-15 Doug Kwan <dougkwan@google.com>
9361
9362 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9363 offset_.
9364 (Stringpool_template::new_key_offset): New method.
9365 (Stringpool_template::add_string): Assign offsets when adding new
9366 strings.
9367 (Stringpool_template::set_string_offsets): Do not set string offsets
9368 when not optimizing.
9369 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9370 member size_.
2e702c99
RM
9371 (Chunked_vector::clear): Clear size_.
9372 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9373 (Chunked_vector::size): Return size_.
9374 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9375 (Chunked_vector::size_): New data member.
1aa37384
DK
9376 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9377 (Stringpool_template::new_key_offset): New method declaration.
9378 (Stringpool_template::offset_): New data member.
9379
b672b057
RÁE
93802010-03-15 Rafael Espindola <espindola@google.com>
9381
9382 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9383 Add_symbols' constructor.
9384 * readsyms.h (Add_symbols): Remove the input_group member.
9385
b6848d3c
ILT
93862010-03-10 Ian Lance Taylor <iant@google.com>
9387
9388 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9389 target to ask whether a reference to a symbol requires a stack
9390 split.
9391 * target.h (Target::is_call_to_non_split): New function.
9392 (Target::do_is_call_to_non_split): Declare virtual function.
9393 * target.cc: Include "symtab.h".
9394 (Target::do_is_call_to_non_split): New function.
9395 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9396
a2a5469e
CC
93972010-03-10 Cary Coutant <ccoutant@google.com>
9398
9399 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9400 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9401 (File_read::open[2]): Add whole_file_view_ to list of views.
9402 (File_read::make_view): Remove test of whole_file_view_.
9403 (File_read::find_or_make_view): Create whole_file_view_ if
9404 necessary.
9405 (File_read::clear_views): Replace bool parameter with enum;
9406 adjust all callers. Don't delete views with permanent data;
9407 do delete cached views and views from archives if
9408 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9409 if clearing the corresponding view.
9410 * fileread.h (File_read::Clear_views_mode): New enum.
9411 (File_read::View::is_permanent_view): New method.
9412 (File_read::clear_views): Replace bool parameter
9413 with enum; adjust all callers.
9414 * options.h (General_options): Change keep_files_mapped option;
9415 add map_whole_files.
9416 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9417 releasing the file.
9418 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9419 the file.
9420
8861f32b
DM
94212010-03-10 David S. Miller <davem@davemloft.net>
9422
9423 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9424
d62d0f5f
ST
94252010-03-09 Sriraman Tallam <tmsriram@google.com>
9426
9427 * icf.cc (get_section_contents): Add '@' marker after processing the
9428 merge reloc.
9429
9177756d
DK
94302010-03-08 Doug Kwan <dougkwan@google.com>
9431
9432 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9433 due to a conversion warning.
9434 (Arm_relobj::update_output_local_symbol_count): Check for local
9435 symbol with unset output index.
9436
9e9e071b
ILT
94372010-03-05 Ian Lance Taylor <iant@google.com>
9438
9439 * options.h (class General_options): Add --spare-dynamic-tags.
9440 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9441 --spare-dynamic-tags.
9442
a81ee015
ILT
94432010-03-05 Ian Lance Taylor <iant@google.com>
9444
9445 * incremental.cc: Include "libiberty.h".
9446
44ec90b9
RO
94472010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9448
9449 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9450 function, is_info_ member.
9451 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9452 (Versions::Versions): Update caller.
9453 (Versions::define_base_version): Likewise.
9454 (Versions::add_def): Likewise.
9455
0897ed3b
ST
94562010-03-03 Sriraman Tallam <tmsriram@google.com>
9457
9458 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9459 (Scan::possible_function_pointer_reloc): New function.
9460 (Scan::local_reloc_may_be_function_pointer): Change to call
9461 possible_function_pointer_reloc.
9462 (Scan::global_reloc_may_be_function_pointer): Ditto.
9463 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9464 relocations in ".data.rel.ro._ZTV" section.
9465 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9466 * testsuite/icf_safe_so_test.cc: Ditto.
9467 * testsuite/icf_safe_test.cc: Ditto.
9468 * testsuite/icf_safe_test.sh: Ditto.
9469
d3bbad62
ILT
94702010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9471 Ian Lance Taylor <iant@google.com>
9472
9473 * target-reloc.h (relocate_section): Check the symbol table index
9474 for -1U before setting the local symbol index.
9475 (scan_relocatable_relocs): If copying the relocation, record that
9476 the local symbol is required.
9477 * object.h (Symbol_value::is_output_symtab_index_set): New
9478 function.
9479 (Symbol_value::may_be_discarded_from_output_symtab): New
9480 function.
9481 (Symbol_value::has_output_symtab_entry): New function.
9482 (Symbol_value::needs_output_symtab_entry): Remove.
9483 (Symbol_value::output_symtab_index): Make sure the symbol index is
9484 set.
9485 (Symbol_value::set_output_symtab_index): Make sure the symbol
9486 index is not set. Make sure the new index is valid.
9487 (Symbol_value::set_must_have_output_symtab_entry): New function.
9488 (Symbol_value::has_output_dynsym_entry): New function.
9489 (Symbol_value::set_output_dynsym_index): Make sure the new index
9490 is valid.
9491 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9492 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9493 local symbol if permitted.
9494 (Sized_relobj::do_finalize_local_symbols): Call
9495 is_output_symtab_index_set rather than needs_output_symtab_entry.
9496 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9497 rather than needs_output_symtab_entry. Call
9498 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9499 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9500 is_output_symtab_index_set rather than needs_output_symtab_entry.
9501 * testsuite/discard_locals_relocatable_test.c: New file.
9502 * testsuite/discard_locals_test.sh: Test -r.
9503 * testsuite/Makefile.am (check_DATA): Add
9504 discard_locals_relocatable_test1.syms,
9505 discard_local_relocatable_test2.syms.
9506 (MOSTLYCLEANFILES): Likewise. Also add
9507 discard_locals_relocatable_test1.lout and
9508 discard_locals_relocatable_test2.out.
9509 (discard_locals_relocatable_test1.syms): New target.
9510 (discard_locals_relocatable_test.o): New target.
9511 (discard_locals_relocatable_test1.out): New target.
9512 (discard_locals_relocatable_test2.syms): New target.
9513 (discard_locals_relocatable_test2.out): New target.
9514 (various): Add missing ../ld-new dependencies.
9515 * testsuite/Makefile.in: Rebuild.
9516
7e8ccf26
NC
95172010-03-03 Nick Clifton <nickc@redhat.com>
9518
9519 * po/fi.po: New Finnish translation.
9520
2a0ff005
DK
95212010-03-01 Doug Kwan <dougkwan@google.com>
9522
9523 * layout.cc (Layout::Layout): Force section types of .init_array*,
9524 .preinit_array* and .fini_array* sections.
9525 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9526 Fix check of return value of std::string::find.().
9527 (Output_section::Input_section_sort_compare::operator()): Remove
9528 comment about .init_array.
9529 (Output_section::Input_section_sort_init_fini_compare::operator()):
9530 New method.
9531 (Output_section::sort_attached_input_sections): Handle .init_array
9532 and .fini_array specially.
9533 * output.h (Output_section::Inut_section_sort_compare): Update
9534 comment.
9535 (Output_section::Input_section_sort_init_fini_compare): New struct.
9536
c3e4ae29
DK
95372010-02-26 Doug Kwan <dougkwan@google.com>
9538
9539 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9540 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9541 * testsuite/debug_msg.sh: Avoid matching source line number for
9542 use of global variable undef_int.
9543
2fd9ae7a
DK
95442010-02-26 Doug Kwan <dougkwan@google.com>
9545
9546 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9547 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9548 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9549 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9550 * options.cc (General_options::General_options): Initialize member
9551 fix_v4bx_.
9552 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9553 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9554 and rm_no_fix_v4bx.stdout
9555 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9556 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9557 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9558 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9559 and arm_no_fix_v4bx.
9560 * Makefile.in: Regenerate.
9561 * testsuite/arm_fix_v4bx.s: New file.
9562 * testsuite/arm_fix_v4bx.sh: Ditto.
9563
67ec7d0b
DK
95642010-02-24 Doug Kwan <dougkwan@google.com>
9565
9566 * arm.cc (Target_arm::got_section): Make the .got section the first
9567 non RELRO section in the data segment.
9568 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9569 suffixes of section names.
9570
10165461
DK
95712010-02-24 Doug Kwan <dougkwan@google.com>
9572
9573 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9574 flags and attributes merging if an input file is a binary file.
9575 * fileread.cc (Input_file::open): Record format of original file.
9576 * fileread.h (Input_file::Format): New enum type.
2e702c99 9577 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9578 (Input_file::format): New method definition.
9579 (Input_file::format_):: New data member.
9580
4a54abbb
DK
95812010-02-24 Doug Kwan <dougkwan@google.com>
9582
9583 * arm.cc (Arm_output_data_got): New class.
9584 (ARM_TCB_SIZE): New constant
9585 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9586 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9587 If user uses a script with a SECTIONS clause, issue only a warning
9588 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9589 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9590 garbage collection.
9591 (Target_arm::got_mode_index_entry): Handle static linking.
9592 (Target_arm::Scan::local): Ditto.
9593 (Target_arm::Scan::global): Ditto.
9594 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9595 all incorrectly implemented relocations.
e1df38aa 9596 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
9597 Arm_output_section::fix_exidx_coverage.
9598 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9599 from ".ARM.exidx." and ".ARM.extab.".
9600
ca419a6f
ILT
96012010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9602
9603 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9604 section if it does not already exist.
9605 * attributes.cc (Attributes_section_data::Attributes_section_data):
9606 Don't crash if size is zero.
9607
135b9c78
ILT
96082010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9609 Ian Lance Taylor <iant@google.com>
9610
9611 * gold.cc (queue_middle_tasks): If no input files were opened,
9612 exit.
9613 * workqueue.h (Task_function::Task_function): Assert that there is
9614 a blocker.
9615
bb0bfe4f
DK
96162010-02-22 Doug Kwan <dougkwan@google.com>
9617
9618 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9619 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9620 types to avoid warnings due to different uint64_t implementations
9621 on different hosts.
9622
2a2b6d42
DK
96232010-02-21 Doug Kwan <dougkwan@google.com>
9624
9625 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9626 handling of the maximum backward branch offset.
2e702c99 9627 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
9628 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9629 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 9630 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
9631 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9632 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9633 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9634 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9635 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9636 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9637 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9638 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9639 thumb2_bl_out_of_range.o): New rules.
9640 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9641 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9642 thumb2_bl_out_of_range
9643 * testsuite/Makefile.in: Regenerate.
9644 * testsuite/arm_bl_in_range.s: New file.
9645 * testsuite/arm_bl_out_of_range.s: Ditto.
9646 * testsuite/arm_branch_in_range.sh: Ditto.
9647 * testsuite/arm_branch_range.t: Ditto.
9648 * testsuite/thumb2_branch_range.t: Ditto.
9649 * testsuite/thumb_bl_in_range.s: Ditto.
9650 * testsuite/thumb_bl_out_of_range.s: Ditto.
9651 * testsuite/thumb_branch_range.t: Ditto.
9652
b487ad64
ST
96532010-02-20 Sriraman Tallam <tmsriram@google.com>
9654
9655 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9656 Add reloc offset information.
9657 * icf.cc (get_section_contents): Change iterators to point to the new
9658 vectors. Add reloc offset information to the contents.
9659 * icf.h (Icf::Sections_reachable_info): New typedef.
9660 (Icf::Sections_reachable_list): New typedef.
9661 (Icf::Offset_info): New typedef.
9662 (Icf::Reloc_info): New struct typedef.
9663 (Icf::Reloc_info_list): New typedef.
9664 (Icf::symbol_reloc_list): Delete method.
9665 (Icf::addend_reloc_list): Delete method.
9666 (Icf::section_reloc_list): Delete method.
9667 (Icf::reloc_info_list): New method.
9668 (Icf::reloc_info_list_): New member.
9669
f96accdf
DK
96702010-02-19 Doug Kwan <dougkwan@google.com>
9671
9672 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9673 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9674 * arm.cc (Arm_relocation_functions): New forward declaration.
9675 (Target_arm::Target_arm): Initialize new data members
9676 got_mod_index_offset_ and tls_base_symbol_defined_.
9677 (Target_arm::Relocate::relocate_tls): New method.
9678 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9679 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9680 New methods.
2e702c99 9681 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
9682 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9683 (Target_arm::got_mod_index_offset_,
9684 Target_arm::tls_base_symbol_defined_): New data members.
9685 (Target_arm::Scan::local, Target::Scan::global,
9686 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9687 relocations.
9688
c8761b9a
DK
96892010-02-18 Doug Kwan <dougkwan@google.com>
9690
9691 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9692 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9693 text section as a parameter becuase some broken tools may not set
9694 the link in section header.
9695 (Target_arm::has_got_section): New method.
9696 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9697 without any mapping symbol as data only. Remove warning.
9698 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9699 link in its section header, try to discover the link by inspecting the
9700 REL31 relocation at the beginning of the section.
9701 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9702 in error message.
9703 (Target_arm::Scan::global): Treat any reference to the symbol
9704 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9705
21bb3914
ST
97062010-02-12 Sriraman Tallam <tmsriram@google.com>
9707
9708 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9709 (Scan::global_reloc_may_be_function_pointer): New function.
9710 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9711 (Scan::global_reloc_may_be_function_pointer): New function.
9712 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9713 (Scan::global_reloc_may_be_function_pointer): New function.
9714 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9715 (Scan::global_reloc_may_be_function_pointer): New function.
9716 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9717 (Scan::global_reloc_may_be_function_pointer): New function.
9718 (Scan::possible_function_pointer_reloc): New function.
9719 (Target_x86_64::can_check_for_function_pointers): New function.
9720 * gc.h (gc_process_relocs): Scan relocation types to determine if
9721 function pointers were taken for targets that support it.
9722 * icf.cc (Icf::find_identical_sections): Include functions for
9723 folding in safe ICF whose pointer is not taken.
9724 * icf.h (Secn_fptr_taken_set): New typedef.
9725 (fptr_section_id_): New member.
9726 (section_has_function_pointers): New function.
9727 (set_section_has_function_pointers): New function.
9728 (check_section_for_function_pointers): New function.
9729 * options.h: Fix comment for safe ICF option.
9730 * target.h (can_check_for_function_pointers): New function.
9731 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9732 Modify icf_safe_test for X86-64.
9733 * testsuite/Makefile.in: Regenerate.
9734 * testsuite/icf_safe_so_test.cc: New file.
9735 * testsuite/icf_safe_so_test.sh: New file.
9736 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9737 (main): Change to take pointer to function kept_func_3.
9738 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9739 folding is done correctly for X86-64.
9740
0da6fa6c
DM
97412010-02-12 David S. Miller <davem@davemloft.net>
9742
9743 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9744 is_symbolless parameter.
9745 (Output_reloc<SHT_REL>::is_symbolless): New.
9746 (Output_reloc<SHT_REL>::is_symbolless_): New.
9747 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9748 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9749 (Output_reloc<SHT_RELA>::is_symbolless): New.
9750 (Output_data_reloc::add_global): Handle is_symbolless.
9751 (Output_data_reloc::add_global_relative): Likewise.
9752 (Output_data_reloc::add_local): Likewise.
9753 (Output_data_reloc::add_local_relative): Likewise.
9754 (Output_data_reloc::add_symbolless_global_addend): New.
9755 (Output_data_reloc::add_symbolless_local_addend): New.
9756 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9757 is_symbolless.
9758 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9759 instead of ->is_relative_
9760 (Output_reloc::write): Likewise.
9761 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9762 (Output_reloc::write_rel): Simplify.
9763
9764 * sparc.cc (Target_sparc::Scan::local): Use
9765 ->add_symbolless_local_addend as needed.
9766 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9767 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9768 based upon relocation offset.
9769
e4782e83
DK
97702010-02-11 Doug Kwan <dougkwan@google.com>
9771
9772 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9773 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9774 beginning of function.
9775 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9776 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9777 parameter is_32bit in calls to should_apply_static_reloc.
9778 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9779 (check_DATA): Add arm_abs_global.stdout.
9780 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9781 arm_abs_global.stdout): New rules.
9782 (MOSTLLYCLEANFILES): Add arm_abs_global
9783 * Makefile.in: Regenerate.
9784 * testsuite/arm_abs_global.s: New file.
9785 * testsuite/arm_abs_global.sh: Ditto.
9786 * testsuite/arm_abs_lib.s: Ditto.
9787
93ceb764
ILT
97882010-02-11 Ian Lance Taylor <iant@google.com>
9789
9790 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9791 Read_relocs task.
9792 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9793 Allocate_commons_task first.
9794 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9795 task, rather than symtab_lock_.
9796 (Gc_process_relocs::~Gc_process_relocs): New function.
9797 (Gc_process_relocs::is_runnable): Check this_blocker_.
9798 (Gc_process_relocs::locks): Use next_blocker_ rather than
9799 blocker_.
9800 (Scan_relocs::~Scan_relocs): New function.
9801 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9802 symtab_lock_.
9803 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9804 next_blocker_.
9805 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9806 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9807 constructor accordingly.
9808 (class Gc_process_relocs): Likewise.
9809 (class Scan_relocs): Likewise.
9810 * common.h (class Allocate_commons_task): Remove symtab_lock_
9811 field, and corresponding constructor parameter.
9812 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9813 symtab_lock_.
9814 (Allocate_commons_task::locks): Likewise.
9815
114dfbe1
ILT
98162010-02-11 Ian Lance Taylor <iant@google.com>
9817
9818 * gold-threads.h (class Once): Define.
9819 (class Initialize_lock): Rewrite as child of Once.
9820 * gold-threads.cc (class Once_initialize): Define.
9821 (once_pointer_control): New static variable.
9822 (once_pointer, once_arg): New static variables.
9823 (c_run_once): New static function.
9824 (Once::Once, Once::run_once, Once::internal_run): New functions.
9825 (class Initialize_lock_once): Remove.
9826 (initialize_lock_control): Remove.
9827 (initialize_lock_pointer): Remove.
9828 (initialize_lock_once): Remove.
9829 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9830 (Initialize_lock::initialize): Rewrite.
9831 (Initialize_lock::do_run_once): New function.
9832 * archive.cc (Archive::interpret_header): Only clear name if it is
9833 not already empty.
9834 * fileread.cc: Include "gold-threads.h"
9835 (file_counts_lock): New static variable.
9836 (file_counts_initialize_lock): Likewise.
9837 (File_read::release): Only increment counts when using --stats.
9838 Use a lock around the increment.
9839 * parameters.cc (class Set_parameters_target_once): Define.
9840 (set_parameters_target_once): New static variable.
9841 (Parameters::Parameters): Move here from parameters.h.
9842 (Parameters::set_target): Rewrite.
9843 (Parameters::set_target_once): New function.
9844 (Parameters::clear_target): Move here and rewrite.
9845 * parameters.h (class Parameters): Update declarations. Add
9846 set_parameters_target_once_ field.
9847 (Parameters::Parameters): Move to parameters.cc.
9848 (Parameters::clear_target): Likewise.
9849 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9850 task.
9851 (Start_group::~Start_group): New function.
9852 (Start_group::is_runnable): New function.
9853 (Start_group::locks, Start_group::run): New functions.
9854 (Finish_group::run): Change saw_undefined to size_t.
9855 * readsyms.h (class Start_group): Define.
9856 (class Finish_group): Change saw_undefined_ field to size_t.
9857 (Finish_group::Finish_group): Remove saw_undefined and
9858 this_blocker parameters. Change all callers.
9859 (Finish_group::set_saw_undefined): New function.
9860 (Finish_group::set_blocker): New function.
9861 * symtab.h (class Symbol_table): Change saw_undefined to return
9862 size_t. Change saw_undefined_ field to size_t.
9863 * target-select.cc (Set_target_once::do_run_once): New function.
9864 (Target_selector::Target_selector): Initialize set_target_once_
9865 field. Don't initialize lock_ and initialize_lock_ fields.
9866 (Target_selector::instantiate_target): Rewrite.
9867 (Target_selector::set_target): New function.
9868 * target-select.h (class Set_target_once): Define.
9869 (class Target_selector): Update declarations. Make
9870 Set_target_once a friend. Remove lock_ and initialize_lock_
9871 fields. Add set_target_once_ field.
9872
fa17a3f4
ILT
98732010-02-10 Ian Lance Taylor <iant@google.com>
9874
9875 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9876 queueing any tasks.
9877 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9878 (queue_middle_tasks): Add all blockers before queueing any tasks.
9879 (queue_final_tasks): Likewise.
9880 * token.h (Task_token::add_blockers): New function.
9881 * object.h (Input_objects::number_of_relobjs): New function.
9882
c7177d31
ILT
98832010-02-10 Ian Lance Taylor <iant@google.com>
9884
5de0e392
ILT
9885 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9886 shared, not if not position independent.
9887 * x86_64.cc (Relocate::relocate_tls): Likewise.
9888 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9889 (tls_pie_pic_test): New target.
9890 * testsuite/Makefile.in: Rebuild.
9891
c7177d31
ILT
9892 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9893 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9894 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9895 * testsuite/Makefile.in: Rebuild.
9896
684b268a
DM
98972010-02-09 David S. Miller <davem@davemloft.net>
9898
9899 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9900 R_SPARC_RELATIVE using ->add_local_relative().
9901 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9902
612a8d3d
DM
9903 * output.h (Output_data_dynamic::add_section_size): New method
9904 that takes two Output_data objects.
9905 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9906 entry param. Handle it in initializers.
9907 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9908 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9909 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9910 arg.
9911 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9912 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9913 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9914 for dynrel_includes_plt.
9915 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9916 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9917 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9918 before .rela.plt
9919 (Target_sparc::do_finalize_sections): Update to pass true for
9920 dynrel_includes_plt.
9921 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9922 output before .rela.plt
9923 (Target_powerpc::do_finalize_sections): Update to pass true for
9924 dynrel_includes_plt when 32-bit.
9925
cb1be87e
DK
99262010-02-08 Doug Kwan <dougkwan@google.com>
9927
9928 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9929 method.
9930 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9931 Arm_relobj::scan_section_for_cortex_a8_stubs,
9932 Arm_relobj::do_relocation_section): Instead of calling
9933 Output_section::output_address, use faster
9934 Arm_relobj::simple_input_section_output_address.
9935
705b5121
DM
99362010-02-08 David S. Miller <davem@davemloft.net>
9937
9938 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9939 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9940 relocation helper function.
9941
024c4466
DM
9942 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9943 just like R_SPARC_GOT{10,13,22}.
9944 (Target_sparc::Scan::local): Likewise.
9945 (Target_sparc::Relocate:relocate): Likewise.
9946
9109c078
ILT
99472010-02-06 Ian Lance Taylor <iant@google.com>
9948
9949 * configure.ac: Rewrite targetobjs duplicate removal code to use
9950 only shell constructs.
9951 * configure: Rebuild.
9952
cf846138
DK
99532010-02-05 Doug Kwan <dougkwan@google.com>
9954
9955 PR 11247
9956 * arm.cc (Arm_relobj::section_is_scannable): New method.
9957 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9958 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9959
6cfaf60b
DK
99602010-02-04 Doug Kwan <dougkwan@google.com>
9961
9962 PR 11247
9963 * arm-reloc-property.cc (cstdio): Include.
9964 * configure.ac (targetobjs): Remove duplicates.
9965 * configure: Regenerate.
9966 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9967 big and little endian version for a given address size.
9968
5c57f1be
DK
99692010-02-03 Doug Kwan <dougkwan@google.com>
9970
9971 * arm-reloc-property.cc
9972 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9973 definition.
9974 * arm-reloc-property.h
9975 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9976 New method definition.
9977 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9978 declaration.
9979 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9980 overflow to N.
9981 (GOT_PREL): Change implemented to Y.
9982 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9983 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9984 (Arm_relocate_functions::movw_abs_nc): Remove method.
9985 (Arm_relocate_functions::movt_abs): Ditto.
9986 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9987 (Arm_relocate_functions::thm_movt_abs): Ditto.
9988 (Arm_relocate_functions::movw_rel_nc): Ditto.
9989 (Arm_relocate_functions::movw_rel): Ditto.
9990 (Arm_relocate_functions::movt_rel): Ditto.
9991 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9992 (Arm_relocate_functions:thm_movw_rel): Ditto.
9993 (Arm_relocate_functions:thm_movt_rel): Ditto.
9994 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9995 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9996 New method definitions.
9997 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9998 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9999 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
10000 (Arm_relocation_functions::arm_grp_ldc): Ditto.
10001 (Target_arm::Relocate::relocate): Check for non-static or
10002 unimplemented relocation code and exit early. Change calls to
10003 Target_arm::reloc_uses_thumb_bit and
10004 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
10005 instead. Refactor code to handle similar relocations to increase
10006 code sharing. Remove check for unsupported relocation code in switch
10007 statement.
10008 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
10009 relocation property table to find out size. Change error message to
10010 print out the name of a relocation code instead of the numeric value.
10011 (Target_arm::scan_reloc_for_stub): Use relocation property table
10012 instead of calling Target_arm::reloc_uses_thumb_bit().
10013
218c5831
DK
100142010-02-02 Doug Kwan <dougkwan@google.com>
10015
10016 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10017 types of relaxed input section.
10018
0d31c79d
DK
100192010-02-02 Doug Kwan <dougkwan@google.com>
10020
10021 * Makefile.am (HFILES): Add arm-reloc-property.h.
10022 (DEFFILES): New.
2e702c99
RM
10023 (TARGETSOURCES): Add arm-reloc-property.cc
10024 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
10025 (libgold_a_SOURCES): $(DEFFILES)
10026 * Makefile.in: Regenerate.
10027 * arm-reloc-property.cc: New file.
10028 * arm-reloc-property.h: New file.
10029 * arm-reloc.def: New file.
10030 * arm.cc: Update comments.
10031 (arm-reloc-property.h): New included header.
10032 (arm_reloc_property_table): New global variable.
10033 (Target_arm::do_select_as_default_target): New method definition.
10034 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10035 arm-reloc-property to targ_extra_obj.
10036 * parameters.cc (set_parameters_target): Call
10037 Target::select_as_default_target().
10038 * target.h (Target::select_as_default_target): New method definition.
10039 (Target::do_select_as_default_target): Same.
10040
546c7457
DK
100412010-02-01 Doug Kwan <dougkwan@google.com>
10042
10043 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10044 first_output_text_section_.
10045 (Arm_exidx_fixup::first_output_text_section): New method definition.
10046 (Arm_exidx_fixup::first_output_text_section_): New data member.
10047 (Arm_exidx_fixup::process_exidx_section): Record the first text
10048 output section seen.
10049 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10050 and entsize in output section header.
10051
11b861d5
DK
100522010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10053
10054 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10055 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10056 (Arm_relocate_functions::thm_alu11): New Method.
10057 (Arm_relocate_functions::thm_pc8): New Method.
10058 (Arm_relocate_functions::thm_pc12): New Method.
10059 (Target_arm::Scan::local): Handle the relocations.
10060 (Target_arm::Scan::global): Likewise.
10061 (Target_arm::Relocate::relocate): Likewise.
10062 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10063
c9a2c125
DK
100642010-01-29 Doug Kwan <dougkwan@google.com>
10065
10066 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
10067 of relocation types as ld.
10068
1521477a
DK
100692010-01-29 Doug Kwan <dougkwan@google.com>
10070
10071 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10072 to public.
10073 (Arm_relocate_functions::thumb_branch_common): Ditto.
10074 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10075 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10076 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10077 Arm_relocate_functions::jump24): Remove.
10078 (Target_arm::Relocate::relocate): Adjust code to call
10079 Arm_relocation_functions::arm_branch_common and
10080 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 10081 wrappers. Merge switch-cases together to reduce source code size.
1521477a 10082
e7eca48c
DK
100832010-01-29 Doug Kwan <dougkwan@google.com>
10084
10085 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10086 output_local_symbol_count_needs_update_.
10087 (Arm_relobj::output_local_symbol_count_needs_update,
10088 Arm_relobj::set_output_local_symbol_count_needs_update,
10089 Arm_relobj::update_output_local_symbol_count): New methods.
10090 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10091 member.
10092 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10093 of pointed function as in a R_ARM_PREL31 relocation.
10094 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10095 for output local symbol count updating.
10096 (Target_arm::do_relax): Update output local symbol counts in objects
10097 if necessary.
10098 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10099
02961d7e
ILT
101002010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10101
10102 * arm.cc: Added support for the ARM relocations:
10103 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
10104 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
10105 (Arm_relocate_functions::movw_rel_nc): Renamed (was
10106 movw_prel_nc).
10107 (Arm_relocate_functions::movw_rel): New method.
10108 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
10109 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
10110 thm_movw_prel_nc).
10111 (Arm_relocate_functions::thm_movw_rel): New method.
10112 (Arm_relocate_functions::thm_movt_rel): Renamed (was
10113 thm_movt_prel).
10114 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
10115 relocations.
10116 (Target_arm::Scan::global): Likewise.
10117 (Target_arm::Relocate::relocate): Likewise.
10118 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10119 Likewise.
10120
b10d2873
ILT
101212010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10122
10123 * arm.cc: Added support for ARM group relocations.
10124 (Target_arm::reloc_needs_sym_origin): New method.
10125 (Arm_relocate_functions::calc_grp_kn): New method.
10126 (Arm_relocate_functions::calc_grp_residual): New method.
10127 (Arm_relocate_functions::calc_grp_gn): New method.
10128 (Arm_relocate_functions::arm_grp_alu): New Method.
10129 (Arm_relocate_functions::arm_grp_ldr): New Method.
10130 (Arm_relocate_functions::arm_grp_ldrs): New Method.
10131 (Arm_relocate_functions::arm_grp_ldc): New Method.
10132 (Target_arm::Scan::local): Handle the ARM group relocations.
10133 (Target_arm::Scan::global): Likewise.
10134 (Target_arm::Relocate::relocate): Likewise.
10135 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10136 Likewise.
10137
2b328d4e
DK
101382010-01-26 Doug Kwan <dougkwan@google.com>
10139
10140 * arm.cc (set): Include.
10141 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10142 pointer type.
2e702c99 10143 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
10144 (Arm_output_section::append_text_sections_to_list): New method.
10145 (Arm_output_section::fix_exidx_coverage): Ditto.
10146 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 10147 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
10148 Relobj::set_section_offset() instead of
10149 Sized_relobj::invalidate_section_offset().
2e702c99 10150 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
10151 parameter for section headers. Ignore relocation sections for
10152 unallocated sections and EXIDX sections.
10153 (Target_arm::fix_exidx_coverage): New method.
10154 (Target_arm::output_section_address_less_than): New type.
10155 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10156 linked text section instead of the EXIDX section.
10157 (Arm_output_section::create_stub_group): Add an assertion to check
10158 that this is not an EXIDX output section.
10159 (Arm_output_section::append_text_sections_to_list): New method.
10160 (Arm_output_section::fix_exidx_coverage): Ditto.
10161 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 10162 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
10163 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10164 first pass.
10165 (Target_arm::fix_exidx_coverage): New method.
10166 * object.h (Relobj::set_output_section): New method.
10167 (Sized_relobj::invalidate_section_offset): Remove method.
10168 (Sized_relobj::do_invalidate_section_offset): Remove method.
10169 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10170
c7f3c371
DK
101712010-01-25 Doug Kwan <dougkwan@google.com>
10172
10173 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10174 Fix warning due to signed and unsigned comparison on a 32-bit host.
10175
8923b24c
DK
101762010-01-22 Doug Kwan <dougkwan@google.com>
10177
10178 * arm.cc (Target_arm::do_relax): Record an output section for section
10179 offset adjustment it contains any stub table that has changed.
10180 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10181 offsets in an output section if necessary.
10182 * output.cc (Output_section::Output_section): Initialize
10183 section_offsets_need_adjustments_.
10184 (Output_section::add_input_section_for_script): Renamed to
10185 Output_section::add_simple_input_section.
10186 (Output_section::save_states): Add a comment.
10187 (Output_section::discard_states): New method defintion.
10188 (Output_section::adjust_section_offsets): Same.
10189 * output.h (Output_section::add_input_section_for_script): Renamed to
10190 Output_section::add_simple_input_section.
10191 (Output_section::discard_states): New method declaration.
10192 (Output_section::adjust_section_offsets): Same.
10193 (Output_section::section_offsets_need_adjustment,
10194 Output_section::set_section_offsets_need_adjustment): New method
10195 definitions.
10196 (Output_section::section_offsets_need_adjustment_): New data member.
10197 * script-sections.cc
10198 (Output_section_element_input::set_section_address): Adjust code for
10199 renaming of Output_section::add_input_section_for_script.
10200 (Orphan_output_section::set_section_address): Same.
10201
9b2fd367
DK
102022010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10203
10204 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10205 Fix_v4bx enum values .
10206 * gold/options.h (General_options): New option definitions.
10207 (General_options::fix_v4bx): New method.
10208 (General_options::Fix_v4bx): New enum.
10209 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10210 (General_options::parse_fix_v4bx_interworking): New method.
10211
80d0d023
DK
102122010-01-22 Doug Kwan <dougkwan@google.com>
10213
10214 * arm.cc (Arm_exidx_fixup): New class.
10215
af2cdeae
DK
102162010-01-21 Doug Kwan <dougkwan@google.com>
10217
10218 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10219 classes.
10220 (Arm_exidx_section_offset_map): New type.
10221
993d07c1
DK
102222010-01-21 Doug Kwan <dougkwan@google.com>
10223
10224 * arm.cc (Arm_exidx_input_section): New class.
10225 (Arm_relobj::exidx_input_section_by_link,
10226 Arm_relobj::exidx_input_section_by_shndx,
10227 Arm_relobj::make_exidx_input_section): New methods.
10228 (read_arm_attributes_section): Remove.
10229 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10230 information about them.
10231 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10232 to here.
10233
5ac169d4
DK
102342010-01-20 Doug Kwan <dougkwan@google.com>
10235
10236 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10237 Input_section_specifier to Section_id.
10238 (Target_arm::new_arm_input_section: Adjust code for change of key
10239 type.
10240 (Target_arm::find_arm_input_section): Ditto.
10241 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10242 (Section_id): Remove.
10243 (Garbage_collection::Section_id_hash): Remove.
10244 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10245 (Section_id): Remove.
10246 (Icf::Section_id_hash): Remove.
10247 * object.h (Section_id, Const_section_id, Section_id_hash,
10248 Const_section_id_hash): New type definitions.
10249 * output.cc (Output_section::add_relaxed_input_section): Change to
10250 use Const_section_id instead of Input_section_specifier as key type.
10251 (Output_section::add_merge_input_section): Ditto.
10252 (Output_section::build_relaxation_map): Change to use Section_id
10253 instead of Input_section_specifier as key type.
2e702c99 10254 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
10255 Ditto.
10256 (Output_section::convert_input_sections_to_relaxed_sections): Change
10257 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 10258 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
10259 (Output_section::find_relaxed_input_section): Ditto.
10260 * output.h (Input_section_specifier): Remove class.
10261 (Output_section::Output_section_data_by_input_section_map): Change
10262 key type to Const_section_id.
10263 (Output_section::Output_relaxed_input_section_by_input_section_map):
10264 Ditto.
10265 (Output_section::Relaxation_map): Change key type to Section_id.
10266
a2162063
ILT
102672010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10268
10269 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10270 (class Arm_v4bx_stub): New class.
10271 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10272 (Stub_factory::make_arm_v4bx_stub): New method.
10273 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10274 (Stub_table::empty): Handle v4bx stubs.
10275 (Stub_table::add_arm_v4bx_stub): New method.
10276 (Stub_table::find_arm_v4bx_stub): New method.
10277 (Arm_relocate_functions::v4bx): New method.
10278 (Target_arm::fix_v4bx): New method.
10279 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10280 (Stub_table::relocate_stubs): Likewise.
10281 (Stub_table::do_write): Likewise.
10282 (Stub_table::update_data_size_and_addralign): Likewise.
10283 (Stub_table::finalize_stubs): Likewise.
10284 (Target_arm::Scan::local): Likewise.
10285 (Target_arm::Scan::global): Likewise.
10286 (Target_arm::do_finalize_sections): Likewise.
10287 (Target_arm::Relocate::relocate): Likewise.
10288 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10289 Likewise.
10290 (Target_arm::scan_reloc_for_stub): Likewise.
10291 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10292
5696ab0b
ILT
102932010-01-19 Ian Lance Taylor <iant@google.com>
10294
10295 * output.cc (Output_section_headers::do_sized_write): Write large
10296 segment count to sh_info field.
10297 (Output_file_header::do_sized_write): For large segment count,
10298 write PN_XNUM to e_phnum field.
10299
800d0f56
ILT
103002010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10301
10302 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10303 (Arm_relocate_functions::thm_jump8): New function.
10304 (Arm_relocate_functions::thm_jump11): New function.
10305 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10306 R_ARM_THM_JUMP11.
10307 (Target_arm::Scan::global): Likewise.
10308 (Target_arm::Relocate::relocate): Likewise.
10309 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10310 Likewise.
10311
41263c05
DK
103122010-01-14 Doug Kwan <dougkwan@google.com>
10313
10314 * arm.cc (map, utility): Include headers.
10315 (Target_arm::apply_cortex_a8_workaround): New method.
10316 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10317 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10318 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10319 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10320 the --[no-]fix-cortex-a8 command line options.
10321 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10322 (Target_arm::relocate_stub): Use addend in instruction template.
10323 * options.h (DEFINE_bool): Set the user-set flag.
10324 (General_options): Add --[no-]-fix-cortex options.
10325 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10326 : Update fast look-up map after conversion.
41263c05 10327
459e9b03
ST
103282010-01-14 Sriraman Tallam <tmsriram@google.com>
10329
10330 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10331 in the first pass of do_layout.
10332
b521dfe4
DK
103332010-01-13 Doug Kwan <dougkwan@google.com>
10334
10335 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10336 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10337 apparent compiler problem of not folding static constant integral
10338 data members of elfcpp::Elf_sizes<32>.
10339
44272192
DK
103402010-01-13 Doug Kwan <dougkwan@google.com>
10341
10342 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10343 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10344 Arm_relobj::scan_section_for_cortex_a8_erratum,
10345 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10346 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10347 sections to scan for relocation stubs into a new method
10348 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10349 relocation and Cortex-A8 stub scanning.
10350 (Target_arm::do_relax): Force stubs to be after stubbed sections
10351 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10352 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10353 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10354
44b71ece
ILT
103552010-01-12 Ian Lance Taylor <iant@google.com>
10356
10357 * target-reloc.h (visibility_error): New inline function.
10358 (relocate_section): Call visibility_error.
10359 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10360 (MOSTLYCLEANFILES): Likewise.
10361 (protected_4_pic.o, protected_3.err): New targets.
10362 * testsuite/protected_4.cc: New file.
10363
a120bc7f
DK
103642010-01-12 Doug Kwan <dougkwan@google.com>
10365
10366 * arm.cc (Cortex_a8_reloc): New class.
10367 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10368 and cortex_a8_relocs_info_.
10369 (Target_arm::fix_cortex_a8): New method definition.
10370 (Target_arm::Cortex_a8_relocs_info): New type.
10371 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10372 New data member declarations.
10373 (Target_arm::scan_reloc_for_stub): Record information about
10374 relocations for THUMB branches that might be exempted from the
10375 Cortex-A8 workaround.
10376 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10377 at the beginning of a relaxation pass.
10378
20138696
DK
103792010-01-12 Doug Kwan <dougkwan@google.com>
10380
10381 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10382 (Arm_relobj::Mapping_symbol_position,
10383 Arm_reloj::Mapping_symbol_position_less,
10384 Arm_relobj::Mapping_symbols_info): New types.
10385 (Target_arm::is_mapping_symbol_name): New method definition.
10386 (Arm_relobj::do_count_local_symbols): Save information about mapping
10387 symbols.
10388
089d69dc
DK
103892010-01-11 Doug Kwan <dougkwan@google.com>
10390
10391 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10392 Arm_relocate_functions::thumb32_branch_upper,
10393 Arm_relocate_functions::thumb32_branch_lower,
10394 Arm_relocate_functions::thumb32_cond_branch_offset,
10395 Arm_relocate_functions::thumb32_cond_branch_upper,
10396 Arm_relocate_functions::thumb32_cond_branch_lower,
10397 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10398 branch offset encoding.
10399 (Arm_relocate_functions::thumb_branch_common): Use new branch
10400 offset encoding methods to avoid code duplication.
10401 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10402 (Stub_addend_reader::operator()): Use new branch encoding method
10403 to avoid code duplication.
10404
99e5bff2
DK
104052010-01-11 Doug Kwan <dougkwan@google.com>
10406
10407 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10408 (Target_arm::do_finalize_sections): Define special EXIDX section
10409 symbols only if referenced.
10410 * gc.h (Garbage_collection::add_reference): New method.
10411 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10412 code duplication.
10413
98e090bd
ILT
104142010-01-11 Ian Lance Taylor <iant@google.com>
10415
d0a91bd8
ILT
10416 * script.cc (Version_script_info::build_expression_list_lookup):
10417 Change complaing about duplicate wildcard match from error to
10418 warning.
10419
98e090bd
ILT
10420 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10421 of 2009-12-30.
10422 (Version_script_info::Version_script_info): Initialize globs_,
10423 default_version_, default_is_global_, and exact_. Don't
10424 initialize globals_ or locals_.
10425 (Version_script_info::build_lookup_tables): Build local symbols
10426 first.
10427 (Version_script_info::unquote): New function.
10428 (Version_script_info::add_exact_match): New function.
10429 (Version_script_info::build_expression_list_lookup): Remove lookup
10430 parameter. Add is_global parameter. Change all callers. Handle
10431 wildcard pattern specially. Unquote pattern. Call
10432 add_exact_match.
10433 (Version_script_info::get_name_to_match): New function.
10434 (Version_script_info::get_symbol_version): New function.
10435 (Version_script_info::get_symbol_version_helper): Remove.
10436 (Version_script_info::check_unmatched_names): Call unquote.
10437 * script.h (class Version_script_info): Change get_symbol_version
10438 to be non-inline and add is_global parameter; change all callers.
10439 Rewrite symbol_is_local. Update declarations. Define struct
10440 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10441 Remove globals_ and locals_ members. Add exact_, globs_,
10442 default_version_, is_global_.
10443 (Version_script_info::Glob): Remove pattern, add expression and
10444 is_global. Update constructor. Change all callers.
10445 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10446 default version.
10447 (Versions::symbol_section_contents): If a symbol is undefined, or
10448 defined in a dynamic object, set the version index to
10449 VER_NDX_LOCAL.
10450 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10451 symbol_is_local.
10452 (Symbol_table::add_from_pluginobj): Likewise.
10453 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10454
d56962d3
DK
104552010-01-11 Doug Kwan <dougkwan@google.com>
10456
10457 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10458 (incremental_dump_LDADD): Add linking option for libintl.
10459 * Makefile.in: Regenerate.
10460
94e6ee91
L
104612010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10462
10463 PR gold/11144
10464 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10465 instead of -Ds.
10466 * testsuite/Makefile.in: Regenerated.
10467
e96c574b
DK
104682010-01-10 Doug Kwan <dougkwan@google.com>
10469
10470 * options.h (DEFINE_var): Use parentheses around argument varname__
10471 in macro body to avoid any unintended subsequent substitutions.
10472
7198066b
ILT
104732010-01-10 Ian Lance Taylor <iant@google.com>
10474
ba4d53bf
ILT
10475 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10476 candidates before doing symbol resolution.
10477
7198066b
ILT
10478 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10479 ODR candidates if only one is weak.
10480
a2beed37
ILT
104812010-01-08 Ian Lance Taylor <iant@google.com>
10482
10483 * script.cc (Version_script_info::build_expression_list_lookup):
10484 Don't warn about ambiguous version, just record the ambiguity.
10485 (Version_script_info::get_symbol_version_helper): Give error if
10486 version is ambiguous.
10487
2fb7225c
DK
104882010-01-08 Doug Kwan <dougkwan@google.com>
10489
10490 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10491 prev_data_size_ and prev_addralign_. Remove initializer for
10492 deleted data member has_been_changed_.
10493 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10494 to determine if the table is empty.
10495 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10496 Remove.
10497 (Stub_table::add_reloc_stub): Define method in class definition
10498 instead of just declaring it there.
10499 (Stub_table::add_cortex_a8_stub): New method definition.
10500 (Stub_table::update_data_size_and_addralign): Ditto.
10501 (Stub_table::finalize_stubs): Ditto.
10502 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10503 (Stub_table::do_addralign_): Return address alignment in the
10504 (Stub_table::do_reset_address_and_file_offset): Define method in
10505 class definition instead of declaring it there. Set current data
10506 size to be the data size of the previous pass.
10507 (Stub_table::set_final_data_size): Use current data size as the
10508 final data size.
10509 (Stub_table::relocate_stub): Change parameter type of stub from
10510 Reloc_stub pointer to Stub pointer.
10511 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10512 (Stub_table::Cortex_a8_stub_list): New typedef.
10513 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10514 Stub_table::prev_addralign_): New data member.
10515 (Arm_relobj::Arm_relobj): Initialize data member
10516 section_has_cortex_a8_workaround_.
10517 (Arm_relobj::section_has_cortex_a8_workaround,
10518 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10519 definitions.
10520 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10521 declarations.
10522 (Target_arm::relocate_stub): Change parameter type of stub from
10523 Reloc_stub pointer to Stub pointer.
10524 (Insn_template::size, Insn_template::alignment): Handle
10525 THUMB16_SPECIAL_TYPE.
10526 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10527 Stub_table::update_data_size_and_addralign,
10528 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10529 definitions.
10530 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10531 (Stub_table::do_write): Ditto.
10532 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10533
880cd20d
ILT
105342010-01-08 Ian Lance Taylor <iant@google.com>
10535
10536 PR 11108
10537 * symtab.h (class Symbol): Remove fields is_target_special_ and
10538 has_plt_offset_. Add field is_defined_in_discarded_section_.
10539 (Symbol::is_defined_in_discarded_section): New function.
10540 (Symbol::set_is_defined_in_discarded_section): New function.
10541 (Symbol::has_plt_offset): Rewrite.
10542 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10543 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10544 Don't initialize is_target_special_ or has_plt_offset_.
10545 Initialize is_defined_in_discarded_section_.
10546 (Symbol_table::add_from_relobj): If appropriate, set
10547 is_defined_in_discarded_section.
10548 * resolve.cc (Symbol::override_base_with_special): Don't test
10549 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10550 * target-reloc.h (relocate_section): Do special handling for
10551 symbols defined in discarded sections for global symbols as well
10552 as local symbols.
10553
2703e3eb
ILT
105542010-01-08 Ian Lance Taylor <iant@google.com>
10555
10556 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10557 the SHT_SYMTAB case.
10558
339d40a3
ILT
105592010-01-08 Ian Lance Taylor <iant@google.com>
10560
10561 * object.cc (Sized_relobj::do_layout): Don't get confused if
10562 layout_eh_frame returns NULL.
10563
abecea76
ILT
105642010-01-08 Ian Lance Taylor <iant@google.com>
10565
10566 PR 11084
10567 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10568 dynamic symbol table, use the normal symbol table.
10569 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10570 symbol table.
10571
6b7dd3f3
ILT
105722010-01-08 Ian Lance Taylor <iant@google.com>
10573
10574 PR 11072
10575 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10576 sections.
10577
36c50e63
L
105782010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10579
10580 * version.cc (print_version): Change to "Copyright 2010".
10581
e291e7b9
ILT
105822010-01-08 Ian Lance Taylor <iant@google.com>
10583
10584 PR 10287
10585 PR 11063
10586 * i386.cc (class Target_i386): Change return type of plt_section
10587 to be non-const.
10588 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10589 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10590 tls_desc_rel_ field.
10591 (Output_data_plt_i386::rel_tls_desc): New function.
10592 (Target_i386::rel_tls_desc_section): New function.
10593 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10594 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10595 R_386_TLS_DESC reloc in rel_tls_desc_section.
10596 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10597 Define struct Tlsdesc_info.
10598 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10599 (Target_x86_64::do_reloc_symbol_index): New function.
10600 (Target_x86_64::add_tlsdesc_info): New function.
10601 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10602 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10603 tlsdesc_rel_ field.
10604 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10605 all callers.
10606 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10607 (Target_x86_64::rela_tlsdesc_section): New function.
10608 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10609 handling.
10610 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10611 (Target_x86_64::do_reloc_addend): New function.
10612 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10613 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10614 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10615 (Output_reloc::type): New function.
10616 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10617 (Output_reloc::is_target_specific): New function.
10618 (Output_reloc::target_arg): New function.
10619 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10620 absolute relocs and target specific relocs.
10621 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10622 add_target_specific.
10623 (class Output_data_reloc) [SHT_RELA]: Likewise.
10624 * output.cc (Output_reloc::Output_reloc): Add four new versions
10625 for absolute relocs and target specific relocs.
10626 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10627 (Output_reloc::get_symbol_index): Likewise.
10628 (Output_reloc::local_section_offset): Check that local_sym_index_
10629 is not TARGET_CODE or 0.
10630 (Output_reloc::symbol_value): Likewise.
10631 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10632 reloc.
10633 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10634 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10635 functions.
10636 * layout.cc (add_target_dynamic_tags): Use output section for
10637 DT_PLTRELSZ and DT_JMPREL.
10638
3a44184e
ILT
106392010-01-07 Ian Lance Taylor <iant@google.com>
10640
10641 PR 11061
10642 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10643 function.
10644 (class Output_data_reloc_generic): Define.
10645 (class Output_data_reloc_base): Change base class to
10646 Output_data_reloc_generic. Change add() method to call
10647 bump_relative_reloc_count for a relative reloc. Remove
10648 sort_relocs_ field.
10649 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10650 to sort_relocs().
10651 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10652 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10653 appropriate.
10654 * layout.h (class Layout): Update declaration.
10655
ea715a34
ILT
106562010-01-07 Ian Lance Taylor <iant@google.com>
10657
10658 * output.h (class Output_data): Add const version of
10659 output_section and do_output_section.
10660 (class Output_section_data): Add const version of
10661 do_output_section.
10662 (class Output_section): Likewise.
10663 * layout.cc (Layout::add_target_dynamic_tags): New function.
10664 * layout.h (class Layout): Update declarations.
10665 * arm.cc (Target_arm::do_finalize_sections): Use
10666 add_target_dynamic_tags.
10667 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10668 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10669 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10670 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10671
659948a4
ILT
106722010-01-07 Ian Lance Taylor <iant@google.com>
10673
10674 PR 11042
10675 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10676 object as needed.
10677
9d3b86f6
ILT
106782010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10679 Ian Lance Taylor <iant@google.com>
10680
10681 PR 11019
10682 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10683 Xindex::read_symtab_xindex.
10684
bb0d3eb0
DK
106852010-01-07 Doug Kwan <dougkwan@google.com>
10686
10687 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10688 (Insn_template::thumb16_bcond_insn): New method declaration.
10689 (Insn_template): Fix spelling.
10690 (Stub::thumb16_special): New method declaration.
10691 (Stub::do_write): Define virtual method which was previously pure
10692 virtual.
10693 (Stub::do_thumb16_special): New method declaration.
10694 (Stub::do_fixed_endian_write): New template member.
10695 (Reloc_stub::do_write): Remove.
10696 (Reloc_stub::do_fixed_endian_write): Remove.
10697 (Cortex_a8_stub): New class definition.
10698 (Stub_factory::make_cortex_a8_stub): New method definition.
10699 (Stub_factory::Stub_factory): Add missing static storage class
10700 qualifier for elf32_arm_stub_a8_veneer_blx.
10701
ffeef7df
ILT
107022010-01-07 Ian Lance Taylor <iant@google.com>
10703
dc3f80fe
ILT
10704 PR 10980
10705 * options.h (class General_options): Add --warn-unresolved-symbols
10706 and --error-unresolved-symbols.
10707 * errors.cc (Errors::undefined_symbol): Implement
10708 --warn-unresolved-symbols.
10709
ffeef7df
ILT
10710 * options.h (class General_options): Add -z text and -z textoff.
10711 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10712
f1ec9ded
ST
107132010-01-06 Sriraman Tallam <tmsriram@google.com>
10714
10715 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10716 (Garbage_collection::cident_sections): New function.
10717 (Garbage_collection::add_cident_section): New function.
10718 (Garbage_collection::cident_sections_): New member.
10719 (gc_process_relocs): Add references to sections whose names are C
10720 identifiers.
10721 * gold.h (cident_section_start_prefix): New constant.
10722 (cident_section_stop_prefix): New constant.
10723 (is_cident): New function.
10724 * layout.cc (Layout::define_section_symbols): Replace string constants
10725 with the newly defined constants.
10726 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10727 C identifiers.
10728 * testsuite/Makefile.am: Add gc_orphan_section_test.
10729 * testsuite/Makefile.in: Regenerate.
10730 * testsuite/gc_orphan_section_test.cc: New file.
10731 * testsuite/gc_orphan_section_test.sh: New file.
10732
6eda8c29
ILT
107332010-01-06 Ian Lance Taylor <iant@google.com>
10734
b9674e17
ILT
10735 PR 10980
10736 * options.h (class General_options): Add --warn-shared-textrel.
10737 * layout.cc (Layout::finish_dynamic_section): Implement
10738 --warn-shared-textrel.
10739
6eda8c29
ILT
10740 PR 10980
10741 * options.h (class General_options): Add --warn-multiple-gp.
10742
32dcd44e
ILT
107432010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10744
10745 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10746 $(THREADSLIB) and $(LIBDL).
10747 * Makefile.in: Rebuild.
10748
a192ba05
ILT
107492010-01-06 Ian Lance Taylor <iant@google.com>
10750
10751 PR 10980
10752 * options.cc (General_options::parse_section_start): New function.
10753 (General_options::section_start): New function.
10754 (General_options::General_options): Initialize all members.
10755 * options.h: Include <map>
10756 (class General_options): Add --section-start. Add section_starts_
10757 member.
10758 * layout.cc (Layout::attach_allocated_section_to_segment): If
10759 --section-start was used, set the address of the segment. Remove
10760 local sort_sections.
10761 (Layout::relaxation_loop_body): If the address of the load segment
10762 has been set by --section-start, don't use it.
10763 * output.h (Output_segment::update_flags_for_output_section): New
10764 function.
10765 * output.cc (Output_segment::add_output_section): Call
10766 update_flags_for_output_section.
10767
dde3f402
ILT
107682010-01-05 Ian Lance Taylor <iant@google.com>
10769
62dfdd4d
ILT
10770 PR 10980
10771 * options.h (class General_options): Add --undefined-version.
10772 * script.cc (struct Version_expression): Add was_matched_by_symbol
10773 field.
10774 (Version_script_info::matched_symbol): New function.
10775 (Version_script_info::get_symbol_version_helper): Call
10776 matched_symbol.
10777 (Version_script_info::check_unmatched_names): New function.
10778 * script.h (class Version_script_info): Update declarations.
10779 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10780
9c4ae156
ILT
10781 * options.h (class General_options): Use DEFINE_bool_alias for
10782 allow_multiple_definition.
10783 * resolve.cc (Symbol_table::should_override): Don't test
10784 allow_multiple_definition.
10785
dde3f402
ILT
10786 PR 10980
10787 * options.h (class General_options): Add --cref.
10788 * main.cc (main): Print cref table if --cref. Don't close mapfile
10789 until after printing cref table.
10790 * cref.cc: Include "symtab.h".
10791 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10792 (Cref_table_compare::operator()): New function.
10793 (Cref_inputs::gather_cref): New function.
10794 (filecol): New static const.
10795 (Cref_inputs::print_cref): New function.
10796 (Cref::print_cref): New function.
10797 * cref.h: Include <cstdio>.
10798 (class Cref): Update declarations.
10799 * mapfile.h (Mapfile::file): New function.
10800 * object.h (class Object): Define Symbols. Declare virtual
10801 do_get_global_symbols.
10802 (Object::get_global_symbols): New function.
10803 * object.cc (Input_objects::add_object): Pass object to cref_ if
10804 --cref.
10805 (Input_objects::archive_start): Likewise.
10806 (Input_objects::archive_stop): Likewise.
10807 (Input_objects::print_cref): New function.
10808 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10809 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10810 --cref.
10811 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10812 function.
10813 * plugin.h (class Sized_pluginobj): Update declarations.
10814
8781f709
ILT
108152010-01-05 Ian Lance Taylor <iant@google.com>
10816
10817 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10818 to is_default_version. Rename insdef to insdefault.
10819 (Symbol_table::add_from_relobj): Rename def to is_default_version
10820 and local to is_forced_local.
10821 (Symbol_table::add_from_pluginobj): Likewise.
10822 (Symbol_table::add_from_dynobj): Likewise.
10823 (Symbol_table::define_special_symbol): Rename insdef to
10824 insdefault.
10825
fe35d28d
ILT
108262010-01-04 Ian Lance Taylor <iant@google.com>
10827
30bc8c46
ILT
10828 PR 10980
10829 * options.h (class General_options): Add
10830 --allow-multiple-definition and -z muldefs.
10831 * resolve.cc (Symbol_table::should_override): Don't warn about a
10832 multiple symbol definition if --allow-multiple-definition or -z
10833 muldefs.
10834
7eaea549
ILT
10835 PR 10980
10836 * options.h (class General_options): Add --add-needed and
10837 --copy-dt-needed-entries. Tweak --as-needed help entry.
10838 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10839 error if --copy-dt-needed-entries aka --add-needed is used and
10840 would cause a change in behaviour.
10841
fe35d28d
ILT
10842 PR 10980
10843 * options.h (class General_options): Add -G as a short version of
10844 --shared. Add no-op options -assert, -g, and -i.
10845
55a2bb35
ST
108462010-01-04 Sriraman Tallam <tmsriram@google.com>
10847
10848 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10849 check for .text or .gnu.linkonce.t sections.
10850 * icf.cc (Icf::find_identical_sections): Ditto.
10851 Change the detection for mangled function name within the section
10852 name.
10853 * icf.h (is_section_foldable_candidate): New function.
10854
719328e1
ILT
108552009-12-30 Ian Lance Taylor <iant@google.com>
10856
10857 PR 10980
10858 * options.h (class General_options): Permit two dashes with
10859 --retain-symbols-file.
10860
d7bb5745
ILT
108612009-12-30 Ian Lance Taylor <iant@google.com>
10862
403a15dd
ILT
10863 PR 10979
10864 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10865 don't put the file header and segment headers in the text
10866 segment.
10867
eda294df
ILT
10868 PR 10979
10869 * common.cc (Sort_commons::operator()): Stabilize sort when both
10870 entries are NULL.
10871 (Symbol_table::do_allocate_commons_list): When allocating common
10872 symbols, skip a symbol which is no longer common.
10873 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10874 an object before checking its type.
10875 * testsuite/common_test_2.c: New file.
10876 * testsuite/common_test_3.c: New file.
10877 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10878 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10879 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10880 (common_test_2_pic.o, common_test_2.so): New targets.
10881 (common_test_3_pic.o, common_test_3.so): New targets.
10882 * testsuite/Makefile.in: Rebuild.
10883
d7bb5745
ILT
10884 PR 10979
10885 * script.cc (read_input_script): If we see a new SECTIONS clause,
10886 and we have added an input section, give an error.
10887 * layout.h (class Layout): Add have_added_input_section function.
10888 Add have_added_input_section_ field.
10889 * layout.cc (Layout::Layout): Initialize
10890 have_added_input_section_.
10891 (Layout::layout): Set have_added_input_section_.
10892 (Layout::layout_eh_frame): Likewise.
10893
fc59c572
ILT
108942009-12-30 Ian Lance Taylor <iant@google.com>
10895
10896 PR 10931
10897 * options.h (class General_options): Add --sort-common option.
10898 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10899 * common.cc (Sort_common): Add sort_order parameter to
10900 constructor. Add sort_order_ field.
10901 (Sort_commons::operator): Check sort_order_.
10902 (Symbol_table::allocate_commons): Determine the sort order.
10903 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10904 Change all callers.
10905 (Symbol_table::do_allocate_commons_list): Likewise.
10906
1c74fab0
ILT
109072009-12-30 Ian Lance Taylor <iant@google.com>
10908
10909 PR 10916
10910 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10911 symbols from this object, don't change the visibility of an
10912 undefined symbol.
10913 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10914
6affe781
ILT
109152009-12-30 Ian Lance Taylor <iant@google.com>
10916
10917 PR 10861
10918 * script.h (class Version_script_info): Define Language enum.
10919 Update declarations. Define Glob, Exact, and Lookup types. Add
10920 new fields globals_, locals_, and is_finalized_.
10921 * script.cc: Various formatting fixes.
10922 (class Parser_closure): Change language_stack_ from a vector of
10923 std::string to one of Version_script_info::Language. Adjust all
10924 uses accordingly.
10925 (class Lazy_demangler): Remove.
10926 (struct Version_expression): Change language from std::string to
10927 Version_script_info::Language.
10928 (Version_script_info::Version_script_info): New function.
10929 (Version_script_info::~Version_script_info): Don't call clear.
10930 (Version_script_info::finalize): New function.
10931 (Version_script_info::build_lookup_tables): New function.
10932 (Version_script_info::build_expression_list_lookup): New
10933 function.
10934 (Version_script_info::get_symbol_version_helper): Rewrite to use
10935 lookup tables.
10936 (Version_script_info::print_expression_list): Adjust to use
10937 Version_script_info::Language.
10938 (script_push_lex_into_version_mode): Check that the version script
10939 has not been finalized.
10940 (version_script_push_lang): Change language string to
10941 Version_script_info::Language.
10942 * options.cc (Command_line::version_script): New function.
10943 * options.h (class General_options): Add finalize_dynamic_list
10944 function. Change version_script from declaration to definition.
10945 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10946 * testsuite/version_script.map: Remove duplicate def of foo.
10947 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10948 version_script.map.
10949 * testsuite/Makefile.in: Rebuild.
10950
818bf354
ILT
109512009-12-30 Ian Lance Taylor <iant@google.com>
10952
10953 PR 10843
10954 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10955 if the input symbol index is 0, make the output symbol index 0.
10956
ebcc8304
ILT
109572009-12-30 Ian Lance Taylor <iant@google.com>
10958
10959 PR 10670
10960 * options.h (class General_options): Add -x/--discard-all.
10961 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10962 --discard-all. If the local symbol needs a dynamic entry, check
10963 that before handling --discard-locals.
10964
176fe33f
ILT
109652009-12-30 Ian Lance Taylor <iant@google.com>
10966
bb321bb1
ILT
10967 PR 10450
10968 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10969 flags to PF_R.
10970 (Output_segment::add_output_section): Don't change the flags if
10971 the type is PT_TLS.
10972
176fe33f
ILT
10973 PR 10450
10974 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10975 GNU hash table if they need a dynamic value. Otherwise, don't add
10976 them if they are defined in a dynamic object or are forced local.
10977
e8cd95c7
ILT
109782009-12-29 Ian Lance Taylor <iant@google.com>
10979
1b81fb71
ILT
10980 PR 10450
10981 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10982 .gnu.hash table for a 32-bit target.
10983
8d6d383d
ILT
10984 PR 10450
10985 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10986 regular and a dynamic object only needs a dynamic symbol table
10987 entry if it is externally visible.
10988
e785ec03
ILT
10989 PR 10450
10990 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10991 constructor. Add global_offset_table_ field.
10992 (Target_i386::got_section): Set global_offset_table_.
10993 (Target_i386::do_finalize_sections): Set global_offset_table_
10994 size.
10995 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10996 in constructor. Add global_offset_table_ field.
10997 (Target_x86_64::got_section): Set global_offset_table_.
10998 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10999 size.
11000
1a2dff53
ILT
11001 * layout.cc (Layout::Layout): Initialize increase_relro_.
11002 (Layout::get_output_section): Add is_relro, is_last_relro, and
11003 is_first_non_relro parameters. Change all callers.
11004 (Layout::choose_output_section): Likewise.
11005 (Layout::add_output_section_data): Likewise.
11006 (Layout::make_output_section): Likewise.
11007 (Layout::set_segment_offsets): Clear increase_relro when using a
11008 linker script.
11009 * layout.h (class Layout): Add increase_relro method. Add
11010 increase_relro_ field. Update declarations.
11011 * output.cc (Output_section::Output_section): Initialize
11012 is_last_relro_ and is_first_non_relro_.
11013 (Output_segment::add_output_section): Group relro sections is
11014 do_sort is true. Handle is_last_relro and is_first_non_relro.
11015 (Output_segment::maximum_alignment): Remove relro handling.
11016 (Output_segment::set_section_addresses): Add increase_relro
11017 parameter. Change all callers. Add initial alignment to align
11018 relro sections on separate page. Remove old relro handling.
11019 (Output_segment::set_section_list_addresses): Remove in_relro
11020 parameter. Change all callers.
11021 (Output_segment::set_offset): Add increase parameter. Change all
11022 callers. Remove old relro handling.
11023 * output.h (class Output_section): Add new methods: is_last_relro,
11024 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11025 Add is_last_relro_ and is_first_non_relro_ fields.
11026 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11027 Create separate .got.plt section. Call increase_relro.
11028 * x86_64.cc (Target_x86_64::got_section): Likewise.
11029 * testsuite/relro_script_test.t: Add .got.plt.
11030
f0ba79e2
ILT
11031 PR 10450
11032 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11033 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11034 (Layout::finalize): Call set_dynamic_symbol_size.
11035 (Layout::set_dynamic_symbol_size): New function.
11036 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11037 set_dynamic_symbol_size.
11038
e8cd95c7
ILT
11039 PR 10450
11040 * output.h (class Output_section): Add is_entsize_zero_ field.
11041 * output.cc (Output_section::Output_section): Initialize
11042 is_entsize_zero_.
11043 (Output_section::set_entsize): If two different entsizes are
11044 requested, force it to zero.
11045 (Output_section::add_input_section): Set flags for .debug_str
11046 before updating section flags. Set entsize.
11047 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11048 and SHF_STRING if all input sections have those flags.
11049
3e1b9a8a
RÁE
110502009-12-29 Rafael Espindola <espindola@google.com>
11051
11052 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
11053 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11054 reporting.
3e1b9a8a 11055
3dcad376
ST
110562009-12-29 Sriraman Tallam <tmsriram@google.com>
11057
11058 * options.cc (General_options::parse_version): Allow -v to exit
11059 without an error if there is nothing to link.
11060
084e2665
ILT
110612009-12-29 Ian Lance Taylor <iant@google.com>
11062
11063 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
11064 using a version of gcc before 4.1.
11065 * configure: Rebuild.
11066
250acde3
CD
110672009-12-28 Chris Demetriou <cgd@google.com>
11068
11069 * attributes.cc (Output_attributes_section_data::do_write): Use
11070 std::vector::front rather than std::vector::data.
11071
99fff23b
ILT
110722009-12-28 Ian Lance Taylor <iant@google.com>
11073
11074 * symtab.h (class Symbol_table): Add enum Defined.
11075 * resolve.cc (Symbol_table::should_override): Add defined
11076 parameter. Change all callers. Test whether object is NULL
11077 before calling a method on it.
11078 (Symbol_table::report_resolve_problem): Add defined parameter.
11079 Change all callers.
11080 (Symbol_table::should_override_with_special): Likewise.
11081 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11082 parameter. Change all callers.
11083 (Symbol_table::do_define_in_output_data): Likewise.
11084 (Symbol_table::define_in_output_segment): Likewise.
11085 (Symbol_table::do_define_in_output_segment): Likewise.
11086 (Symbol_table::define_as_constant): Likewise.
11087 (Symbol_table::do_define_as_constant): Likewise.
11088 * script.h (class Symbol_assignment): Add is_defsym parameter to
11089 constructor; change all callers.
11090 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11091 parameter. Change all callers. Add is_defsym_ field.
11092 (class Parser_closure): Add parsing_defsym parameter to
11093 constructor; change all callers. Add parsing_defsym accessor
11094 function. Add parsing_defsym_ field.
11095
556bd683
ILT
110962009-12-28 Ian Lance Taylor <iant@google.com>
11097
11098 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 11099 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 11100
1782c879
ILT
111012009-12-23 Ian Lance Taylor <iant@google.com>
11102
11103 * i386.cc (Target_i386::do_calls_non_split): Recognize
11104 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
11105 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
11106 -fsplit-stack prologue when using %r11.
1782c879 11107
329ca2b1
ST
111082009-12-21 Sriraman Tallam <tmsriram@google.com>
11109
11110 * options.cc (General_options::parse_version): Make -v continue and do
11111 the link like GNU ld does.
11112
d675ff46
RÁE
111132009-12-17 Rafael Avila de Espindola <espindola@google.com>
11114
11115 * Makefile.am (CCFILES): Add timer.cc.
11116 (HFILES): Add timer.h.
11117 * configure.ac: Check for sysconf and times.
11118 * main.cc: include timer.h.
11119 (main): Use Timer instead of get_run_time.
11120 * timer.cc: New.
11121 * timer.h: New.
11122 * workqueue.cc: include timer.h.
11123 (Workqueue::find_and_run_task):
11124 Report user, sys and wall time.
11125 * Makefile.in: Regenerate.
11126 * config.in: Regenerate.
11127 * configure: Regenerate.
11128
d6344fb5
DK
111292009-12-16 Doug Kwan <dougkwan@google.com>
11130
11131 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
11132 sections.
11133 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11134 relaxed input sections.
11135 * output.cc (Output_section::find_relaxed_input_section): Change
11136 return type to Output_relaxed_input_section pointer. Adjust code
11137 for new type of relaxed_input_section_map_.
11138 * output.h (Output_section::find_relaxed_input_section): Change
11139 return type to Output_relaxed_input_section pointer.
11140 (Output_section::Output_relaxed_input_section_by_input_section_map):
11141 New type.
11142 (Output_section::relaxed_input_section_map_): Change type to
11143 Output_section::Output_relaxed_input_section_by_input_section_map.
11144 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11145 input section.
11146
0e0d5469
ILT
111472009-12-15 Ian Lance Taylor <iant@google.com>
11148
11149 * layout.cc (Layout::create_shstrtab): Only write out after input
11150 sections if we are compressing debug sections.
11151
0649a889
ILT
111522009-12-15 Ian Lance Taylor <iant@google.com>
11153
11154 * archive.cc (Archive::add_symbols): Only look up a symbol without
11155 a version if there is, in fact, a version.
11156
2ea97941
ILT
111572009-12-14 Ian Lance Taylor <iant@google.com>
11158
11159 Revert -Wshadow changes, all changes from:
11160 2009-12-11 Doug Kwan <dougkwan@google.com>
11161 2009-12-11 Nick Clifton <nickc@redhat.com>
11162 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11163
b0eec2cc
DK
111642009-12-11 Doug Kwan <dougkwan@google.com>
11165
11166 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11167 due to -Wshadow.
11168 * attributes.cc (Object_attribute::size): Ditto.
11169 (Attributes_section_data::size): Ditto.
11170 (Attributes_section_data::Attributes_section_data): Ditto.
11171 (Output_attributes_section_data::do_write): Ditto.
11172 * attributes.h (Object_attribute::set_type): Ditto.
11173 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11174
91d6fa6a
NC
111752009-12-11 Nick Clifton <nickc@redhat.com>
11176
11177 * archive.cc: Fix shadowed variable warnings.
11178 * arm.cc: Likewise.
11179 * compressed_output.cc: Likewise.
11180 * compressed_output.h: Likewise.
11181 * configure: Likewise.
11182 * dwarf_reader.cc: Likewise.
11183 * dynobj.cc: Likewise.
11184 * dynobj.h: Likewise.
11185 * ehframe.cc: Likewise.
11186 * ehframe.h: Likewise.
11187 * errors.cc: Likewise.
11188 * expression.cc: Likewise.
11189 * fileread.cc: Likewise.
11190 * fileread.h: Likewise.
11191 * freebsd.h: Likewise.
11192 * i386.cc: Likewise.
11193 * icf.cc: Likewise.
11194 * incremental.h: Likewise.
11195 * layout.cc: Likewise.
11196 * layout.h: Likewise.
11197 * mapfile.cc: Likewise.
11198 * merge.cc: Likewise.
11199 * merge.h: Likewise.
11200 * object.cc: Likewise.
11201 * object.h: Likewise.
11202 * options.h: Likewise.
11203 * output.cc: Likewise.
11204 * output.h: Likewise.
11205 * parameters.cc: Likewise.
11206 * plugin.cc: Likewise.
11207 * powerpc.cc: Likewise.
11208 * reduced_debug_output.cc: Likewise.
11209 * reduced_debug_output.h: Likewise.
11210 * reloc.cc: Likewise.
11211 * reloc.h: Likewise.
11212 * resolve.cc: Likewise.
11213 * script-sections.cc: Likewise.
11214 * script.cc: Likewise.
11215 * script.h: Likewise.
11216 * sparc.cc: Likewise.
11217 * symtab.cc: Likewise.
11218 * symtab.h: Likewise.
11219 * target-select.cc: Likewise.
11220 * target-select.h: Likewise.
11221 * token.h: Likewise.
11222 * workqueue.cc: Likewise.
11223 * workqueue.h: Likewise.
11224 * x86_64.cc: Likewise.
11225
a0351a69
DK
112262009-12-10 Doug Kwan <dougkwan@google.com>
11227
11228 * arm.cc (attributes.h): New include.
11229 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11230 (Arm_relobj::~Arm_relobj): Delete object pointed by
11231 attributes_section_data_.
11232 (Arm_relobj::attributes_section_data): New method definition.
11233 (Arm_relobj::attributes_section_data_): New data member declaration.
11234 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11235 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11236 attributes_section_data_.
11237 (Arm_dynobj::attributes_section_data): New method definition.
11238 (Arm_dynobj::attributes_section_data_): New data member declaration.
11239 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11240 initialization value of may_use_blx_ to false.
2e702c99 11241 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
11242 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11243 object attributes to compute results instead of hard-coding.
11244 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11245 Target_arm::get_secondary_compatible_arch,
11246 Target_arm::set_secondary_compatible_arch
11247 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11248 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11249 New method declarations.
11250 (Target_arm::get_aeabi_object_attribute): New method definition.
11251 (Target_arm::attributes_section_data_): New data member declaration.
11252 (read_arm_attributes_section): New template definition.
11253 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11254 (Arm_dynobj::do_read_symbols): Ditto.
11255 (Target_arm::do_finalize_sections): Merge attributes sections from
11256 input. Check for BLX use after attributes section merging.
11257 Fix __exidx_start and __exidx_end visibility. Create an
11258 .ARM.attributes section if necessary.
11259 (Target_arm::get_secondary_compatible_arch,
11260 Target_arm::set_secondary_compatible_arch,
11261 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11262 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 11263 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
11264 New method definitions.
11265
b59befec
ILT
112662009-12-09 Ian Lance Taylor <iant@google.com>
11267
11268 * plugin.cc (Plugin::load): Don't cast from void* to a function
11269 pointer.
11270
1276bc89
ILT
112712009-12-09 Ian Lance Taylor <iant@google.com>
11272
11273 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11274 information fields.
11275
2f2de248
L
112762009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11277
11278 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11279 Replace two_file_shared_1.so with two_file_shared_2.so.
11280 * testsuite/Makefile.in: Regenerated.
11281
4f787271
DK
112822009-12-08 Doug Kwan <dougkwan@google.com>
11283
11284 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11285 (HFILES): Add attributes.h and int_encoding.h.
11286 * Makefile.in: Regenerate.
11287 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11288 function definitions to int_encoding.cc
11289 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11290 prototypes to int_encoding.h
11291 * reduced_debug_output.cc (int_encoding.h): New include.
11292 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11293 function definitions to int_encoding.cc
11294 (insert_into_vector, read_from_pointer): Move template definitions to
11295 int_encoding.h
11296 * attributes.cc: New file.
11297 * attributes.h: New file.
11298 * int_encoding.cc: New file.
11299 * int_encoding.h: New file.
11300
20b52f1a
RÁE
113012009-12-07 Rafael Avila de Espindola <espindola@google.com>
11302
11303 PR gold/11055
11304 * incremental-dump.cc (dump_incremental_inputs): New.
11305 (main): Use dump_incremental_inputs.
11306
53d7974c
L
113072009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11308
11309 PR gold/10893
11310 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11311 checking elfcpp::STT_FUNC.
11312 (Target_i386::Relocate::relocate): Likewise.
11313 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11314
11315 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11316 symbols from shared libraries into normal FUNC symbols.
11317
11318 * symtab.h (Symbol): Add is_func and use it.
11319
05a352e6
DK
113202009-12-05 Doug Kwan <dougkwan@google.com>
11321
11322 * arm.cc (Target_arm::arm_info): Initialize new fields
11323 attributes_section and attributes_vendor.
11324 * i386.cc (Target_i386::i386_info): Same.
11325 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11326 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11327 fields attributes_section and attributes_vendor.
53d7974c 11328 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11329 * target.h (Target::attributes_section, Target::attributes_vendor,
11330 Target::is_attributes_section, Target::attribute_arg_type,
11331 Target::attributes_order): New method definitions.
11332 (Target::Target_info::attributes_section,
11333 Target::Target_info::attributes_vendor): New fields.
11334 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11335 virtual method definitions.
11336 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11337 attributes_section and attributes_vendor.
11338 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11339
f4e5969c
DK
113402009-12-05 Doug Kwan <dougkwan@google.com>
11341
11342 * arm.cc: Update comments about interworking and stub generation.
11343 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11344 considered as non-PIC.
11345 (Arm_relocate_functions::base_abs): Fix formatting.
11346 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11347 of function to use GOT entry address instead of offset.
11348 (Target_arm::Scan::global): Issue an error if a symbol would need a
11349 PLT does not get one because it is untyped. Remove code to create
11350 dynamic symbols for relative branches.
11351 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11352 takes unsigned integer instead of boolean.
11353
1abce4a6
L
113542009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11355
11356 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11357 (two_file_test_LDADD): Likewise.
11358 (common_test_1_LDADD): Likewise.
11359 (exception_test_LDADD) Likewise.
11360 (weak_test_LDADD): Likewise.
11361 (many_sections_test_LDADD): Likewise.
11362 (initpri1_LDADD): Likewise.
11363 (script_test_1_LDADD): Likewise.
11364 (script_test_2_LDADD): Likewise.
11365 (justsyms_LDADD): Likewise.
11366 (binary_test_LDADD): Likewise.
11367 (large_LDADD): Likewise.
11368 * testsuite/Makefile.in: Regenerated.
11369
adcf2816 113702009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11371
adcf2816
L
11372 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11373 (Symbol_table::override_with_special): Likewise.
11374 (Symbol_table::add_from_object): Likewise.
11375
28e67f5d
RÁE
113762009-12-04 Rafael Avila de Espindola <espindola@google.com>
11377
11378 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11379 Don't set the data_offset twice.
11380
ae10a101
RÁE
113812009-12-04 Rafael Avila de Espindola <espindola@google.com>
11382
11383 * testsuite/Makefile.in: Regenerate.
11384
f59f41f3
DK
113852009-12-03 Doug Kwan <dougkwan@google.com>
11386
11387 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11388 (Target_arm::do_finalize_sections): Add parameter for symbol table
11389 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11390 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11391 parameter for symbol table pointer.
11392 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11393 an additional parameter for a pointer to symbol table.
11394 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11395 parameter for a symbol table pointer.
11396 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11397 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11398 Ditto.
11399 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11400 parameter for a symbol table pointer.
11401
ca55d848
RÁE
114022009-12-03 Rafael Avila de Espindola <espindola@google.com>
11403
11404 * incremental.cc (Incremental_inputs_header)
11405 (Incremental_inputs_header_write, Incremental_inputs_entry)
11406 (Incremental_inputs_entry_write): Move ...
11407 * incremental.h (Incremental_inputs_header)
11408 (Incremental_inputs_header_write, Incremental_inputs_entry)
11409 (Incremental_inputs_entry_write): here.
11410
3aec4f9c
RÁE
114112009-12-02 Rafael Avila de Espindola <espindola@google.com>
11412
11413 * incremental.cc (make_sized_incremental_binary): Set the target.
11414 Error if it is incompatible.
11415 * output.h (Output_file): Add filename method.
11416
9c0ae74d
RÁE
114172009-12-02 Rafael Avila de Espindola <espindola@google.com>
11418
11419 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11420 from the get_* methods.
11421
a45500ae
RÁE
114222009-12-02 Rafael Avila de Espindola <espindola@google.com>
11423
11424 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11425 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11426 Write 0 for the data_offset of scripts.
11427
325e6408
RÁE
114282009-12-02 Rafael Avila de Espindola <espindola@google.com>
11429
11430 * testsuite/Makefile.am: Add the incremental_test.sh test.
11431 * testsuite/incremental_test.sh: New.
11432 * testsuite/incremental_test_1.c: New.
11433 * testsuite/incremental_test_2.c: New.
11434
954c3e2e
RÁE
114352009-12-01 Rafael Avila de Espindola <espindola@google.com>
11436
703d02da 11437 * incremental-dump.cc (main): Fix typos.
954c3e2e 11438
f8086623
RÁE
114392009-11-27 Rafael Avila de Espindola <espindola@google.com>
11440
11441 PR gold/11025
11442 * incremental-dump.cc (main): Use llu to print 64 bit values.
11443
3b0dd6ac
L
114442009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11445 H.J. Lu <hongjiu.lu@intel.com>
11446
11447 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11448 $(LIBDL).
11449 (incremental_dump_LDADD): Likewise.
11450 * Makefile.in: Regenerated.
11451
a6d1ef57 114522009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11453
a6d1ef57
DK
11454 Revert:
11455
11456 2009-11-25 Doug Kwan <dougkwan@google.com>
11457
11458 * arm.cc (Target_arm::Target_arm): Move method definition
11459 outside of class definition. Add code to handle
11460 --target1-rel, --target1-abs and --target2= options.
11461 (Target_arm::get_reloc_reloc_type): Change method to be
11462 non-static and const.
11463 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11464 New data member declaration.
11465 (Target_arm::Scan::local, Target_arm::Scan::global,
11466 Target_arm::Relocate::relocate,
11467 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11468 Adjust call to Target_arm::get_real_reloc_type.
11469 (Target_arm::get_real_reloc_type): Use command line options
11470 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11471 * options.h (--target1-rel, --target1-abs, --target2): New
11472 ARM-only options.
11473
50aeb7d4
DK
114742009-11-25 Doug Kwan <dougkwan@google.com>
11475
11476 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11477 class definition. Add code to handle --target1-rel, --target1-abs
11478 and --target2= options.
11479 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11480 and const.
11481 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11482 member declaration.
11483 (Target_arm::Scan::local, Target_arm::Scan::global,
11484 Target_arm::Relocate::relocate,
11485 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11486 call to Target_arm::get_real_reloc_type.
11487 (Target_arm::get_real_reloc_type): Use command line options to
11488 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11489 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11490 options.
11491
51938283
DK
114922009-11-25 Doug Kwan <dougkwan@google.com>
11493
11494 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11495 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11496 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11497 formatting.
11498 (Arm_relocate_functions::thm_call): Replace body with a call to
11499 Arm_relocate_functions::thumb_branch_common.
11500 (Arm_relocate_functions::thm_jump24,
11501 Arm_relocate_functions::thm_xpc22): New method definitions.
11502 (Arm_relocate_functions::thumb_branch_common): New method definition.
11503 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11504 operator.
11505 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11506 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11507
e2b8f3c4
RÁE
115082009-11-24 Rafael Avila de Espindola <espindola@google.com>
11509
11510 * Makefile.am: Build incremental-dump
11511 * Makefile.in: Regenerate.
11512 * incremental-dump.cc: New.
11513 * incremental.cc (Incremental_inputs_header_data,
11514 Incremental_inputs_entry_data): Move to incremental.h
11515 * incremental.h: (Incremental_inputs_header_data,
11516 Incremental_inputs_entry_data): Move from incremental.cc
11517
bcba9aec
RÁE
115182009-11-24 Rafael Avila de Espindola <espindola@google.com>
11519
11520 * incremental.cc (Incremental_inputs_header,
11521 Incremental_inputs_header_write, Incremental_inputs_entry,
11522 Incremental_inputs_entry_write): Add a typedef with the data type.
11523
7c3afe08
RÁE
115242009-11-24 Rafael Avila de Espindola <espindola@google.com>
11525
11526 * incremental.cc (Incremental_inputs_header,
11527 Incremental_inputs_header_write, Incremental_inputs_entry,
11528 Incremental_inputs_entry_write): Update comment about which
11529 type has the filed descriptions.
11530
d204b6e9
DK
115312009-11-15 Doug Kwan <dougkwan@google.com>
11532
11533 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11534 (Arm_relocate_functions::arm_branch_common): Change method defintion
11535 in class definition to a method declaration and update list of formal
11536 parameters.
11537 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11538 Arm_relocation_functions::jump24): Adjust call to
11539 Arm_relocate_functions::arm_branch_common. Update list of formal
11540 parameters.
11541 (Arm_relocate_functions::xpc25): New method definition.
11542 (Arm_relocate_functions::arm_branch_common): Move method defintion
11543 out from class definition. Use stubs for mode-switching and extending
11544 branch ranges.
11545 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11546 specially. Change code to enable use of stubs in ARM branches.
11547
43d12afe
DK
115482009-11-10 Doug Kwan <dougkwan@google.com>
11549
11550 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11551 in method declaration.
11552 (Target_arm::relocate_stub): New method declaration.
11553 (Target_arm::default_target): Change to return a pointer instead of
11554 a const reference.
11555 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11556 Target_arm::default_target.
11557 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11558 method definition.
11559 (Target_arm::relocate_section): Adjust view.
11560 (Target_arm::relocate_stub): New method definition.
11561
ac33a407
DK
115622009-11-10 Doug Kwan <dougkwan@google.com>
11563
11564 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11565 a format warning.
11566 * incremental.cc (open_incremental_binary): Initialized local
11567 variables to avoid warnings.
11568 * object.cc (make_elf_object): Ditto.
11569 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11570 a format warning.
e1df38aa 11571
88ee28e9
L
11572009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11573
11574 PR gold/10930
11575 * testsuite/plugin_test.c: Include "config.h".
11576
2daedcd6
DK
115772009-11-09 Doug Kwan <dougkwan@google.com>
11578
11579 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11580 (arm_symbol_value): Remove.
11581 (Arm_relocate_functions::arm_branch_common,
11582 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11583 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11584 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11585 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11586 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11587 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11588 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11589 Arm_relocate_functions::thm_mobw_abs_nc,
11590 Arm_relocate_functions::thm_mov_abs,
11591 Arm_relocate_functions::movw_prel_nc,
11592 Arm_relocate_functions::thm_movt_abs,
11593 Arm_relocate_functions::movt_prel,
11594 Arm_relocate_functions::thm_movw_prel_nc,
11595 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11596 (Target_arm::Relocate::relocate): Only decompose address into two
11597 parts if relocation type uses the thumb-bit and pass the actual
11598 bit instead of a flag indicating that the thumb-bit is used. Adjust
11599 calls to methods in Arm_relocate_functions for this change.
11600
1276bc89 116012009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
11602
11603 PR 10925
11604 * reloc.cc: Instantiate
11605 Sized_relobj::initialize_input_to_output_maps and
11606 Sized_relobj:free_input_to_output_maps.
11607
e53ad1b5
ILT
116082009-11-06 Ian Lance Taylor <iant@google.com>
11609
11610 PR 10876
11611 * defstd.cc (in_segment): Set only_if_ref true for "end".
11612
eb44217c
DK
116132009-11-06 Doug Kwan <dougkwan@google.com>
11614
11615 * arm.cc (class Reloc_stub): Correct a comment.
11616 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11617 (Target_arm::scan_section_for_stubs): New method declaration.
11618 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11619 Change methods from private to protected.
11620 (Target_arm::do_may_relax): New method definition.
11621 (Target_arm::do_relax, Target_arm::group_sections,
11622 Target_arm::scan_reloc_for_stub,
11623 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11624 (Target_arm::arm_input_section_map_): New data member declaration.
11625 (Target_arm::scan_reloc_for_stub,
11626 Target_arm::scan_reloc_section_for_stubs,
11627 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11628 Target_arm::do_relax): New method definitions.
11629
5d329b7d
ILT
116302009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11631
11632 * configure.ac: Check for (struct stat)::st_mtim
11633 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11634 * config.in: Regenerate.
11635 * configure: Regenerate.
11636
96a0d71b
ILT
116372009-11-05 Ian Lance Taylor <iant@google.com>
11638
11639 PR 10910
11640 * output.cc (Output_segment::add_output_section): Add missing
11641 return statement.
11642
594c8e5e
ILT
116432009-11-04 Ian Lance Taylor <iant@google.com>
11644
11645 PR 10880
11646 * object.h (class Object): Add is_needed and set_is_needed
11647 methods. Add is_needed_ field. Make bool fields into bitfields.
11648 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11649 defined in a dynamic object and referenced by a regular object,
11650 set is_needed for the dynamic object.
11651 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11652 if the file is marked with as_needed and it is not needed.
11653
22b127cc
ILT
116542009-11-04 Ian Lance Taylor <iant@google.com>
11655
11656 PR 10887
11657 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11658 tags if data is discarded by linker script.
11659 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11660 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11661 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11662 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11663
f5c870d2
ILT
116642009-11-04 Ian Lance Taylor <iant@google.com>
11665
11666 * layout.cc (Layout::get_output_section): Add is_interp and
11667 is_dynamic_linker_section parameters. Change all callers.
11668 (Layout::choose_output_section): Likewise.
11669 (Layout::make_output_section): Likewise.
11670 (Layout::add_output_section_data): Add is_dynamic_linker_section
11671 parameter. Change all callers.
11672 * layout.h (class Layout): Update declarations.
11673 * output.h (class Output_section): Add is_interp, set_is_interp,
11674 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11675 Add is_interp_, is_dynamic_linker_section_ fields. Change
11676 generate_code_fills_at_write_ to a bitfield.
11677 * output.cc (Output_section::Output_sections): Initialize new
11678 fields.
11679 (Output_segment::add_output_section): Add do_sort parameter.
11680 Change all callers.
11681
1ae4d23b
ILT
116822009-11-03 Ian Lance Taylor <iant@google.com>
11683
11684 PR 10860
11685 * options.h (class General_options): Add --warn-common.
11686 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11687 merging two common symbols.
11688 (Symbol_table::should_override): Handle --warn-common when merging
11689 a common symbol with a defined symbol. Use report_resolve_problem
11690 for multiple definitions.
11691 (Symbol_table::report_resolve_problem): New function.
11692 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11693
55da9579
DK
116942009-11-03 Doug Kwan <dougkwan@google.com>
11695
11696 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11697 stub_factory_.
11698 (Target_arm::stub_factory): New method definition.
11699 (Target_arm::new_arm_input_section,
11700 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11701 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 11702 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
11703 New type definitions.
11704 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11705 member declarations.
11706 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11707 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11708 New method definitions.
11709
37a9ac43
ILT
117102009-11-03 Ian Lance Taylor <iant@google.com>
11711
11712 * options.h (class General_options): Add --warn_constructors.
11713
b3d6a3d4
ILT
117142009-11-03 Ian Lance Taylor <iant@google.com>
11715
11716 PR 10893
11717 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11718 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11719
934b01dd
ILT
117202009-11-03 Ian Lance Taylor <iant@google.com>
11721
11722 PR 10895
11723 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11724 --msgid-bugs-address.
11725 (install-pdf): New target.
11726 (install-data_yes): Look up one directory to find mkinstalldirs.
11727
03c1939b
L
117282009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11729
11730 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11731 tree.
11732
ebd95253
DK
117332009-10-30 Doug Kwan <dougkwan@google.com>
11734
11735 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11736
e9bbb538
DK
117372009-10-30 Doug Kwan <dougkwan@google.com>
11738
11739 * arm.cc (Stub_addend_reader): New struct template definition
11740 and partial specializations.
11741 (Stub_addend_reader::operator()): New method definition for a
11742 partially specialized template.
11743
d5b40221
DK
117442009-10-30 Doug Kwan <dougkwan@google.com>
11745
11746 * arm.cc (Arm_relobj::processor_specific_flags): New method
11747 definition.
11748 (Arm_relobj::do_read_symbols): New method declaration.
11749 (Arm_relobj::processor_specific_flags_): New data member declaration.
11750 (Arm_dynobj): New class definition.
11751 (Target_arm::do_finalize_sections): Add input_objects parameter.
11752 (Target_arm::do_adjust_elf_header): New method declaration.
11753 (Target_arm::are_eabi_versions_compatible,
11754 (Target_arm::merge_processor_specific_flags): New method declaration.
11755 (Target_arm::do_make_elf_object): New overloaded method definitions
11756 and declaration.
11757 (Arm_relobj::do_read_symbols): New method definition.
11758 (Arm_dynobj::do_read_symbols): Ditto.
11759 (Target_arm::do_finalize_sections): Add input_objects parameters.
11760 Merge processor-specific flags from all input objects.
11761 (Target_arm::are_eabi_versions_compatible,
11762 Target_arm::merge_processor_specific_flags,
11763 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11764 New method definitions.
11765 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11766 Input_objects pointer type parameter.
11767 * layout.cc (Layout::finalize): Pass input objects to target's.
11768 finalize_sections function.
11769 * output.cc (Output_file_header::do_sized_write): Set ELF file
11770 header's processor-specific flags.
11771 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11772 Input_objects pointer type parameter.
11773 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11774 * target.h (Input_objects): New forward class declaration.
11775 (Target::processor_specific_flags,
11776 Target::are_processor_specific_flags_sect): New method definitions.
11777 (Target::finalize_sections): Add input_objects parameter.
11778 (Target::Target): Initialize processor_specific_flags_ and
11779 are_processor_specific_flags_set_.
11780 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11781 parameter.
11782 (Target::set_processor_specific_flags): New method definition.
11783 (Target::processor_specific_flags_,
11784 Target::are_processor_specific_flags_set_): New data member
11785 declarations.
11786 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11787 Input_objects pointer type parameter.
11788
ebabffbd
DK
117892009-10-30 Doug Kwan <dougkwan@google.com>
11790
11791 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11792
ad0f2072
ILT
117932009-10-28 Ian Lance Taylor <iant@google.com>
11794
11795 * object.h (class Relobj): Drop options parameter from
11796 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11797 do_scan_relocs, do_relocate. Change all callers.
11798 (class Sized_relobj): Drop options parameters from
11799 do_gc_process_relocs, do_scan_relocs, do_relocate,
11800 do_relocate_sections, relocate_sections, emit_relocs_scan,
11801 emit_relocs_scan_reltype. Change all callers.
11802 (struct Relocate_info): Remove options field and all references to
11803 it.
11804 * reloc.h (class Read_relocs): Remove options constructor
11805 parameter and options_ field. Change all callers.
11806 (class Gc_process_relocs, class Scan_relocs): Likewise.
11807 (class Relocate_task): Likewise.
11808 * target-reloc.h (scan_relocs): Remove options parameter. Change
11809 all callers.
11810 (scan_relocatable_relocs): Likewise.
11811 * target.h (class Sized_target): Remove options parameter from
11812 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11813 all callers.
11814 * gc.h (gc_process_relocs): Remove options parameter. Change all
11815 callers.
11816 * arm.cc: Update functions to remove options parameters.
11817 * i386.cc: Likewise.
11818 * powerpc.cc: Likewise.
11819 * sparc.cc: Likewise.
11820 * x86_64.cc: Likewise.
11821 * testsuite/testfile.cc: Likewise.
11822
8ffa3667
DK
118232009-10-28 Doug Kwan <dougkwan@google.com>
11824
11825 * arm.cc (Arm_relobj): New class definition.
e1df38aa 11826 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
11827 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11828 New method definitions.
11829
40f36857
CC
118302009-10-28 Cary Coutant <ccoutant@google.com>
11831
11832 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11833 (Plugin::cleanup_done_): New member.
11834 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11835 (Plugin_manager::cleanup_done_): Remove.
11836 (Plugin_manager::add_input_file): Edit error message.
11837 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11838 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11839
2c849493
ILT
118402009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11841
11842 * fileread.cc: (File_read::View::~View): Use the new
11843 data_ownership_ filed.
11844 (File_read::~File_read): Dispose the new whole_file_view_.
11845 (File_read::open): Mmap the whole file if needed.
11846 (File_read::open): Use whole_file_view_ instead of contents_.
11847 (File_read::find_view): Use whole_file_view_ if applicable.
11848 (File_read::do_read): Use whole_file_view_ instead of contents_.
11849 (File_read::make_view): Use whole_file_view_ instead of contents_,
11850 update File_read::View::View call.
11851 (File_read::find_or_make_view): Update File_read::View::View
11852 call.
11853 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11854 remove contents_
11855 (File_read::View::Data_ownership): New enum.
11856 (File_read::View::View): Replace bool mapped_ with Data_ownership
11857 argument.
11858 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11859 (File_read::View::data_ownership_): New field.
11860 (File_read::contents_): Remove (replaced by whole_file_view_).
11861 (File_read::whole_file_view_): New field.
11862 * options.h (class General_options): Add --keep-files-mapped.
11863
24998053
CC
118642009-10-27 Cary Coutant <ccoutant@google.com>
11865
11866 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11867 * testsuite/Makefile.am (plugin_test_5): New test case.
11868 * testsuite/Makefile.in: Regenerate.
11869
72adc4fa
DK
118702009-10-25 Doug Kwan <dougkwan@google.com>
11871
11872 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11873 from private to protected to allow access by child class.
11874 (Sized_relobj::do_relocate_sections): New method declaration.
11875 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 11876 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
11877 Sized_relobj::relocate_sections. Instantiate template explicitly
11878 for different target sizes and endianity.
11879
07f508a2
DK
118802009-10-24 Doug Kwan <dougkwan@google.com>
11881
11882 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11883 (Arm_input_section::as_arm_input_section): New method.
11884 (Arm_output_section): New class definition.
11885 (Arm_output_section::create_stub_group,
11886 Arm_output_section::group_sections): New method definitions.
11887
10ad9fe5
DK
118882009-10-22 Doug Kwan <dougkwan@google.com>
11889
11890 * arm.cc (Arm_input_section): New class definition.
11891 (Arm_input_section::init, Arm_input_section:do_write,
11892 Arm_input_section::set_final_data_size,
11893 Arm_input_section::do_reset_address_and_file_offset): New method
11894 definitions.
11895
56ee5e00
DK
118962009-10-21 Doug Kwan <dougkwan@google.com>
11897
11898 * arm.cc (Stub_table, Arm_input_section): New forward class
11899 declarations.
11900 (Stub_table): New class defintion.
11901 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11902 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11903 New method definition.
11904
b569affa
DK
119052009-10-21 Doug Kwan <dougkwan@google.com>
11906
11907 * arm.cc: Update copyright comments.
11908 (Target_arm): New forward class template declaration.
11909 (Arm_address): New type.
11910 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11911 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11912 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11913 constants.
11914 (Insn_template): Same.
11915 (DEF_STUBS): New macro.
11916 (Stub_type): New enum type.
11917 (Stub_template): New class definition.
11918 (Stub): Same.
11919 (Reloc_stub): Same.
11920 (Stub_factory): Same.
11921 (Target_arm::Target_arm): Initialize may_use_blx_ and
11922 should_force_pic_veneer_.
11923 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11924 Target_arm::should_force_pic_veneer,
11925 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11926 Target_arm::using_thumb_only, Target_arm:;default_target): New
11927 method defintions.
11928 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11929 New data member declarations.
11930 (Insn_template::size, Insn_template::alignment): New method defintions.
11931 (Stub_template::Stub_template): New method definition.
11932 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11933 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11934 (Stub_factory::Stub_factory): New method definition.
11935 * gold.h (string_hash): New template.
11936 * output.h (Input_section_specifier::hash_value): Use
11937 gold::string_hash.
11938 (Input_section_specifier::string_hash): Remove.
11939 * stringpool.cc (Stringpool_template::string_hash): Use
11940 gold::string_hash.
11941
6c172549
DK
119422009-10-20 Doug Kwan <dougkwan@google.com>
11943
11944 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11945 symbols of relaxed input sections.
11946 * output.h (Output_section::find_relaxed_input_section): Make
11947 method public.
11948
c5617f2f
DK
119492009-10-16 Doug Kwan <dougkwan@google.com>
11950
11951 * dynobj.cc (Versions::Versions): Initialize version_script_.
11952 Only insert base version symbol definition for a shared object
11953 if version script defines any version versions.
11954 (Versions::define_base_version): New method definition.
11955 (Versions::add_def): Check that base version is not needed.
11956 (Versions::add_need): Define base version lazily.
11957 * dynobj.h (Versions::define_base_version): New method declaration.
11958 (Versions::needs_base_version_): New data member declaration.
11959 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11960 (check_DATA): Add no_version_test.stdout.
11961 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11962 New make rules.
11963 * testsuite/Makefile.in: Regenerate.
11964 * testsuite/no_version_test.c: New file.
11965 * testsuite/no_version_test.sh: Ditto.
11966
3c12dcdb
DK
119672009-10-16 Doug Kwan <dougkwan@google.com>
11968
11969 * expression.cc (class Segment_start_expression): New class definition.
11970 (Segment_start_expression::value): New method definition.
11971 (script_exp_function_segment_start): Return a new
11972 Segment_start_expression.
11973 * gold/script-c.h (script_saw_segment_start_expression): New function
11974 prototype.
11975 * script-sections.cc (Script_sections::Script_sections): Initialize
11976 SAW_SEGMENT_START_EXPRESSION_ to false.
11977 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11978 and -Tbbs options to specify section addresses if given in
11979 command line and no SEGMENT_START expression is seen in a script.
11980 * script-sections.h (Script_sections::saw_segment_start_expression,
11981 Script_sections::set_saw_segment_start_expression): New method
11982 definition.
11983 (Script_sections::saw_segment_start_expression_): New data member
11984 declaration.
11985 * script.cc (script_saw_segment_start_expression): New function.
11986 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11987 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11988 script_test_7.sh and script_test_8.sh.
11989 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11990 script_test_8.stdout.
11991 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11992 (script_test_6, script_test_6.stdout, script_test_7,
11993 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11994 * Makefile.in: Regenerate.
11995 * testsuite/script_test_6.sh: New file.
11996 * testsuite/script_test_6.t: Same.
11997 * testsuite/script_test_7.sh: Same.
11998 * testsuite/script_test_7.t: Same.
11999 * testsuite/script_test_8.sh: Same.
12000
64b1ae37
DK
120012009-10-16 Doug Kwan <dougkwan@google.com>
12002
12003 * output.cc (Output_segment::set_section_list_address): Cast
12004 expressions to unsigned long long type to avoid format warnings.
12005
661be1e2
ILT
120062009-10-15 Ian Lance Taylor <iant@google.com>
12007
12edd763 12008 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 12009 dot assignment to script_sections_.
12edd763
ILT
12010 * script-sections.cc (Script_sections::add_dot_assignment):
12011 Initialize if necessary.
12012
68b6574b
ILT
12013 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12014 program headers with no load segment if there is a linker script.
12015
661be1e2
ILT
12016 * layout.cc (Layout::set_segment_offsets): Align the file offset
12017 to the segment aligment for -N or -n with no load segment.
12018 * output.cc (Output_segment::add_output_section): Don't crash if
12019 the first section is a TLS section.
12020 (Output_segment::set_section_list_addresses): Print an error
12021 message if the address moves backward in a linker script.
12022 * script-sections.cc
12023 (Output_section_element_input::set_section_addresses): Don't
12024 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12025 (Orphan_output_section::set_section_addresses): Likewise.
12026
f15f61a7
DK
120272009-10-15 Doug Kwan <dougkwan@google.com>
12028
12029 * layout.cc (Layout::finish_dynamic_section): Generate tags
12030 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12031 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12032 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12033
82bb573a
ILT
120342009-10-14 Ian Lance Taylor <iant@google.com>
12035
12036 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12037 fields.
12038 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12039 data_shdr fields of relinfo.
12040 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12041 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12042 R_386_TLS_LDO_32, adjust based on section flags.
12043 (Target_i386::Relocate::fix_up_ldo): Remove.
12044
374ad285
ILT
120452009-10-13 Ian Lance Taylor <iant@google.com>
12046
12047 Add support for -pie.
12048 * options.h (class General_options): Add -pie and
12049 --pic-executable.
12050 (General_options::output_is_position_independent): Test -pie.
12051 (General_options::output_is_executable): Return true if not shared
12052 and not relocatable.
12053 (General_options::output_is_pie): Remove.
12054 * options.cc (General_options::finalize): Reject incompatible uses
12055 of -pie.
12056 * gold.cc (queue_middle_tasks): A -pie link is not static.
12057 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12058 * symtab.cc (Symbol::final_value_is_known): Return false if
12059 output_is_position_independent.
12060 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
12061 output_is_position_independent.
12062 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
12063 output_is_position_independent.
12064 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
12065 output_is_position_independent.
12066 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
12067 two_file_pie_test.
12068 (basic_pie_test.o, basic_pie_test): New targets.
12069 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12070 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12071 (two_file_pie_test): New target.
12072 * testsuite/Makefile.in: Rebuild.
12073 * README: Remove note saying that -pie is not supported.
12074
c6585162
ILT
120752009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12076
12077 * options.h (class General_options): Add -init and -fini.
12078 * layout.cc (Layout::finish_dynamic_section): Emit
12079 given init and fini functions.
12080
032ce4e9
ST
120812009-10-13 Sriraman Tallam <tmsriram@google.com>
12082
12083 * gc.h (gc_process_relocs): Check if icf is enabled using new
12084 function.
12085 * gold.cc (queue_initial_tasks): Likewise.
12086 (queue_middle_tasks): Likewise.
12087 * object.cc (do_layout): Likewise.
12088 * symtab.cc (is_section_folded): Likewise.
12089 * main.cc (main): Likewise.
12090 * reloc.cc (Read_relocs::run): Likewise.
12091 (Sized_relobj::do_scan_relocs): Likewise.
12092 * icf.cc (is_function_ctor_or_dtor): New function.
12093 (Icf::find_identical_sections): Check if function is ctor or dtor when
12094 safe icf is chosen.
12095 * options.h (General_options::icf): Change option to be an enum.
12096 (Icf_status): New enum.
12097 (icf_enabled): New method.
12098 (icf_safe_folding): New method.
12099 (set_icf_status): New method.
12100 (icf_status_): New variable.
12101 * (options.cc) (General_options::finalize): Set icf_status_.
12102 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12103 icf_test and icf_keep_unique_test to use the --icf enum flag.
12104 * testsuite/icf_safe_test.sh: New file.
e1df38aa 12105 * testsuite/icf_safe_test.cc: New file.
032ce4e9 12106
f345227a
ST
121072009-10-12 Sriraman Tallam <tmsriram@google.com>
12108
12109 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
12110 includes to gc.h and icf.h.
12111 * arm.cc: Include gc.h.
12112 * gold.cc: Likewise.
12113 * i386.cc: Likewise.
12114 * powerpc.cc: Likewise.
12115 * sparc.cc: Likewise.
12116 * x86_64.cc: Likewise.
12117 * gc.h: Include icf.h.
12118
1c7814ed
ILT
121192009-10-11 Ian Lance Taylor <iant@google.com>
12120
12121 * plugin.cc: Include "gold.h" before other header files.
12122
ae3b5189
CD
121232009-10-10 Chris Demetriou <cgd@google.com>
12124
12125 * options.h (Input_file_argument::Input_file_type): New enum.
12126 (Input_file_argument::is_lib_): Replace with...
12127 (Input_file_argument::type_): New member.
12128 (Input_file_argument::Input_file_argument): Take Input_file_type
12129 'type' rather than boolean 'is_lib' as second argument.
12130 (Input_file_argument::is_lib): Use type_.
12131 (Input_file_argument::is_searched_file): New function.
12132 (Input_file_argument::may_need_search): Handle is_searched_file.
12133 * options.cc (General_options::parse_library): Support -l:filename.
12134 (General_options::parse_just_symbols): Update for Input_file_argument
12135 changes.
12136 (Command_line::process): Likewise.
12137 * archive.cc (Archive::get_file_and_offset): Likewise.
12138 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12139 * script.cc (read_script_file, script_add_file): Likewise.
12140 * fileread.cc (Input_file::Input_file): Likewise.
12141 (Input_file::will_search_for): Handle is_searched_file.
12142 (Input_file::open): Likewise.
12143 * readsyms.cc (Read_symbols::get_name): Likewise.
12144 * testsuite/Makefile.am (searched_file_test): New test.
12145 * testsuite/Makefile.in: Regenerate.
12146 * testsuite/searched_file_test.cc: New file.
12147 * testsuite/searched_file_test_lib.cc: New file.
12148
f3048a1d
ILT
121492009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12150 Ian Lance Taylor <iant@google.com>
12151
12152 * descriptor.cc: Include <cstdio> and "binary-io.h".
12153 (Descriptors::open): Open the files in binary mode always.
12154 * script.cc (Lex::get_token): Treat \r as whitespace.
12155
d4780e57
ILT
121562009-10-09 Ian Lance Taylor <iant@google.com>
12157
12158 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12159
d9a893b8
ILT
121602009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12161 Ian Lance Taylor <iant@google.com>
12162
12163 * configure.ac: Check for readv function also.
12164 * fileread.cc (readv): Define if not HAVE_READV.
12165 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12166 does not exist.
12167 * config.in: Regenerate.
12168 * configure: Regenerate.
12169
c0a62865
DK
121702009-10-09 Doug Kwan <dougkwan@google.com>
12171
12172 * layout.cc (Layout::make_output_section): Call target hook to make
12173 ordinary output section.
12174 (Layout::finalize): Adjust parameter list of call the
12175 Target::may_relax().
12176 * layout.h (class Layout::section_list): New method.
12177 * merge.h (Output_merge_base::entsize): Change visibility to public.
12178 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12179 New methods.
12180 (Output_merge_string::do_is_string): New method.
12181 * object.cc (Sized_relobj::do_setup): renamed from
12182 Sized_relobj::set_up.
12183 * object.h (Sized_relobj::adjust_shndx,
12184 Sized_relobj::initializ_input_to_output_maps,
12185 Sized_relobj::free_input_to_output_maps): Change visibilities to
12186 protected.
12187 (Sized_relobj::setup): Virtualize.
12188 (Sized_relobj::do_setup): New method declaration.
12189 (Sized_relobj::invalidate_section_offset,
12190 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12191 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12192 * options.cc (parse_int): New function.
12193 * options.h (parse_int): New declaration.
12194 (DEFINE_int): New macro.
12195 (stub_group_size): New option.
12196 * output.cc (Output_section::Output_section): Initialize memebers
12197 merge_section_map_, merge_section_by_properties_map_,
12198 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12199 (Output_section::add_input_section): Handled deferred code-fill
12200 generation and remove an old comment.
12201 (Output_section::add_relaxed_input_section): New method definition.
12202 (Output_section::add_merge_input_section): Use merge section by
12203 properties map to speed to search. Update merge section maps
12204 as appropriate.
12205 (Output_section::build_relaxation_map): New method definition.
12206 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12207 Same.
12208 (Output_section::relax_input_section): Renamed to
12209 Output_section::convert_input_sections_to_relaxed_sections and change
12210 interface to take a vector of pointers to relaxed sections.
12211 (Output_section::find_merge_section,
12212 Output_section::find_relaxed_input_section): New method definitions.
12213 (Output_section::is_input_address_mapped,
12214 Output_section::output_offset, Output_section::output_address):
12215 Use output section data maps to speed up searching.
12216 (Output_section::find_starting_output_address): Add comments.
12217 (Output_section::do_write,
12218 Output_section::write_to_postprocessing_buffer): Do code-fill
12219 generation as appropriate.
12220 (Output_section::get_input_sections): Invalidate relaxed input section
12221 map.
12222 (Output_section::restore_states): Adjust type of checkpoint .
12223 Invalidate relaxed input section map.
12224 * output.h (Output_merge_base): New class declaration.
12225 (Input_section_specifier): New class defintion.
12226 (class Output_relaxed_input_section) Change base class to
12227 Output_section_data_build.
12228 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12229 base class initializer.
12230 (Output_section::add_relaxed_input_section): New method declaration.
12231 (Output_section::Input_section): Change visibility to protected.
2e702c99 12232 (Output_section::Input_section::relobj,
c0a62865
DK
12233 Output_section::Input_section::shndx): Handle relaxed input sections.
12234 Output_section::input_sections) Change visibility to protected. Also
12235 define overload to return a non-const pointer.
12236 (Output_section::Merge_section_properties): New class defintion.
12237 (Output_section::Merge_section_by_properties_map,
12238 Output_section::Output_section_data_by_input_section_map,
12239 Output_section::Relaxation_map): New types.
12240 (Output_section::relax_input_section): Rename method to
12241 Output_section::convert_input_sections_to_relaxed_sections and change
12242 interface to take a vector of relaxed section pointers.
12243 (Output_section::find_merge_section,
12244 Output_section::find_relaxed_input_section,
12245 Output_section::build_relaxation_map,
12246 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12247 New method declarations.
12248 (Output_section::merge_section_map_
12249 Output_section::merge_section_by_properties_map_,
12250 Output_section::relaxed_input_section_map_,
12251 Output_section::is_relaxed_input_section_map_valid_,
12252 Output_section::generate_code_fills_at_write_): New data members.
12253 * script-sections.cc
12254 (Output_section_element_input::set_section_addresses): Call
12255 current_data_size and addralign methods of relaxed input sections.
12256 (Orphan_output_section::set_section_addresses): Call current_data_size
12257 and addralign methods of relaxed input sections.
12258 * symtab.cc (Symbol_table::compute_final_value): Extract template
12259 from the body of Symbol_table::sized_finalize_symbol.
12260 (Symbol_table::sized_finalized_symbol): Call
12261 Symbol_table::compute_final_value.
12262 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12263 (Symbol_table::compute_final_value): New templated method declaration.
12264 * target.cc (Target::do_make_output_section): New method defintion.
12265 * target.h (Target::make_output_section): New method declaration.
12266 (Target::relax): Add more parameters for input objects, symbol table
12267 and layout. Adjust call to do_relax.
12268 (Target::do_make_output_section): New method declaration.
12269 (Target::do_relax): Add parameters for input objects, symbol table
12270 and layout.
12271
d446d6c4
ILT
122722009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12273
12274 * pread.c: Include stdio.h.
12275
bc06c745
ILT
122762009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12277
12278 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12279 defined.
12280
75aea3d0
ILT
122812009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12282
12283 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12284 Change read_shndx type to unsigned int.
12285 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12286 int.
12287 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12288 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12289 Change read_shndx type to unsigned int.
12290 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12291 int.
12292 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12293 * layout.cc (Layout::create_symtab_sections): Cast the result of
12294 local_symcount * symsize to off_t in the gold_assert.
12295
be8fcb75
ILT
122962009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12297
12298 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12299 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12300 R_ARM_BASE_ABS.
12301 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12302 (Arm_relocate_functions::thm_abs5): New function.
12303 (Arm_relocate_functions::abs12): New function.
12304 (Arm_relocate_functions::abs16): New function.
12305 (Arm_relocate_functions::base_abs): New function.
12306 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12307 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12308 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12309 R_ARM_BASE_ABS.
12310 (Scan::global): Likewise.
12311 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12312 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12313 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12314 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12315 R_ARM_BASE_ABS.
12316
c2a122b6
ILT
123172009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12318
12319 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12320 (Arm_relocate_functions::movt_prel): New function.
12321 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12322 (Arm_relocate_functions::thm_movt_prel): New function.
12323 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12324 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12325 (Scan::global, Relocate::relocate): Likewise.
12326 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12327
c4aa1e2d
ILT
123282009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12329
12330 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12331 Incremental_checker.
12332 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12333 unsigned int.
12334 (class Incremental_inputs_header): New class.
12335 (Incremental_inputs_header_writer): Edit comment.
12336 (Incremental_inputs_entry): New class.
12337 (Incremental_inputs_entry_writer): Edit comment.
12338 (Sized_incremental_binary::do_find_incremental_inputs_section):
12339 Add *strtab_shndx parameter, fill it.
12340 (Sized_incremental_binary::do_check_inputs): New method.
12341 (Incremental_checker::can_incrementally_link_output_file): Use
12342 Sized_incremental_binary::check_inputs.
12343 (Incremental_inputs::report_command_line): Save command line in
12344 command_line_.
12345 * incremental.h:
12346 (Incremental_binary::find_incremental_inputs_section): New
12347 method.
12348 (Incremental_binary::do_find_incremental_inputs_section): Add
12349 strtab_shndx parameter.
12350 (Incremental_binary::do_check_inputs): New pure virtual method.
12351 (Sized_incremental_binary::do_check_inputs): Declare.
12352 (Incremental_checker::Incremental_checker): Add incremental_inputs
12353 parameter, use it to initialize incremental_inputs_.
12354 (Incremental_checker::incremental_inputs_): New field.
12355 (Incremental_checker::command_line): New method.
12356 (Incremental_checker::inputs): New method.
12357 (Incremental_checker::command_line_): New field.
12358
c549a694
ILT
123592009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12360
12361 * incremental.cc: Include <cstdarg> and "target-select.h".
12362 (vexplain_no_incremental): New function.
12363 (explain_no_incremental): New function.
12364 (Incremental_binary::error): New method.
12365 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12366 method.
12367 (make_sized_incremental_binary): New function.
12368 (open_incremental_binary): New function.
12369 (can_incrementally_link_file): Add checks if output is ELF and has
12370 inputs section.
12371 * incremental.h: Include "elfcpp_file.h" and "output.h".
12372 (Incremental_binary): New class.
12373 (Sized_incremental_binary): New class.
12374 (open_incremental_binary): Declare.
12375 * object.cc (is_elf_object): Use
12376 elfcpp::Elf_recognizer::is_elf_file.
12377 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12378 * output.h (Output_file::filesize): New method.
12379
fd3c5f0b
ILT
123802009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12381
12382 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12383 New function.
12384 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12385 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12386 function.
12387 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12388 function.
12389 (Arm_relocate_functions::movw_abs_nc): New function.
12390 (Arm_relocate_functions::movt_abs): New function.
12391 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12392 (Arm_relocate_functions::thm_movt_abs): New function.
12393 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12394 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12395 (Scan::global): Likewise.
12396 (Relocate::relocate): Likewise.
12397 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12398
7f5309a5
ILT
123992009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12400
12401 * arm.cc (Arm_relocate_functions::got_prel) New function.
12402 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12403 (Relocate::relocate): Likewise.
12404 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12405
364c7fa5
ILT
124062009-10-06 Ian Lance Taylor <iant@google.com>
12407
12408 * options.h (class General_options): Define
12409 split_stack_adjust_size parameter.
12410 * object.h (class Object): Add uses_split_stack_ and
12411 has_no_split_stack_ fields. Add uses_split_stack and
12412 has_no_split_stack accessor functions. Declare
12413 handle_split_stack_section.
12414 (class Reloc_symbol_changes): Define.
12415 (class Sized_relobj): Define Function_offsets. Declare
12416 split_stack_adjust, split_stack_adjust_reltype, and
12417 find_functions.
12418 * object.cc (Object::handle_split_stack_section): New function.
12419 (Sized_relobj::do_layout): Call handle_split_stack_section.
12420 * dynobj.cc (Sized_dynobj::do_layout): Call
12421 handle_split_stack_section.
12422 * reloc.cc (Sized_relobj::relocate_sections): Call
12423 split_stack_adjust for executable sections in split_stack
12424 objects. Pass reloc_map to relocate_section.
12425 (Sized_relobj::split_stack_adjust): New function.
12426 (Sized_relobj::split_stack_adjust_reltype): New function.
12427 (Sized_relobj::find_functions): New function.
12428 * target-reloc.h: Include "object.h".
12429 (relocate_section): Add reloc_symbol_changes parameter. Change
12430 all callers.
12431 * target.h (class Target): Add calls_non_split method. Declare
12432 do_calls_non_split virtual method. Declare match_view and
12433 set_view_to_nop.
12434 * target.cc: Include "elfcpp.h".
12435 (Target::do_calls_non_split): New function.
12436 (Target::match_view): New function.
12437 (Target::set_view_to_nop): New function.
12438 * gold.cc (queue_middle_tasks): Give an error if mixing
12439 split-stack and non-split-stack objects with -r.
12440 * i386.cc (Target_i386::relocate_section): Add
12441 reloc_symbol_changes parameter.
12442 (Target_i386::do_calls_non_split): New function.
12443 * x86_64.cc (Target_x86_64::relocate_section): Add
12444 reloc_symbol_changes parameter.
12445 (Target_x86_64::do_calls_non_split): New function.
12446 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12447 parameter.
12448 * powerpc.cc (Target_powerpc::relocate_section): Add
12449 reloc_symbol_changes parameter.
12450 * sparc.cc (Target_sparc::relocate_section): Add
12451 reloc_symbol_changes parameter.
12452 * configure.ac: Call AM_CONDITIONAL for the default target.
12453 * configure: Rebuild.
12454 * testsuite/Makefile.am (TEST_AS): New variable.
12455 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12456 (check_DATA): Add split_i386 and split_x86_64 files.
12457 (SPLIT_DEFSYMS): Define.
12458 (split_i386_[1234n].o): New targets.
12459 (split_i386_[124]): New targets.
12460 (split_i386_[1234r].stdout): New targets.
12461 (split_x86_64_[1234n].o): New targets.
12462 (split_x86_64_[124]): New targets.
12463 (split_x86_64_[1234r].stdout): New targets.
12464 (MOSTLYCLEANFILES): Add new executables.
12465 * testsuite/split_i386.sh: New file.
12466 * testsuite/split_x86_64.sh: New file.
12467 * testsuite/split_i386_1.s: New file.
12468 * testsuite/split_i386_2.s: New file.
12469 * testsuite/split_i386_3.s: New file.
12470 * testsuite/split_i386_4.s: New file.
12471 * testsuite/split_i386_n.s: New file.
12472 * testsuite/split_x86_64_1.s: New file.
12473 * testsuite/split_x86_64_2.s: New file.
12474 * testsuite/split_x86_64_3.s: New file.
12475 * testsuite/split_x86_64_4.s: New file.
12476 * testsuite/split_x86_64_n.s: New file.
12477 * testsuite/testfile.cc (Target_test): Update relocation_section
12478 function.
12479 * testsuite/Makefile.in: Rebuild.
12480
e8a9fcda
ILT
124812009-10-06 Ian Lance Taylor <iant@google.com>
12482
12483 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12484 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12485 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12486 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12487 the address on ldo_addrs_.
12488 (Target_i386::Relocate::fix_up_ldo): New function.
12489
e99daf92
ILT
124902009-10-06 Rafael Espindola <espindola@google.com>
12491
12492 * plugin.cc (add_input_library): New.
12493 (Plugin::load): Add add_input_library to tv.
12494 (Plugin_manager::add_input_file): Add the is_lib argument.
12495 (add_input_file): Update call to Plugin_manager::add_input_file.
12496 (add_input_library): New.
12497 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12498
966d4097
DK
124992009-09-30 Doug Kwan <dougkwan@google.com>
12500
12501 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12502 symbol and call Symbol::may_need_copy_reloc to determine if
12503 a copy reloc is needed.
12504 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12505 nocopyreloc is given in command line.
12506 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12507 given in command line.
12508 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12509 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12510 of the removed Target_i386::may_need_copy_reloc.
12511 * options.h (copyreloc): New option with default value false.
12512 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12513 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12514 instead of the removed Target_powerpc::may_need_copy_reloc.
12515 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12516 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12517 instead of the removed Target_sparc::may_need_copy_reloc.
12518 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12519 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12520 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12521 instead of the removed Target_x86_64::may_need_copy_reloc.
12522
029ba973
ILT
125232009-09-30 Ian Lance Taylor <iant@google.com>
12524
12525 * object.h (class Object): Remove target_ field, and target,
12526 sized_target, and set_target methods.
12527 (Object::sized_target): Remove.
12528 (class Sized_relobj): Update declarations. Remove sized_target.
12529 * object.cc (Sized_relobj::setup): Remove target parameter.
12530 Change all callers.
12531 (Input_objects::add_object): Don't do anything with the target.
12532 (make_elf_sized_object): Add punconfigured parameter. Change all
12533 callers. Set or test parameter target.
12534 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12535 Change all callers.
12536 * parameters.cc (Parameters::set_target): Change parameter type to
12537 be non-const.
12538 (Parameters::default_target): Remove.
12539 (set_parameters_target): Change parameter type to be non-const.
12540 (parameters_force_valid_target): New function.
12541 (parameters_clear_target): New function.
12542 * parameters.h (class Parameters): Update declarations. Remove
12543 default_target method. Add sized_target and clear_target
12544 methods. Change target_ to be non-const.
12545 (set_parameters_target): Update declaration.
12546 (parameters_force_valid_target): Declare.
12547 (parameters_clear_target): Declare.
12548 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12549 as NULL if we aren't searching.
12550 (Add_symbols::run): Don't check for compatible target.
12551 * fileread.cc (Input_file::open_binary): Call
12552 parameters_force_valid_target.
12553 * gold.cc (queue_middle_tasks): Likewise.
12554 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12555 set_target on object.
12556 * dynobj.h (class Sized_dynobj): Update declarations.
12557 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12558 make_elf_object returns NULL.
12559 (Archive::include_member): Don't check whether object target is
12560 compatible.
12561 * output.cc (Output_section::add_input_section): Get target from
12562 parameters.
12563 (Output_section::relax_input_section): Likewise.
12564 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12565 parameters.
12566 (Sized_relobj::do_scan_relocs): Likewise.
12567 (Sized_relobj::relocate_sections): Likewise.
12568 * resolve.cc (Symbol_table::resolve): Likewise.
12569 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12570 parameter. Change all callers.
12571 (Symbol_table::add_from_object): Get target from parameters.
12572 (Symbol_table::add_from_relobj): Don't check object target.
12573 (Symbol_table::add_from_dynobj): Likewise.
12574 (Symbol_table::define_special_symbol): Get target from
12575 parameters.
12576 * symtab.h (class Symbol_table): Update declaration.
12577 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12578 parameter. Change all callers. Clear parameter target.
12579 (Binary_test): Test target here.
12580 * testsuite/object_unittest.cc (gold_testsuite): Remove
12581 target_test_pointer parameter. Change all callers.
12582 (Object_test): Test target here.
12583
a6a22b83
ILT
125842009-09-26 Ian Lance Taylor <iant@google.com>
12585
12586 * testsuite/initpri1.c: Don't try to use constructor priorities if
12587 compiling with gcc before 4.3.
12588
6a8f49fe
ILT
125892009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12590
12591 * testsuite/retain_symbols_file_test.sh (check_present): Change
12592 output file name to retain_symbols_file_test.stdout.
12593 (check_absent): Likewise.
12594
8c604651
CS
125952009-09-18 Craig Silverstein <csilvers@google.com>
12596
12597 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12598 * options.cc: Include <cerrno> and <fstream>.
12599 (General_options::finalize): Parse -retain-symbols-file tag.
12600 * options.h: New flag.
12601 (General_options): New method should_retain_symbol, new
12602 variable symbols_to_retain.
12603 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12604 should_retain_symbol map.
12605 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12606 * testsuite/Makefile.in: Regenerate.
12607 * testsuite/retain_symbols_file_test.sh: New file.
12608
ca58b19f
NC
126092009-09-18 Nick Clifton <nickc@redhat.com>
12610
12611 * po/es.po: Updated Spanish translation.
12612
20e6d0d6
DK
126132009-09-17 Doug Kwan <dougkwan@google.com>
12614
12615 * debug.h (DEBUG_RELAXATION): New constant.
12616 (DEBUG_ALL): Add DEBUG_RELAXATION.
12617 (debug_string_to_enum): Add relaxation debug option.
12618 * layout.cc
12619 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12620 Layout::Relaxation_debug_check::read_sections,
12621 Layout::Relaxation_debug_check::read_sections): New method definitions.
12622 (Layout::Layout): Initialize data members
12623 record_output_section_data_from_scrips_,
12624 script_output_section_data_list_ and relaxation_debug_check_.
12625 (Layout::save_segments, Layout::restore_segments,
12626 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12627 Layout::relaxation_loop_body): New method definitions.
12628 (Layout::finalize): Support relaxation. Move section layout code to
12629 Layout::relaxation_loop_body.
12630 (Layout::set_asection_address_from_script): Move code for orphan
12631 section placement out.
12632 (Layout::place_orphan_sections_in_script): New method definition.
12633 * layout.h (Output_segment_headers, Output_file_header):
12634 New forward class declarations.
12635 (Layout::~Layout): Define.
12636 (Layout::new_output_section_data_from_script): New method definition.
12637 (Layout::place_orphan_sections_in_script): New method declaration.
12638 (Layout::Segment_states): New type declaration.
12639 (Layout::save_segments, Layout::restore_segments,
12640 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12641 Layout::relaxation_loop_body): New method declarations.
12642 (Layout::Output_section_data_list): New type declaration.
12643 (Layout::Relaxation_debug_check): New class definition.
12644 (Layout::record_output_section_data_from_script_,
12645 Layout::script_output_section_data_list_, Layout::segment_states_,
12646 Layout::relaxation_debug_check_): New data members.
12647 * output.cc: (Output_section_headers::do_size): New method definition.
12648 (Output_section_headers::Output_section_headers): Move size
12649 computation to Output_section_headers::do_size.
12650 (Output_segment_headers::do_size): New method definition.
e1df38aa 12651 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
12652 Output_file_header::do_size and call it.
12653 (Output_file_header::do_size): New method definition.
12654 (Output_data_group::Output_data_group): Adjust call to
12655 Output_section_data.
12656 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12657 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 12658 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
12659 RELAXED_INPUT_SECTION_CODE.
12660 (Output_section::Output_section): Initialize data member checkpoint_.
12661 (Output_section::~Output_section): Delete checkpoint object pointed
12662 by checkpoint_.
12663 (Output_section::add_input_section): Always add an Input_section if
12664 relaxing.
12665 (Output_section::add_merge_input_section): Add assert.
12666 (Output_section::relax_input_section): New method definition.
12667 (Output_section::set_final_data_size): Set load address to zero for
12668 an unallocated section.
12669 (Output_section::do_address_and_file_offset_have_reset_values):
12670 New method definition.
12671 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12672 Handle relaxed input section.
12673 (Output_section::sort_attached_input_sections): Checkpoint input
12674 section list lazily.
12675 (Output_section::get_input_sections): Change type of input_sections to
12676 list of Simple_input_section pointers. Checkpoint input section list
12677 lazily. Also handle relaxed input sections.
12678 (Output_section::add_input_section_for_script): Take a reference to
12679 a Simple_input_section object instead of Relobj pointer and section
12680 index as parameter. Handle relaxed input sections.
12681 (Output_section::save_states, Output_section::restore_states): New
12682 method definitions.
12683 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12684 (Output_data::is_data_size_fixed): New method definition.
12685 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12686 if it is fixed.
12687 (Output_data::address_and_file_offset_have_reset_values): New method
12688 definition.
12689 (Output_data::do_address_and_file_offset_have_reset_values): New method
12690 definition.
12691 (Output_data::set_data_size): Check that data size is not fixed.
12692 (Output_data::fix_data_size): New method definition.
12693 (Output_data::is_data_size_fixed_): New data member.
12694 (Output_section_headers::set_final_data_size): New method definition.
12695 (Output_section_headers::do_size): New method declaration.
12696 (Output_segment_headers::set_final_data_size): New method definition.
12697 (Output_segment_headers::do_size): New method declaration.
12698 (Output_file_header::set_final_data_size)::New method definition.
12699 (Output_file_header::do_size)::New method declaration.
12700 (Output_section_data::Output_section_data): Add new parameter
12701 is_data_size_fixed and use it to fix data size.
12702 (Output_data_const::Output_data_const): Adjust call to base class
12703 constructor and fix data size.
12704 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12705 base class constructor and fix data size.
12706 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12707 base class constructor and fix data size.
12708 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12709 class constructor and fix data size.
12710 (Output_data_group::set_final_data_size): New method definition.
12711 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12712 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12713 class constructor and fix data size.
12714 (Output_relaxed_input_section): New class definition.
12715 (Output_section::Simple_input_section): New class definition.
12716 (Output_section::get_input_sections): Adjust parameter list.
12717 (Output_section::add_input_section_for_script): Same.
12718 (Output_section::save_states, Output_section::restore_states,
12719 Output_section::do_address_and_file_offset_have_reset_values,
12720 (Output_section::Input_section::Input_section): Handle
12721 RELAXED_INPUT_SECTION_CODE. Add new overload for
12722 Output_relaxed_input_section.
12723 (Output_section::Input_section::is_input_section,
12724 Output_section::Input_section::set_output_section): Handle relaxed
12725 input section.
12726 (Output_section::Input_section::is_relaxed_input_section,
12727 Output_section::Input_section::output_section_data,
12728 Output_section::Input_section::relaxed_input_section): New method
12729 definitions.
12730 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12731 value.
12732 (Output_section::Input_section::u1_): Update comments.
12733 (Output_section::Input_section::u2_): Add new union member poris.
12734 (Output_section::Checkpoint_output_section): New classs definition.
12735 (Output_section::relax_input_section): New method declaration.
12736 (Output_section::checkpoint_): New data member.
12737 (Output_segment): Update comments.
12738 (Output_segment::Output_segment): Un-privatize copy constructor.
12739 (Output_segment::operator=): Un-privatize.
12740 * script-sections.cc (Output_section_element::Input_section_list):
12741 Change element type to Output_section::Simple_input_section.
12742 (Output_section_element_dot_assignment::set_section_addresses):
12743 Register output section data for relaxation clean up.
12744 (Output_data_exression::Output_data_expression): Adjust call to base
12745 constructor to fix data size.
12746 (Output_section_element_data::set_section_addresses): Register
12747 Output_data_expression object for relaxation clean up.
12748 (struct Input_section_info): Replace Relobj pointer and section index
12749 pair with Output_section::Simple_input_section and Convert struct to a
12750 class.
12751 (Input_section_sorter::operator()): Adjust access to
e1df38aa 12752 Input_section_info data member to use accessors.
20e6d0d6
DK
12753 (Output_section_element_input::set_section_addresses): Use layout
12754 parameter. Adjust code to use Output_section::Simple_input_section
12755 and Input_secction_info classes. Register filler for relaxation
12756 clean up.
12757 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12758 and section index pair with Output_section::Simple_input_section
12759 class. Adjust code accordingly.
12760 (Phdrs_element::release_segment): New method definition.
12761 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12762 segment list.
12763 (Script_sections::release_segments): New method definition.
12764 * gold/script-sections.h (Script_sections::release_segments): New
12765 method declaration.
12766 * gold/target.h (Target::may_relax, Target::relax,
12767 Target::do_may_relax, Target::do_relax): New method definitions.
12768
5e445df6
ILT
127692009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12770
12771 * arm.cc (has_signed_unsigned_overflow): New function.
12772 (Arm_relocate_functions::abs8): New function.
12773 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12774 (Target_arm::Scan::global): Likewise.
12775 (Target_arm::relocate::relocate): Likewise.
12776 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12777 Likewise.
12778
8c604651 127792009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
12780
12781 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12782 * testsuite/Makefile.in: Regenerate.
12783
1e9cc1c2
NC
127842009-09-11 Nick Clifton <nickc@redhat.com>
12785
12786 * po/gold.pot: Updated by the Translation project.
12787
6a89f575
CC
127882009-09-08 Cary Coutant <ccoutant@google.com>
12789
12790 * output.cc (Output_file::open): Add execute permission to empty file.
12791 * testsuite/Makefile.am (permission_test): New test.
12792 * testsuite/Makefile.in: Regenerate.
12793
fdcac5af
ILT
127942009-09-02 Ian Lance Taylor <iant@google.com>
12795
12796 * output.cc (Output_file::resize): Call map_no_anonymous rather
12797 than map.
12798
44453f85
ILT
127992009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12800
12801 * gold.cc: Include "incremental.h".
12802 (queue_initial_tasks): Call Incremental_checker methods.
12803 * incremental.cc: Include "output.h".
12804 (Incremental_checker::can_incrementally_link_output_file): New
12805 method.
12806 * incremental.h (Incremental_checker): New class.
12807
12808 * output.cc (Output_file::open_for_modification): New method.
12809 (Output_file::map_anonymous): Changed return type to bool. Record
12810 map in base_ field.
12811 (Output_file::map_no_anonymous): New method, broken out of map.
12812 (Output_file::map): Use map_no_anonymous and map_anonymous.
12813 * output.h (class Output_file): Update declarations.
12814
293c1386
CC
128152009-08-24 Cary Coutant <ccoutant@google.com>
12816
12817 * options.h (Command_line::Pre_options): New class.
12818 (Command_line::pre_options): New member.
12819 * options.cc (gold::options::ready_to_register): New variable.
12820 (One_option::register_option): Do nothing if not registering options.
12821 Assert if same short option registered twice.
12822 (General_options::General_options): Turn off option registration when
12823 done constructing.
12824 (Command_line::Pre_options::Pre_options): New constructor.
12825
f773f3d2
CC
128262009-08-24 Cary Coutant <ccoutant@google.com>
12827
06a73cfe
CC
12828 * options.h (General_options::no_keep_memory): Remove incorrect
12829 short option.
f773f3d2 12830
a15af8e2
RW
128312009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12832
12833 * Makefile.am (am__skiplex, am__skipyacc): New.
12834 * Makefile.in: Regenerate.
12835
c462b41b
RW
128362009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12837
14ec8efd
RW
12838 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12839 (INCLUDES): ... this.
12840 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12841 (AM_CPPFLAGS): Renamed from ...
12842 (INCLUDE): ... this.
12843 * Makefile.in, testsuite/Makefile.in: Regenerate.
12844
81ecdfbb
RW
12845 * Makefile.in: Regenerate.
12846 * aclocal.m4: Likewise.
12847 * config.in: Likewise.
12848 * configure: Likewise.
12849 * testsuite/Makefile.in: Likewise.
12850
c462b41b
RW
12851 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12852 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12853 * Makefile.in: Regenerate.
12854 * testsuite/Makefile.in: Regenerate.
12855
2da73f13
CC
128562009-08-19 Cary Coutant <ccoutant@google.com>
12857
12858 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12859 symbols in shared libraries overridden by hidden or internal symbols
12860 in the main program.
12861
2db70501
CD
128622009-08-19 Chris Demetriou <cgd@google.com>
12863
12864 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12865 checking source file names in error messages.
12866
f733487b
DK
128672009-08-18 Doug Kwan <dougkwan@google.com>
12868
12869 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12870 an elcpp::Ehdr as parameter. Adjust call to set_target.
12871 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12872 an elfcpp::Ehdr as parameter.
12873 * object.cc (Object::set_target): Remove the version that looks up
12874 a target and sets it.
12875 (Sized_relobj::setup): Take a Target object instead of
12876 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12877 (make_elf_sized_object): Find target and ask target to
12878 make an ELF object.
12879 * object.h: (Object::set_target): Remove the version that looks up
12880 a target and sets it.
12881 (Sized_relobj::setup): Take a Target object instead of
12882 an elfcpp:Ehdr as parameter.
12883 * target.cc: Include dynobj.h.
12884 (Target::do_make_elf_object_implementation): New.
2e702c99 12885 (Target::do_make_elf_object): New.
f733487b
DK
12886 * target.h (Target::make_elf_object): New template declaration.
12887 (Target::do_make_elf_object): New method declarations.
12888 (Target::do_make_elf_object_implementation): New template declaration.
12889
cc70f101
ILT
128902009-08-14 Ian Lance Taylor <iant@google.com>
12891
12892 * gold.h (FUNCTION_NAME): Define.
12893 (gold_unreachable): Use FUNCTION_NAME.
12894
ef5e0cb1
ST
128952009-08-12 Sriraman Tallam <tmsriram@google.com>
12896
12897 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12898 symbol in the --keep-unique list is not found.
12899
48c187ce
ST
129002009-08-12 Sriraman Tallam <tmsriram@google.com>
12901
12902 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12903 been maked as --keep-unique.
12904 (Icf::unfold_section): New function.
12905 * icf.h (Icf::unfold_section): New function.
12906 * options.h (General_options::keep_unique): New option.
12907 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12908 * testsuite/Makefile.in: Regenerate.
12909 * testsuite/icf_keep_unique_test.sh: New file.
12910 * testsuite/icf_keep_unique_test.cc: New file.
12911
645afe0c
CC
129122009-08-12 Cary Coutant <ccoutant@google.com>
12913
12914 PR 10471
12915 * resolve.cc (Symbol_table::resolve): Check for references from
12916 dynamic objects to hidden and internal symbols.
12917 * testsuite/Makefile.am (hidden_test.sh): New test.
12918 * testsuite/Makefile.in: Regenerate.
12919 * testsuite/hidden_test.sh: New script.
12920 * testsuite/hidden_test_1.c: New test source.
12921 * testsuite/hidden_test_main.c: New test source.
12922
11af873f
DK
129232009-08-11 Doug Kwan <dougkwan@google.com>
12924
12925 * arm.cc: Update comments.
12926 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12927 segment to locate the .ARM.exidx section if present.
12928
b9f7d72d
DK
129292009-08-09 Doug Kwan <dougkwan@google.com>
12930
12931 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12932 patch.
12933
ddd3c53c
ST
129342009-08-07 Sriraman Tallam <tmsriram@google.com>
12935 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12936 compiler warnings.
12937
27721062
ST
129382009-08-06 Sriraman Tallam <tmsriram@google.com>
12939
12940 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12941 valid tls_segment only for non-debug-section relocations.
12942 * testsuite/Makefile.am: Add gc_tls_test.
12943 * testsuite/Makefile.in: Regenerate.
12944 * testsuite/gc_tls_test.cc: New file.
12945 * testsuite/gc_tls_test.sh: New file.
12946
ef15dade 129472009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 12948
ef15dade
ST
12949 * icf.cc: New file.
12950 * icf.h: New file.
12951 * Makefile.am (CCFILES): Add icf.cc.
12952 (HFILES): Add icf.h
12953 * Makefile.in: Regenerate.
12954 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12955 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12956 section, symbol and addend information for the relocs.
12957 * gold.cc (queue_middle_tasks): Call identical code folding.
12958 * gold.h: Add defines for multimap.
12959 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12960 to the call of finalize_local_symbols.
12961 * main.cc (main): Create object of class Icf.
12962 * object.cc (Sized_relobj::do_layout): Allow this function to be
12963 called twice during icf.
12964 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12965 to sections marked as identical by icf.
12966 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12967 when available.
12968 (Sized_relobj::do_section_entsize): New function.
12969 * object.h (Object::section_entsize): New function.
12970 (Object::do_section_entsize): New pure virtual function.
12971 (Relobj::finalize_local_symbols): Add new parameter.
12972 (Relobj::do_section_entsize): New function.
12973 * options.h (General_options::icf): New option.
12974 (General_options::icf_iterations): New option.
12975 (General_options::print_icf_sections): New option.
12976 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12977 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12978 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12979 icf.
12980 * symtab.cc (Symbol_table::is_section_folded): New function.
12981 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12982 to sections marked as identical by icf.
12983 * symtab.h (Symbol_table::set_icf): New function.
12984 (Symbol_table::icf): New function.
12985 (Symbol_table::is_section_folded): New function.
12986 (Symbol_table::icf_): New data member.
12987 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12988 * testsuite/Makefile.am: Add commands to build icf_test.
12989 * testsuite/Makefile.in: Regenerate.
12990 * testsuite/icf_test.sh: New file.
12991 * testsuite/icf_test.cc: New file.
12992
c3b65ac4
CD
129932009-07-24 Chris Demetriou <cgd@google.com>
12994
12995 * layout.cc (is_compressible_debug_section): Fix incorrect
12996 comment about compressed section names.
12997
1caf2c51
ILT
129982009-07-20 Ian Lance Taylor <ian@airs.com>
12999
13000 PR 10419
13001 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
13002
1ef4d87f
ILT
130032009-07-16 Ian Lance Taylor <iant@google.com>
13004
13005 PR 10400
13006 * layout.h: #include <map>.
13007 (class Kept_section): Change from struct to class. Add accessors
13008 and setters. Add section size to Comdat_group mapping. Change
13009 Comdat_group to std::map. Add is_comdat_ field. Add
13010 linkonce_size field in union.
13011 (class Layout): Update declaration of find_or_add_kept_section.
13012 Don't declare find_kept_object.
13013 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13014 parameter. Add object, shndx, is_comdat, and is_group_name
13015 parameters. Change all callers. Adjust for new Kept_section.
13016 (Layout::find_kept_object): Remove.
13017 * object.cc (Sized_relobj::include_section_group): Update use of
13018 Kept_section. Rename secnum to shndx. Only record
13019 Kept_comdat_section if sections are the same size.
13020 (Sized_relobj::include_linkonce_section): Update use of
13021 Kept_section. Only record Kept_comdat_section if sections are the
13022 same size. Set size of linkonce section.
13023 (Sized_relobj::map_to_kept_section): Update call to
13024 get_kept_comdat_section.
13025 * object.h (class Sized_relobj): Rename fields in
13026 Kept_comdat_section to drop trailing underscores; change object
13027 field to Relobj*. Change Kept_comdat_section_table to store
13028 struct rather than pointer.
13029 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13030 Add kept_object and kept_shndx parameters. Change all callers.
13031 (Sized_relobj::get_kept_comdat_section): Change return type to
13032 bool. Add kept_object and kept_shndx parameters. Change all
13033 callers.
13034 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13035 Layout::find_or_add_kept_section.
13036
37c3b7b0
ILT
130372009-07-09 Ian Lance Taylor <iant@google.com>
13038
13039 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13040 Reserve space in the hash table.
13041
98fa85cb
ILT
130422009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13043
13044 * fileread.cc (File_read::get_mtime): New method.
13045 * fileread.h (Timespec): New structure.
13046 (File_read::get_mtime): New method.
13047 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13048 Renamed from timestamp_nsec.
13049 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13050 Elf_Xword.
e1df38aa 13051 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 13052 timestamp_nsec.
e1df38aa 13053 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
13054 (Incremental_inputs::report_obejct): Save mtime; style fix.
13055 (Incremental_inputs::report_script): Save mtime; style fix.
13056 (Incremental_inputs::finalize_inputs): Style fix.
13057 (Incremental_inputs::finalize): Style fix.
13058 (Incremental_inputs::create_input_section_data): Store inputs
13059 mtime.
13060 * incremental.h (Incremental_inputs::report_script): Add mtime
13061 argument.
13062 (Incremental_inputs::Input_info::Input_info): Intialize only one
13063 union member.
13064 (Incremental_inputs::Input_info::archive): Move to nameless
13065 union.
13066 (Incremental_inputs::Input_info::obejct): Move to nameless union.
13067 (Incremental_inputs::Input_info::script): Move to nameless union.
13068 (Incremental_inputs::mtime): New field.
13069 * script.cc (read_input_script): Pass file mtime to
13070 Incremental_input.
13071 * script.h (Script_info::inputs): Style fix.
13072
c9d70757
ILT
130732009-07-01 Ian Lance Taylor <ian@airs.com>
13074
13075 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13076 instead of 32.
13077
9c547ec3
ILT
130782009-06-24 Ian Lance Taylor <iant@google.com>
13079
13080 PR 10156
13081 * layout.cc (Layout::choose_output_section): If we find an
13082 existing section, update the flags.
13083 (Layout::create_notes): New function, broken out of
13084 Layout::finalize.
13085 (Layout::finalize): Don't create note sections.
13086 (Layout::create_note): Don't crash if linker script discards
13087 section.
13088 (Layout::create_gold_note): Likewise.
13089 (Layout::create_build_id): Likewise. Don't set
13090 after_input_sections on the section.
13091 (Layout::create_executable_stack_info): Remove target parameter.
13092 Change caller.
13093 * layout.h (class Layout): Declare create_notes. Update
13094 declaration of create_executable_stack_info.
13095 * gold.cc (queue_middle_tasks): Call create_notes.
13096 * output.cc (Output_section::update_flags_for_input_section): Move
13097 here from output.h. If SHF_ALLOC flag is newly set, mark address
13098 invalid.
13099 * output.h (Output_data::mark_address_invalid): New function.
13100 (class Output_section): Only declare, not define,
13101 update_flags_for_input_section. Remove set_flags.
13102
55458500
ILT
131032009-06-24 Ian Lance Taylor <iant@google.com>
13104
13105 * script-sections.cc (Output_section_definition::
13106 set_section_addresses): Rename shadowing local load_address to
13107 laddr.
13108
1307d6cd
ILT
131092009-06-24 Ian Lance Taylor <iant@google.com>
13110
13111 PR 10244
13112 * reloc.cc (relocate_sections): Skip empty relocation sections.
13113
ec3f783e
ILT
131142009-06-23 Ian Lance Taylor <iant@google.com>
13115
13116 PR 10156
13117 * layout.cc (Layout::create_note): Use choose_output_section
13118 rather than make_output_section.
13119
459c9f1c
ILT
131202009-06-23 Ian Lance Taylor <iant@google.com>
13121
13122 PR 10237
13123 * options.cc (General_options::parse_V): Set printed_version_.
13124 (General_options::General_options): Initialize printed_version_.
13125 * options.h (class General_options): Add printed_version_ field.
13126 * gold.cc (queue_initial_tasks): If there are no input files,
13127 don't give a fatal error if we printed the version information.
13128 (queue_middle_tasks): If using -r with a shared object, give a
13129 fatal error rather than an ordinary error.
13130
1518dc8f
ILT
131312009-06-23 Ian Lance Taylor <iant@google.com>
13132
13133 PR 10219
13134 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13135 (Layout::make_output_section): Set have_stabstr_section_ if we see
13136 a .stab*str section.
13137 (Layout::finalize): Call link_stabs_sections.
13138 (Layout::link_stabs_sections): New file.
13139 * layout.h (class Layout): Add have_stabstr_section_ field.
13140 Declare link_stabs_sections.
13141
3d857b98
DK
131422009-06-23 Doug Kwan <dougkwan@google.com>
13143
13144 * Makefile.am (libgold_a_LIBADD): New.
13145 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 13146 * Makefile.in: Regenerate.
3d857b98
DK
13147 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13148 * configure: Regenerate.
13149 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13150 * fileread.cc: Include sys/state.h
13151 * gold.h: Declare memmem and strndup if found missing.
13152 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13153
0639a6f6
ILT
131542009-06-23 Ian Lance Taylor <iant@google.com>
13155
13156 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13157 * configure: Rebuild.
13158
8d63875c
ILT
131592009-06-23 Ian Lance Taylor <iant@google.com>
13160
13161 PR 10147
13162 * object.cc (Object::section_contents): Don't try to get a view if
13163 the section has length zero.
13164 (Object::handle_gnu_warning_section): If the section is empty, use
13165 the name of the section as the warning.
13166
f7c8a183
ILT
131672009-06-23 Ian Lance Taylor <iant@google.com>
13168
13169 PR 10133
13170 * stringpool.h (class Stringpool_template): Add optimize_ field.
13171 (Stringpool_template::set_optimize): New function.
13172 * stringpool.cc (Stringpool_template::Stringpool_template):
13173 Initialize optimize_ field.
13174 (Stringpool_template::set_string_offsets): Test local optimize
13175 fild rather than parameter.
13176 * layout.cc (Layout::Layout): Call set_optimize on the section
13177 name stringpool.
13178
e6a307ba
ILT
131792009-06-22 Ian Lance Taylor <iant@google.com>
13180
13181 PR 10030
13182 * yyscript.y: Parse TARGET.
13183 * script.cc (script_set_target): New function.
13184 * script-c.h (script_set_target): Declare.
13185 * options.cc (General_options::string_to_object_format): Rename
13186 from string_to_object_format in anonymous namespace. Change
13187 callers.
13188 * options.h (class General_options): Declare
13189 string_to_object_format.
13190
3ee173de
ILT
131912009-06-22 Ian Lance Taylor <iant@google.com>
13192
13193 * script-sections.cc (Script_sections::create_segments): Don't put
13194 program headers in a PT_LOAD segment if -n or -N.
13195
131962009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
13197
13198 PR 10141
13199 * options.h (class General_options): Add -z lazy and -z now. Sort
13200 -z options into alphabetical order.
13201 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13202
cd6739a1 132032009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
13204
13205 * layout.cc (Layout::make_output_section): Call
13206 Target::new_output_section.
13207 (Layout::attach_allocated_section_to_segment): Put large section
13208 sections in a separate load segment with the large segment flag
13209 set.
13210 (Layout::segment_precedes): Sort large data segments after other
13211 load segments.
13212 (align_file_offset): New static function.
13213 (Layout::set_segment_offsets): Use align_file_offset.
13214 * output.h (class Output_section): Add is_small_section_ and
13215 is_large_section_ fields.
13216 (Output_section::is_small_section): New function.
13217 (Output_section::set_is_small_section): New function.
13218 (Output_section::is_large_section): New function.
13219 (Output_section::set_is_large_section): New function.
13220 (Output_section::is_large_data_section): New function.
13221 (class Output_segment): Add is_large_data_segment_ field.
13222 (Output_segment::is_large_data_segment): New function.
13223 (Output_segment::set_is_large_data_segment): New function.
13224 * output.cc (Output_section::Output_section): Initialize new
13225 fields.
13226 (Output_segment::Output_segment): Likewise.
13227 (Output_segment::add_output_section): Add assertion that large
13228 data sections always go in large data segments. Force small data
13229 sections to the end of the list of data sections. Force small BSS
13230 sections to the start of the list of BSS sections. For large BSS
13231 sections to the end of the list of BSS sections.
13232 * symtab.h (class Symbol): Declare is_common_shndx.
13233 (Symbol::is_defined): Check Symbol::is_common_shndx.
13234 (Symbol::is_common): Likewise.
13235 (class Symbol_table): Define enum Commons_section_type. Update
13236 declarations. Add small_commons_ and large_commons_ fields.
13237 * symtab.cc (Symbol::is_common_shndx): New function.
13238 (Symbol_table::Symbol_table): Initialize new fields.
13239 (Symbol_table::add_from_object): Put small and large common
13240 symbols in the right list.
13241 (Symbol_table::sized_finalized_symbol): Check
13242 Symbol::is_common_shndx.
13243 (Symbol_table::sized_write_globals): Likewise.
13244 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13245 common symbol lists. Don't call do_allocate_commons_list if the
13246 list is empty.
13247 (Symbol_table::do_allocate_commons_list): Remove is_tls
13248 parameter. Add comons_section_type parameter. Change all
13249 callers. Handle small and large common symbols.
13250 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13251 Symbol::is_common_shndx.
13252 * resolve.cc (symbol_to_bits): Likewise.
13253 * target.h (Target::small_common_shndx): New function.
13254 (Target::small_common_section_flags): New function.
13255 (Target::large_common_shndx): New function.
13256 (Target::large_common_section_flags): New function.
13257 (Target::new_output_section): New function.
13258 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13259 small_common_section_flags, and large_common_section_flags
13260 fields.
13261 (Target::do_new_output_section): New virtual function.
13262 * arm.cc (Target_arm::arm_info): Initialize new fields.
13263 * i386.cc (Target_i386::i386_info): Likewise.
13264 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13265 Likewise.
13266 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13267 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13268 (Target_x86_64::do_new_output_section): New function.
13269 * configure.ac: Define conditional MCMODEL_MEDIUM.
13270 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13271 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13272 (large_LDFLAGS): Define.
13273 * testsuite/large.c: New file.
13274 * testsuite/testfile.cc (Target_test::test_target_info):
13275 Initialize new fields.
13276 * configure, testsuite/Makefile.in: Rebuild.
13277
bb04269c
DK
132782009-06-05 Doug Kwan <dougkwan@google.com>
13279
13280 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13281 * Makefile.in: Regenerate.
bb04269c
DK
13282 * i386.cc (class Target_i386): Define new virtual method to
13283 override do_is_local_label_name in parent.
13284 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13285 local symbols if --discard-locals or -X is given.
13286 * options.h (class General_options): Declare new options
13287 '--discard-locals' and '-X' for discarding locals.
13288 * target.h (class Target): Define new methods is_local_label_name.
13289 Declare new virtual method do_is_local_label_name.
13290 * target.cc: New file.
13291 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13292 (check_SCRIPTS): Add discard_locals_test.sh.
13293 (check_DATA): Add discard_local_tests.syms.
13294 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13295 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13296 * testsuite/Makefile.in: Regenerate.
13297 * testsuite/discard_locals_test.c: New file.
13298 * testsuite/discard_locals_test.sh: Same.
13299
805bb01c
DK
133002009-06-05 Doug Kwan <dougkwan@google.com>
13301
13302 * object.cc (Sized_relobj::Sized_relobj): Initialize
13303 discarded_eh_frame_shndx_ to -1U.
13304 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13305 section.
13306 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13307 a discarded .eh_frame section.
13308 (Sized_relobj::do_finalize_local_symbols): Ditto.
13309 * object.h (class Sized_relobj): Declare new member
13310 discarded_eh_frame_shndx_.
13311 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13312 (local_labels_test.o, local_labels_test): New rules.
13313 * testsuite/Makefile.in: Regenerate.
13314
1dcd334d
DK
133152009-06-04 Doug Kwan <dougkwan@google.com>
13316
13317 * layout.cc (Layout::section_name_mapping): Add mapping for
13318 special ARM sections.
13319
96d49306
DK
133202009-06-03 Doug Kwan <dougkwan@google.com>
13321
13322 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13323 (utils::has_overflow): Same.
13324
dff16297
ILT
133252009-06-03 Ian Lance Taylor <iant@google.com>
13326
13327 * layout.cc (Layout::section_name_mapping): New array, replacing
13328 Layout::linkonce_mapping.
13329 (Layout::section_name_mapping_count): New variable, replacing
13330 Layout::linkonce_mapping_count.
13331 (Layout::linkonce_output_name): Remove.
13332 (Layout::output_section_name): Rewrite.
13333 * layout.h (class Layout): Rename Linkonce_mapping to
13334 Section_name_mapping, linkonce_mapping to section_name_mapping,
13335 linkonce_mapping_count to section_name_mapping_count. Don't
13336 declare linkonce_output_name.
13337
c121c671
DK
133382009-06-03 Doug Kwan <dougkwan@google.com>
13339
13340 * gold/arm.cc (namespace utils): New.
13341 (Target_arm::reloc_is_non_pic): Define new method.
13342 (class Arm_relocate_functions): New.
13343 (Target_arm::Relocate::relocate): Handle relocation types used by
13344 Android.
13345
07800fab
ILT
133462009-06-03 Ian Lance Taylor <iant@google.com>
13347
13348 * arm.cc (Target_arm::scan::global): Use || instead of |.
13349
c121c671
DK
133502009-06-02 Doug Kwan <dougkwan@google.com>
13351
13352 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13353 issued_non_pic_error_.
13354 (class Target_arm::Scan): Declare new method check_non_pic.
13355 Define new method symbol_needs_plt_entry.
13356 Declare new data member issued_non_pic_error_.
13357 (class Target_arm::Relocate): Declare new method
13358 should_apply_static_reloc.
13359 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13360 (Target_arm::Scan::check_non_pic): Define new method.
13361 (Target_arm::Scan::local): Handle a small subset of reloc types used
13362 by Android.
13363 (Target_arm::Scan::local): Same.
13364 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13365
b19b0c6d
ILT
133662009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13367
13368 * incremental.cc (Incremental_inputs::report_command_line): Filter
13369 out --incremental-* options.
13370
94cdfcff
DK
133712009-05-29 Doug Kwan <dougkwan@google.com>
13372
13373 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13374 template class.
13375 (class Target_arm): Update comment.
13376 (Target_arm::Target_arm): Initialize new data members GOT_,
13377 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13378 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13379 and Target_arm::rel_dyn_section.
13380 Declare new_enum Target_arm::Got_type.
13381 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13382 and DYNBSS_.
13383 Update commments for member do_dynsym_value.
13384 (Target_arm::got_size, Target_arm::plt_section,
13385 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13386 new methods inside class defintion.
13387 (Target_arm::got_section): Define new method.
13388 (Target_arm::rel_dyn_section): Same.
13389 (Output_data_plt_arm): New template class.
13390 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13391 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13392 (Output_data_plt_arm::add_entry): Same.
13393 (Output_data_plt_arm::first_plt_entry): Define new
13394 static data member for PLT instruction template.
13395 (Output_data_plt_arm::plt_entry): Same.
13396 (Output_data_plt_arm::do_write): Define new method.
13397 (Target_arm::make_plt_entry): Same.
13398 (Target_arm::do_finalize_sections): Same.
13399 (Target_arm::do_dynsym_value): Same.
13400
4a657b0d
DK
134012009-05-28 Doug Kwan <dougkwan@google.com>
13402
13403 * Makefile.am (TARGETSOURCES): Add arm.cc.
13404 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13405 * Makefile.in: Regenerate.
13406 * arm.cc: New file.
13407 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13408
e7ae8c36
DK
134092009-05-26 Doug Kwan <dougkwan@google.com>
13410
13411 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13412 (General_options::check_excluded_libs): Strip off directories in
13413 archive name before matching like GNU ld does.
13414 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13415 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13416 (exclude_libs_test_LDFLAGS): Add linker option
13417 -Wl,--exclude-libs,libexclude_libs_test_3
13418 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13419 an explicit archive without using -l.
13420 (alt/libexclude_libs_test_3.a): New make rule.
13421 * testsuite/Makefile.in: Regenerate.
13422 * testsuite/exclude_libs_test.c : Declare lib3_default().
13423 (main): Call it.
13424 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13425 * exclude_libs_test_3.c: New file.
13426
f12e7348
NC
134272009-05-26 Nick Clifton <nickc@redhat.com>
13428
13429 * po/id.po: New Indonesian translation.
13430 * po/gold.pot: Updated template file.
13431
4daadc0d
ST
134322009-05-22 Sriraman Tallam <tmsriram@google.com>
13433
e1df38aa 13434 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13435 gc_comdat_test files. Add -Wl,--gc-sections to build
13436 gc_comdat_test.
13437 * testsuite/Makefile.in: Regenerate.
13438 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13439
531813ad
ST
134402009-05-21 Sriraman Tallam <tmsriram@google.com>
13441
13442 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13443 kept comdat section was garbage collected.
13444 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13445 * testsuite/Makefile.in: Regenerate.
13446 * testsuite/gc_comdat_test.sh: New file.
13447 * testsuite/gc_comdat_test_1.cc: New file.
13448 * testsuite/gc_comdat_test_2.cc: New file.
13449
65514900
CC
134502009-05-19 Doug Kwan <dougkwan@google.com>
13451
13452 * archive.cc (Archive::Archive): Move constructor from archive.h
13453 to here. Initialize no_export_.
13454 (Archive::get_elf_object_for_member): Set no_export flag of object.
13455 * archive.h (Archive::Archive): Move constructor body to
13456 archive.cc.
13457 (Archive::no_export): New method.
13458 (Archive::no_export_): New field.
13459 * object.h (Object::Object): Initialize no_export_ to false.
13460 (Object::no_export, Object::set_no_export): New methods.
13461 (Object::no_export_): New field.
13462 * options.cc (General_options::parse_exclude_libs): New method.
13463 (General_options::check_excluded_libs) Same.
13464 * options.h (exclude_libs): New option.
13465 (General_options::check_excluded_libs): New method declaration.
13466 (General_options::excluded_libs_): New field.
13467 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13468 default or protected visibility if an object has no-export flag set.
13469 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13470 (check_SCRIPTS): Add exclude_libs_test.sh.
13471 (check_DATA): Add exclude_libs_test.syms.
13472 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13473 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13474 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13475 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13476 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13477 libexclude_libs_test_2.a): New rules.
13478 * testsuite/Makefile.in: Regenerate.
13479 * testsuite/exclude_libs_test.c: New file.
13480 * testsuite/exclude_libs_test.sh: Ditto.
13481 * testsuite/exclude_libs_test_1.c: Ditto.
13482 * testsuite/exclude_libs_test_2.c: Ditto.
13483
1b77ea50
ILT
134842009-05-15 Ian Lance Taylor <iant@google.com>
13485
13486 * configure.ac: Check for declarations for cases where libiberty.h
13487 checks HAVE_DECL_xxx.
13488 * configure, config.in: Rebuild.
13489
072fe7ce
ILT
134902009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13491
13492 * gold.h (Incremental_argument_list): Remove (invalid) forward
13493 declaration.
13494 * incremental.cc (Incremental_inputs::report_achive): New method.
13495 (Incremental_inputs::report_object): New method.
13496 (Incremental_inputs::report_script): New method.
13497 (Incremental_inputs::finalize_inputs): New method.
13498 (Incremental_inputs::finalize): Call finalize_inputs().
13499 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13500 Create inputs entries.
13501 * incremental.h (Incremental_input_type): New enum.
13502 (Incremental_inputs::Incremental_input): Initialize new fields.
13503 (Incremental_inputs::report_inputs): New method.
13504 (Incremental_inputs::report_achive): New method.
13505 (Incremental_inputs::report_object): New method.
13506 (Incremental_inputs::report_script): New method.
13507 (Incremental_inputs::finalize_inputs): New method.
13508 (Incremental_inputs::Input_info): New struct.
13509 (Incremental_inputs::Input_info_map): New typedef.
13510 (Incremental_inputs::lock_): New field.
13511 (Incremental_inputs::Inputs_): New field.
13512 (Incremental_inputs::Inputs_map): New field.
13513 * main.cc (main): Call Incremental_input::report_inputs.
13514 * options.h (Input_argument_list): Typedef moved from
13515 Input_arguments.
13516 (Input_file_group::Files): Remove, use ::Input_argument_list.
13517 (Input_file_group::Input_argument_list): Remove, use
13518 ::Input_argument_list.
13519 * plugin.cc (Plugin_manager::add_input_file): Add error in
13520 incremental build.
13521 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13522 functions.
13523 * script.cc (read_input_script): Call
13524 Incremental_input::report_script.
13525 * script.h (Script_info): New class.
13526
b0481b0b
ILT
135272009-04-27 Ian Lance Taylor <iant@google.com>
13528
13529 * x86_64.cc (do_adjust_output_section): Set entsize to
13530 plt_entry_size.
13531
b22a5a41 135322009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13533
13534 * output.cc (Output_file::close): After short writes, continue
13535 writing from the correct offset in the buffer being written.
13536
40fde488
CD
135372009-04-23 Chris Demetriou <cgd@google.com>
13538
13539 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13540 * configure: Regenerate.
13541 * config.in: Regenerate.
13542 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13543 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13544
3ce2c28e
ILT
135452009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13546
13547 * incremental.cc (Incremental_inputs_header_data): Renamed from
13548 Incremental_input_header_data.
13549 (Incremental_inputs_header_data::data_size): New field.
13550 (Incremental_inputs_header_data::put_input_file_count): Renamed
13551 from input_file_count.
13552 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13553 from command_line_offset.
13554 (Incremental_inputs_header_data::put_reserved): Renamed from
13555 put_reserved.
13556 (Incremental_inputs_entry_data): Renamed from
13557 Incremental_input_entry_data.
13558 (Incremental_inputs_entry_data::data_size): New field.
13559 (Incremental_inputs::report_command_line): New method.
13560 (Incremental_inputs::finalize): New method.
13561 (Incremental_inputs::create_incremental_inputs_data): New method.
13562 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13563 * incremental.h: New file.
13564 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13565 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13566 incremental builds.
703d02da 13567 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13568 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13569 (Layout::create_incremental_info_sections): New method.
13570 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13571 * main.cc (main): Notify Incremental_input of the command line.
13572
e55bde5e
ILT
135732009-04-01 Ian Lance Taylor <iant@google.com>
13574 Mikolaj Zalewski <mikolajz@google.com>
13575
13576 * gold.h (reserve_unordered_map): Define, three versions, one for
13577 each version of Unordered_map.
13578 * layout.cc (Layout::Layout): Remove options parameter. Add
13579 number_of_input_files parameter. Don't initialize options_.
13580 Initialize number_of_input_files_ and resized_signatures_. Move
13581 sections_are_attached_.
13582 (Layout::layout_group): Reserve space for group_signatures_.
13583 (Layout::find_or_add_kept_section): Change name parameter to be a
13584 reference. Resize signatures_ map when it gets large enough.
13585 (Layout::layout_eh_frame): Use parameters->options() instead of
13586 this->options_.
13587 (Layout::make_output_section): Likewise.
13588 (Layout::attach_allocated_section_to_segment): Likewise.
13589 (Layout::finalize, Layout::create_executable_stack): Likewise.
13590 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13591 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13592 * layout.h (class Layout): Update declarations. Remove options_
13593 field. Add number_of_input_files_ and resized_signatures_
13594 fields. Move sections_are_attached_ field.
13595 * main.cc (main): Pass number of input files to Layout
13596 constructor. Don't pass options.
13597
154b857c
ILT
135982009-03-30 Ian Lance Taylor <iant@google.com>
13599
13600 * ffsll.c (ffsll): Correct implementation.
13601
2f35ab9b
ILT
136022009-03-27 Ian Lance Taylor <iant@google.com>
13603
fd03461a
ILT
13604 * ffsll.c: New file.
13605 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13606 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13607 * ftruncate.c (ftruncate): Declare before definition.
13608 * mremap.c (mremap): Likewise.
13609 * pread.c (pread): Likewise.
13610 * configure, Makefile.in, config.in: Rebuild.
13611
2f35ab9b
ILT
13612 * mremap.c: New file.
13613 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13614 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13615 (mremap): Declare if HAVE_MREMAP is not defined.
13616 * configure, Makefile.in, config.in: Rebuild.
13617
33aea2fd
CC
136182009-03-27 Cary Coutant <ccoutant@google.com>
13619
13620 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13621 position independent.
13622 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13623 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13624
6d479619
CC
136252009-03-24 Cary Coutant <ccoutant@google.com>
13626
13627 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13628 an executable.
13629 (needs_dynamic_reloc): Likewise.
13630
afc06bb8
ILT
136312009-03-24 Ian Lance Taylor <iant@google.com>
13632
13633 * yyscript.y (file_cmd): Recognize EXTERN.
13634 (extern_name_list, extern_name_list_body): New nonterminals.
13635 * script.cc (script_add_extern): Define.
13636 * script-c.h (script_add_extern): Declare.
13637
f6060a4d
ILT
136382009-03-24 Rafael Avila de Espindola <espindola@google.com>
13639
13640 * object.cc (is_elf_object): Define.
13641 * object.h (is_elf_object): Declare.
13642 * archive.cc (Archive::get_elf_object_for_member): Call
13643 is_elf_object.
33aea2fd 13644 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 13645
26736d8e
ILT
136462009-03-24 Elliott Hughes <enh@google.com>
13647
13648 * output.cc (Output_file::map_anonymous): Define.
13649 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13650 try an anonymous one. Report the size if the mmap fails.
13651 * output.h (class Output_file): Declare map_anonymous.
13652
22fd9730
ILT
136532009-03-24 Ian Lance Taylor <iant@google.com>
13654
13655 * target-select.cc (instantiate_target): Don't acquire the lock if
13656 the instantiated_target_ field has already been set.
13657
cb010894
ILT
136582009-03-23 Ian Lance Taylor <iant@google.com>
13659
7f055c20
ILT
13660 * gold-threads.h (class Initialize_lock): Define.
13661 * gold-threads.cc (class Initialize_lock_once): Define.
13662 (initialize_lock_control): New static variable.
13663 (initialize_lock_pointer): New static variable.
13664 (initialize_lock_once): New static function.
13665 (Initialize_lock::Initialize_lock): Define.
13666 (Initialize_lock::initialize): Define.
13667 * target-select.h: Include "gold-threads.h".
13668 (class Target_selector): Add lock_ and initialize_lock_ fields.
13669 Don't define instantiate_target, just declare it.
13670 * target-select.cc (Target_selector::Target_selector): Initialize
13671 new fields.
13672 (Target_selector::instantiate_target): Define.
13673 * descriptors.h: Include "gold-threads.h".
13674 (class Descriptors): Add initialize_lock_ field.
13675 * descriptors.cc (Descriptors::Descriptors): Initialize new
13676 field.
13677 (Descriptors::open): Use initialize_lock_ field
13678 * errors.h (class Errors): Add initialize_lock_ field.
13679 * errors.cc (Errors::Errors): Initialize new field.
13680 (Errors::initialize_lock): Use initialize_lock_ field.
13681 * powerpc.cc (class Target_selector_powerpc): Remove
13682 instantiated_target_ field. In do_recognize call
13683 instantiate_target rather than do_instantiate_target. In
13684 do_instantiate_target just allocate a new target.
13685 * sparc.cc (class Target_selector_sparc): Likewise.
13686
36959681
ILT
13687 * freebsd.h: New file.
13688 * i386.cc: Include "freebsd.h".
13689 (Target_i386): Derive from Target_freebsd rather than
13690 Sized_target.
13691 (Target_selector_i386): Derive from Target_selector_freebsd rather
13692 than Target_selector.
13693 * x86_64.cc: Include "freebsd.h".
13694 (Target_x86_64): Derive from Target_freebsd rather than
13695 Sized_target.
13696 (Target_selector_x86_64): Derive from Target_selector_freebsd
13697 rather than Target_selector.
13698 * target.h (class Target): Add adjust_elf_header and
13699 do_adjust_elf_header.
13700 * output.cc (Output_file_header:: do_sized_write): Call target
13701 adjust_elf_header routine.
13702 * configure.tgt: Set targ_osabi.
13703 * configure.ac: Define GOLD_DEFAULT_OSABI.
13704 * parameters.cc (Parameters::default_target): Pass
13705 GOLD_DEFAULT_OSABI to select_target.
13706 * target-select.h (class Target_selector): Make instantiate_target
13707 protected rather than private.
13708 * Makefile.am (HFILES): Add freebsd.h.
13709 * configure, Makefile.in, config.in: Rebuild.
13710
cb010894
ILT
13711 * merge.cc (do_add_input_section): Correct pend value. Change
13712 message about last entry not being null terminated from error to
13713 warning.
13714
0e879927
ILT
137152009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13716
13717 * incremental.cc: New file.
13718 * Makefile.am (CCFILES): Add incremental.cc.
13719 * Makefile.in: Rebuild.
13720
41105937
PP
137212009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13722
13723 * layout.cc (Layout::output_section_name): Preserve names
13724 of '.note.' sections.
e1df38aa 13725
60439920
ILT
137262009-03-19 Ian Lance Taylor <iant@google.com>
13727
13728 * descriptors.cc (Descriptors::open): Check that the options are
13729 valid before using them.
13730
0d371ad3
ILT
137312009-03-18 Ian Lance Taylor <iant@google.com>
13732
13733 * script-sections.h: Include <list>.
13734 (class Script_sections): Change Sections_elements from std::vector
13735 to std::list. Typedef public Elements_iterator. Add
13736 orphan_section_placement_, data_segment_align_start_, and
13737 saw_data_segment_align_ fields. Remove data_segment_align_index_
13738 field.
13739 * script-sections.cc (class Orphan_section_placement): New class.
13740 (class Sections_element): Add virtual functions is_relro and
13741 orphan_section_init. Remove virtual function place_orphan_here.
13742 (class Output_section_definition): Add is_relro and
13743 orphan_section_init. Remove place_orphan_here.
13744 (class Orphan_output_section): Likewise.
13745 (Script_sections::Script_sections): Update for field changes.
13746 (Script_sections::data_segment_align): Set saw_data_segment_align_
13747 and data_segment_align_start_, not data_segment_align_index.
13748 (Script_sections::data_segment_relro_end): Check
13749 saw_data_segment_align_. Use data_segment_align_start_ rather
13750 than data_segment_align_index_.
13751 (Script_sections::place_orphan): Rewrite to use
13752 Orphan_section_placement.
13753
9201d894
ILT
137542009-03-17 Ian Lance Taylor <iant@google.com>
13755
9c5b8369
ILT
13756 * archive.cc (Archive::add_symbols): Check for a version attached
13757 to the symbol name in the archive map.
13758 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13759 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13760 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13761 (ver_test_11.a): New target.
13762 * testsuite/Makefile.in: Rebuild.
13763
9201d894
ILT
13764 * configure.ac: Check for chsize and posix_fallocate. Replace
13765 ftruncate.
13766 * ftruncate.c: New file, from gnulib.
13767 * output.cc (posix_fallocate): Define dummy version if not
13768 HAVE_POSIX_FALLOCATE.
13769 (Output_file::map): Call posix_fallocate rather than lseek and
13770 write.
13771 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13772 * configure, Makefile.in, config.in: Rebuild.
13773
ef4ab7a8 137742009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 13775
ef4ab7a8
PP
13776 * layout.h (Layout::create_note): Add section_name parameter.
13777 * layout.cc (Layout::create_note): Likewise.
13778 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 13779
8c500701
ILT
137802009-03-17 Ian Lance Taylor <iant@google.com>
13781
e85b18e1
ILT
13782 * descriptors.cc: Include "options.h".
13783 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13784 (Descriptors::open): Always use O_CLOEXEC when opening a new
13785 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13786 then set FD_CLOEXEC.
13787
9efe6174
ILT
13788 * sparc.cc (class Target_sparc): Add has_got_section.
13789 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13790 make sure we have a GOT section.
13791
13792 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13793 (Target_sparc::Scan::local): Likewise.
13794 (Target_sparc::Scan::global): Likewise.
13795 (Target_sparc::Relocate::relocate): Likewise.
13796 (Target_sparc::Relocate::relocate_tls): Likewise.
13797
8c500701
ILT
13798 * symtab.cc (Symbol_table::define_default_version): New function,
13799 broken out of add_from_object.
13800 (Symbol_table::add_from_object): Call define_default_version.
13801 (Symbol_table::define_special_symbol): Add resolve_oldsym
13802 parameter. Change all callers. If the version for a symbol comes
13803 from a version script, resolve it with the symbol with the same
13804 name with no version. Also add the symbol without a version if
13805 appropriate.
13806 (do_define_in_output_data): If resolving with oldsym, don't delete
13807 sym.
13808 (do_define_in_output_segment): Likewise.
13809 (do_define_as_constant): Likewise.
13810 * symtab.h (class Symbol_table): Update declarations.
13811
f1ed28fb
ILT
138122009-03-13 Ian Lance Taylor <iant@google.com>
13813
15f8229b
ILT
13814 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13815 (Read_symbols::requeue): New function.
13816 (Read_symbols::do_read_symbols): If make_elf_object fails because
13817 the target type is not configured, and the file was searched for,
13818 issue a warning and retry with the next directory.
13819 (Add_symbols::run): If the file has an incompatible format, and
13820 it was searched for, requeue the Read_symbols task. On error,
13821 release the object.
13822 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13823 dirindex parameter to constructor. Change all callers. Declare
13824 incompatible_warning and requeue.
13825 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13826 input_argument_ and input_group_ fields. Add them to
13827 constructor. Change all callers.
13828 (class Read_script): Add dirindex_ field. Add it to constructor.
13829 Change all callers.
13830 * archive.cc (Archive::setup): Remove input_objects parameter.
13831 Change all callers.
13832 (Archive::get_file_and_offset): Likewise.
13833 (Archive::read_all_symbols): Likewise.
13834 (Archive::read_symbols): Likewise.
13835 (Archive::get_elf_object_for_member): Remove input_objects
13836 parameter. Add punconfigured parameter. Change all callers.
13837 (Archive::add_symbols): Change return type to bool. Check return
13838 value of include_member.
13839 (Archive::include_all_members): Likewise.
13840 (Archive::include_member): Change return type to bool. Return
13841 false if first included object has incompatible target. Set
13842 included_member_ field.
13843 (Add_archive_symbols::run): If add_symbols returns false, requeue
13844 Read_symbols task.
13845 * archive.h (class Archive): Add included_member_ field.
13846 Initialize it in constructor. Add input_file and searched_for
13847 methods. Update declarations.
13848 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13849 input_argument_ fields. Add them to constructor. Change all
13850 callers.
13851 * script.cc: Include "target-select.h".
13852 (class Parser_closure): Add skip_on_incompatible_target_ and
13853 found_incompatible_target_ fields. Add
13854 skip_on_incompatible_target parameter to constructor. Change all
13855 callers. Add methods skip_on_incompatible_target,
13856 clear_skip_on_incompatible_target, found_incompatible_target, and
13857 set_found_incompatible_target.
13858 (read_input_script): Add dirindex parameter. Change all callers.
13859 If parser finds an incompatible target, requeue Read_symbols
13860 task.
13861 (script_set_symbol): Clear skip_on_incompatible_target in
13862 closure.
13863 (script_add_assertion, script_parse_option): Likewise.
13864 (script_start_sections, script_add_phdr): Likewise.
13865 (script_check_output_format): New function.
13866 * script.h (read_input_script): Update declaration.
13867 * script-c.h (script_check_output_format): Declare.
13868 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13869 (ignore_cmd): Remove OUTPUT_FORMAT.
13870 * fileread.cc (Input_file::Input_file): Add explicit this.
13871 (Input_file::will_search_for): New function.
13872 (Input_file::open): Add pindex parameter. Change all callers.
13873 * fileread.h (class Input_file): Add input_file_argument method.
13874 Declare will_search_for. Update declarations.
13875 * object.cc (make_elf_object): Add punconfigured parameter.
13876 Change all callers.
13877 * object.h (class Object): Make input_file public. Add
13878 searched_for method.
13879 (make_elf_object): Update declaration.
13880 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13881 restart search.
13882 * dirsearch.h (class Dirsearch): Update declaration.
13883 * options.h (class General_options): Add --warn-search-mismatch.
13884 * parameters.cc (Parameters::is_compatible_target): New function.
13885 * parameters.h (class Parameters): Declare is_compatible_target.
13886 * workqueue.cc (Workqueue::add_blocker): New function.
13887 * workqueue.h (class Workqueue): Declare add_blocker.
13888
f1ed28fb
ILT
13889 * fileread.cc (Input_file::open): Remove options parameter.
13890 Change all callers.
13891 (Input_file::open_binary): Likewise.
13892 * script.cc (read_input_script): Likewise.
13893 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13894 options parameter from constructor. Change all callers.
13895 (class Read_script): Likewise.
13896 * fileread.h (class Input_file): Update declarations.
13897 * script.h (read_input_script): Update declaration.
13898
34dd024a
NC
138992009-03-10 Nick Clifton <nickc@redhat.com>
13900
13901 * po/es.po: New Spanish translation.
13902
6d71b17c
CC
139032009-03-06 Cary Coutant <ccoutant@google.com>
13904
13905 * options.cc (parse_short_option): Keep dash_z from registering itself.
13906
031cdbed
ILT
139072009-03-03 Ian Lance Taylor <iant@google.com>
13908
13909 PR 9918
13910 * target-reloc.h (relocate_section): Pass output_section to
13911 relocate.
13912 * i386.cc (Target_i386::should_apply_static_reloc): Add
13913 output_section parameter. Change all callers.
13914 (Target_i386::Relocate::relocate): Add output_section parameter.
13915 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13916 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13917 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13918 * testsuite/two_file_shared.sh: New script.
13919 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13920 (check_DATA): Add two_file_shared.dbg.
13921 (two_file_shared.dbg): New target.
13922 * testsuite/Makefile.in: Rebuild.
13923
15d5fa16
ILT
139242009-03-01 Ian Lance Taylor <iant@google.com>
13925
13926 * configure.ac: Check for byteswap.h.
13927 * configure: Rebuild.
13928 * config.in: Rebuild.
13929
8a4c0b0d
ILT
139302009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13931
13932 * layout.cc (Layout::find_or_add_kept_section): New function.
13933 (Layout::add_comdat): Removed.
13934 * layout.h (struct Kept_section): Move out of class Layout.
13935 Remove trailing underscores from field names. Add group_sections
13936 field. Rename group_ field to is_group. Change all uses.
13937 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13938 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13939 comdat_groups_ field.
13940 (Sized_relobj::include_section_group): Use
13941 find_or_add_kept_section and Kept_section::group_sections.
13942 (Sized_relobj::include_linkonce_section): Likewise.
13943 * object.cc (class Sized_relobj): Don't define Comdat_group or
13944 Comdat_group_table. Remove find_comdat_group and
13945 add_comdat_group. Remove comdat_groups_ field.
13946 * plugin.cc (include_comdat_group): Use
13947 Layout::find_or_add_kept_section.
13948
b4ecf66b
ILT
139492009-02-28 Ian Lance Taylor <iant@google.com>
13950
14359ca0
ILT
13951 * README: --gc-sections and map files are now supported. Document
13952 some build requirements.
13953
b4ecf66b
ILT
13954 PR 6992
13955 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13956 relocatable link set the value of the section symbol to zero.
13957 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13958 relocatable link don't include the section address in the local
13959 symbol value.
13960
0602e05a
ILT
139612009-02-27 Ian Lance Taylor <iant@google.com>
13962
fd9d194f
ILT
13963 PR 6811
13964 * options.h (class Search_directory): Add is_system_directory.
13965 (class General_options): Declare is_in_system_directory.
13966 * options.cc (get_relative_sysroot): Make static.
13967 (get_default_sysroot): Make static.
13968 (General_optoins::is_in_system_directory): New function.
13969 * fileread.cc (Input_file::is_in_system_directory): New function.
13970 * fileread.h (class Input_file): Declare is_in_system_directory.
13971 * object.h (class Object): Add is_in_system_directory.
13972 (class Input_objects): Remove system_library_directory_ field.
13973 * object.cc (Input_objects::add_object): Don't set
13974 system_library_directory_.
13975 (input_objects::found_in_system_library_directory): Remove.
13976 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13977 parameter. Change all callers.
13978 (Symbol_table::sized_write_globals): Likewise.
13979 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13980 Call Object::is_in_system_directory.
13981 * symtab.h (class Symbol_table): Update declarations.
13982
61edd21f
ILT
13983 PR 5990
13984 * descriptors.h (Open_descriptor): Add is_on_stack field.
13985 * descriptors.cc (Descriptors::open): If the descriptor is on the
13986 top of the stack, remove it. Initialize is_on_stack field.
13987 (Descriptors::release): Only add pod to stack if it is not on the
13988 stack already.
13989 (Descriptors::close_some_descriptor): Clear stack_next and
13990 is_on_stack fields.
13991
e29e076a
ILT
13992 PR 7091
13993 * output.cc (Output_section::find_starting_output_address): Rename
13994 from starting_output_address; add PADDR parameter; change return
13995 type.
13996 * output.h (class Output_section): Declare
13997 find_starting_output_address instead of starting_output_address.
13998 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13999 section symbol for which we can't find a merge section.
14000
0602e05a
ILT
14001 PR 9836
14002 * symtab.cc (Symbol_table::add_from_object): If the visibility is
14003 hidden or internal, force the symbol to be local.
14004 * resolve.cc (Symbol::override_visibility): Define.
14005 (Symbol::override_base): Use override_visibility.
14006 (Symbol_table::resolve): Likewise.
14007 (Symbol::override_base_with_special): Likewise.
14008 (Symbol_table::override_with_special): If the visibility is hidden
14009 or internal, force the symbol to be local.
14010 * symtab.h (class Symbol): Add set_visibility and
14011 override_visibility.
14012 * testsuite/ver_test_1.sh: New file.
14013 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14014 (check_DATA): Add ver_test_1.syms.
14015 (ver_test_1.syms): New target.
14016 * testsuite/Makefile.in: Rebuild.
14017
401a9a73
CC
140182009-02-25 Cary Coutant <ccoutant@google.com>
14019
14020 * layout.cc (Layout::choose_output_section): Don't rename sections
14021 when using a linker script that has a SECTIONS clause.
14022 * Makefile.in: Regenerate.
14023
14024 * testsuite/Makefile.am (script_test_5.sh): New test case.
14025 * testsuite/Makefile.in: Regenerate.
14026 * testsuite/script_test_5.cc: New file.
14027 * testsuite/script_test_5.sh: New file.
14028 * testsuite/script_test_5.t: New file.
14029
f488e4b0
CC
140302009-02-13 Rafael Avila de Espindola <espindola@google.com>
14031
14032 * archive.cc (Archive::include_member): Update calls to add_symbols.
14033 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14034 the Layout argument.
14035 * dynobj.h (do_add_symbols): Add the Layout argument.
14036 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14037 Layout argument.
14038 * object.h (Object::add_symbols): Add the Layout argument.
14039 (Object::do_add_symbols): Add the Layout argument.
14040 (Sized_relobj::do_add_symbols): Add the Layout argument.
14041 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14042 Unify the two versions.
14043 (Add_plugin_symbols): Remove.
14044 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14045 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14046 (Add_plugin_symbols): Remove.
14047 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14048 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14049 (Add_symbols::run): Make it work with Pulginobj.
14050
89dd1680
ILT
140512009-02-06 Ian Lance Taylor <iant@google.com>
14052
14053 * object.cc (Sized_relobj::do_layout): Make info message start
14054 with lower case letter.
14055
266d0a74
ILT
140562009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14057
602b464e
ILT
14058 * binary.cc: Fix file comment.
14059
266d0a74
ILT
14060 * options.h (enum Incremental_disposition): Define.
14061 (class General_options): Add new options: --incremental,
14062 --incremental_changed, --incremental_unchanged,
14063 --incremental_unknown. Add incremental_disposition_ and
14064 implicit_incremental_ fields.
14065 (General_options::incremental_disposition): New function.
14066 (class Position_dependent_options): Add incremental_disposition
14067 option.
14068 (Position_dependent_options::copy_from_options): Set incremental
14069 dispositions.
14070 * options.cc (General_options::parse_incremental_changed): New
14071 function.
2e702c99
RM
14072 (General_options::parse_incremental_unchanged): New function.
14073 (General_options::parse_incremental_unknown): New function.
14074 (General_options::General_options): Initialize new fields
266d0a74 14075 incremental_disposition_ and implicit_incremental_.
2e702c99 14076 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
14077 without --incremental.
14078
f073bbf7
CD
140792009-02-06 Chris Demetriou <cgd@google.com>
14080
14081 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14082 pointer and to report location as the file name associated with
14083 the symbol.
14084 (gold_undefined_symbol_at_location): New function to replace the
14085 old gold_undefined_symbol functionality.
14086 * target-reloc.h (relocate_section): Update to use
14087 gold_undefined_symbol_at_location.
14088 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14089 Call gold_undefined_symbol function rather than gold_error.
14090 * errors.h (Errors::undefined_symbol): Take location as a
14091 string, rather than calculating it from a relocation.
14092 * errors.cc (Errors::fatal): Print "fatal error:" before the
14093 formatted message.
14094 (Errors::error, Errors::error_at_location): Print "error: "
14095 before the formatted message.
14096 (Errors::undefined_symbol): Take location as a string, rather
14097 than calculating it from a relocation.
14098 (gold_undefined_symbol_at_location): New function akin to
14099 old gold_undefined_symbol, calculates location from relocation.
14100 (gold_undefined_symbol): Change to take only a Symbol pointer
14101 and to report location as the file name associated with the symbol.
14102 * testsuite/debug_msg.sh: Update for changed error messages.
14103 * testsuite/undef_symbol.sh: Likewise.
14104
8e94a90c
ILT
141052009-02-04 Duncan Sands <baldrick@free.fr>
14106
14107 PR 9812
14108 * reduced_debug_output.h
14109 (Output_reduced_debug_abbrev_section::failed): Use format for
14110 gold_warning.
14111 (Output_reduced_debug_info_section::faild): Likewise.
14112
88a0e15b
ILT
141132009-01-31 Mikolaj Zalewski <mikolajz@google.com>
14114
14115 * script.cc (Lazy_demangler): New class.
2e702c99 14116 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
14117 symbol only once.
14118
5efc7cd2
CC
141192009-01-29 Cary Coutant <ccoutant@google.com>
14120
14121 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
14122 to __tls_get_addr.
14123 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14124
e0ebcf42
ILT
141252009-01-28 Ian Lance Taylor <iant@google.com>
14126
5efc7cd2 14127 * version.cc (version_string): Bump to 1.9.
75fe7426 14128
e0ebcf42
ILT
14129 * gold.h: Include <cstring> and <stdint.h>.
14130 * version.cc: Include <cstdio>.
14131 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
14132 warning.
14133 * reduced_debug_output.cc (insert_into_vector): Rename from
14134 Insert_into_vector; change all callers. Use Swap_unaligned to
14135 avoid aliasing issue; remove union since it is unnecessary.
14136
8e2813be 141372009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
14138
14139 * Makefile.am (CCFILES): Add gc.cc.
14140 (HFILES): Add gc.h.
14141 * Makefile.in: Regenerate.
14142 * gold.cc (Gc_runner): New class.
14143 (queue_initial_tasks): Call garbage collection related tasks
14144 when corresponding options are invoked.
14145 (queue_middle_gc_tasks): New function.
14146 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14147 processed early before laying out sections during garbage collection.
14148 * gold.h (queue_middle_gc_tasks): New function.
14149 (is_prefix_of): Move from "layout.cc".
14150 * i386.cc (Target_i386::gc_process_relocs): New function.
14151 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14152 * main.cc (main): Create object of class "Garbage_collection".
14153 * object.cc (Relobj::copy_symbols_data): New function.
14154 (Relobj::is_section_name_included): New function.
e1df38aa
NC
14155 (Sized_relobj::do_layout): Allow this function to be called twice
14156 during garbage collection and defer layout of section during the
6d03d481
ST
14157 first call.
14158 * object.h (Relobj::get_symbols_data): New function.
14159 (Relobj::is_section_name_included): New function.
14160 (Relobj::copy_symbols_data): New function.
14161 (Relobj::set_symbols_data): New function.
14162 (Relobj::get_relocs_data): New function.
14163 (Relobj::set_relocs_data): New function.
14164 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14165 (Relobj::gc_process_relocs): New function.
14166 (Relobj::do_gc_process_relocs): New pure virtual function.
14167 (Relobj::sd_): New data member.
14168 (Sized_relobj::is_output_section_offset_invalid): New function.
14169 (Sized_relobj::do_gc_process_relocs): New function.
14170 * options.h (General_options::gc_sections): Modify to not be a no-op.
14171 (General_options::print_gc_sections): New option.
14172 * plugin.cc (Plugin_finish::run): Remove function call to
14173 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14174 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14175 * reloc.cc (Read_relocs::run): Add task to process relocs and
14176 determine unreferenced sections when doing garbage collection.
14177 (Gc_process_relocs): New class.
14178 (Sized_relobj::do_gc_process_relocs): New function.
14179 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14180 sections that are garbage collected.
14181 * reloc.h (Gc_process_relocs): New class.
14182 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14183 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14184 symbols whose corresponding sections are garbage collected.
14185 (Symbol_table::Symbol_table): Add new parameter for the garbage
14186 collection object.
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::resolve): Do not treat symbols seen in dynamic objects
14191 as garbage.
14192 (Symbol_table::add_from_object): Likewise.
14193 (Symbol_table::add_from_relobj): When building shared objects, do not
14194 treat externally visible symbols as garbage.
14195 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14196 table information for static and relocatable links.
14197 * symtab.h (Symbol_table::set_gc): New function.
14198 (Symbol_table::gc): New function.
14199 (Symbol_table::gc_mark_undef_symbols): New function.
14200 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14201 (Symbol_table::gc_mark_dyn_syms): New function.
14202 (Symbol_table::gc_): New data member.
e1df38aa 14203 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
14204 function.
14205 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14206 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14207
3b293544
CF
142082009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14209
14210 * options.h (General_options::gc_sections): Define as a no-op for now.
14211 (General_options::no_keep_memory): Ditto.
14212 (General_options::Bshareable): Define.
14213 * options.cc (General_options::finalize): Honor -Bshareable.
14214
83d22aa8
AS
142152009-01-20 Andreas Schwab <schwab@suse.de>
14216
14217 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14218 read the value in the contents, since we don't use it. Use the
14219 template endianness when writing.
14220 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14221
cd536b21
AS
142222009-01-19 Andreas Schwab <schwab@suse.de>
14223
14224 * configure.tgt (powerpc64-*): Fix targ_obj.
14225
99e9a495
ILT
142262009-01-15 Ian Lance Taylor <iant@google.com>
14227
14228 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14229 local symbols when stripping all symbols.
14230
bbbfea06
CC
142312009-01-14 Cary Coutant <ccoutant@google.com>
14232
99e9a495 14233 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 14234
0f7c0701
CC
142352009-01-14 Cary Coutant <ccoutant@google.com>
14236
14237 * archive.cc (Archive::get_elf_object_for_member): Remove call
14238 to File_read::claim_for_plugin.
14239 * descriptors.cc (Descriptors::open): Remove reference to
14240 is_claimed.
14241 (Descriptors::claim_for_plugin): Remove.
14242 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14243 (Descriptors::is_claimed): Remove.
14244 (claim_descriptor_for_plugin): Remove.
14245 * fileread.cc (File_read::claim_for_plugin): Remove.
14246 * fileread.h (File_read::claim_for_plugin): Remove.
14247 (File_read::descriptor): Reopen descriptor if necessary.
14248 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14249 (Plugin_manager::all_symbols_read): Add task parameter. Change
14250 all callers.
14251 (Plugin_manager::get_input_file): New function.
14252 (Plugin_manager::release_input_file): New function.
14253 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14254 corresponding data member.
14255 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14256 and pass to base constructor. Change all callers.
14257 (get_input_file, release_input_file): New functions.
14258 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14259 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14260 (Plugin_manager::all_symbols_read): Add task parameter.
14261 (Plugin_manager::get_input_file): New function.
14262 (Plugin_manager::release_input_file): New function.
14263 (Plugin_manager::task_): New data member.
14264 (Pluginobj::Pluginobj): Add filesize parameter.
14265 (Pluginobj::filename): New function.
14266 (Pluginobj::descriptor): New function.
14267 (Pluginobj::filesize): New function.
14268 (Pluginobj::filesize_): New data member.
14269 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14270 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14271 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14272
14273 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14274 with archive libraries.
14275 * testsuite/Makefile.in: Regenerate.
14276 * testsuite/plugin_test.c (struct sym_info): New type.
14277 (get_input_file, release_input_file): New static variables.
14278 (onload): Capture new transfer vector entries.
14279 (claim_file_hook): Stop reading at end of file according to filesize.
14280 Factor out parsing of readelf output into separate function.
14281 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14282 APIs and get the source file name from the symbol table. Convert
14283 source file name to corresponding object file name. Print info
14284 message when adding new input files.
14285 (parse_readelf_line): New function.
14286 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14287 * testsuite/plugin_test_2.sh: Likewise.
14288 * testsuite/plugin_test_3.sh: Likewise.
14289 * testsuite/plugin_test_4.sh: New test case.
14290
62a6d109
ILT
142912009-01-07 Ian Lance Taylor <iant@google.com>
14292
14293 * version.cc (version_string): Bump to 1.8.
14294
483620e8
CC
142952008-12-23 Cary Coutant <ccoutant@google.com>
14296
14297 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14298 * plugin.cc (Plugin_manager::finish): Rename as
14299 layout_deferred_objects. Move cleanup to separate function.
14300 (Plugin_manager::cleanup): New function.
14301 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14302 separately.
14303 * plugin.h (Plugin_manager::finish): Rename as
14304 layout_deferred_objects.
14305 (Plugin_manager::cleanup): New function.
14306 (Plugin_manager::cleanup_done): New field.
14307
d66a9eb3
CC
143082008-12-23 Cary Coutant <ccoutant@google.com>
14309
14310 * plugin.cc (is_visible_from_outside): New function.
14311 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14312 so we don't return "IR only" status for exported symbols or -r links.
14313
14314 * testsuite/Makefile.am (plugin_test_3): New test case.
14315 * testsuite/Makefile.in: Regenerate.
14316 * testsuite/plugin_test_3.sh: New file.
14317
5995b570
CC
143182008-12-22 Cary Coutant <ccoutant@google.com>
14319
14320 * object.cc (Sized_relobj::layout_section): New function.
14321 (Sized_relobj::do_layout): Defer layout of input sections until after
14322 plugin has provided replacement files.
14323 (Sized_relobj::do_layout_deferred_sections): New function.
14324 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14325 (Relobj::layout_deferred_sections): New function.
14326 (Relobj::do_layout_deferred_sections): New function.
14327 (Sized_relobj::do_layout_deferred_sections): New function.
14328 (Sized_relobj::layout_section): New function.
14329 (Sized_relobj::Deferred_layout): New structure.
14330 (Sized_relobj::deferred_layout_): New field.
14331 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14332 Change all callers. Layout deferred sections.
14333 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14334 references.
14335 (Plugin_hook::run): Move code from do_plugin_hook inline.
14336 (Plugin_hook::do_plugin_hook): Remove.
14337 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14338 (Plugin_manager::finish): Renamed, was cleanup.
14339 (Plugin_manager::should_defer_layout): New function.
14340 (Plugin_manager::add_deferred_layout_object): New function.
14341 (Plugin_manager::Deferred_layout_list): New type.
14342 (Plugin_manager::deferred_layout_objects_): New field.
14343 (Plugin_hook::do_plugin_hook): Remove.
14344
ee769c88
ILT
143452008-12-17 Ian Lance Taylor <iant@google.com>
14346
14347 * options.h (class General_options): Add --no case for
14348 --export-dynamic.
14349
abc8dcba
CC
143502008-12-16 Cary Coutant <ccoutant@google.com>
14351
14352 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14353 vector.
14354 (Plugin_manager::claim_file): Create plugin object even if
14355 plugin did not call the add_symbols callback.
14356 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14357 asking for more symbols than were added.
14358 * testsuite/Makefile.am (plugin_test_1): Add test case with
14359 no global symbols.
14360 (empty.syms): New target.
14361 * testsuite/Makefile.in: Regenerate.
14362 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14363 message. Don't call add_symbols if no globals.
14364 (all_symbols_read_hook): Don't provide replacement for empty
14365 claimed file.
14366
b0074644
ILT
143672008-12-12 Ian Lance Taylor <iant@google.com>
14368
68943102
ILT
14369 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14370 r_type == 0 for a local symbol with r_sym == 0.
14371 (scan_relocatable_relocs): Pass r_sym to
14372 local_non_section_strategy.
14373 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14374 r_sym parameter.
14375
b0074644
ILT
14376 * configure.ac: Update test for TLS descriptors: they are
14377 supported as of glibc 2.9.
14378 * configure: Rebuild.
14379
c2508178
ILT
143802008-12-11 Ian Lance Taylor <iant@google.com>
14381
14382 PR 7091
14383 * target-reloc.h (Default_scan_relocatable_relocs): For each
14384 function, map r_type == 0 to RELOC_DISCARD.
14385
2756a258
CC
143862008-12-10 Cary Coutant <ccoutant@google.com>
14387
14388 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14389 object to override a kept COMDAT group from a plugin object.
14390
bb6f53d3
ILT
143912008-12-09 Ian Lance Taylor <iant@google.com>
14392
fbc558e1
ILT
14393 PR 7088
14394 * yyscript.y (file_cmd): Handle INPUT.
14395
bb6f53d3
ILT
14396 * testsuite/initpri1.c: Change all declarations to be full
14397 prototypes by adding void, to avoid compiler warnings.
14398
4674ecfc
CC
143992008-12-05 Rafael Avila de Espindola <espindola@google.com>
14400
14401 * options.cc (General_options::parse_plugin_opt): New.
14402 (General_options::add_plugin): The argument now is just the filename.
14403 (General_options::add_plugin_option): New.
14404 * options.h (plugin_opt): New.
14405 (add_plugin): Change argument name.
14406 (add_plugin_option): New.
14407 * plugin.cc (Plugin::load): Don't parse the plugin option.
14408 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14409 (Plugin::add_option): New.
14410 (Plugin::args_): Change type.
14411 (Plugin::filename_): New.
14412 (Plugin_manager::add_plugin_option): New.
14413 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14414 * testsuite/Makefile.in: Regenerate.
14415
fd06b4aa
CC
144162008-12-05 Cary Coutant <ccoutant@google.com>
14417
14418 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14419 Handle --strip-lto-sections option.
14420 * options.h (strip_lto_sections): New option.
14421
6c52134c
CC
144222008-12-01 Cary Coutant <ccoutant@google.com>
14423
14424 * plugin.cc (ld_plugin_message): Change format parameter to const.
14425 Fix mismatch between new[] and delete.
14426
a45248e0
CC
144272008-11-14 Cary Coutant <ccoutant@google.com>
14428
14429 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14430 instead of -1U.
14431
c82fbeee
CS
144322008-11-05 Craig Silverstein <csilvers@google.com>
14433
14434 * options.cc (General_options::parse_dynamic_list): New function.
14435 * options.h (General_options): New flags dynamic_list,
14436 dynamic_list_data, dynamic_list_cpp_new, and
14437 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14438 (General_options::in_dynamic_list): New function.
14439 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14440 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14441 (Lex::can_continue_name): Likewise.
14442 (yylex): Likewise.
14443 (read_script_file): New parameter script_options.
14444 (read_dynamic_list): New function.
14445 (Script_options::define_dynamic_list): New function.
14446 (dynamic_list_keyword_parsecodes): New variable.
14447 (dynamic_list_keywords): New variable.
14448 * script.h (Script_options::define_dynamic_list): New function
14449 prototype.
14450 (read_dynamic_list): New function prototype.
14451 * symtab.cc (strprefix): New macro.
14452 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14453 dynamic_list_data, dynamic_list_cpp_new, and
14454 dynamic_list_cpp_typeinfo.
14455 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14456 (dynamic_list_expr): New rule.
14457 (dynamic_list_nodes): Likewise.
14458 (dynamic_list_node): Likewise.
14459 * testsuite/Makefile.am (dynamic_list): New test.
14460 * testsuite/Makefile.in: Regenerated.
14461 * testsuite/dynamic_list.t: New file.
14462 * testsuite/dynamic_list.sh: New file.
14463
e0bb29a5
CS
144642008-11-05 Craig Silverstein <csilvers@google.com>
14465
14466 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14467 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14468 (t11_last): Likewise.
14469 * testsuite/ver_test_6.c (main): Likewise.
14470
4e1e25e0
CC
144712008-10-07 Cary Coutant <ccoutant@google.com>
14472
14473 * options.c (General_options::finalize): Add check for -static and
14474 -shared.
14475 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14476 is not empty.
14477
92f03fcb
CC
144782008-10-02 Cary Coutant <ccoutant@google.com>
14479
14480 * plugin.cc (make_sized_plugin_object): Fix conditional
14481 compilation to work when not all targets are enabled.
14482
fbd8a257
CC
144832008-09-29 Cary Coutant <ccoutant@google.com>
14484
14485 * archive.cc (Archive::get_file_and_offset): Use filename instead
14486 of name to get library path.
14487 (Archive::include_member): Unlock external member of a thin archive.
14488
14489 * testsuite/Makefile.am (TEST_AR): New variable.
14490 (thin_archive_test_1): New test.
14491 (thin_archive_test_2): New test.
81636b3f
CC
14492 * testsuite/Makefile.in: Regenerate.
14493 * testsuite/thin_archive_main.cc: New file.
14494 * testsuite/thin_archive_test_1.cc: New file.
14495 * testsuite/thin_archive_test_2.cc: New file.
14496 * testsuite/thin_archive_test_3.cc: New file.
14497 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14498
eff45813
CC
144992008-09-29 Cary Coutant <ccoutant@google.com>
14500
14501 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14502 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14503 instead of -1U.
14504 (Sized_relobj::do_finalize_local_symbols): Likewise.
14505 (Sized_relobj::map_to_kept_section): Likewise.
14506 * object.h (Sized_relobj::invalid_address): New constant.
14507 (Sized_relobj::do_output_section_offset): Check for invalid_address
14508 and return -1ULL.
14509 * output.cc (Output_reloc::local_section_offset): Use constant
14510 invalid_address instead of -1U.
14511 (Output_reloc::get_address): Likewise.
14512 (Output_section::output_address): Change -1U to -1ULL.
14513 * output.h (Output_reloc::invalid_address): New constant.
14514 * reloc.cc (Sized_relobj::write_sections): Use constant
14515 invalid_address instead of -1U.
14516 (Sized_relobj::relocate_sections): Likewise.
14517 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14518 values for merge sections.
14519 * target-reloc.h (relocate_for_relocatable): Use constant
14520 invalid_address instead of -1U.
14521
89fc3421
CC
145222008-09-19 Cary Coutant <ccoutant@google.com>
14523
14524 Add plugin functionality for link-time optimization (LTO).
14525 * configure.ac (plugins): Add --enable-plugins option.
14526 * configure: Regenerate.
14527 * config.in: Regenerate.
14528 * Makefile.am (LIBDL): New variable.
14529 (CCFILES): Add plugin.cc.
14530 (HFILES): Add plugin.h.
14531 (ldadd_var): Add LIBDL.
14532 * Makefile.in: Regenerate.
14533
14534 * archive.cc: Include "plugin.h".
14535 (Archive::setup): Don't preread archive symbols when using a plugin.
14536 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14537 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14538 files.
14539 (Archive::include_member): Add symbols from plugin objects.
14540 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14541 * descriptors.cc (Descriptors::open): Check for file descriptors
14542 abandoned by plugins.
14543 (Descriptors::claim_for_plugin): New function.
14544 * descriptors.h (Descriptors::claim_for_plugin): New function.
14545 (Open_descriptor::is_claimed): New field.
14546 (claim_descriptor_for_plugin): New function.
14547 * fileread.cc (File_read::claim_for_plugin): New function.
14548 * fileread.h (File_read::claim_for_plugin): New function.
14549 (File_read::descriptor): New function.
14550 * gold.cc: Include "plugin.h".
14551 (queue_initial_tasks): Add task to call plugin hooks for generating
14552 new object files.
14553 * main.cc: Include "plugin.h".
14554 (main): Load plugin libraries.
14555 * object.h (Pluginobj): Declare.
14556 (Object::pluginobj): New function.
14557 (Object::do_pluginobj): New function.
14558 (Object::set_target): New function.
14559 * options.cc: Include "plugin.h".
14560 (General_options::parse_plugin): New function.
14561 (General_options::General_options): Initialize plugins_ field.
14562 (General_options::add_plugin): New function.
14563 * options.h (Plugin_manager): Declare.
14564 (General_options): Add --plugin option.
14565 (General_options::has_plugins): New function.
14566 (General_options::plugins): New function.
14567 (General_options::add_plugin): New function.
14568 (General_options::plugins_): New field.
14569 * plugin.cc: New file.
14570 * plugin.h: New file.
14571 * readsyms.cc: Include "plugin.h".
14572 (Read_symbols::do_read_symbols): Check for archive before checking
14573 for ELF file. Call plugin hooks to claim files.
14574 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14575 from a real object file; force override when processing replacement
14576 files.
14577 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14578 (Symbol::init_base_object): Likewise.
14579 (Symbol::init_base_output_data): Likewise.
14580 (Symbol::init_base_output_segment): Likewise.
14581 (Symbol::init_base_constant): Likewise.
14582 (Symbol::init_base_undefined): Likewise.
14583 (Symbol::output_section): Assert that object is not a plugin.
14584 (Symbol_table::add_from_pluginobj): New function.
14585 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14586 undefined.
14587 (Symbol_table::sized_write_globals): Likewise.
14588 (Symbol_table::add_from_pluginobj): Instantiate template.
14589 * symtab.h (Sized_pluginobj): Declare.
14590 (Symbol::in_real_elf): New function.
14591 (Symbol::set_in_real_elf): New function.
14592 (Symbol::in_real_elf_): New field.
14593 (Symbol_table::add_from_pluginobj): New function.
14594
14595 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14596 (LIBDL): New variable.
14597 (LDADD): Add LIBDL.
14598 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14599 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14600 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14601 (MOSTLYCLEANFILES): Likewise.
14602 * testsuite/Makefile.in: Regenerate.
14603 * testsuite/plugin_test.c: New file.
14604 * testsuite/plugin_test_1.sh: New file.
14605 * testsuite/plugin_test_2.sh: New file.
14606
de31bda5
ILT
146072008-09-16 Ian Lance Taylor <iant@google.com>
14608
9c2d0ef9
ILT
14609 * target-reloc.h (relocate_section): Check whether a symbol is
14610 defined by the ABI before reporting an undefined symbol error.
14611 * target.h (Target::is_defined_by_abi): Make parameter const.
14612 (Target::do_is_defined_by_abi): Likewise.
14613 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14614 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14615 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14616 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14617 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14618 * testsuite/Makefile.in: Rebuild.
14619
de31bda5
ILT
14620 * fileread.cc (make_view): Add casts to avoid warning.
14621
9fa33bee
AO
146222008-09-16 Alexandre Oliva <aoliva@redhat.com>
14623
14624 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14625 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14626
183fd0e3
AO
146272008-09-16 Alexandre Oliva <aoliva@redhat.com>
14628
14629 * options.h (General_options::output_is_executable): New.
14630 (General_options::output_is_pie): New.
14631 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14632 for shared libraries.
14633 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14634
7be8330a
CD
146352008-09-11 Chris Demetriou <cgd@google.com>
14636
14637 * options.h (origin): New -z option.
14638 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14639 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14640 in DT_FLAGS_1.
14641
a9caad02
CC
146422008-09-05 Cary Coutant <ccoutant@google.com>
14643
14644 * fileread.cc (File_read::make_view): Add check for attempt to map
14645 beyond end of file.
14646
ae6dce4d
CC
146472008-09-05 Cary Coutant <ccoutant@google.com>
14648
14649 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14650 explicit instantiations.
14651
d7ab2a47
KVH
146522008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14653
14654 PR gold/6858
14655 * options.cc (General_options::finalize): Allow undefined symbols
14656 in shlibs if linking -shared.
14657
14658 PR gold/6859
14659 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14660 symbols as not needing a dynsym entry.
14661
1e52a9c1
CS
146622008-08-20 Craig Silverstein <csilvers@google.com>
14663
14664 * fileread.cc (File_read::open): Do not lock the file unless it
14665 was successfully opened.
14666
d85c80a3
CC
146672008-08-14 Cary Coutant <ccoutant@google.com>
14668
14669 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14670 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14671 * testsuite/tls_test.cc (struct int128): 128-bit struct
14672 for testing TLS relocs with non-zero addend.
14673 (v12): New TLS variable.
14674 (t12): New test.
14675 (t_last): Add check for v12.
14676 * testsuite/tls_test.h (t12): New function.
14677 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14678
2d924fd9
ILT
146792008-08-13 Ian Lance Taylor <iant@google.com>
14680
14681 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14682 set tls_segment_ or relro_segment_.
14683 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14684 when appropriate.
14685 * output.h (Output_section::clear_is_relro): New function.
14686 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14687 sections specially even when output_data_ is empty.
14688 (Output_segment::maximum_alignment): When first section is relro,
14689 only force alignment for PT_LOAD segments.
14690 * script.cc (script_data_segment_align): New function.
14691 (script_data_segment_relro_end): New function.
14692 * script-c.h (script_data_segment_align): Declare.
14693 (script_data_segment_relro_end): Declare.
14694 * script-sections.h (class Script_sections): Declare
14695 data_segment_align and data_segment_relro_end. Add fields
14696 segment_align_index_ and saw_relro_end_.
14697 * script-sections.cc (class Sections_element): Add set_is_relro
14698 virtual function. Add new bool* parameter to place_orphan_here.
14699 Add get_output_section virtual function.
14700 (class Output_section_definition): Add set_is_relro. Add new
14701 bool* parameter to place_orphan_here. Add get_output_section.
14702 Add is_relro_ field.
14703 (Output_section_definition::Output_section_definition): Initialize
14704 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14705 and is_relro_ fields.
14706 (Output_section_definition::place_orphan_here): Add is_relro
14707 parameter.
14708 (Output_section_definition::set_section_addresses): Set relro for
14709 output section.
14710 (Output_section_definition::alternate_constraint): Likewise.
14711 (class Orphan_output_section): Add new bool* parameter to
14712 place_orphan_here. Add get_output_section.
14713 (Orphan_output_section::place_orphan_here): Add is_relro
14714 parameter.
14715 (Script_sections::Script_sections): Initialize
14716 data_segment_align_index_ and saw_relro_end_.
14717 (Script_sections::data_segment_align): New function.
14718 (Script_sections::data_segment_relro_end): New function.
14719 (Script_sections::place_orphan): Set or clear is_relro.
14720 (Script_sections::set_section_addresses): Force alignment of first
14721 TLS section.
14722 * yyscript.y (exp): Call script_data_segment_align and
14723 script_data_segment_relro_end.
14724 * testsuite/relro_script_test.t: New file.
14725 * testsuite/relro_test.cc (using_script): Declare.
14726 (t1, t2): Test using_script.
14727 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14728 (relro_script_test_SOURCES): Define.
14729 (relro_script_test_DEPENDENCIES): Define.
14730 (relro_script_test_LDFLAGS): Define.
14731 (relro_script_test_LDADD): Define.
14732 (relro_script_test.so): New target.
14733 * testsuite/Makefile.in: Rebuild.
14734
f827c9a9
CC
147352008-08-06 Cary Coutant <ccoutant@google.com>
14736
14737 * archive.cc (Archive::total_archives, Archive::total_members)
14738 (Archive::total_members_loaded): New variables.
14739 (Archive::setup): Add parameter. Add option to preread
14740 archive symbols.
14741 (Archive::read_armap): Add counter.
14742 (Archive::get_file_and_offset): New function.
14743 (Archive::get_elf_object_for_member): New function.
14744 (Archive::read_all_symbols): New function.
14745 (Archive::read_symbols): New function.
14746 (Archive::add_symbols): Add counters.
14747 (Archive::include_all_members): Use armap to find members if it's
14748 already built.
14749 (Archive::include_member): Skip reading symbols if already read.
14750 Factored code into Archive::get_file_and_offset and
14751 Archive::get_elf_object_for_member. Changed call to
14752 Mapfile::report_include_archive_member.
14753 (Archive::print_stats): New function.
14754 * archive.h: Declare Object and Read_symbols_data classes.
14755 (Archive::Archive): Add initializers for new members.
14756 (Archive::setup): Add parameter.
14757 (Archive::print_stats): New function.
14758 (Archive::total_archives, Archive::total_members)
14759 (Archive::total_members_loaded): New variables.
14760 (Archive::get_file_and_offset): New function.
14761 (Archive::get_elf_object_for_member): New function.
14762 (Archive::read_all_symbols): New function.
14763 (Archive::read_symbols): New function.
14764 (Archive::Archive_member): New class.
14765 (Archive::members_): New member.
14766 (Archive::num_members_): New member.
14767 * main.cc: Include archive.h.
14768 (main): Call Archive::print_stats.
14769 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14770 archive parameter; member_name is now the fully-decorated name.
14771 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14772 * options.h: (General_options): Add --preread-archive-symbols option.
14773 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14774 Archive::setup.
14775
de4c45bd
ILT
147762008-08-04 Ian Lance Taylor <iant@google.com>
14777
14778 * symtab.h (Symbol::use_plt_offset): New function.
14779 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14780 * powerpc.cc (Relocate::relocate): Likewise.
14781 * sparc.cc (Relocate::relocate): Likewise.
14782 * x86_64.cc (Relocate::relocate): Likewise.
14783 * testsuite/weak_plt.sh: New test.
14784 * testsuite/weak_plt_main.cc: New test.
14785 * testsuite/weak_plt_shared.cc: New test.
14786 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14787 (check_PROGRAMS): Add weak_plt.
14788 (check_DATA): Add weak_plt_shared.so.
14789 (weak_plt_main_pic.o, weak_plt): New targets.
14790 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14791 * testsuite/Makefile.in: Rebuild.
14792
14793 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14794 gcctestdir/ld.
14795 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14796 * testsuite/Makefile.in: Rebuild.
14797
323ee3f4
AM
147982008-08-04 Alan Modra <amodra@bigpond.net.au>
14799
14800 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14801 * Makefile.in: Regenerate.
14802 * po/POTFILES.in: Regenerate.
14803
7c07ecec
ILT
148042008-07-29 Ian Lance Taylor <iant@google.com>
14805
14806 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14807 symbols before other symbols.
14808 * testsuite/script_test_2.cc (test_addr): Declare.
14809 (test_addr_alias): Declare.
14810 (main): Check that test_addr and test_addr_alias have the right
cd536b21 14811 values.
7c07ecec
ILT
14812 * testsuite/script_test_2.t: Define test_addr_alias and
14813 test_addr.
14814
5778530e
ILT
148152008-07-24 Ian Lance Taylor <iant@google.com>
14816
2a00e4fb
ILT
14817 PR 5990
14818 * descriptors.cc: New file.
14819 * descriptors.h: New file.
14820 * gold-threads.h (class Hold_optional_lock): New class.
14821 * fileread.cc: Include "descriptors.h".
14822 (File_read::~File_read): Release descriptor rather than closing
14823 it.
14824 (File_read::open) [file]: Call open_descriptor rather than open.
14825 Set is_descriptor_opened_.
14826 (File_read::open) [memory]: Assert that descriptor is not open.
14827 (File_read::reopen_descriptor): New function.
14828 (File_read::release): Release descriptor.
14829 (File_read::do_read): Make non-const. Reopen descriptor.
14830 (File_read::read): Make non-const.
14831 (File_read::make_view): Reopen descriptor.
14832 (File_read::do_readv): Likewise.
14833 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14834 Update declarations.
14835 * layout.cc: Include "descriptors.h".
14836 (Layout::create_build_id): Use open_descriptor rather than open.
14837 * output.cc: Include "descriptors.h".
14838 (Output_file::open): Use open_descriptor rather than open.
14839 * archive.cc (Archive::const_iterator): Change Archive to be
14840 non-const.
14841 (Archive::begin, Archive::end): Make non-const.
14842 (Archive::count_members): Likewise.
14843 * archive.h (class Archive): Update declarations.
14844 * object.h (Object::read): Make non-const.
14845 * Makefile.am (CCFILES): Add descriptors.cc.
14846 (HFILES): Add descriptors.h.
14847 * Makefile.in: Rebuild.
14848
801647d1
ILT
14849 PR 6716
14850 * gold.h: Always include <clocale>. Add Solaris workarounds
14851 following code in binutils/sysdep.h.
14852
5edd166e
ILT
14853 PR 6048
14854 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14855 this->eh_frame_hdr_ is NULL before using it.
14856
c89ad728
ILT
14857 * dynobj.cc (Versions::Versions): Update comment.
14858
aa86f06b
ILT
14859 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14860 the base version name.
14861
5778530e
ILT
14862 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14863 array size plus one.
14864 (Stringpool_template::set_string_offsets): Subtract one from key
14865 before using it as an array index.
14866 (Stringpool_template::get_offset_with_length): Likewise.
14867 (Stringpool_template::write_to_buffer): Likewise.
14868 * stringpool.h (Stringpool_template::get_offset_from_key):
14869 Likewise.
14870
057ead22
ILT
148712008-07-23 Ian Lance Taylor <iant@google.com>
14872
7f649c59
ILT
14873 PR 6658
14874 * object.h (Merged_symbol_value::value): Do our best to handle a
14875 negative addend.
14876
057ead22
ILT
14877 PR 6647
14878 * script.cc (Version_script_info::get_versions): Don't add empty
14879 version tag to return value.
14880 (Version_script_info::get_symbol_version_helper): Change return
14881 type to bool. Add pversion parameter. Change all callers.
14882 (script_register_vers_node): Don't require a non-NULL tag.
14883 * script.h (class Version_script_info): Update declarations.
14884 (Version_script_info::get_symbol_version): Change return type to
14885 bool. Add version parameter. Change all callers.
14886 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14887 handling. Handle an empty version from a version script.
14888 (Symbol_table::define_special_symbol): Likewise.
14889 * testsuite/ver_test_10.script: New file.
14890 * testsuite/ver_test_10.sh: New file.
14891 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14892 (check_DATA): Add ver_test_10.syms.
14893 (ver_test_10.syms, ver_test_10.so): New target.
14894 * testsuite/Makefile.in: Rebuild.
14895
58e54ac2
CD
148962008-07-23 Simon Baldwin <simonb@google.com>
14897
14898 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14899 to zero for undefined symbols from dynamic libraries.
14900
95d14cd3
ILT
149012008-07-23 Ian Lance Taylor <iant@google.com>
14902
14903 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14904 Change all callers.
14905 * symtab.h (class Symbol_table): Update declaration.
14906 * testsuite/ver_test_9.cc: New file.
14907 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14908 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14909 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14910 (ver_test_9.so, ver_test_9.o): New targets.
14911 * testsuite/Makefile.in: Rebuild.
14912
92de84a6
ILT
149132008-07-22 Ian Lance Taylor <iant@google.com>
14914
34810851
ILT
14915 * options.h (class General_options): Define --check-sections.
14916 * layout.cc (Layout::set_segment_offsets): Handle
14917 --check-sections.
14918
af6156ef
ILT
14919 * options.h (class General_options): Define -n/--nmagic and
14920 -N/--omagic.
14921 * options.cc (General_options::finalize): For -n/--nmagic or
14922 -N/--omagic, set -static.
14923 * layout.cc (Layout::attach_allocated_section_to_segment): If
14924 -N/--omagic, don't put read-only and read-write sections in
14925 different segments.
14926 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14927 finding a read-only segment.
14928 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14929 don't set the minimum segment alignment to the common page size,
14930 and don't set the file offset to the address modulo the page size.
14931 * script-sections.cc (Script_sections::create_segments): If
14932 -n/--omagic, don't put read-only and read-write sections in
14933 different segments.
14934
92de84a6
ILT
14935 * cref.cc: New file.
14936 * cref.h: New file.
14937 * options.h (class General_options): Add --print-symbol-counts.
14938 * main.cc (main): Issue defined symbol report if requested.
14939 * archive.cc (Archive::interpret_header): Make into a const member
14940 function.
14941 (Archive::add_symbols): Call Input_objects::archive_start and
14942 archive_stop.
14943 (Archive::const_iterator): Define new class.
14944 (Archive::begin, Archive::end): New functions.
14945 (Archive::include_all_members): Rewrite to use iterator.
14946 (Archive::count_members): New function.
14947 * archive.h (class Archive): Update declarations.
14948 (Archive::filename): New function.
14949 * object.cc: Include "cref.h".
14950 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14951 (Sized_relobj::do_get_global_symbol_counts): New function.
14952 (Input_objects::add_object): Add object to cross-referencer.
14953 (Input_objects::archive_start): New function.
14954 (Input_objects::archive_stop): New function.
14955 (Input_objects::print_symbol_counts): New function.
14956 * object.h: Declare Cref and Archive.
14957 (Object::get_global_symbol_counts): New function.
14958 (Object::do_get_global_symbol_counts): New pure virtual function.
14959 (class Sized_relobj): Add defined_count_ field. Update
14960 declarations.
14961 (class Input_objects): Add cref_ field. Update constructor.
14962 Update declarations.
14963 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14964 defined_count_.
14965 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14966 symbol counts.
14967 (Sized_dynobj::do_get_global_symbol_counts): New function.
14968 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14969 defined_count_. Update declarations. Define Symbols typedef.
14970 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14971 parameter. Change all callers.
14972 (Symbol_table::add_from_dynobj): Add sympointers and defined
14973 parameters. Change all callers.
14974 * symtab.h (class Symbol_table): Update declarations.
14975 * Makefile.am (CCFILES): Add cref.cc.
14976 (HFILES): Add cref.h.
14977 * Makefile.in: Rebuild.
14978
3f7c5e1d
CD
149792008-07-22 Simon Baldwin <simonb@google.com>
14980
14981 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14982 to zero when writing undefined symbols.
14983
e0b64032
ILT
149842008-07-22 Ian Lance Taylor <iant@google.com>
14985
14986 * output.cc (Output_section::add_input_section): Don't try to
14987 merge empty merge sections.
14988
096b02cf
CS
149892008-07-21 Craig Silverstein <csilvers@google.com>
14990
14991 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14992 Include symbol version in error message.
cd536b21 14993
1d1f116d
CD
149942008-07-20 Chris Demetriou <cgd@google.com>
14995
cd536b21 14996 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
14997 (RANDOM_SEED_CFLAGS): New substituted variable.
14998 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14999 * configure: Rebuild.
15000 * Makefile.in: Likewise.
15001 * testsuite/Makefile.in: Likewise.
15002
a18f591e
ILT
150032008-07-18 Ian Lance Taylor <iant@google.com>
15004
15005 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
15006 where we see NAME/NULL and NAME/VERSION as separate symbols.
15007 * testsuite/ver_test_main.cc (main): Call t4.
15008 (t4, t4_2a): Define.
15009 * testsuite/ver_test_2.cc (t4_2): Define.
15010 * testsuite/ver_test_2.script: Put t4_2a in VER2.
15011 * testsuite/ver_test_4.cc (t4_2a): Define.
15012 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15013 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15014
c6e3f6ed
ILT
150152008-07-17 Ian Lance Taylor <iant@google.com>
15016
15017 * dynobj.cc (Versions::add_def): If we give an error about a
15018 missing version, go ahead and create the version anyhow.
15019
ef9beddf
ILT
150202008-07-10 Ian Lance Taylor <iant@google.com>
15021
15022 Handle output sections with more than 0x7fffffff bytes.
15023 * object.h (class Relobj): Change map_to_output_ to
15024 output_sections_, and just keep a section pointer. Change all
15025 uses. Move comdat group support to Sized_relobj.
15026 (Relobj::is_section_specially_mapped): Remove.
15027 (Relobj::output_section): Remove poff parameter. Change all
15028 callers.
15029 (Relobj::output_section_offset): New function.
15030 (Relobj::set_section_offset): Rewrite.
15031 (Relobj::map_to_output): Remove.
15032 (Relobj::output_sections): New function.
15033 (Relobj::do_output_section_offset): New pure virtual function.
15034 (Relobj::do_set_section_offset): Likewise.
15035 (class Sized_relobj): Add section_offsets_ field. Add comdat
15036 group support from Relobj. Update declarations.
15037 (Sized_relobj::get_output_section_offset): New function.
15038 (Sized_relobj::do_output_section_offset): New function.
15039 (Sized_relobj::do_set_section_offset): New function.
15040 * object.cc (Relobj::output_section_address): Remove.
15041 (Sized_relobj::Sized_relobj): Initialize new fields.
15042 (Sized_relobj::include_section_group): Cast find_kept_object to
15043 Sized_relobj.
15044 (Sized_relobj::include_linkonce_section): Likewise.
15045 (Sized_relobj::do_layout): Use separate arrays for output section
15046 and output offset.
15047 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15048 output_sections.
15049 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15050 output_sections and section_offsets.
15051 (Sized_relobj::write_local_symbols): Likewise.
15052 (map_to_kept_section): Compute output address directly.
15053 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15054 output_sections and section_offsets.
15055 (Sized_relobj::write_sections): Likewise.
15056 (Sized_relobj::relocate_sections): Likewise.
15057 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15058 * output.h (class Output_reloc): Update declarations. Change
15059 u2_.relobj to Sized_relobj*.
15060 (class Output_data_reloc): Change add functions to use
15061 Sized_relobj*.
15062 * output.cc (Output_reloc::Output_reloc): Change relobj to
15063 Sized_relobj*.
15064 (Output_reloc::local_section_offset): Change return type to
15065 Elf_Addr. Use get_output_section_offset.
15066 (Output_reloc::get_address): Likewise.
15067 (Output_section::is_input_address_mapped): Don't call
15068 is_section_specially_mapped.
15069 (Output_section::output_offset): Likewise.
15070 (Output_section::output_address): Likewise.
15071 (Output_section::starting_output_address): Likewise.
15072 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15073 parameter to Sized_relobj*.
15074 (Copy_relocs::need_copy_reloc): Likewise.
15075 (Copy_relocs::save): Likewise.
15076 * copy-relocs.h (class Copy_relocs): Update declarations.
15077 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15078 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15079 * target-reloc.h (relocate_for_relocatable): Change
15080 offset_in_output_section type to Elf_Addr. Change code that uses
15081 it as well.
15082 * layout.cc (Layout::layout): Always set *off.
15083 * mapfile.cc (Mapfile::print_input_section): Use
15084 output_section_offset.
15085 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15086 Sized_relobj*.
15087 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15088 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15089 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15090
5cb66f97
ILT
150912008-07-03 Ian Lance Taylor <iant@google.com>
15092
15093 * layout.cc (Layout::include_section): Do not discard unrecognized
15094 SHT_STRTAB sections.
15095
afe47622
CS
150962008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15097
15098 * script.cc (Lex::can_continue_name): Make '?' allowable in
15099 version-script names.
15100 * testsuite/version_script.map: Change glob pattern to use '?'
15101
5adf9721
ILT
151022008-06-30 Manish Singh <yosh@gimp.org>
15103
15104 PR 6585
15105 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
15106 Correct typo.
15107
e6fde208
ILT
151082008-06-30 Ian Lance Taylor <iant@google.com>
15109
15110 PR 6660
15111 PR 6682
15112 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
15113 versions]: Don't try to read the value in the contents, since we
15114 don't use it. Use the template endianness when writing.
15115
3f2e6a2d
CC
151162008-06-25 Cary Coutant <ccoutant@google.com>
15117
15118 * fileread.cc (File_read::make_view): Assert on zero-length view.
15119 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
15120 symbol table when there are no symbols to read.
15121
c43d3a48
CS
151222008-06-23 Craig Silverstein <csilvers@google.com>
15123
15124 * version.cc (version_string): Bump to 1.7
15125
5f494ea0
CS
151262008-06-18 Craig Silverstein <csilvers@google.com>
15127
15128 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
15129 constant 0xFFFF to type Valtype.
15130 (Powerpc_relocate_functions::rel16_ha): Likewise.
15131
c42e122e
ILT
151322008-06-17 Ian Lance Taylor <iant@google.com>
15133
f34787f8
ILT
15134 * output.h (Output_section::Input_section): Initialize p2align_ to
15135 zero for Output_section_data constructors.
15136 (Output_section::Input_section::addralign): If not an input
15137 section, return the alignment of the Output_section_data.
15138 * testsuite/copy_test.cc: New file.
15139 * testsuite/copy_test_1.cc: New file.
15140 * testsuite/copy_test_2.cc: New file.
15141 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15142 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15143 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15144 (copy_test_1_pic.o, copy_test_1.so): New targets.
15145 (copy_test_2_pic.o, copy_test_2.so): New targets.
15146 * testsuite/Makefile.in: Rebuild.
15147
c42e122e
ILT
15148 * script-sections.cc (Script_sections::place_orphan): Initialize
15149 local variable exact.
15150
ce3ac18a
DE
151512008-06-13 David Edelsohn <edelsohn@gnu.org>
15152
15153 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15154
42cacb20
DE
151552008-06-12 David Edelsohn <edelsohn@gnu.org>
15156 David S. Miller <davem@davemloft.net>
15157
15158 * powerpc.cc: New file.
15159 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15160 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15161 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15162 * Makefile.in: Rebuild.
15163
7b308235
ILT
151642008-06-09 Ian Lance Taylor <iant@google.com>
15165
15166 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15167 <exception>.
15168 (throwing, orig_terminate): New static variables.
15169 (terminate_handler): New static function.
15170 (t2): Set terminate handler.
15171
f0b886e3
ILT
151722008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15173
15174 PR 6584
cd536b21 15175 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
15176 alignment.
15177
3e90f135
CC
151782008-05-30 Cary Coutant <ccoutant@google.com>
15179
15180 * archive.cc (Archive::include_all_members) Correct to step
15181 over symbol table and extended name table in thin archives.
15182
e09ad04a
ILT
151832008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15184
15185 PR 6407
15186 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15187 calculation.
15188
62b01cb5
ILT
151892008-05-28 Caleb Howe <cshowe@google.com>
15190
15191 * reduced_debug_output.cc: New file.
15192 * reduced_debug_output.h: New file.
92de84a6 15193 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
15194 * options.cc (General_options::finalize): Add strip_debug_non_line
15195 to the strip heirarchy.
15196 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15197 fields.
15198 * layout.cc: Include "reduced_debug_output.h".
15199 (Layout::Layout): Initialize new fields.
15200 (line_only_debug_sections): New static array.
15201 (is_lines_only_debug_sections): New static inline function.
15202 (Layout::include_section): Handle --strip-debug-non-line.
15203 (Layout::make_output_section): If --strip-debug-non-line, build
15204 new output sections for .debug_abbrev and .debug_info.
15205 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15206 gold. Warn about possible overflow.
15207 (read_signed_LEB_128): Likewise.
15208 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15209 (read_signed_LEB_128): Declare.
15210 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15211 (HFILES): Add reduced_debug_output.h.
15212 * Makefile.in: Rebuild.
15213
7d9e3d98
ILT
152142008-05-21 Ian Lance Taylor <iant@google.com>
15215
15216 * mapfile.cc: New file.
15217 * mapfile.h: New file.
15218 * options.h (class General_options): Add -M/--print-map and -Map.
15219 * options.cc (General_options::finalize): Make -M equivalent to
15220 -Map -.
15221 * main.cc: Include <cstdio> and "mapfile.h".
15222 (main): Open mapfile if requested.
15223 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15224 constructor. Change caller.
15225 (queue_initial_tasks): Add mapfile parameter. Change caller.
15226 (queue_middle_tasks): Likewise.
15227 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15228 declarations.
15229 * archive.cc: Include "mapfile.h".
15230 (Archive::add_symbols): Add mapfile parameter. Change all
15231 callers. Pass mapfile, symbol, and reason to include_member.
15232 (Archive::include_all_members): Add mapfile parameter. Change all
15233 callers.
15234 (Archive::include_member): Add mapfile, sym, and why parameters.
15235 Change all callers. Report inclusion to map file.
15236 * archive.h: Include "fileread.h".
15237 (class Archive): Update declarations.
15238 (Archive::file): New const method.
15239 (class Add_archive_symbols): Add mapfile_ field. Update
15240 constructor. Change all callers.
15241 * readsyms.h (class Read_symbols): Likewise.
15242 (class Finish_group): Likewise.
15243 (class Read_script): Likewise.
15244 * common.cc: Include "mapfile.h".
15245 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15246 all callers.
15247 (Symbol_table::do_allocate_commons): Likewise.
15248 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15249 symbol allocation to mapfile.
15250 * common.h (class Allocate_commons_task): Add mapfile_ field.
15251 Update constructor. Change all callers.
15252 * symtab.h (class Symbol_table): Update declarations.
15253 * layout.cc: Include "mapfile.h".
15254 (Layout_task_runner::run): Print information to mapfile.
15255 (Layout::create_gold_note): Change Output_data_fixed_space to
15256 Output_data_zero_fill.
15257 (Layout::create_build_id): Likewise.
15258 (Layout::print_to_mapfile): New function.
15259 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15260 constructor. Change caller.
15261 (class Layout): Declare print_to_mapfile.
15262 * output.cc (Output_section::Input_section::print_to_mapfile): New
15263 function.
15264 (Output_section::add_input_section): If producing a map, always
15265 add to input_sections_ list.
15266 (Output_section::do_print_to_mapfile): New function.
15267 (Output_segment::print_sections_to_mapfile): New function.
15268 (Output_segment::print_section_list_to_mapfile): New function.
15269 * output.h: Include "mapfile.h".
15270 (Output_data::print_to_mapfile): New function.
15271 (Output_data::do_print_to_mapfile): New virtual function.
15272 (Output_segment_headers::do_print_to_mapfile): New function.
15273 (Output_file_header::do_print_to_mapfile): New function.
15274 (Output_data_const::do_print_to_mapfile): New function.
15275 (class Output_data_const_buffer): Add map_name_ field. Update
15276 constructor. Change all callers. Add do_print_to_mapfile
15277 function.
15278 (class Output_data_fixed_space): Likewise.
15279 (class Output_data_space): Likewise.
15280 (class Output_data_zero_fill): New class.
15281 (Output_data_strtab::do_print_to_mapfile): New function.
15282 (Output_data_reloc_base::do_print_to_mapfile): New function.
15283 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15284 (Output_data_group::do_print_to_mapfile): New function.
15285 (Output_data_got::do_print_to_mapfile): New function.
15286 (Output_data_dynamic::do_print_to_mapfile): New function.
15287 (Output_symtab_xindex::do_print_to_mapfile): New function.
15288 (class Output_section): Declare do_print_to_mapflie. Declare
15289 print_to_mapfile in Input_section.
15290 (class Output_segment): Declare new functions.
15291 * object.h (Sized_relobj::symbol_count): New function.
15292 * script-sections.cc
15293 (Output_section_element_dot_assignment::set_section_addresses):
15294 Change Output_data_fixed_space to Output_data_zero_fill.
15295 (Output_data_expression::do_print_to_mapfile): New function.
15296 * script.cc (read_input_script): Add mapfile parameter. Change
15297 all callers.
15298 * script.h (read_input_script): Update declaration.
15299 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15300 (Eh_frame::do_print_to_mapfile): New function.
15301 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15302 (Output_merge_string::do_print_to_mapfile): New function.
15303 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15304 function.
15305 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15306 function.
15307 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15308 function.
15309 * Makefile.am (CCFILES): Add mapfile.cc.
15310 (HFILES): Add mapfile.h.
15311 * Makefile.in: Rebuild.
15312
9f1d377b
ILT
153132008-05-19 Ian Lance Taylor <iant@google.com>
15314
15315 * options.h (class General_options): Add -z relro.
15316 * layout.cc (Layout::Layout): Initialize relro_segment_.
15317 (Layout::add_output_section_data): Return the output section.
15318 (Layout::make_output_section): Rcognize relro sections and mark
15319 them appropriately.
15320 (Layout::attach_allocated_section_to_segment): Put relro sections
15321 in a PT_GNU_RELRO segment.
15322 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15323 section as relro.
15324 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15325 PT_TLS segments.
15326 (Layout::linkonce_mapping): Map d.rel.ro.local to
15327 .data.rel.ro.local.
15328 (Layout::output_section_name): Us .data.rel.ro.local for any
15329 section which begins with that.
15330 * layout.h (class Layout): Update add_output_section_data
15331 declaration. Add relro_segment_ field.
15332 * output.cc (Output_section::Output_section): Initialize is_relro_
15333 and is_relro_local_ fields.
15334 (Output_segment::add_output_section): Group relro sections.
15335 (Output_segment::is_first_section_relro): New function.
15336 (Output_segment::maximum_alignment): If there is a relro section,
15337 align the segment to the common page size.
15338 (Output_segment::set_section_addresses): Track whether we are
15339 looking at relro sections. If the last section is a relro
15340 section, align to the common page size.
15341 (Output_segment::set_section_list_addresses): Add in_relro
15342 parameter. Change all callers. Align to the page size when
15343 moving from relro to non-relro section.
15344 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15345 segment.
15346 * output.h (class Output_section): Add is_relro_ and
15347 is_relro_local_ fields.
15348 (Output_section::is_relro): New function.
15349 (Output_section::set_is_relro): New function.
15350 (Output_section::is_relro_local): New function.
15351 (Output_section::set_is_relro_local): New function.
15352 (class Output_segment): Update declarations.
15353 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15354 * sparc.cc (Target_sparc::got_section): Likewise.
15355 * x86_64.cc (Target_x86_64::got_section): Likewise.
15356 * testsuite/relro_test_main.cc: New file.
15357 * testsuite/relro_test.cc: New file.
15358 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15359 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15360 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15361 (relro_test.so, relro_test_pic.o): New targets.
15362 * testsuite/Makefile.in: Rebuild.
15363
a984ee1d
ILT
153642008-05-16 Ian Lance Taylor <iant@google.com>
15365
01676dcd
ILT
15366 * output.cc (Output_segment::add_output_section): Remove front
15367 parameter.
15368 * output.h (class Output_segment): Remove
15369 add_initial_output_section and overloaded add_output_section.
15370 Update declaration of remaining add_output_section.
15371 * layout.cc (Layout::create_interp): Call add_output_section
15372 rather than add_initial_output_section.
15373 (Layout::finish_dynamic_section): Likewise.
15374
497897f9
ILT
15375 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15376 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15377 know the dynamic type.
15378 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15379 field. Initialize it in constructor.
15380 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15381 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15382 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15383 reloc.
15384
a984ee1d
ILT
15385 * output.cc (Output_reloc::get_address): Change return type to
15386 Elf_Addr.
15387 * output.h (class Output_reloc): Update get_address declaration.
15388 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15389 for section addresses.
15390
55ba0940
ILT
153912008-05-09 Ian Lance Taylor <iant@google.com>
15392
15393 PR 6493
15394 * gold.cc (gold_nomem): Use return value of write.
15395
75517b77
ILT
153962008-05-08 Ian Lance Taylor <iant@google.com>
15397
15398 * symtab.c (Symbol::init_base_output_data): Add version
15399 parameter. Change all callers.
15400 (Symbol::init_base_output_segment): Likewise.
15401 (Symbol::init_base_constant): Likewise.
15402 (Symbol::init_base_undefined): Likewise.
15403 (Sized_symbol::init_output_data): Likewise.
15404 (Sized_symbol::init_output_segment): Likewise.
15405 (Sized_symbol::init_constant): Likewise.
15406 (Sized_symbol::init_undefined): Likewise.
15407 (Symbol_table::do_define_in_output_data): If the new symbol has a
15408 version, mark it as the default.
15409 (Symbol_table::do_define_in_output_segment): Likewise.
15410 (Symbol_table::do_define_as_constant): Likewise.
15411 * symtab.h (class Symbol): Update declarations.
15412 (class Sized_symbol): Likewise.
15413 * resolve.cc (Symbol::override_version): New function.
c42e122e 15414 (Symbol::override_base): Call override_version.
75517b77
ILT
15415 (Symbol::override_base_with_special): Likewise.
15416 * testsuite/ver_script_8.script: New file.
15417 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15418 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15419 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15420 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15421
f1f70eae
ILT
154222008-05-06 Ian Lance Taylor <iant@google.com>
15423
f3e9c5c5
ILT
15424 PR 6049
15425 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15426 functions.
15427 (class General_options): Remove existing --undefined, and add
15428 --no-undefined instead. Add new --undefined as synonym for -u.
15429 * archive.cc (Archive::add_symbols): Check whether symbol was
15430 named with -u.
15431 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15432 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15433 all uses. Add IS_UNDEFINED. Update declarations to split
15434 different versions of init_base. Declare init_base_undefined.
15435 (Symbol::is_defined): Handle IS_UNDEFINED.
15436 (Symbol::is_undefined): Likewise.
15437 (Symbol::is_weak_undefined): Call is_undefined.
15438 (Symbol::is_absolute): Handle IS_CONSTANT.
15439 (class Sized_symbol): Update declarations to split different
15440 versions of init. Declare init_undefined.
15441 (class Symbol_table): Declare new functions.
15442 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15443 Change all callers.
15444 (Symbol::init_base_output_data): Likewise.
15445 (Symbol::init_base_output_segment): Likewise.
15446 (Symbol::init_base_constant): Likewise.
15447 (Symbol::init_base_undefined): New function.
15448 (Sized_symbol::init_object): Rename from init. Change all
15449 callers.
15450 (Sized_symbol::init_output_data): Likewise.
15451 (Sized_symbol::init_output_segment): Likewise.
15452 (Sized_symbol::init_constant): Likewise.
15453 (Sized_symbol::init_undefined): New function.
15454 (Symbol_table::add_undefined_symbols_from_command_line): New
15455 function.
15456 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15457 function.
15458 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15459 (Symbol::output_section): Likewise.
15460 (Symbol::set_output_section): Likewise.
15461 (Symbol_table::sized_finalize_symbol): Likewise.
15462 (Symbol_table::sized_write_globals): Likewise.
15463 * resolve.cc (Symbol_table::should_override): Likewise.
15464 (Symbol::override_base_with_special): Likewise.
15465
8bdcdf2c
ILT
15466 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15467 symbol, change it to have default visibility.
15468 * testsuite/protected_1.cc: New file.
15469 * testsuite/protected_2.cc: New file.
15470 * testsuite/protected_3.cc: New file.
15471 * testsuite/protected_main_1.cc: New file.
15472 * testsuite/protected_main_2.cc: New file.
15473 * testsuite/protected_main_3.cc: New file.
15474 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15475 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15476 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15477 (protected_1.so): New target.
15478 (protected_1_pic.o, protected_2_pic.o): New targets.
15479 (protected_3_pic.o): New target.
15480 (check_PROGRAMS): Add protected_2.
15481 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15482 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15483 * testsuite/Makefile.in: Rebuild.
15484
2b706932
ILT
15485 * options.h (DEFINE_var): Add set_user_set_##varname__.
15486 (DEFINE_bool_alias): New macro.
15487 (class General_options): Define -Bstatic using DEFINE_bool_alias
15488 rather than DEFINE_special. Add --undefined as an alias for -z
15489 defs.
15490 * options.cc (General_options::parse_Bstatic): Remove.
15491
d82a5bcc
ILT
15492 * options.h (class General_options): Add --fatal-warnings.
15493 * main.cc (main): Implement --fatal-warnings.
15494 * errors.h (Errors::warning_count): New function.
15495
f1f70eae
ILT
15496 * options.h (class General_options): Add -Bsymbolic-functions.
15497 * symtab.h (Symbol::is_preemptible): Check for
15498 -Bsymbolic-functions.
15499
8825ac63
ILT
155002008-05-05 Ian Lance Taylor <iant@google.com>
15501
d98bc257
ILT
15502 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15503 as noVARNAME rather than no-VARNAME.
15504 (class General_options): Add option -z combreloc.
15505 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15506 get_address.
15507 (Output_reloc::sort_before) [SHT_REL]: New function.
15508 (Output_reloc::sort_before) [SHT_RELA]: New function.
15509 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15510 Sort_relocs_comparison.
15511 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15512 parameter. Change all callers.
15513 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15514 sort_relocs parameter. Change all callers.
15515 * output.cc (Output_reloc::get_address): New function, broken out
15516 of write_rel.
15517 (Output_reloc::write_rel): Call it.
15518 (Output_reloc::compare): New function.
15519 (Output_data_reloc_base::do_write): Optionally sort relocs.
15520
60b2b4e7
ILT
15521 * configure.ac: If targ_extra_obj is set, link it in.
15522 * configure.tgt: Initialize all variables.
15523 (x86_64*): Set targ_extra_obj and targ_extra_size.
15524 * configure: Rebuild.
15525
8825ac63
ILT
15526 * object.cc (Sized_relobj::include_section_group): Adjust section
15527 indexes read from group data. Build vector to pass to
15528 layout_group.
15529 * layout.cc (Layout::layout_group): Add flags and shndxes
15530 parameters. Remove contents parameter. Change caller. Update
15531 explicit instantiations.
15532 * layout.h (class Layout): Update layout_group declaration.
15533 * output.cc (Output_data_group::Output_data_group): Add flags and
15534 input_shndxes parameters. Remove contents parameter. Change
15535 caller.
15536 (Output_data_group::do_write): Change input_sections_ to
15537 input_shndxes_.
15538 * output.h (class Output_data_group): Update constructor
15539 declaration. Rename input_sections_ to input_shndxes_.
15540 * testsuite/many_sections_test.cc: Add template.
15541
e94cf127
CC
155422008-04-30 Cary Coutant <ccoutant@google.com>
15543
4418b2d5
CC
15544 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15545
e94cf127
CC
15546 * layout.cc (Layout::include_section): Refactored check for debug
15547 info section.
15548 (Layout::add_comdat): Add new parameters. Change type
15549 of signature parameter. Add object and shndx to signatures table.
15550 (Layout::find_kept_object): New function.
15551 * layout.h: Include <cstring>.
15552 (Layout::is_debug_info_section): New function.
15553 (Layout::add_comdat): Add new parameters.
15554 (Layout::find_kept_object): New function.
15555 (Layout::Kept_section): New struct.
15556 (Layout::Signatures): Change type of map range.
15557 * object.cc (Relobj::output_section_address): New function.
15558 (Sized_relobj::include_section_group): Add new parameters. Change
15559 calls to Layout::add_comdat. Change to build table of kept comdat
15560 groups and table mapping discarded sections to kept sections.
15561 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15562 (Sized_relobj::do_layout): Change calls to include_section_group and
15563 include_linkonce_section.
15564 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15565 value to zero when section is discarded.
15566 (Sized_relobj::map_to_kept_section): New function.
15567 * object.h (Relobj::output_section_address): New function.
15568 (Relobj::Comdat_group): New type.
15569 (Relobj::find_comdat_group): New function.
15570 (Relobj::Comdat_group_table): New type.
15571 (Relobj::Kept_comdat_section): New type.
15572 (Relobj::Kept_comdat_section_table): New type.
15573 (Relobj::add_comdat_group): New function.
15574 (Relobj::set_kept_comdat_section): New function.
15575 (Relobj::get_kept_comdat_section): New function.
15576 (Relobj::comdat_groups_): New field.
15577 (Relobj::kept_comdat_sections_): New field.
15578 (Symbol_value::input_value): Update comment.
15579 (Sized_relobj::map_to_kept_section) New function.
15580 (Sized_relobj::include_linkonce_section): Add new parameter.
15581 * target-reloc.h (Comdat_behavior): New type.
15582 (get_comdat_behavior): New function.
15583 (relocate_section): Add code to map a discarded section to the
15584 corresponding kept section when applying a relocation.
15585
e4e5049b
CS
155862008-04-30 Craig Silverstein <csilvers@google.com>
15587
15588 * dwarf_reader.cc (next_generation_count): New static var.
15589 (Addr2line_cache_entry): New struct.
15590 (addr2line_cache): New static var.
15591 (Dwarf_line_info::one_addr2line): Added caching.
15592 (Dwarf_line_info::clear_addr2line_cache): New function.
15593 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15594 cache-size parameter.
15595 (Dwarf_line_info::one_addr2line_cache): New function.
15596 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15597 new cache-size argument to one_addr2line(), and clear cache.
15598
d09e9154
CC
155992008-04-28 Cary Coutant <ccoutant@google.com>
15600
15601 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15602 R_386_PC8 relocations.
15603
7ef73768
ILT
156042008-04-23 Ian Lance Taylor <iant@google.com>
15605
55438702
ILT
15606 * object.cc (Sized_relobj::include_section_group): Check for
15607 invalid section group.
15608
c165fb93
ILT
15609 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15610 header size.
15611
7ef73768
ILT
15612 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15613 than read for file header.
15614 * archive.cc (Archive::include_member): Likewise.
15615
6194aaab
L
156162008-04-23 Paolo Bonzini <bonzini@gnu.org>
15617
15618 * aclocal.m4: Regenerate.
15619 * configure: Regenerate.
15620
d491d34e
ILT
156212008-04-19 Ian Lance Taylor <iant@google.com>
15622
5ea2bac6
ILT
15623 * version.cc (version_string): Bump to 1.6.
15624
7bc3e21a
ILT
15625 * testsuite/Makefile.am (many_sections_r_test): New target.
15626 (many_sections_r_test_SOURCES): Remove.
15627 (many_sections_r_test_DEPENDENCIES): Remove.
15628 (many_sections_r_test_LDFLAGS): Remove.
15629 (many_sections_r_test_LDADD): Remove.
15630
7fcd3aa9
ILT
15631 * object.cc (Sized_relobj::do_add_symbols): Always pass
15632 local_symbol_count_ to add_from_relobj.
15633
4c94d6ae
ILT
15634 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15635 every thousand variables.
15636 * testsuite/Makefile.in: Rebuild.
15637
d491d34e
ILT
15638 * object.cc (Xindex::initialize_symtab_xindex): New function.
15639 (Xindex::read_symtab_xindex): New function.
15640 (Xindex::sym_xindex_to_shndx): New function.
15641 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15642 available.
15643 (Sized_relobj::do_initialize_xindex): New function.
15644 (Sized_relobj::do_read_symbols): Adjust section links.
15645 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15646 parameter. Change all callers.
15647 (Sized_relobj::include_section_group): Adjust section links and
15648 symbol section indexes.
15649 (Sized_relobj::do_layout): Adjust section links.
15650 (Sized_relobj::do_count_local_symbols): Adjust section links and
15651 symbol section indexes.
15652 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15653 ordinary and special symbols.
15654 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15655 dynsym_xindex parameters. Change all callers. Adjust section
15656 links. Use SHN_XINDEX when needed.
15657 (Sized_relobj::get_symbol_location_info): Adjust section links.
15658 Don't get fooled by special symbols.
15659 * object.h (class Xindex): Define.
15660 (class Object): Add xindex_ parameter. Declare virtual functoin
15661 do_initialize_xindex.
15662 (Object::adjust_sym_shndx): New function.
15663 (Object::set_xindex): New protected function.
15664 (class Symbol_value): Add is_ordinary_shndx_ field.
15665 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15666 (Symbol_value::value): Assert ordinary section.
15667 (Symbol_value::initialize_input_to_output_map): Likewise.
15668 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15669 Change all callers.
15670 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15671 all callers.
15672 (class Sized_relobj): Update declarations.
15673 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15674 parameter. Change all callers.
15675 (Sized_relobj::adjust_shndx): New function.
15676 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15677 field.
15678 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15679 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15680 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15681 (Sized_dynobj::read_dynsym_section): Adjust section links.
15682 (Sized_dynobj::read_dynamic): Likewise.
15683 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15684 section links.
15685 (Sized_dynobj::do_initialize_xindex): New function.
15686 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15687 do_initialize_xindex.
15688 (Sized_dynobj::adjust_shndx): New function.
15689 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15690 dynsym_xindex_ fields.
15691 (Layout::finalize): Add a call to set_section_indexes before
15692 creating the symtab sections.
15693 (Layout::set_section_indexes): Don't do anything if the section
15694 already has a section index.
15695 (Layout::create_symtab_sections): Add shnum parameter. Change
15696 caller. Create .symtab_shndx section if needed.
15697 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15698 caller.
15699 (Layout::allocated_output_section_count): New function.
15700 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15701 needed.
15702 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15703 fields. Update declarations.
15704 (Layout::symtab_xindex): New function.
15705 (Layout::dynsym_xindex): New function.
15706 (class Write_symbols_task): Add layout_ field.
15707 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15708 Change caller.
15709 * output.cc (Output_section_headers::Output_section_headers): Add
15710 shstrtab_section parameter. Change all callers.
15711 (Output_section_headers::do_sized_write): Store overflow values
15712 for section count and section string table section index in
15713 section header zero.
15714 (Output_file_header::do_sized_write): Check for overflow of
15715 section count and section string table section index.
15716 (Output_symtab_xindex::do_write): New function.
15717 (Output_symtab_xindex::endian_do_write): New function.
15718 * output.h (class Output_section_headers): Add shstrtab_section_.
15719 Update declarations.
15720 (class Output_symtab_xindex): Define.
15721 (Output_section::has_out_shndx): New function.
15722 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15723 field.
15724 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15725 Change all callers.
15726 (Sized_symbol::init): Likewise.
15727 (Symbol::output_section): Check for ordinary symbol.
15728 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15729 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15730 callers.
15731 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15732 Change all callers. Simplify handling of symbols from sections
15733 not included in the link.
15734 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15735 distinction.
15736 (Weak_alias_sorter::operator()): Assert that symbols are
15737 ordinary.
15738 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15739 distinction.
15740 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15741 parameters. Change all callers.
15742 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15743 symbol distinction. Use SHN_XINDEX when needed.
15744 (Symbol_table::write_section_symbol): Add symtab_xindex
15745 parameter. Change all callers.
15746 (Symbol_table::sized_write_section_symbol): Likewise. Use
15747 SHN_XINDEX when needed.
15748 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15749 declarations.
15750 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15751 (Symbol::is_defined): Check is_ordinary.
15752 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15753 (Symbol::is_absolute, Symbol::is_common): Likewise.
15754 (class Sized_symbol): Update declarations.
15755 (class Symbol_table): Update declarations.
15756 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15757 parameters. Change all callers.
15758 (Sized_symbol::override): Likewise.
15759 (Symbol_table::override): Likewise.
15760 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15761 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15762 is_ordinary, and orig_st_shndx parameters. Change all callers.
15763 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15764 to be in an ordinary section.
15765 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15766 object and is_ordinary parameters. Change all callers.
15767 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15768 Change all callers. Don't add undefined or non-ordinary symbols
15769 to reloc_map_.
15770 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15771 Change all callers.
15772 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15773 declarations.
15774 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15775 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15776 (Sized_relobj::relocate_sections): Likewise.
15777 * target-reloc.h (scan_relocs): Adjust section symbol index.
15778 (scan_relocatable_relocs): Likewise.
15779 * i386.cc (Scan::local): Check for ordinary symbols.
15780 * sparc.cc (Scan::local): Likewise.
15781 * x86_64.cc (Scan::local): Likewise.
15782 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15783 to symbol_section_and_value.
15784 * testsuite/many_sections_test.cc: New file.
15785 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15786 (check_PROGRAMS): Add many_sections_test.
15787 (many_sections_test_SOURCES): Define.
15788 (many_sections_test_DEPENDENCIES): Define.
15789 (many_sections_test_LDFLAGS): Define.
15790 (BUILT_SOURCES): Add many_sections_define.h.
15791 (many_sections_define.h): New target.
15792 (BUILT_SOURCES): Add many_sections_check.h.
15793 (many_sections_check.h): New target.
15794 (check_PROGRAMS): Add many_sections_r_test.
15795 (many_sections_r_test_SOURCES): Define.
15796 (many_sections_r_test_DEPENDENCIES): Define.
15797 (many_sections_r_test_LDFLAGS): Define.
15798 (many_sections_r_test_LDADD): Define.
15799 (many_sections_r_test.o): New target.
15800 * testsuite/Makefile.in: Rebuild.
15801
c5818ff1
CC
158022008-04-17 Cary Coutant <ccoutant@google.com>
15803
15804 * errors.cc (Errors::info): New function.
15805 (gold_info): New function.
15806 * errors.h (Errors::info): New function.
15807 * gold.h (gold_info): New function.
15808 * object.cc (Input_objects::add_object): Print trace output.
15809 * options.cc (options::parse_set): New function.
15810 (General_options::parse_wrap): Deleted.
15811 (General_options::General_options): Deleted initializer.
15812 * options.h (options::String_set): New typedef.
15813 (options::parse_set): New function.
15814 (DEFINE_set): New macro.
15815 (General_options::wrap): Changed to use DEFINE_set. Changed
15816 callers of any_wrap_symbols and is_wrap_symbol.
15817 (General_options::trace, General_options::trace_symbol):
15818 New options.
15819 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15820 (General_options::wrap_symbols_): Deleted.
15821 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15822
b5be4a7c
DM
158232008-04-17 David S. Miller <davem@davemloft.net>
15824
15825 * options.cc (General_options::parse_V): New function.
15826 * options.h: Add entries for -V and -Qy.
15827
155a0dd7
ILT
158282008-04-17 Ian Lance Taylor <iant@google.com>
15829
15830 * common.cc (Symbol_table::allocate_commons): Remove options
15831 parameter. Change caller.
15832 (Symbol_table::do_allocate_commons): Remove options parameter.
15833 Change caller. Just call do_allocate_commons_list twice.
15834 (Symbol_table::do_allocate_commons_list): New function, broken out
15835 of do_allocate_commons.
15836 * common.h (class Allocate_commons_task): Remove options_ field.
15837 Update constructor.
15838 * symtab.cc (Symbol_table::Symbol_table): Initialize
15839 tls_commons_.
15840 (Symbol_table::add_from_object): Put TLS common symbols on
15841 tls_commons_ list.
15842 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15843 which are IN_OUTPUT_DATA.
15844 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15845 allocate_commons and do_allocate_commons declarations. Declare
15846 do_allocate_commons_list.
15847 * gold.cc (queue_middle_tasks): Update creation of
15848 Allocate_commons_task to not pass options.
15849 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15850 (TLS_TEST_C_FLAGS): New variable.
15851 (tls_test_c_pic.o): New target.
15852 (tls_test_shared.so): Link in tls_test_c_pic.o.
15853 (tls_test_c_pic_ie.o): New target.
15854 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15855 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15856 (tls_test_c.o): New target.
15857 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15858 (tls_pic_test_LDADD): Likewise.
15859 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15860 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15861 (tls_test_c_gnu2.o): New target.
15862 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15863 tls_test_c_gnu2.o.
15864 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15865 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15866 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15867 * testsuite/tls_test.cc: Include "config.h".
15868 (t_last): Call t11_last.
15869 * testsuite/tls_test.h (t11, t11_last): Declare.
15870 * testsuite/tls_test_c.c: New file.
15871 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15872 * configure.ac: Check for OpenMP support.
15873 * configure, config.in, Makefile.in: Rebuild.
15874 * testsuite/Makefile.in: Rebuild.
15875
edfbb029
CC
158762008-04-16 Cary Coutant <ccoutant@google.com>
15877
15878 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15879 (Target_i386::tls_base_symbol_defined_): New field.
15880 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15881 (Target_i386::Scan::global): Likewise.
15882 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15883 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15884 (Target_x86_64::tls_base_symbol_defined_): New field.
15885 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15886 (Target_x86_64::Scan::global): Likewise.
15887
f3c69fca
CC
158882008-04-16 Cary Coutant <ccoutant@google.com>
15889
15890 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15891 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15892 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15893 building shared libraries.
15894 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15895 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15896 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15897 * testsuite/Makefile.in: Rebuild.
15898 * testsuite/weak_undef.h: New file.
15899 * testsuite/weak_undef_file1.cc: Add extra test cases.
15900 * testsuite/weak_undef_file2.cc: Likewise.
15901 * testsuite/weak_undef_test.cc: Likewise.
15902
7c414435
DM
159032008-04-16 David S. Miller <davem@davemloft.net>
15904
32b769e1
DM
15905 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15906 Add issued_non_pic_error_ field. Declare check_non_pic.
15907 (Target_sparc::Scan::check_non_pic): New function.
15908 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15909 (Target_sparc::Scan::global): Likewise.
15910
11936fb1
DM
15911 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15912 * configure: Rebuild.
15913
7c414435
DM
15914 * options.h (DEFINE_enable): New macro.
15915 (new_dtags): New enable option.
15916 (initfirst, interpose, loadfltr, nodefaultlib,
15917 nodelete, nodlopen, nodump): New -z options.
15918 * layout.cc (Layout:finish_dynamic_section): If new
15919 dtags enabled, emit DT_RUNPATH. Also, emit a
15920 DT_FLAGS_1 containing any specified -z flags.
15921
85c7bf8b
ILT
159222008-04-16 Ian Lance Taylor <iant@google.com>
15923
12c0daef
ILT
15924 * copy-relocs.cc: New file.
15925 * copy-relocs.h: New file.
15926 * reloc.cc: Remove Copy_relocs code.
15927 * reloc.h: Likewise.
15928 * reloc-types.h (struct Reloc_types) [both versions]: Add
15929 get_reloc_addend_noerror.
15930 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15931 variants of add_global which take an addend which must be zero.
15932 * i386.cc: Include "copy-relocs.h".
15933 (class Target_i386): Change type of copy_relocs_ to variable,
15934 update initializer.
15935 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15936 Change all callers.
15937 (Target_i386::do_finalize_sections): Change handling of
15938 copy_relocs_.
15939 * sparc.cc: Include "copy-relocs.h".
15940 (class Target_sparc): Change type of copy_relocs_ to variable,
15941 update initializer.
15942 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15943 Change all callers.
15944 (Target_sparc::do_finalize_sections): Change handling of
15945 copy_relocs_.
15946 * x86_64.cc: Include "copy-relocs.h".
15947 (class Target_x86_64): Change type of copy_relocs_ to variable,
15948 update initializer.
15949 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15950 class. Change all callers.
15951 (Target_x86_64::do_finalize_sections): Change handling of
15952 copy_relocs_.
15953 * Makefile.am (CCFILES): Add copy-relocs.cc.
15954 (HFILES): Add copy-relocs.h.
15955
4f4995b6
ILT
15956 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15957
85c7bf8b
ILT
15958 * testsuite/script_test_4.sh: Permit leading zeroes.
15959
4f2a9edd
ILT
159602008-04-15 Ian Lance Taylor <iant@google.com>
15961
e6188289
ILT
15962 * script-sections.cc (Script_sections::create_segments): Use
15963 header_size_adjustment even when there is enough room for the
15964 headers.
15965 * testsuite/script_test_4.sh: New file.
15966 * testsuite/script_test_4.t: New file.
15967 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15968 (check_DATA): Add script_test_4.stdout.
15969 (MOSTLYCLEANFILES): Likewise.
15970 (script_test_4): New target.
15971 (script_test_4.stdout): New target.
15972 * testsuite/Makefile.in: Rebuild.
15973
4f2a9edd
ILT
15974 * sparc.cc: Add definitions for Output_data_plt_sparc class
15975 constants.
15976
f5314dd5
DM
159772008-04-14 David S. Miller <davem@davemloft.net>
15978
15979 * sparc.cc: New file.
15980 * Makefile.am (TARGETSOURCES): Add sparc.cc
15981 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15982 * configure.tgt: Document targ_extra_size and
15983 targ_extra_big_endian. Add entries for sparc-* and
15984 sparc64-*.
15985 * configure.ac: Handle targ_extra_size and
15986 targ_extra_big_endian.
15987 * Makefile.in: Rebuild.
15988 * configure: Likewise.
15989 * po/POTFILES.in: Likewise.
15990 * po/gold.pot: Likewise.
15991
154e0e9a
ILT
159922008-04-14 Ian Lance Taylor <iant@google.com>
15993
15994 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15995 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15996 in the name/type/flags to section mapping. Don't call
15997 allocate_output_section.
15998 (Layout::choose_output_section): Change parameter from adjust_name
15999 to is_input_section. Don't permit input sections after sections
16000 are attached to segments. Don't call allocate_output_section.
16001 (Layout::layout_eh_frame): Call update_flags_for_input_section,
16002 not write_enable_output_section.
16003 (Layout::make_output_section): Don't push to
16004 unattached_section_list_ nor call attach_to_segment. Call
16005 attach_section_to_segment if sections are attached.
16006 (Layout::attach_sections_to_segments): New function.
16007 (Layout::attach_section_to_segment): New function.
16008 (Layout::attach_allocated_section_to_segment): Rename from
16009 attach_to_segment. Remove flags parameter.
16010 (Layout::allocate_output_section): Remove function.
16011 (Layout::write_enable_output_section): Remove function.
16012 * layout.h (class Layout): Update for above changes. Add new
16013 field sections_are_attached_.
16014 * output.h (Output_section::update_flags_for_input_section): New
16015 function.
16016 * output.cc (Output_section::add_input_section): Call
16017 update_flags_for_input_section.
16018 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16019
009a67a2
CC
160202008-04-11 Cary Coutant <ccoutant@google.com>
16021
16022 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16023 thought unnecessary.
16024 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16025
759b1a24
ILT
160262008-04-11 Ian Lance Taylor <iant@google.com>
16027
16028 * output.h (class Output_section_data): Remove inline definition
16029 of set_addralign.
16030 * output.cc (Output_section_data::set_addralign): New function.
16031
c2b45e22
CC
160322008-04-11 Cary Coutant <ccoutant@google.com>
16033
16034 Add support for TLS descriptors for i386 and x86_64.
16035 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16036 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16037 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16038 GOT_TYPE_TLS_DESC.
16039 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16040 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16041 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16042 relocations.
16043 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16044 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16045 Fix problem with initial-exec relocations.
16046 (Target_i386::Relocate::relocate_tls): Likewise.
16047 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16048 relaxation.
16049 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16050 support for section-plus-offset dynamic table entries.
16051 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16052 (Output_data_dynamic::Dynamic_entry): Add support for
16053 section-plus-offset dynamic table entries.
16054 (Output_data_dynamic::Classification): Likewise.
16055 (Output_data_dynamic::classification_): Renamed offset_.
16056 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16057 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16058 (Target_x86_64::make_plt_section): New function.
16059 (Target_x86_64::reserve_tlsdesc_entries): New function.
16060 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
16061 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
16062 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
16063 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
16064 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
16065 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
16066 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
16067 add extra PLT entry for TLS descriptors.
16068 (Output_data_plt_x86_64::got_): New field.
16069 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16070 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16071 fields.
16072 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16073 descriptors.
16074 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16075 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16076 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16077 R_386_TLS_DESC_CALL relocations.
16078 (Target_x86_64::Scan::global): Likewise.
16079 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16080 for TLS descriptors.
16081 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16082 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16083 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16084 GD-to-IE relaxation.
16085 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16086 and TLS_DESCRIPTORS.
16087 * Makefile.in: Rebuild.
16088 * configure: Rebuild.
16089 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16090 (tls_test_shared2.so): New target.
16091 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16092 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16093 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16094 (tls_shared_gd_to_ie_test_LDADD): New variable.
16095 (tls_shared_gnu2_gd_to_ie_test): New target.
16096 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16097 New targets.
16098 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16099 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16100 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16101 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16102 (tls_shared_gnu2_test): New target.
16103 (tls_test_gnu2_shared.so): New target.
16104 (tls_shared_gnu2_test_SOURCES): New variable.
16105 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
16106 (tls_shared_gnu2_test_LDFLAGS): New variable.
16107 (tls_shared_gnu2_test_LDADD): New variable.
16108 * testsuite/Makefile.in: Rebuild.
16109 * testsuite/Makefile.
16110
83bfb6b7
ILT
161112008-04-11 Ian Lance Taylor <iant@google.com>
16112
16113 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
16114 justsyms.t.
16115 * testsuite/Makefile.in: Rebuild.
16116
16117 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
16118 long.
16119 * testsuite/script_test_2.cc (main): Adjust test.
16120
706e1f5e
ILT
161212008-04-11 David S. Miller <davem@davemloft.net>
16122 Ian Lance Taylor <iant@google.com>
16123
16124 * options.h (General_options): Add entries for '-Y' and
16125 '-relax'.
16126 * options.cc (General_options:finalize): If -Y was used, add those
16127 entries to the library path instead of the default "/lib" and
16128 "/usr/lib".
16129
7c98e6bb
DM
161302008-04-11 David S. Miller <davem@davemloft.net>
16131
16132 * testsuite/justsyms.t: Start at 0x100.
16133 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
16134 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16135 long.
16136 * testsuite/script_test_2.cc: Adjust string and section length
16137 checks.
7c98e6bb 16138
99a37bfd
ILT
161392008-04-09 Ian Lance Taylor <iant@google.com>
16140
2cefc357
ILT
16141 PR gold/5996
16142 * script-sections.cc (Sections_element::allocate_to_segment): Add
16143 orphan parameter.
16144 (Output_section_definition::allocate_to_segment): Likewise.
16145 (Orphan_output_section::allocate_to_segment): Likewise.
16146 (Script_sections::attach_sections_using_phdrs_clause): Don't
16147 propagate non-PT_LOAD segments to orphan sections.
16148 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16149 readelf rather than objdump.
16150 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16151 .interp section and PT_INTERP segment are the same size.
16152 * testsuite/Makefile.in: Rebuild.
16153
99a37bfd
ILT
16154 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16155 aliases for symbols defined in the same object.
16156 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16157 (weak_alias_test_SOURCES): New variable.
16158 (weak_alias_test_DEPENDENCIES): New variable.
16159 (weak_alias_test_LDFLAGS): New variable.
16160 (weak_alias_test_LDADD): New variable.
16161 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16162 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16163 (weak_alias_test_3.o): New target.
16164 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16165 * testsuite/weak_alias_test_main.cc: New file.
16166 * testsuite/weak_alias_test_1.cc: New file.
16167 * testsuite/weak_alias_test_2.cc: New file.
16168 * testsuite/weak_alias_test_3.cc: New file.
16169
780e49c5
ILT
161702008-04-08 Ian Lance Taylor <iant@google.com>
16171
cdb0b8f5
ILT
16172 * options.h (class General_options): Add --noinhibit-exec option.
16173 * main.cc (main): Check --noinhibit-exec.
16174
0864d551
ILT
16175 * options.h (class General_options): Define --wrap as a special
16176 option. Add wrap_symbols_ field.
16177 (General_options::any_wrap_symbols): New function.
16178 (General_options::is_wrap_symbol): New function.
16179 * options.cc (General_options::parse_wrap): New function.
16180 (General_options::General_options): Initialize wrap_symbols_.
16181 * symtab.cc (Symbol_table::wrap_symbol): New function.
16182 (Symbol_table::add_from_object): Handle --wrap.
16183 * symtab.h (class Symbol_table): Declare wrap_symbol.
16184 * target.h (Target::wrap_char): New function.
16185 (Target::Target_info): Add wrap_char field.
16186 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16187 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16188 * testsuite/testfile.cc (Target_test::test_target_info):
16189 Likewise.
16190
789aa6de
ILT
16191 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16192 there is one.
16193
2c38906f
ILT
16194 * layout.h (class Layout): Add added_eh_frame_data_ field.
16195 * layout.cc (Layout::Layout): Initialize new field.
16196 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16197 output section until we find a section we merged successfully.
16198 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16199 that the size be non-zero.
16200
780e49c5
ILT
16201 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16202 qualifier.
16203
7fcd0256
ILT
162042008-04-08 Craig Silverstein <csilvers@google.com>
16205
16206 * configure.ac: Export new conditional variable HAVE_ZLIB.
16207 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16208 on HAVE_ZLIB.
16209 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16210 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16211
6835af53
ILT
162122008-04-07 Ian Lance Taylor <iant@google.com>
16213
e24f324c
ILT
16214 * version.cc (version_string): Set to "1.5".
16215
a036edd8
ILT
16216 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16217 Add issued_non_pic_error_ field. Declare check_non_pic.
16218 (Target_x86_64::Scan::check_non_pic): New function.
16219 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16220 (Target_x86_64::Scan::global): Likewise.
16221
624f8810
ILT
16222 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16223 addend parameter. Change caller. Handle merge sections.
16224 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16225 Address to Addend. Don't add in the result of
16226 local_section_offset, pass down the addend and use the returned
16227 value.
16228 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16229 Update declarations of local_section_offset and symbol_value.
16230 * testsuite/two_file_test_1.cc (t18): New function.
16231 * testsuite/two_file_test_2.cc (f18): New function.
16232 * testsuite/two_file_test_main.cc (main): Call t18.
16233 * testsuite/two_file_test.h (t18, f18): Declare.
16234
6835af53
ILT
16235 * configure.ac: Don't test for objdump, c++filt, or readelf.
16236 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16237 conditionals.
16238 (TEST_READELF): New variable.
16239 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16240 (check_PROGRAMS): Add two_file_strip_test.
16241 (two_file_strip_test): New target.
16242 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16243 (two_file_same_shared_strip_test_SOURCES): New variable.
16244 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16245 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16246 (two_file_same_shared_strip_test_LDADD): New variable.
16247 (two_file_shared_strip.so): New target.
16248 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16249 (ver_test_5.syms, ver_test_7.syms): Likewise.
16250 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16251 (strip_test_3.stdout): Use TEST_OBJDUMP.
16252 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16253
86925eef
CC
162542008-04-04 Cary Coutant <ccoutant@google.com>
16255
16256 * symtab.h (Symbol::is_weak_undefined): New function.
16257 (Symbol::is_strong_undefined): New function.
16258 (Symbol::is_absolute): New function.
16259 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16260 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16261 absolute symbols.
16262 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16263 (weak_undef_test): New target.
16264 * testsuite/Makefile.in: Rebuild.
16265 * testsuite/weak_undef_file1.cc: New file.
16266 * testsuite/weak_undef_file2.cc: New file.
16267 * testsuite/weak_undef_test.cc: New file.
16268
126f3ece
ILT
162692008-04-03 Craig Silverstein <csilvers@google.com>
16270
16271 * compressed_output.h (class Output_compressed_section): Use
16272 unsigned buffer.
16273 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16274 add zlib header.
16275 (zlib_compressed_suffix): Removed.
16276 (Output_compressed_section::set_final_data_size): Use unsigned
16277 buffers.
16278 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16279 Fix linker invocation.
16280 (flagstest_o_specialfile_and_compress_debug_sections):
16281 Likewise.
16282 * testsuite/Makefile.in: Regenerated.
16283
deae2a14
DM
162842008-04-02 David S. Miller <davem@davemloft.net>
16285
16286 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16287 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16288
70752818
ILT
162892008-04-02 Craig Silverstein <csilvers@google.com>
16290
16291 * TODO: New file.
16292
39d0cb0e
ILT
162932008-04-02 Ian Lance Taylor <iant@google.com>
16294
16295 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16296 parameters. Update for new key type to views_. Change all
16297 callers.
16298 (File_read::read): Adjust for byteshift in returned view.
16299 (File_read::add_view): New function, broken out of
16300 find_and_make_view.
16301 (File_read::make_view): New function, broken out of
16302 find_and_make_view.
16303 (File_read::find_or_make_view): Add offset and aligned
16304 parameters. Rewrite accordingly. Change all callers.
16305 (File_read::get_view): Add offset and aligned parameters. Adjust
16306 for byteshift in return value.
16307 (File_read::get_lasting_view): Likewise.
16308 * fileread.h (class File_read): Update declarations.
16309 (class File_read::View): Add byteshift_ field. Add byteshift to
16310 constructor. Add byteshift method.
16311 * archive.h (Archive::clear_uncached_views): New function.
16312 (Archive::get_view): Add aligned parameter. Change all callers.
16313 * object.h (Object::get_view): Add aligned parameter. Change all
16314 callers.
16315 (Object::get_lasting_view): Likewise.
16316
16317 * fileread.cc (File_read::release): Don't call clear_views if
16318 there are multiple objects.
16319 * fileread.h (File_read::clear_uncached_views): New function.
16320 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16321 on the archive.
16322
a1207466
CC
163232008-03-31 Cary Coutant <ccoutant@google.com>
16324
16325 Add thin archive support.
16326 * archive.cc (Archive::armagt): New const.
16327 (Archive::setup): Remove task parameter and calls to unlock.
16328 (Archive::unlock_nested_archives): New function.
16329 (Archive::read_header): Add nested_off parameter. Change
16330 all callers.
16331 (Archive::interpret_header): Likewise.
16332 (Archive::include_all_members): Change to handle thin
16333 archives.
16334 (Archive::include_member): Likewise.
16335 * archive.h (Archive::Archive): Add new parameters and
16336 initializers.
16337 (Archive::armagt): New const.
16338 (Archive::setup): Remove task parameter.
16339 (Archive::unlock_nested_archives): New function.
16340 (Archive::read_header): Add nested_off parameter.
16341 (Archive::interpret_header): Likewise.
16342 (Archive::Nested_archive_table): New typedef.
16343 (Archive::is_thin_archive_): New field.
16344 (Archive::nested_archives_): New field.
16345 (Archive::options_): New field.
16346 (Archive::dirpath_): New field.
16347 (Archive::task_): New field.
16348 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16349 for thin archives. Pass additional parameters to
16350 Archive::Archive. Unlock the archive file after calling
16351 Archive::setup.
cd536b21 16352
479f6503
ILT
163532008-03-29 Ian Lance Taylor <iant@google.com>
16354
686c8caf
ILT
16355 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16356 version symbol to be local.
16357 * testsuite/ver_test_4.sh: New file.
16358 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16359 (check_DATA): Add ver_test_4.syms.
16360 (ver_test_4.syms): New target.
16361 * testsuite/Makefile.in: Rebuild.
16362
ab794b6b
ILT
16363 * output.cc
16364 (Output_section::Input_section_sort_entry::has_priority): New
16365 function.
16366 (Output_section::Input_section_sort_entry::match_file_name): New
16367 function.
16368 (Output_section::Input_section_sort_entry::match_section_name):
16369 Remove.
16370 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16371 Remove.
16372 (Output_section::Input_section_sort_entry::match_section_file):
16373 Remove.
16374 (Output_section::Input_section_sort_compare::operator()): Rewrite
16375 using new Input_section_sort_entry functions. Sort crtbegin and
16376 crtend first. Sort sections with no priority before sections with
16377 a priority.
16378 * testsuite/initpri1.c (d3): Check j != 4.
16379 (cd5): New constructor/destructor function.
16380 (main): Check j != 2.
16381
479f6503
ILT
16382 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16383 new symbol when resolving, don't call set_is_default.
16384 * testsuite/ver_test_7.cc: New file.
16385 * testsuite/ver_test_7.sh: New file.
16386 * testsuite/Makefile.am (ver_test_7.so): New target.
16387 (ver_test_7.o): New target.
16388 (check_SCRIPTS): Add ver_test_7.sh.
16389 (check_DATA): Add ver_test_7.syms.
16390 (ver_test_7.syms): New target.
16391
2fd32231
ILT
163922008-03-28 Ian Lance Taylor <iant@google.com>
16393
16394 * layout.cc (Layout::layout): If we see an input section with a
16395 name that needs sorting, set the must_sort flag for the output
16396 section.
16397 (Layout::make_output_section): If the name of the output section
16398 indicates that it might require sorting, set the may_sort flag.
16399 * output.h (Output_section::may_sort_attached_input_sections): New
16400 function.
16401 (Output_section::set_may_sort_attached_input_sections): New
16402 function.
16403 (Output_section::must_sort_attached_input_sections): New
16404 function.
16405 (Output_section::set_must_sort_attached_input_sections): New
16406 function.
16407 (class Output_section): Declare Input_section_sort_entry. Define
16408 Input_section_sort_compare. Declare
16409 sort_attached_input_sections. Add new fields:
16410 may_sort_attached_input_sections_,
16411 must_sort_attached_input_sections_,
16412 attached_input_sections_are_sorted_.
16413 * output.cc (Output_section::Output_section): Initialize new
16414 fields.
16415 (Output_section::add_input_section): Add an entry to
16416 input_sections_ if may_sort or must_sort are true.
16417 (Output_section::set_final_data_size): Call
16418 sort_attached_input_sections if necessary.
16419 (Output_section::Input_section_sort_entry): Define new class.
16420 (Output_section::Input_section_sort_compare::operator()): New
16421 function.
16422 (Output_section::sort_attached_input_sections): New function.
16423 * configure.ac: Check whether the compiler supports constructor
16424 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16425 * testsuite/initpri1.c: New file.
16426 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16427 CONSTRUCTOR_PRIORITY.
16428 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16429 (initpri1_LDFLAGS): New variable.
16430 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16431
18e6b24e
ILT
164322008-03-27 Ian Lance Taylor <iant@google.com>
16433
49bdd526
ILT
16434 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16435 * testsuite/common_test_1.c: New file.
16436 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16437 (common_test_1_SOURCES): New variable.
16438 (common_test_1_DEPENDENCIES): New variable.
16439 (common_test_1_LDFLAGS): New variable.
16440
18e6b24e
ILT
16441 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16442 and commons_ correctly when NAME/VERSION does not override
16443 NAME/NULL.
16444 * testsuite/ver_test_6.c: New file.
16445 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16446 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16447 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16448
04bf7072
ILT
164492008-03-26 Ian Lance Taylor <iant@google.com>
16450
5871526f
ILT
16451 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16452 of an undefined symbol from a version script.
16453 * testsuite/Makefile.am (ver_test_5.so): New target.
16454 (ver_test_5.o): New target.
16455 (check_SCRIPTS): Add ver_test_5.sh.
16456 (check_DATA): Add ver_test_5.syms.
16457 (ver_test_5.syms): New target.
16458 * testsuite/ver_test_5.cc: New file.
16459 * testsuite/ver_test_5.script: New file.
16460 * testsuite/ver_test_5.sh: New file.
16461 * Makefile.in, testsuite/Makefile.in: Rebuild.
16462
04bf7072
ILT
16463 PR gold/5986
16464 Fix problems building gold with gcc 4.3.0.
16465 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16466 (gold_error_at_location, gold_warning_at_location): Use it.
16467 * configure.ac: Check whether we can compile and use a template
16468 function with a printf attribute.
16469 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16470 when jumping over bytes.
16471 * object.cc: Instantiate Object::read_section_data.
16472 * debug.h: Include <cstring>
16473 * dwarf_reader.cc: Include <algorithm>
16474 * main.cc: Include <cstring>.
16475 * options.cc: Include <cstring>.
16476 * output.cc: Include <cstring>.
16477 * script.cc: Include <cstring>.
16478 * script.h: Include <string>.
16479 * symtab.cc: Include <cstring> and <algorithm>.
16480 * target-select.cc: Include <cstring>.
16481 * version.cc: Include <string>.
16482 * testsuite/testmain.cc: Include <cstdlib>.
16483 * configure, config.in: Rebuild.
16484
874c5b28
ILT
164852008-03-25 Ian Lance Taylor <iant@google.com>
16486
819d6c3a
ILT
16487 * options.cc: Include "../bfd/bfdver.h".
16488 (options::help): Print bug reporting address.
16489
f4b2c6f5
ILT
16490 * version.cc (print_version): Adjust output for current value of
16491 BFD_VERSION_STRING.
16492
16493 * NEWS: New file.
16494
e96caa79
ILT
16495 * options.cc (options::help): Print list of supported targets.
16496 * target-select.h: Include <vector>.
16497 (class Target_selector): Make machine_, size_, and is_big_endian_
16498 fields const. Add bfd_name_ and instantiated_target_ fields.
16499 (Target_selector::Target_selector): Add bfd_name parameter.
16500 (Target_selector::recognize): Make non-virtual, call
16501 do_recognize.
16502 (Target_selector::recognize_by_name): Make non-virtual, call
16503 do_recognize_by_name.
16504 (Target_selector::supported_names): New function.
16505 (Target_selector::bfd_name): New function.
16506 (Target_selector::do_instantiate_target): New pure virtual
16507 function.
16508 (Target_selector::do_recognize): New virtual function.
16509 (Target_selector::do_recognize_by_name): New virtual function.
16510 (Target_selector::instantiate_target): New private function.
16511 (supported_target_names): Declare.
16512 * target-select.cc (Target_selector::Target_selector): Update for
16513 new parameter and fields.
16514 (select_target_by_name): Check that the name matches before
16515 calling recognize_by_name.
16516 (supported_target_names): New function.
16517 * i386.cc (class Target_selector_i386): Update Target_selector
16518 constructor call. Remove recognize and recognize_by_name. Add
16519 do_instantiate_target.
16520 * x86_64.cc (class Target_selector_x86_64): Likewise.
16521 * testsuite/testfile.cc (class Target_selector_test): Update for
16522 changes to Target_selector.
16523
874c5b28
ILT
16524 * README: Rewrite, with some notes on unsupported features.
16525
0a65a3a7
CC
165262008-03-24 Cary Coutant <ccoutant@google.com>
16527
16528 * i386.cc (Target_i386::Got_type): New enum declaration.
16529 (Target_i386::Scan::local): Updated callers of Output_data_got
16530 member functions.
16531 (Target_i386::Scan::global): Likewise.
16532 (Target_i386::Relocate::relocate): Likewise.
16533 (Target_i386::Relocate::relocate_tls): Likewise.
16534 * object.h (Got_offset_list): New class.
16535 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16536 (Sized_relobj::local_got_offset): Likewise.
16537 (Sized_relobj::set_local_got_offset): Likewise.
16538 (Sized_relobj::local_has_tls_got_offset): Removed.
16539 (Sized_relobj::local_tls_got_offset): Removed.
16540 (Sized_relobj::set_local_tls_got_offset): Removed.
16541 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16542 * output.cc (Output_data_got::add_global): Added got_type parameter.
16543 (Output_data_got::add_global_with_rel): Likewise.
16544 (Output_data_got::add_global_with_rela): Likewise.
16545 (Output_data_got::add_global_pair_with_rel): New function.
16546 (Output_data_got::add_global_pair_with_rela): New function.
16547 (Output_data_got::add_local): Added got_type parameter.
16548 (Output_data_got::add_local_with_rel): Likewise.
16549 (Output_data_got::add_local_with_rela): Likewise.
16550 (Output_data_got::add_local_pair_with_rel): New function.
16551 (Output_data_got::add_local_pair_with_rela): New function.
16552 (Output_data_got::add_global_tls): Removed.
16553 (Output_data_got::add_global_tls_with_rel): Removed.
16554 (Output_data_got::add_global_tls_with_rela): Removed.
16555 (Output_data_got::add_local_tls): Removed.
16556 (Output_data_got::add_local_tls_with_rel): Removed.
16557 (Output_data_got::add_local_tls_with_rela): Removed.
16558 * output.h (Output_data_got::add_global): Added got_type parameter.
16559 (Output_data_got::add_global_with_rel): Likewise.
16560 (Output_data_got::add_global_with_rela): Likewise.
16561 (Output_data_got::add_global_pair_with_rel): New function.
16562 (Output_data_got::add_global_pair_with_rela): New function.
16563 (Output_data_got::add_local): Added got_type parameter.
16564 (Output_data_got::add_local_with_rel): Likewise.
16565 (Output_data_got::add_local_with_rela): Likewise.
16566 (Output_data_got::add_local_pair_with_rel): New function.
16567 (Output_data_got::add_local_pair_with_rela): New function.
16568 (Output_data_got::add_global_tls): Removed.
16569 (Output_data_got::add_global_tls_with_rel): Removed.
16570 (Output_data_got::add_global_tls_with_rela): Removed.
16571 (Output_data_got::add_local_tls): Removed.
16572 (Output_data_got::add_local_tls_with_rel): Removed.
16573 (Output_data_got::add_local_tls_with_rela): Removed.
16574 * resolve.cc (Symbol::override_base_with_special): Removed
16575 reference to has_got_offset_ field.
16576 * symtab.cc (Symbol::init_fields): Replaced initialization
16577 of got_offset_ with got_offsets_. Removed initialization
16578 of has_got_offset_
53fcba31 16579 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16580 (Symbol::got_offset): Likewise.
16581 (Symbol::set_got_offset): Likewise.
16582 (Symbol::has_tls_got_offset): Removed.
16583 (Symbol::tls_got_offset): Removed.
16584 (Symbol::set_tls_got_offset): Removed.
16585 (Symbol::got_offset_): Removed.
16586 (Symbol::tls_mod_got_offset_): Removed.
16587 (Symbol::tls_pair_got_offset_): Removed.
16588 (Symbol::got_offsets_): New field.
16589 (Symbol::has_got_offset): Removed.
16590 (Symbol::has_tls_mod_got_offset): Removed.
16591 (Symbol::has_tls_pair_got_offset): Removed.
16592 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16593 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16594 member functions.
16595 (Target_x86_64::Scan::global): Likewise.
16596 (Target_x86_64::Relocate::relocate): Likewise.
16597 (Target_x86_64::Relocate::relocate_tls): Likewise.
16598
bd52eafb
BE
165992008-03-25 Ben Elliston <bje@au.ibm.com>
16600
16601 * yyscript.y: Fix spelling error in comment.
16602
8b105e34
ILT
166032008-03-24 Ian Lance Taylor <iant@google.com>
16604
8ed814a9
ILT
16605 * options.h (class General_options): Define build_id option.
16606 * layout.h (class Layout): Declare write_build_id, create_note,
16607 create_build_id. Add build_id_note_ member.
16608 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16609 "libiberty.h", "md5.h", "sha1.h".
16610 (Layout::Layout): Initialize eh_frame_data_,
16611 eh_frame_hdr_section_, and build_id_note_.
16612 (Layout::finalize): Call create_build_id.
16613 (Layout::create_note): New function, broken out of
16614 Layout::create_gold_note.
16615 (Layout::create_gold_note): Call create_note.
16616 (Layout::create_build_id): New function.
16617 (Layout::write_build_id): New function.
16618 (Close_task_runner::run): Call write_build_id.
16619
8b105e34
ILT
16620 * x86_64.cc: Correct license to GPLv3.
16621
086a1841
ILT
166222008-03-23 Ian Lance Taylor <iant@google.com>
16623
16624 * options.cc: Include "demangle.h".
16625 (parse_optional_string): New function.
16626 (parse_long_option): Handle takes_optional_argument.
16627 (parse_short_option): Update dash_z initializer. Handle
16628 takes_optional_argument.
16629 (General_options::General_options): Initialize do_demangle_.
16630 (General_options::finalize): Set do_demangle_. Handle demangling
16631 style.
16632 * options.h (parse_optional_string): Declare.
16633 (struct One_option): Add optional_arg field. Update constructor.
16634 Update call constructor calls. Add takes_optional_argument
16635 function.
16636 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16637 (DEFINE_optional_string): Define.
16638 (General_options::demangle): Change from DEFINE_bool to
16639 DEFINE_optional_string.
16640 (General_options::no_demangle): New function.
16641 (General_options::do_demangle): New function.
16642 (General_options::set_do_demangle): New function.
16643 (General_options::execstack_status_): Move definition to end of
16644 class definition.
16645 (General_options::static_): Likewise.
16646 (General_options::do_demangle_): New field.
16647 * object.cc (big_endian>::get_symbol_location_info): Call
16648 Options::do_demangle, not Options::demangle.
16649 * symtab.cc (demangle): Likewise.
16650
cbb93e63
ILT
166512008-03-22 Ian Lance Taylor <iant@google.com>
16652
16653 * gold.h: Include <cstddef> and <sys/types.h>
16654 * options.h: Include <cstring>.
16655
ec531623
ILT
166562008-03-21 Ian Lance Taylor <iant@google.com>
16657
16658 * Added source code to GNU binutils.
752937aa 16659\f
b90efa5b 16660Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
16661
16662Copying and distribution of this file, with or without modification,
16663are permitted in any medium without royalty provided the copyright
16664notice and this notice are preserved.
16665
16666Local Variables:
16667mode: change-log
16668left-margin: 8
16669fill-column: 74
16670version-control: never
16671End:
This page took 1.181196 seconds and 4 git commands to generate.