Clean up System V IPC objects allocated by test.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
b66d1c52
CC
12015-02-04 Peter Collingbourne <pcc@google.com>
2
3 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
4 forwarding symbols when computing symbol resolution info for plugins.
5 * plugin.h (Plugin_manager::symtab): New method.
6 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
7
23081de0
CC
82015-02-03 Cary Coutant <ccoutant@google.com>
9 Peter Collingbourne <pcc@google.com>
10
11 PR gold/15660
12 * archive.cc (Thin_archive_object_unlocker): New class.
13 (Archive::include_member): Unlock external members of thin archives.
14 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
15 (plugin_test_2): Likewise.
16 (plugin_test_3): Likewise.
17 (plugin_test_4): Likewise.
18 (plugin_test_5): Likewise.
19 (plugin_test_6): Likewise.
20 (plugin_test_7): Likewise.
21 (plugin_test_8): Likewise.
22 (plugin_test_9): Likewise.
23 (plugin_test_10): Likewise.
24 (plugin_test_11): New test case.
25 * testsuite/Makefile.in: Regenerate.
26 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
27 file to decide whether to claim file.
28 (all_symbols_read_hook): Likewise.
29 * testsuite/plugin_test_1.sh: Adjust expected output.
30 * testsuite/plugin_test_2.sh: Likewise.
31 * testsuite/plugin_test_3.sh: Likewise.
32 * testsuite/plugin_test_6.sh: Likewise.
33 * testsuite/plugin_test_tls.sh: Likewise.
34 * testsuite/plugin_test_11.sh: New testcase.
35
362015-02-03 Cary Coutant <ccoutant@google.com>
37
38 * descriptors.cc (Descriptors::open): Set artificially-low limit for
39 file descriptors when debugging enabled. Add debug output.
40 (Descriptors::release): Add debug output.
41 (Descriptors::close_some_descriptor): Likewise.
42 (Descriptors::close_all): Likewise.
43 * fileread.cc (File_read::lock): Likewise.
44 (File_read::unlock): Likewise.
45
24dd5808
CC
462015-02-02 Cary Coutant <ccoutant@google.com>
47
48 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
49 executable output file.
50
fa89cc82
HS
512015-01-22 Han Shen <shenhan@google.com>
52
53 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
54 (Target_arm::do_plt_address_for_global): New method.
55 (Target_arm::do_plt_address_for_local): New method.
56 (Target_arm::rel_irelative_section): New method.
57 (Target_arm::make_data_plt): Add more parameters for plt ctor.
58 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
59 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
60 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
61 (Target_arm::Scan::check_non_pic): Add ifunc support.
62 (Target_arm::Scan::local): Add ifunc support.
63 (Target_arm::Scan::global): Add ifunc support.
64 (Target_arm::make_plt_section): New method.
65 (Target_arm::make_plt_entry): Change to call to make_plt_section.
66 (Target_arm::make_local_ifunc_plt_entry): New method.
67 (Target_arm::got_irelative_): New member.
68 (Target_arm::rel_irelative_): New member.
69 (Target_arm::got_section): Add creation for got_irelative_.
70 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
71 (Target_arm::Relocate::relocate): Properly set local ifunc address.
72 (Target_arm::do_dynsym_value): Properly set global ifunc address.
73 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
74 (Output_data_plt_arm::IRelative_data): New type.
75 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
76 (Output_data_plt_arm::add_entry): Add more parameters.
77 (Output_data_plt_arm::add_relocation): New method.
78 (Output_data_plt_arm::add_local_ifunc_entry): New method.
79 (Output_data_plt_arm::rel_irelative): New method.
80 (Output_data_plt_arm::entry_count): Modified.
81 (Output_data_plt_arm::address_for_global): New method.
82 (Output_data_plt_arm::address_for_local): New method.
23081de0 83gold/
fa89cc82
HS
84 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
85 (Output_data_plt_arm::insert_irelative_data): New method.
86 (Output_data_plt_arm::irelative_rel_): New member.
87 (Output_data_plt_arm::got_): New member.
88 (Output_data_plt_arm::got_irelative_): New member.
89 (Output_data_plt_arm::irelative_count_): New member.
90 (Output_data_plt_arm::IRelative_data_vec): New typedef.
91 (Output_data_plt_arm::irelative_data_vec_): New member.
92 (Output_data_plt_arm::do_write): Write out irelative entries.
93 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
94 more parameters to ctor.
95 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
96 more parameters to ctor.
97 * output.h (Output_data_reloc::add_local_relative): New method.
98 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
99
0f81d3f0
AM
1002015-01-29 Alan Modra <amodra@gmail.com>
101
102 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
103 and GOT_TLSGD to LE optimization.
104
65d92137
CC
1052015-01-28 Cary Coutant <ccoutant@google.com>
106
107 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
108 for undef TLS symbols.
109 (Target_x86_64::Relocate::relocate_tls): Likewise.
110 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
111
5485698a
CC
1122015-01-25 Cary Coutant <ccoutant@google.com>
113
114 * output.cc (Output_segment::set_section_addresses): Fix calculation
115 of size of relro segment.
116
b01a4b04
AM
1172015-01-22 Alan Modra <amodra@gmail.com>
118
119 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
120 condition for need of ifunc plt entry.
121 (Target_powerpc::Scan::global <got relocs>): Likewise.
122
3d0064a9
CC
1232015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
124
125 * mips.cc (reloc_high): Add r_sym.
126 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
127 reloc_high constructor.
128 (Mips_relocate_functions::relgot16_local): Likewise.
129 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
130 r_type to decide whether LO16 matches HI16.
131 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
132 rello16 and relgot16_local.
133
a5cd8f05
CC
1342015-01-09 Cary Coutant <ccoutant@google.com>
135
136 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
137 unless alignment is larger than page size.
138
4fc1b9d4
L
1392015-01-06 H.J. Lu <hongjiu.lu@intel.com>
140 Cary Coutant <ccoutant@google.com>
141
142 PR gold/17729
143 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
144 (DEFAULT_TARGET_X32): Set for x32.
145 * x86_64.cc (cmp_insn_32): New.
146 (lea_r10_insn_32): Likewise.
147 (lea_r11_insn_32): Likewise.
148 (cmp_insn_64): Likewise.
149 (lea_r10_insn_64): Likewise.
150 (lea_r11_insn_64): Likewise.
151 (Target_x86_64<size>::do_calls_non_split): Handle x32.
152 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
153 (check_DATA): Add split_x32 files.
154 (split_x32_[1234n].o): New targets.
155 (split_x32_[124]): New targets.
156 (split_x32_[1234r].stdout): New targets.
157 * testsuite/split_x32.sh: New file.
158 * testsuite/split_x32_1.s: Likewise.
159 * testsuite/split_x32_2.s: Likewise.
160 * testsuite/split_x32_3.s: Likewise.
161 * testsuite/split_x32_4.s: Likewise.
162 * testsuite/split_x32_n.s: Likewise.
163 * configure: Regenerated.
164 * testsuite/Makefile.in: Likewise.
165
e749cab8
L
1662015-01-06 H.J. Lu <hongjiu.lu@intel.com>
167
168 PR gold/17809
169 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
170 x32.
171
af759df0
AM
1722015-01-02 Alan Modra <amodra@gmail.com>
173
174 * version.cc (print_version): Just print current year.
175 * dwp.cc (print_version): Likewise.
176
b90efa5b
AM
1772015-01-01 Alan Modra <amodra@gmail.com>
178
179 Update year range in copyright notice of all files.
180
f12d1e8a
AM
1812014-12-25 Alan Modra <amodra@gmail.com>
182
183 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
184 new enums.
185 (Target_arm::merge_object_attributes, ): Likewise.
186
5c294fee
TG
1872014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
188
189 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
190 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
191 AEABI_VFP_args_vfp to check that.
192 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
193 value and replace hardcoded values by enum values.
194
e30880c2
CC
1952014-12-22 Cary Coutant <ccoutant@google.com>
196
197 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
198
bd040da1
L
1992014-12-20 H.J. Lu <hongjiu.lu@intel.com>
200
201 PR gold/14608
202 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
203 to "return i * i * 3;".
204
e02a4046
CC
2052014-12-16 Cary Coutant <ccoutant@google.com>
206
207 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
208 (Mapfile::print_output_data): Use current_data_size() to avoid
209 assert for sections requiring postprocessing; if address is not valid,
210 print 0.
211 (Mapfile::print_output_section): Use current_data_size(); print note
212 that addresses and sizes are before compression.
213
add6016b
L
2142014-12-14 H.J. Lu <hongjiu.lu@intel.com>
215
216 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
217 Cast current_group_size to unsigned long when reporting error.
218
0bf32ea9
JY
2192014-12-10 Jing Yu <jingyu@google.com>
220
221 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
222 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
223 Update error message.
224 (Target_aarch64::do_relax): Use absolute value of option
225 stub_group_size. Replace local variable with class member
226 stub_group_size_.
227
cbcb23fa
AM
2282014-12-04 Alan Modra <amodra@gmail.com>
229
230 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
231 addend of PLTREL24 reloc when not generating a plt stub. Make
232 max_branch_offset an "Address".
fbad6518 233 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
234 (Target_powerpc::Relocate::relocate): Likewise.
235
1611bc4a
AM
2362014-12-04 Alan Modra <amodra@gmail.com>
237
238 PR 17670
239 * symtab.cc (Symbol::set_undefined): Remove assertion.
240 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
241 on symbols defined in discarded sections, instead return false.
242 Rearrange params, update all callers.
243 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
244 branches to syms in discarded sections.
245 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
246 undefined and flag as discarded.
247 (Target_powerpc::Relocate::relocate): Localize variable.
248
4759c34e
L
2492014-12-03 H.J. Lu <hongjiu.lu@intel.com>
250
251 PR gold/17675
252 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
253 * testsuite/Makefile.in: Regenerated.
254
1f98a074
AM
2552014-12-03 Alan Modra <amodra@gmail.com>
256
257 PR 17566
258 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
259 when adding dynamic relocations against section symbols.
260
fb257835
DI
2612014-12-01 Dimitry Ivanov <dimitry@google.com>
262
263 * layout.cc (Layout::finish_dynamic_section): When '-z global'
264 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
265 * options.h (General_options): New -z option (global).
266
d8e60314
CC
2672014-12-01 Cary Coutant <ccoutant@google.com>
268
269 PR gold/17578
270 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
271 is given.
272 (Layout::create_executable_stack_info): Warn when -z noexecstack is
273 given but some inputs require executable stack.
274
982bbd97
CC
2752014-11-26 Cary Coutant <ccoutant@google.com>
276
277 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
278 .debug_str_offsets; strip .debug_gnu_pubnames and
279 .debug_gnu_pubtypes.
280 (lines_only_debug_sections): Strip all four new sections.
281
bb779192
HS
2822014-11-26 Jing Yu <jingyu@google.com>
283
284 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
285 register to be x0 when to relax TLSDESC_LD64_LO12.
286
a3e60ddb
AM
2872014-11-26 Alan Modra <amodra@gmail.com>
288
289 * powerpc.cc (struct Stub_table_owner): New.
290 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
291 unsigned int vector. Update all references.
292 (powerpc_relobj::set_stub_table): Take an unsigned int param
293 rather than a Stub_table. Update callers.
294 (Powerpc_relobj::clear_stub_table): New function.
295 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
296 stub_group_size_ vars.
297 (Target_powerpc::new_stub_table): Delete.
298 (max_branch_delta): New function, extracted from..
299 (Target_powerpc::Relocate::relocate): ..here..
300 (Target_powerpc::Branch_info::make_stub): ..and here. Return
301 status on whether stub created successfully.
302 (Stub_control::Stub_control): Add "no_size_errors" param. Move
303 default sizing to..
304 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
305 reduce on relax failure.
306 (Target_powerpc::group_sections): Add "no_size_errors" param.
307 Use stub_group_size_. Set up group info in a temp vector,
308 before building Stub_table vector. Account for input sections
309 possibly already converted to relaxed sections.
310 (Stub_table::init): Delete. Merge into..
311 (Stub_table::Stub_table): ..here.
312 (Stub_table::can_reach_stub): New function.
313 (Stub_table::add_plt_call_entry): Add "from" parameter and
314 return true iff stub could be reached.
315 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
316 param too.
317 (Stub_table::clear_stubs): Add "all" param.
318
a20605cf
AM
3192014-11-26 Alan Modra <amodra@gmail.com>
320
321 * powerpc.cc (Stub_control::set_output_and_owner): New function.
322 (Target_powerpc::group_sections): Use it.
323
43b64deb
CC
3242014-11-25 Cary Coutant <ccoutant@google.com>
325
326 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
327 (Binary_to_elf::write_symbol): Add st_size parameter.
328 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
329
c924eb67
CC
3302014-11-25 Cary Coutant <ccoutant@google.com>
331
332 PR gold/17639
333 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
334 (Sized_relobj_file::do_layout): Handle deferred sections properly
335 during GC pass 1. Don't add reloc sections to deferred list twice.
336 * object.h (Sized_relobj_file::is_deferred_layout): New function.
337 (Sized_relobj_file::is_deferred_layout_): New data member.
338
9d585188
L
3392014-11-21 H.J. Lu <hongjiu.lu@intel.com>
340
341 PR gold/17619
342 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
343 Check PC-relative offset overflow in PLT entry.
344
3ffaac20
AM
3452014-11-21 Alan Modra <amodra@gmail.com>
346
347 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
348 for undefined weaks.
349
0cfb0717
AM
3502014-11-20 Alan Modra <amodra@gmail.com>
351
352 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
353 from --stub-group-size parameter divided by 1024.
354 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
355 template parameter. Update all uses.
356 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
357 has_stub_value. Set for long branches. Don't report overflow for
358 branch to undefined weak symbols. Print info message on
359 overflowing branch to stub.
360
f9dffbf0
AM
3612014-11-20 Alan Modra <amodra@gmail.com>
362
363 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
364
e88ba8d5
L
3652014-11-13 H.J. Lu <hongjiu.lu@intel.com>
366
367 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
368 entry for R_X86_64_GOTPLT64.
369 (Target_x86_64<size>::Relocate::relocate): Update comments for
370 R_X86_64_GOTPLT64.
371
d37ffe25
ED
3722014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
373
374 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
375 * plugin.h: add lock definition
376
9726c3c1
HS
3772014-10-29 Han Shen <shenhan@google.com>
378 Jing Yu <jingyu@google.com>
379
380 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
381 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
382 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
383 Symbol::TLS_REF.
384 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
385 method.
386 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
387 (Target_aarch64::tls_ld_to_le): New method.
388 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
389 for 64bit targets.
390 (Output_data_plt_aarch64::irelative_rel_): New data member.
391 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
392 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
393 (Output_data_plt_aarch64::add_relocation): New method.
394 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
395 offset. Add got_irelative size to got size.
396 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
397 type string with the new typename.
398 (AArch64_relocate_functions::update_adr): Replace parameter x with
399 immed.
400 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
401 (AArch64_relocate_functions::reloc_common): New method.
402 (AArch64_relocate_funcsions::rela_general): Extract common part out
403 into reloc_common method.
404 (AArch64_relocate_functions::rela_general): Likewise.
405 (AArch64_relocate_functions::pcrela_general): Likewise.
406 (AArch64_relocate_functions::adr): New method.
407 (AArch64_relocate_functions::adrp): Calculate immed before calling
408 update_adr.
409 (AArch64_relocate_functions::adrp): Likewise.
410 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
411 comparing x to 0. Calculate immed from ~x when x < 0.
412 (Target_aarch64::optimize_tls_reloc): Add new cases for
413 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
414 TLSLD_MOVW_DTPREL_G0_NC.
415 (Target_aarch64::possible_function_pointer_reloc): Implement this
416 method.
417 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
418 comment.
419 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
420 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
421 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
422 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
423 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
424 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
425 (Target_aarch64::make_plt_entry): Call add_entry with two more
426 parameters.
427 (Target_aarch64::make_local_ifunc_plt_entry): New method.
428 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
429 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
430 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
431 (Target_aarch64::Relocate::relocate_tls): Add cases for
432 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
433 TLSLD_MOVW_DTPREL_G0_NC.
434 * testsuite/icf_safe_so_test.cc: Correct test comment.
435 * testsuite/icf_safe_test.sh: Add AArch64 arch.
436
80272b8c
AM
4372014-10-22 Alan Modra <amodra@gmail.com>
438
439 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
440 thread_starter.
441
998a69f4
AS
4422014-10-18 Andreas Schwab <schwab@linux-m68k.org>
443
444 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
445
aed56ec5
CC
4462014-10-17 Cary Coutant <ccoutant@google.com>
447
448 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
449 Add "typename" keyword.
450
bb779192 4512014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
452 Jing Yu <jingyu@google.com>
453
454 Patch for gold aarch64 backend to support relaxation.
455 * aarch64-reloc.def: Change format.
456 * aarch64.cc (class Reloc_stub): New class.
457 (class Stub_table): New class.
458 (class AArch64_relobj): New class.
459 (class AArch64_input_section): New class.
460 (class AArch64_output_section): New class.
461 (Target_aarch64::new_stub_table): New method.
462 (Target_aarch64::new_aarch64_input_section): New method.
463 (Target_aarch64::find_aarch64_input_section): New method.
464 (Target_aarch64::scan_section_for_stubs): New method.
465 (Target_aarch64::scan_reloc_section_for_stubs): New method.
466 (Target_aarch64::relocate_stub): New method.
467 (Target_aarch64::current_target): New method.
468 (Target_aarch64::do_make_elf_object): New method.
469 (Target_aarch64::do_may_relax): New method.
470 (Target_aarch64::do_relax): New method.
471 (Target_aarch64::group_sections): New method.
472 (Target_aarch64::scan_reloc_for_stub): New method.
473 (Target_aarch64::do_make_output_section): New method.
474 (Target_aarch64::stub_tables_): New data member.
475 (Target_aarch64::aarch64_input_section_map_): New data member.
476 (AArch64_relocate_functions::maybe_apply_stub): New method.
477
db4c9594
CC
4782014-09-30 Cary Coutant <ccoutant@google.com>
479
480 PR gold/17432
481 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
482
cd6da036
KC
4832014-09-30 Kito Cheng <kito@0xlab.org>
484
485 PR gold/13597
486 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
487 hash table before sysv-style hash table.
488
5f772412
ST
4892014-09-29 Sriraman Tallam <tmsriram@google.com>
490
491 * options.h (--pic-executable): Add negative to alias to -no-pie.
492
5efeedf6
CC
4932014-09-26 Cary Coutant <ccoutant@google.com>
494
495 PR gold/16773
496 * object.cc (Sized_relobj_file): Compute value of section symbols
497 for TLS sections the same as TLS symbols.
498
1707f183
CC
4992014-09-25 Cary Coutant <ccoutant@google.com>
500
501 PR gold/17432
502 * resolve.cc (Symbol_table::resolve): Override common placeholder
503 symbols, but adjust sizes.
504 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
505 symbols to common lists.
506
00cac886
AM
5072014-09-24 Alan Modra <amodra@gmail.com>
508
509 * po/POTFILES.in: Regenerate.
510
635aa30e
CC
5112014-09-23 Taiju Tsuiki <tzik@google.com>
512 Cary Coutant <ccoutant@google.com>
513
71b9b91b 514 PR gold/14860
635aa30e
CC
515 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
516 on input_sections_blocker.
517 * layout.cc (Write_sections_task::locks): Unblock
518 input_sections_blocker_.
519 * layout.h (Write_sections_task::Write_sections_task): Add
520 input_sections_blocker.
521 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
522 to DEPENDENCIES.
523 * testsuite/Makefile.in: Regenerate.
524
c0c71592
RÁE
5252014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
526
527 * testsuite/Makefile.am (plugin_test_10): New test.
528 * testsuite/Makefile.in: Regenerate
529 * testsuite/plugin_common_test_2.c (c1): Align to 8.
530 * testsuite/plugin_test_10.sh: New file.
531
6168c2a1
RÁE
5322014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
533
534 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
535 * resolve.cc (Symbol_table::resolve): Don't override common symbols
536 during the replacement phase.
537
3a531937
JY
5382014-09-17 Han Shen <shenhan@google.com>
539 Jing Yu <jingyu@google.com>
540
541 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
542 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
543 * aarch64.cc (Target_aarch64): Add data members
544 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
545 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
546 constructor.
547 (Target_aarch64::do_reloc_symbol_index): New method.
548 (Target_aarch64::do_reloc_addend): New method.
549 (Target_aarch64::add_tlsdesc_info): New method.
550 (Target_aarch64::do_dynsym_value): New method.
551 (Target_aarch64::do_make_data_plt): Add new parameters: got,
552 got_irelative. Pass them to Output_data_plt_aarch64_standard.
553 (Target_aarch64::make_data_plt): Add new parameters: got,
554 got_irelative. Pass them to do_make_data_plt.
555 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
556 (Target_aarch64::Relocate:tls_gd_to_le): New method.
557 (Target_aarch64::Relocate:tls_ie_to_le): New method.
558 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
559 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
560 (Target_aarch64::got_tlsdesc_section): New method.
561 (Target_aarch64::make_local_ifunc_plt_entry): New method.
562 (Target_aarch64::define_tls_base_symbol): New method.
563 (Target_aarch64::reserve_tlsdesc_entries): New method.
564 (Target_aarch64::got_mod_index_entry): New method.
565 (Target_aarch64::rela_tlsdesc_section): New method.
566 (Target_aarch64::rela_irelative_section): New method.
567 (Target_aarch64::Tlsdesc_info): New struct.
568 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
569 relocations and tlsdesc relocations.
570 (Target_aarch64::optimize_tls_reloc): Implement method.
571 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
572 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
573 in constructor.
574 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
575 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
576 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
577 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
578 (Output_data_plt_aarch64::rela_tlsdesc): New method.
579 (Output_data_plt_aarch64::rela_irelative): New method.
580 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
581 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
582 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
583 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
584 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
585 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
586 (Output_data_plt_aarch64_standard): New member variables:
587 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
588 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
589 New parameter: got, got_irelative.
590 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
591 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
592 (Output_data_plt_aarch64::do_write): Replace got_address with
593 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
594 (AArch64_relocate_functions::update_movnz): New method.
595 (AArch64_relocate_functions): Correct format.
596 (AArch64_relocate_functions::movnz): New method.
597 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
598 before the switch. Add new cases to switch.
00cac886 599 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
600 tlsgd tlsdesc cases.
601 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
602 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
603 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
604 Call reloc_name_in_error_message to print unsupported reloc.
605 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
606 make_data_plt.
607 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
608 relocs. Fill in some more dynamic tags.
609 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
610 Skip call tls_get_addr when tlsgd is relaxed.
611 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
612 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
613 tlsdesc->ie relaxation.
614
62661c93
SS
6152014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
616
617 * mips.cc (Target_mips_nacl): New class.
618 (Target_selector_mips_nacl): New class.
619 (target_selector_mips32): Rename from target_selector_mips32be and use
620 Target_selector_mips_nacl instead of Target_selector_mips.
621 (target_selector_mips32el): Rename from target_selector_mips32 and use
622 Target_selector_mips_nacl instead of Target_selector_mips.
623 (target_selector_mips64): Rename from target_selector_mips64be and use
624 Target_selector_mips_nacl instead of Target_selector_mips.
625 (target_selector_mips64el): Rename from target_selector_mips64 and use
626 Target_selector_mips_nacl instead of Target_selector_mips.
627 (Target_mips::mips_info): Add const attribute.
628
54674d38
CC
6292014-09-02 Cary Coutant <ccoutant@google.com>
630
631 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
632 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
633 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
634 (Sized_incr_dynobj::do_section_name): Likewise.
635 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
636 (Sized_incr_dynobj::do_section_name): Likewise.
637 * object.h (Object::section_name): Likewise.
638 (Object::do_section_name): Likewise.
639 (Sized_relobj_file::do_section_name): Likewise.
640 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
641 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
642
9860cbcf
CC
6432014-09-02 Cary Coutant <ccoutant@google.com>
644
645 PR gold/17005
646 * ehframe.cc (Fde::write): Add output_offset parameter.
647 (Cie::write): Likewise.
648 (Eh_frame::set_final_data_size): Account for offset within output
649 section.
650 (Eh_frame::do_sized_write): Likewise.
651 * ehframe.h (Fde::write): Add output_offset parameter.
652 (Cie::write): Likewise.
653 * output.cc (Output_section::Input_section_sort_entry): Remove
654 section_has_name_; add output_section_name parameter. Use
655 output section name for non-input sections.
656 (Output_section::Input_section_sort_entry::section_has_name): Remove.
657 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
658 (Output_section::Input_section_sort_compare): Remove logic for
659 sections without names.
660 (Output_section::Input_section_sort_init_fini_compare): Likewise.
661 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
662 Likewise.
663 (Output_section::Input_section_sort_section_name_compare): Likewise.
664
8e33481e
HS
6652014-08-29 Han Shen <shenhan@google.com>
666 Jing Yu <jingyu@google.com>
667
668 * aarch64-reloc-property.cc
669 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
670 reference reloc property in the table.
671 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
672 3 other entries.
673 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
674 2 new overloaded methods.
675 (Output_data_got_aarch64::do_write): Add code to write out
676 static relocs.
677 (class Output_data_got_aarch64::Static_reloc): New class to wrap
678 static relocs.
679 (Output_data_got_aarch64::static_relocs): New vector to
680 hold static relocs.
681 (Target_aarch64::TCB_SIZE): New const static memeber.
682 (Target_aarch64::tcb_size): New method.
683 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
684 (Target_aarch64::Relocate::relocate_tls): New method.
685 (Target_aarch64::Scan::local): Add code handling new reloc types.
686 (Target_aarch64::Scan::global): Add code handling new reloc types.
687
81233653
ST
6882014-08-13 Sriraman Tallam <tmsriram@google.com>
689
690 * options.h (-no-pie): Add option.
691
9363c7c3
JY
6922014-08-08 Jing Yu <jingyu@google.com>
693 Han Shen <shenhan@google.com>
694
695 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
696 (DEFFILES): add aarch64-reloc.def.
697 (TARGETSOURCES): Add aarch64-reloc-property.cc.
698 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
699 * Makefile.in: Regenerate.
700 * aarch64-reloc-property.cc: New file.
701 * aarch64-reloc-property.h: New file.
702 * aarch64-reloc.def: New file.
703 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
704 with tab to make the format consistent.
705 (Output_data_got_aarch64::symbol_table_): New method.
706 (Target_aarch64::do_plt_address_for_global): New method.
707 (Target_aarch64::do_plt_address_for_local): New method.
708 (Target_aarch64::do_select_as_default_target): New method.
709 (Target_aarch64::do_make_data_plt): New method.
710 (Target_aarch64::make_data_plt): New method.
711 (Output_data_plt_aarch64::has_irelative_section): New method.
712 (Output_data_plt_aarch64::address_for_global): New method.
713 (Output_data_plt_aarch64::address_for_local): New method.
714 (Output_data_plt_aarch64::irelative_rel_): New parameter.
715 (Output_data_plt_aarch64::add_entry): Implement contents.
716 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
717 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
718 the got_pov entry to plt0.
719 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
720 Implement contents.
721 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
722 (AArch64_howto): New struct.
723 (aarch64_howto[]): New static const array.
724 (AArch64_relocate_functions): New class.
725 (Target_aarch64::Scan::get_reference_flags): Remove method.
726 (Target_aarch64::Scan::local): Implement to support a few relocations.
727 (Target_aarch64::Scan::global): Implement to support a few relocations.
728 (Target_aarch64::make_plt_section): Implement contents.
729 (Target_aarch64::make_plt_entry): Implement contents.
730 (Target_aarch64::do_finalize_sections): Implement contents.
731 (Target_aarch64::Relocate::relocate): Implement a few relocations.
732 (Target_aarch64::relocate_section): Implement contents.
733
ad9fe6c1
AM
7342014-08-06 Alan Modra <amodra@gmail.com>
735
736 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
737
7cd4e5b7
AM
7382014-08-06 Alan Modra <amodra@gmail.com>
739
740 PR 13227
741 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
742
5ad9b0a7
ST
7432014-07-21 Sriraman Tallam <tmsriram@google.com>
744
745 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 746 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 747
e051745c
CC
7482014-07-08 Cary Coutant <ccoutant@google.com>
749
750 * expression.cc (struct Expression::Expression_eval_info): Add
751 new fields type_pointer, vis_pointer, and nonvis_pointer.
752 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
753 nonvis_pointer parameters. Adjust all calls.
754 (Symbol_expression::value): Update type, visibility, and nonvis bits
755 in caller.
756 * script.cc (Symbol_assignment::sized_finalize): Update type,
757 visibility, and remaining st_other bits for new symbol.
758 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
759 vis_pointer, and nonvis_pointer parameters.
760 * symtab.h (Symbol::set_type): New method.
761
762 * testsuite/Makefile.am (defsym_test): New test.
763 * testsuite/Makefile.in: Regenerate.
764 * testsuite/defsym_test.c: New file.
765 * testsuite/defsym_test.sh: New file.
766
f35c4853
CC
7672014-07-08 Cary Coutant <ccoutant@google.com>
768
769 PR gold/15639
770 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
771 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
772 (Sized_dynobj::base_read_symbols): ...new method.
773 * object.h (Sized_relobj_file::base_read_symbols): New method.
774 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
775 (Sized_relobj_file::base_read_symbols): ...new method.
776 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
777 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
778 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
779
2900af2d
AM
7802014-07-04 Alan Modra <amodra@gmail.com>
781
782 * po/POTFILES.in: Regenerate.
783
053a4d68
JY
7842014-07-02 Jing Yu <jingyu@google.com>
785
786 * aarch64.cc: New file
787 * Makefile.am (TARGETSOURCES): Add aarch64.cc
788 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
789 * Makefile.in: Regenerate.
790 * configure.tgt: Add entries for aarch64*.
791 * configure.ac: Likewise.
792 * configure: Likewise.
793
7b549045
AM
7942014-06-27 Alan Modra <amodra@gmail.com>
795
796 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
797
cb818dbf
CC
7982014-06-24 Cary Coutant <ccoutant@google.com>
799
800 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
801 sections.
802 (Dwo_file::sized_read_unit_index): Likewise.
803
9810d34d
SS
8042014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
805
806 * mips.cc: New file.
807 * Makefile.am (TARGETSOURCES): Add mips.cc
808 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
809 * configure.tgt: Add entries for mips*.
810 * configure.ac: Likewise.
811 * Makefile.in: Regenerate.
812 * configure: Likewise.
813
9baa787b
CC
8142014-06-09 Cary Coutant <ccoutant@google.com>
815
816 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
817 unit_length is within section bounds.
818
8f89af0a
CC
8192014-06-09 Cary Coutant <ccoutant@google.com>
820
821 PR gold/16980
822 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
823 map.
824
a47622ac
AM
8252014-06-07 Alan Modra <amodra@gmail.com>
826
827 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
828
4320c691
CC
8292014-06-06 Cary Coutant <ccoutant@google.com>
830
831 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
832 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
833 (Dwarf_pubnames_table::read_header): Likewise.
834 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
835 .debug_gnu_pubtypes.
836
270c9937
JB
8372014-06-05 Joel Brobecker <brobecker@adacore.com>
838
839 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
840 * Makefile.in, configure: Regenerate.
841
397998fc
AM
8422014-06-03 Alan Modra <amodra@gmail.com>
843
844 * powerpc.cc (addis_12_2): Define.
845 (Stub_table::do_write): Support fusion on ELFv2 stubs.
846
61f5c66f
AM
8472014-06-03 Alan Modra <amodra@gmail.com>
848
849 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
850 st_other output.
851
f6971787
AM
8522014-06-02 Alan Modra <amodra@gmail.com>
853
854 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
855 Only ignore relocs on ELFv1.
856 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
857
f6fb8322
CC
8582014-05-30 Cary Coutant <ccoutant@google.com>
859
860 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
861 * testsuite/Makefile.in: Regenerate.
862 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
863
c23dd342
L
8642014-05-27 H.J. Lu <hongjiu.lu@intel.com>
865
866 PR gold/16945
867 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
868 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
869
5fe7ffdc
AM
8702014-05-15 Alan Modra <amodra@gmail.com>
871
872 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
873 Compare FDE contents with DW_CFA_nop rather than 0.
874
a82bef93
ST
8752014-05-13 Sriraman Tallam <tmsriram@google.com>
876
877 * symtab.h (may_need_copy_reloc): Remove check for position independent
878 code.
879 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
880 position independence before pc absolute may_need_copy_reloc call.
881 Add check for executable output befor pc relative may_need_copy_reloc
882 call.
883 * i386.cc: Ditto.
884 * arm.cc: Ditto.
885 * sparc.cc: Ditto.
886 * tilegx.cc: Ditto.
887 * powerpc.cc: Add check for no position independence before
888 may_need_copy_reloc calls.
889 * testsuite/pie_copyrelocs_test.cc: New file.
890 * testsuite/pie_copyrelocs_shared_test.cc: New file.
891 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 892 * Makefile.in: Regenerate.
a82bef93 893
53c66605
ML
8942014-05-08 Martin Liška <mliska@suse.cz>
895
896 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
897
57b2284c
CC
8982014-05-06 Cary Coutant <ccoutant@google.com>
899
900 PR gold/16900
901 * i386.cc (Output_data_got_plt_i386): New class.
902 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
903 parameter. Change all callers.
904 (Output_data_plt_i386::layout_): Remove.
905 (Output_data_plt_i386::got_plt_): Change type.
906 (Target_i386::got_plt_): Change type. Change all references.
907 (Target_i386::got_section): Create instance of new class.
908 (Output_data_got_plt_i386::do_write): New function.
909 * x86_64.cc (Output_data_got_plt_x86_64): New class.
910 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
911 parameter. Change all callers.
912 (Output_data_plt_x86_64::layout_): Remove.
913 (Output_data_plt_x86_64::got_plt_): Change type.
914 (Target_x86_64::got_plt_): Change type. Change all references.
915 (Target_x86_64::got_section): Create instance of new class.
916 (Output_data_got_plt_x86_64::do_write): New function.
917 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
918 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
919 class.
920
6b97515d 9212014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 922
6b97515d
CC
923 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
924 if we have pubnames/pubtypes.
925
d1bddd3c
CC
9262014-05-02 Cary Coutant <ccoutant@google.com>
927
5fe7ffdc
AM
928 * defstd.cc (in_segment): Define __ehdr_start here...
929 * layout.cc (Layout::finalize): ...Instead of here. Set the
930 output segment when known.
931 * resolve.cc (Symbol::override_base_with_special): Remember
932 the original binding.
933 * symtab.cc (Symbol::set_output_segment): New function.
934 (Symbol::set_undefined): New function.
935 * symtab.h (Symbol::is_weak_undefined): Check original undef
936 binding.
937 (Symbol::is_strong_undefined): New function.
938 (Symbol::set_output_segment): New function.
939 (Symbol::set_undefined): New function.
940 * target-reloc.h (is_strong_undefined): Remove.
941 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
942 Check for hidden undefs.
943 (relocate_section): Call Symbol::is_strong_undefined.
944
945 * testsuite/Makefile.am (ehdr_start_test_1)
946 (ehdr_start_test_2, ehdr_start_test_3)
947 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
948 * testsuite/Makefile.in: Regenerate.
949 * testsuite/ehdr_start_def.cc: New source file.
950 * testsuite/ehdr_start_test.cc: New source file.
951 * testsuite/ehdr_start_test.t: New linker script.
952 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 953
7849f6d8
CC
9542014-04-23 Cary Coutant <ccoutant@google.com>
955
bf2cc635 956 PR gold/16870
7849f6d8
CC
957 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
958
99fd8cff
CC
9592014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
960
961 * layout.cc (Layout::include_section): Allow a target to decide
962 whether to include a section.
963 * target.h (Target::should_include_section): New function.
964 (Target::do_should_include_section): New function.
965
91f43acd
CC
9662014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
967
968 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
969 inline into ...
970 (Copy_relocs::emit): ... here.
971 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
972 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
973 (Copy_reloc_entry::entries_): Change from private to protected.
974
c4eb27e1
ST
9752014-04-02 Sriraman Tallam <tmsriram@google.com>
976
977 * icf.cc (get_section_contents): Replace copies of reloc
978 vectors with const references.
979
ae447ddd
CC
9802014-04-02 Cary Coutant <ccoutant@google.com>
981
982 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
983 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
984 * configure: Regenerate.
985 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
986 -fno-use-linker-plugin.
987 (LINK1, CXXLINK1): Add it to the link command.
988 * testsuite/Makefile.in: Regenerate.
989
fa47fa92
AM
9902014-03-12 Alan Modra <amodra@gmail.com>
991
992 * Makefile.in: Regenerate.
993
9b12c500
CC
9942014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
995
996 * symtab.h (Symbol::set_nonvis): New function.
997
beacaa96
CC
9982014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
999
1000 * symtab.cc (Sized_symbol<32>::init_output_data):
1001 Instantiate the template.
1002 (Sized_symbol<64>::init_output_data): Likewise.
1003
800d9823
CC
10042014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1005
1006 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1007 adjust dynamic symbol value.
1008 * target.h (Target::adjust_dyn_symbol): New function.
1009 (Target::do_adjust_dyn_symbol): New function.
1010
918fc1f8 10112014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 1012
918fc1f8
CC
1013 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1014 Get the value of DYNAMIC_CUSTOM dynamic entry.
1015 * output.h (Output_data_dynamic::add_custom): New function.
1016 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1017 dynamic entry.
1018 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1019 * target.h (Target::dynamic_tag_custom_value): New function.
1020 (Target::do_dynamic_tag_custom_value): New function.
1021
98ff9231
CC
10222014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1023
1024 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1025 dynsym indexes.
1026 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1027 (Target::do_has_custom_set_dynsym_indexes): New function.
1028 (Target::set_dynsym_indexes): New function.
1029 (Target::do_set_dynsym_indexes): New function.
1030
b80eed39
AM
10312014-03-07 Alan Modra <amodra@gmail.com>
1032
1033 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1034 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1035 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1036 (Powerpc_relocate_functions::has_overflow_bitfield,
1037 overflowed): Use the above.
1038 (Target_powerpc::Relocate::relocate): Correct overflow checking
1039 for a number of relocations. Modify overflow test for 16-bit
1040 fields in instructions to signed/unsigned according to whether
1041 the field takes a signed or unsigned value.
1042
4b95cf5c
AM
10432014-03-05 Alan Modra <amodra@gmail.com>
1044
1045 Update copyright years.
1046
45965137
AM
10472014-03-05 Alan Modra <amodra@gmail.com>
1048
1049 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1050 R_PPC64_ADDR64_LOCAL.
1051 (Target_powerpc::Relocate::relocate): Likewise.
1052
2c80b753
AM
10532014-03-03 Alan Modra <amodra@gmail.com>
1054
1055 * dwp.cc (print_version): Update copyright year to current.
1056
c1c69e83
AM
10572014-02-10 Alan Modra <amodra@gmail.com>
1058
1059 * po/gold.pot: Regenerate.
1060
dd0c4e70
CC
10612014-02-06 Cary Coutant <ccoutant@google.com>
1062
1063 Fix problem where -u is ignored when a weak undef is seen.
1064
1065 * archive.cc (Library_base::should_include_member): Reorder
1066 code to check for -u option if a weak undef has already been seen.
1067 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1068 * testsuite/Makefile.in: Regenerate.
1069 * testsuite/weak_undef_file3.cc: New file.
1070 * testsuite/weak_undef_file4.cc: New file.
1071 * testsuite/weak_undef_test_2.cc: New file.
1072
1a221d3d
CC
10732014-02-05 Cary Coutant <ccoutant@google.com>
1074
1075 Fix issues with gold undefined symbol diagnostics.
1076
1077 PR binutils/15435
1078 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1079 check to here.
1080 * target-reloc.h (is_strong_undefined): New function.
1081 (relocate_section): Move undef vtable symbol check from here.
1082 Check for is_strong_undefined.
1083
e889f0a4 10842014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1085
e889f0a4
CC
1086 Fix problems with the --dynamic-list option.
1087
1088 PR gold/13577
1089 * options.cc (General_options::parse_dynamic_list):
1090 Set have_dynamic_list_.
1091 (General_options::General_options): Initialize have_dynamic_list_.
1092 (General_options::finalize): Turn off -Bsymbolic and
1093 -Bsymbolic-functions if --dynamic-list provided.
1094 * options.h (General_options::have_dynamic_list): New function.
1095 (General_options::have_dynamic_list_): New data member.
1096 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
1097 correctly.
5fe7ffdc 1098
e889f0a4
CC
1099 PR gold/16530
1100 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
1101 in --dynamic-list, mark it.
5fe7ffdc 1102
e889f0a4
CC
1103 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
1104 (dynamic_list_2): New test case.
1105 * testsuite/Makefile.in: Regenerate.
1106 * testsuite/dynamic_list_2.cc: New file.
1107 * testsuite/dynamic_list_2.t: New file.
1108 * testsuite/dynamic_list_lib1.cc: New file.
1109 * testsuite/dynamic_list_lib2.cc: New file.
1110 * testsuite/gc_dynamic_list_test.c: New file.
1111 * testsuite/gc_dynamic_list_test.sh: New file.
1112 * testsuite/gc_dynamic_list_test.t: New file.
1113
ec673e64
CC
11142014-01-28 Cary Coutant <ccoutant@google.com>
1115
1116 Add .gdb_index version 7 support.
1117
1118 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1119 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1120 debug sections.
1121 (Dwarf_ranges_table::read_ranges_table): Likewise.
1122 (Dwarf_pubnames_table::read_section): Check for GNU-style
1123 sections, and for compressed debug sections.
1124 (Dwarf_pubnames_table::read_header): Compute end address of table.
1125 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1126 for end of list by offset, not by offset == 0.
1127 (Dwarf_info_reader::do_read_string_table): Check for compressed
1128 debug sections.
1129 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1130 Initialize new data members.
1131 (Dwarf_pubnames_table::next_name): return flag_byte.
1132 (Dwarf_pubnames_table::end_of_table_): New data member.
1133 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1134 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1135 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1136 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1137 read skeleton type unit DIEs.
1138 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1139 (Gdb_index::do_write): Write flag_byte.
1140 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1141 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1142 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1143 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1144
221fd5d5
L
11452014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1146
1147 * version.cc (print_version): Update copyright year to 2014.
1148
6c09fb0b
ILT
11492013-12-19 Dimitry Andric <dimitry@andric.com>
1150
1151 * stringpool.cc (Stringpool_template::reserve): Add
1152 HAVE_UNORDERED_MAP case.
1153 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1154
8356f2d0
CC
11552013-12-18 Cary Coutant <ccoutant@google.com>
1156
1157 * configure.ac: Check for <unordered_set> and <unordered_map>.
1158 * config.in: Regenerate.
1159 * configure: Regenerate.
1160 * system.h: Use <unordered_set> and <unordered_map> if available.
1161
f2c7d7ee
RM
11622013-12-10 Roland McGrath <mcgrathr@google.com>
1163
1164 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1165 with $(INSTALL_PROGRAM_ENV).
1166 * Makefile.in: Regenerate.
1167
6632e8cc
CC
11682013-11-22 Cary Coutant <ccoutant@google.com>
1169
1170 * configure.ac: Add check for which library is needed for
1171 dlopen.
1172 * configure: Regenerate.
1173
0c075858
CC
11742013-11-22 Cary Coutant <ccoutant@google.com>
1175
1176 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1177 assembler.
1178 * testsuite/Makefile.in: Regenerate.
1179
f49fe902
L
11802013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1181
1182 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1183 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1184 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1185 (Target_x86_64<size>::Scan::local): Likewise.
1186 (Target_x86_64<size>::Scan::global): Likewise.
1187 (Target_x86_64<size>::Relocate::relocate): Likewise.
1188 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1189 Likewise.
1190 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1191 R_X86_64_PC32_BND.
1192
1193 * testsuite/Makefile.am (check_PROGRAMS): Add
1194 exception_x86_64_bnd_test.
1195 (exception_x86_64_bnd_test_SOURCES): New macro.
1196 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1197 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1198 (exception_x86_64_bnd_test_LDADD): Likewise.
1199 (exception_x86_64_bnd_1.o): New rule.
1200 (exception_x86_64_bnd_2.o): Likewise.
1201 * testsuite/Makefile.in: Regenerated.
1202
9055360d
AM
12032013-11-15 Alan Modra <amodra@gmail.com>
1204
1205 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1206 accessor.
1207 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1208 Only call ppc64_local_entry_offset for 64-bit. Restrict
1209 symval_for_branch lookup to ELFv1.
1210 (Stub_table::add_plt_call_entry): Use unsigned int off.
1211 (Output_data_glink::Address, invalid_address): New.
1212 (Output_data_glink::add_eh_frame): Move out of line. Add
1213 support for ELFv2.
1214 (Output_data_glink::add_global_entry, find_global_entry,
1215 global_entry_address): New functions.
1216 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1217 ge_size): New variables.
1218 (Output_data_glink::set_final_data_size): Add global entry
1219 stub sizing.
1220 (Output_data_glink::do_write): Write global entry stubs.
1221 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1222 parameter. Return true for ELFv2. Adjust callers.
1223 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1224 ELFv1. Similarly for ifunc and dynamic relocation processing
1225 specific to ELFv1. Recognize that symbols are defined on
1226 their plt entries for ELFv2.
1227 (Target_powerpc::symval_for_branch): Assert if called for
1228 ELFv2 or ppc32.
1229 (Target_powerpc::Relocate::relocate): Use global entry plt
1230 stub for symbol value if such exists on ELFv2.
1231 (Target_powerpc::Relocate::relocate): Don't call
1232 symval_for_branch when ELFv2. Do adjust for local entry
1233 offset when ELFv2.
1234 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1235 plt stub for ELFv2.
1236 (Target_powerpc::do_plt_address_for_global): Similarly.
1237
cafdd569
CC
12382013-11-14 Cary Coutant <ccoutant@google.com>
1239
1240 Revert patch -- this did not fix the problem, and there is
1241 no race there.
1242
1243 2013-11-14 Cary Coutant <ccoutant@google.com>
1244
1245 PR gold/14860
1246 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1247 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1248 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1249 updating fde_offsets_.
1250 (Eh_frame_hdr::lock_): New data member.
1251
94e49e16
CC
12522013-11-14 Cary Coutant <ccoutant@google.com>
1253
1254 * dwp.cc (Dwo_file_entry): New type.
1255 (File_list): Use Dwo_file_entry.
1256 (Dwo_file::verify): New function.
1257 (Dwo_file::verify_dwo_list): New function.
1258 (Dwo_file::sized_verify_dwo_list): New function.
1259 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1260 list.
1261 (Dwp_options): New enum type.
1262 (dwp_options): Add --verify-only.
1263 (usage): Likewise.
1264 (main): Likewise.
1265 * dwp.h (gold_info): Add declaration.
1266
7cdd7d57
CC
12672013-11-14 Cary Coutant <ccoutant@google.com>
1268
1269 PR gold/14860
1270 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1271 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1272 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1273 updating fde_offsets_.
1274 (Eh_frame_hdr::lock_): New data member.
1275
1d946cb3
CC
12762013-11-06 Cary Coutant <ccoutant@google.com>
1277
1278 PR gold/15758
1279 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1280 before reloc sections.
1281
4f65b40e
AM
12822013-11-04 Alan Modra <amodra@gmail.com>
1283
1284 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1285 (Symbol::needs_dynamic_reloc): Test new flag.
1286 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1287 (Target_powerpc::Scan::get_reference_flags): Add target param.
1288 Return FUNC_DESC_ABI for 64-bit ELFv1.
1289 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1290 call.
1291 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1292 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1293
908794a9
CC
12942013-10-31 Cary Coutant <ccoutant@google.com>
1295
1296 Restore support for dwp v2 DWARF package file format.
1297
1298 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1299 tu_length parameter. Adjust all callers.
1300 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1301 * dwp.cc: Include dwarf.h.
1302 (Section_bounds): New struct type.
1303 (Unit_set): New struct type.
1304 (Dwo_file::Dwo_file): Initialize new data member.
1305 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1306 Combine and rename to...
1307 (Dwo_file::read_unit_index): ...this.
1308 (Dwo_file::sized_read_compunit_index)
1309 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1310 (Dwo_file::sized_read_unit_index): ...this.
1311 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1312 parameters; add section_id parameter.
1313 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1314 (Dwo_file::add_unit_set): ...this.
1315 (Dwo_file::shndx_map_): Remove.
1316 (Dwo_file::sect_offsets_): New data member.
1317 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1318 (Dwp_output_file::add_section): Rename to...
1319 (Dwp_output_file::add_contribution): ...this.
1320 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1321 (Dwp_output_file::add_tu_set): Likewise.
1322 (Dwp_output_file::Contribution): New type.
1323 (Dwp_output_file::Section::contributions): New data member.
1324 (Dwp_output_file::Cu_or_tu_set): Remove.
1325 (Dwp_output_file::Section::Section): New ctor.
1326 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1327 (Dwp_output_file::Dwp_index::Section_table): New type.
1328 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1329 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1330 parameter.
1331 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1332 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1333 (Dwp_output_file::Dwp_index::section_table): New member function.
1334 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1335 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1336 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1337 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1338 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1339 (Dwp_output_file::Dwp_index::section_table_): New data member.
1340 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1341 (Dwp_output_file::add_output_section): New member function.
1342 (Dwp_output_file::write_new_section): New member function.
1343 (Dwp_output_file::write_contributions): New member function.
1344 (Dwp_output_file::section_id_map_): New data member.
1345 (class Dwo_id_info_reader): Remove.
1346 (class Unit_reader): New class.
1347 (get_dwarf_section_name): New function.
1348 (Dwo_file::read_executable): Adjust initializations of class data.
1349 (Dwo_file::read): Add support for v2 package file format.
1350 (Dwo_file::read_unit_index): Likewise.
1351 (Dwo_file::sized_read_unit_index): Likewise.
1352 (Dwo_file::copy_section): Likewise.
1353 (Dwo_file::add_unit_set): Likewise.
1354 (Dwp_output_file::add_output_section): Likewise.
1355 (Dwp_output_file::add_contribution): Likewise.
1356 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1357 for empty slot.
1358 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1359 file format.
1360 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1361 slot.
1362 (Dwp_output_file::initialize): Remove unused function.
1363 (Dwp_output_file::finalize): Add support for v2 package file format.
1364 (Dwp_output_file::write_index): Likewise.
1365 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1366 function prototype.
1367
2500c017
CC
13682013-10-31 Cary Coutant <ccoutant@google.com>
1369
1370 * configure.ac: Fix check for -fmerge-constants.
1371 * configure.ac: Regenerate.
1372
dd0845d7
RM
13732013-10-30 Roland McGrath <mcgrathr@google.com>
1374
1375 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1376 Correct 9-byte nop sequence to match what the assembler generates.
1377
b4f7960d
AM
13782013-10-30 Alan Modra <amodra@gmail.com>
1379
1380 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1381 ppc64_local_entry_offset, ppc64_local_entry_offset,
1382 do_read_symbols): New functions.
1383 (Powerpc_relobj::e_flags_, st_other_): New vars.
1384 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1385 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1386 (Powerpc_relobj::e_flags_): New var.
1387 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1388 and adjust for ELFv2.
1389 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1390 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1391 (Powerpc_dynobj::do_find_special_sections): Likewise.
1392 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1393 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1394 to ELFv2 local entry.
1395 (Target_powerpc::do_relax): No thread safe barriers needed for
1396 ELFv2.
1397 (Output_data_plt_powerpc::initial_plt_entry_size_,
1398 plt_entry_size): Delete. Replace all uses with
1399 first_plt_entry_offset() and plt_entry_size().
1400 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1401 reserved_size parm. Update callers.
1402 (Output_data_plt_powerpc::entry_count): Update.
1403 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1404 and use Target_powerpc::first_plt_entry_offset().
1405 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1406 rename to plt_entry_size.
1407 (Output_data_plt_powerpc::add_ifunc_entry,
1408 add_local_ifunc_entry): Adjust reloc for ELFv2.
1409 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1410 (glink_eh_frame_fde_64v2): New.
1411 (Stub_table::plt_call_size): Support ELFv2 sizing.
1412 (Output_data_glink::add_eh_frame): Use the new FDE.
1413 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1414 (Stub_table::do_write): Write ELFv2 stubs and glink.
1415 (Target_powerpc::Relocate::relocate): Replaces nop after call
1416 with ld 2,24(1) and adjust local offset destination for ELFv2.
1417
f9c6b907
AM
14182013-10-30 Alan Modra <amodra@gmail.com>
1419
1420 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1421 (Target_powerpc::Scan::global, local): Likewise.
1422 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1423 on all ppc64 @h and @ha relocs.
1424
e84fe78f
AM
14252013-10-14 Alan Modra <amodra@gmail.com>
1426
1427 * output.h (Output_data_got::add_constant): Tidy.
1428 (Output_data_got::add_constant_pair): New function.
1429 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1430 methods used so as to first call reserve_ent().
1431
679e4abf
RM
14322013-10-11 Roland McGrath <mcgrathr@google.com>
1433
44dcb735
RM
1434 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1435 add_got_entry and add_got_entry_pair.
1436
13323c49
RM
1437 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1438 (HAVE_PUBNAMES): Likewise.
1439 * configure: Regenerate.
1440
1496b446
RM
1441 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1442 * testsuite/Makefile.in: Regenerate.
1443
cc84c10b
RM
1444 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1445 Remove const from declaration.
1446 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1447 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1448 * output.h (Output_file_header): Remove const from member target_
1449 and corresponding constructor argument.
1450 * output.cc (Output_file_header::Output_file_header): Update prototype.
1451 (Output_file_header::do_sized_write): Use this->target_ in place
1452 of parameters()->target().
1453
52f66a2c
RM
1454 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1455
2b64b551
RM
1456 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1457 * configure: Regenerate.
1458 * Makefile.in: Regenerate.
1459 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1460 * testsuite/merge_string_literals_2.c: Likewise.
1461 * testsuite/Makefile.am
1462 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1463 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1464 literal -fmerge-constants.
1465 * testsuite/Makefile.in: Regenerate.
1466
43819297
RM
1467 * i386.cc (Target_i386): Remove unused member dynbss_.
1468 * arm.cc (Target_arm): Likewise.
1469 * powerpc.cc (Target_powerpc): Likewise.
1470 * sparc.cc (Target_sparc): Likewise.
1471 * tilegx.cc (Target_tilegx): Likewise.
1472 * x86_64.cc (Target_x86_64): Likewise.
1473 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1474 type_signature_, type_offset_.
1475 * plugin.h (Plugin_hook): Remove unused member layout_.
1476 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1477 mapfile_.
1478 (Read_member): Remove unused members input_objects_, symtab_,
1479 mapfile_, layout_.
1480 (Check_library): Remove unused member symtab_.
1481 * archive.h (Lib_group): Remove unused member lib_.
1482 * archive.cc (Lib_group::Lib_group): Update initializer.
1483 * incremental.h (Incremental_binary): Remove unused member target_.
1484 (Incremental_script_entry): Removed unused member script_.
1485 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1486 * icf.h (Icf): Remove unused member num_tracked_relocs.
1487
39d9ead7
RM
1488 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1489 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1490 its only use.
1491 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1492
679e4abf
RM
1493 * archive.h: Use struct rather than class for forward declaration
1494 of Read_symbols_data.
1495
54de2ea6
CC
14962013-10-07 Cary Coutant <ccoutant@google.com>
1497
1498 PR gold/16010
1499 * testsuite/Makefile.am (icf_test): Fix dependencies.
1500 (icf_safe_test): Likewise.
1501 (icf_safe_so_test): Likewise.
1502 (large_symbol_alignment): Add empty _LDADD rule.
1503 * testsuite/Makefile.in: Regenerate.
1504
b14016f0
L
15052013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1506
1507 PR gold/15927
1508 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1509 relocation for R_X86_64_32 on x32.
1510
eb426534
RM
15112013-08-27 Roland McGrath <mcgrathr@google.com>
1512
1513 * output.cc (Output_segment::set_section_addresses): Take new
1514 Target* argument. If target->isolate_execinstr() and the segment
1515 is executable and starts at a target->abi_pagesize() boundary,
1516 pad its end out to a target->abi_pagesize() boundary with code fill.
1517 * output.h (Output_segment::set_section_addresses): Update decl.
1518 * layout.h (Layout::check_output_data_for_reset_values): Take new
1519 argument RELAX_OUTPUTS.
1520 (Layout): New member relax_output_list_.
1521 (Layout::add_relax_output): New method.
1522 * layout.cc (Layout::Layout): Update constructor.
1523 (Layout::reset_relax_output): New method.
1524 (Layout::clean_up_after_relaxation): Call it.
1525 (Layout::prepare_for_relaxation): Update caller.
1526 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1527 Call reset_relax_output before re-processing segments for
1528 isolate_execinstr case.
1529 (Layout::write_data): Handle relax_output_list_.
1530 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1531 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1532
9aff4b7a
NC
15332013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1534
1535 PR binutils/15834
1536 * object.h: Fix typos.
1537
93f8221c
RM
15382013-08-16 Roland McGrath <mcgrathr@google.com>
1539
1540 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1541 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1542
e44c3715
CC
15432013-08-07 Cary Coutant <ccoutant@google.com>
1544
1545 Revert support for v2 DWP files:
1546
1547 2013-03-01 Cary Coutant <ccoutant@google.com>
1548
1549 Add dwp support for v2 DWARF package file format.
1550 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1551 tu_length parameter. Adjust all callers.
1552 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1553 * dwp.cc: Include dwarf.h.
1554 (Section_bounds): New struct type.
1555 (Unit_set): New struct type.
1556 (Dwo_file::Dwo_file): Initialize new data member.
1557 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1558 Combine and rename to...
1559 (Dwo_file::read_unit_index): ...this.
1560 (Dwo_file::sized_read_compunit_index)
1561 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1562 (Dwo_file::sized_read_unit_index): ...this.
1563 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1564 parameters; add section_id parameter.
1565 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1566 (Dwo_file::add_unit_set): ...this.
1567 (Dwo_file::shndx_map_): Remove.
1568 (Dwo_file::sect_offsets_): New data member.
1569 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1570 (Dwp_output_file::add_section): Rename to...
1571 (Dwp_output_file::add_contribution): ...this.
1572 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1573 (Dwp_output_file::add_tu_set): Likewise.
1574 (Dwp_output_file::Contribution): New type.
1575 (Dwp_output_file::Section::contributions): New data member.
1576 (Dwp_output_file::Cu_or_tu_set): Remove.
1577 (Dwp_output_file::Section::Section): New ctor.
1578 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1579 (Dwp_output_file::Dwp_index::Section_table): New type.
1580 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1581 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1582 parameter.
1583 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1584 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1585 (Dwp_output_file::Dwp_index::section_table): New member function.
1586 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1587 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1588 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1589 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1590 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1591 (Dwp_output_file::Dwp_index::section_table_): New data member.
1592 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1593 (Dwp_output_file::add_output_section): New member function.
1594 (Dwp_output_file::write_new_section): New member function.
1595 (Dwp_output_file::write_contributions): New member function.
1596 (Dwp_output_file::section_id_map_): New data member.
1597 (class Dwo_id_info_reader): Remove.
1598 (class Unit_reader): New class.
1599 (get_dwarf_section_name): New function.
1600 (Dwo_file::read_executable): Adjust initializations of class data.
1601 (Dwo_file::read): Add support for v2 package file format.
1602 (Dwo_file::read_unit_index): Likewise.
1603 (Dwo_file::sized_read_unit_index): Likewise.
1604 (Dwo_file::copy_section): Likewise.
1605 (Dwo_file::add_unit_set): Likewise.
1606 (Dwp_output_file::add_output_section): Likewise.
1607 (Dwp_output_file::add_contribution): Likewise.
1608 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1609 for empty slot.
1610 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1611 file format.
1612 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1613 slot.
1614 (Dwp_output_file::initialize): Remove unused function.
1615 (Dwp_output_file::finalize): Add support for v2 package file format.
1616 (Dwp_output_file::write_index): Likewise.
1617 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1618 function prototype.
1619
c6905c28
CC
16202013-07-31 Cary Coutant <ccoutant@google.com>
1621
1622 * object.cc (Sized_relobj::do_output_section_address): New function.
1623 (Sized_relobj): Instantiate explicitly.
1624 * object.h (Object::output_section_address): New function.
1625 (Object::do_output_section_address): New function.
1626 (Sized_relobj::do_output_section_address): New function.
1627 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1628
16292013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 1630 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
1631
1632 * parameters.cc (Parameters::entry): Return target-specific entry
1633 symbol name.
1634 * target.h (Target::entry_symbol_name): New function.
1635 (Target_info::entry_symbol_name): New data member.
1636
1637 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1638 * i386.cc (Target_i386::i386_info): Likewise.
1639 (Target_i386_nacl::i386_nacl_info): Likewise.
1640 * sparc.cc (Target_sparc::sparc_info): Likewise.
1641 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1642 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1643 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1644 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1645
234d4ab8
SA
16462013-07-22 Sterling Augustine <saugustine@google.com>
1647
1648 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1649 Convert parameter shndx to local variable. Add parameters symtab
1650 and symtab_size. Scan over section names. Find relocation
1651 section corresponding to current section. Create and initialize
1652 reloc_mapper_ and reloc_type_.
1653 (Dwarf_pubnames_table::read_header): Add assertion. Change
1654 unit_length to off_t. Initialize member unit_length_. Fill in field
1655 cu_offset_.
1656 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1657 Initialize new fields unit_length_ and cu_offset_.
1658 (Dwarf_pubnames_table::read_section): Update prototype.
1659 (Dwarf_pubnames_table::cu_offset): New member function.
1660 (Dwarf_pubnames_table::subsection_size): Likewise.
1661 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1662 New fields.
1663 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1664 member functions public.
1665 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1666 Update comment. Rework logic. Move repeated parts to...
1667 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1668 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1669 pubtypes_table_, and stmt_list_offset.
1670 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1671 Gdb_index::find_pubtype_offset,
1672 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1673 (Gdb_index::pubnames_read): Update prototype and rework logic.
1674 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1675 Forward declare.
1676 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1677 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1678 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1679 Gdb_index::map_pubtable_to_dies):
1680 Declare functions.
1681 (Gdb_index::pubnames_read): Update declaration.
1682 (Gdb_index::Pubname_offset_map): New type.
1683 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1684 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1685 Gdb_index::stmt_list_offset): Declare.
1686 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1687 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1688 Gdb_index::pubtypes_offset_): Remove.
1689
a3ed37d8
RM
16902013-07-19 Roland McGrath <mcgrathr@google.com>
1691
1692 * options.h (General_options): Add -Trodata-segment option.
1693 * parameters.cc (Parameters::check_rodata_segment): New function.
1694 (Parameters::set_target_once): Call it.
1695 * parameters.h (Parameters): Declare it (private member function).
1696 * layout.cc (load_seg_unusable_for_headers): New function, broken
1697 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1698 then validate rodata segment rather than text segment.
1699 (relaxation_loop_body): Call that.
1700 (is_text_segment): New function. Don't admit a non-executable
1701 segment if TARGET->isolate_execinstr().
1702 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1703
eb5b4ded
CC
17042013-07-15 Shawn Landden <shawnlandden@gmail.com>
1705
1706 PR gold/15070
1707 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1708 * nacl.h (Sniff_file::View::View): Request aligned view.
1709
4d5effb9
CC
17102013-07-11 Cary Coutant <ccoutant@google.com>
1711
1712 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1713 correct BRLT entry size.
1714
ba8ca3e7
AM
17152013-07-03 Alan Modra <amodra@gmail.com>
1716
1717 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1718 comment.
1719
267257d2
CC
17202013-07-01 Cary Coutant <ccoutant@google.com>
1721
1722 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1723 reloc_type_.
1724 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1725 (Dwarf_ranges_table::lookup_reloc): New function.
1726 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1727 reloc_type_.
1728 (Dwarf_ranges_table::lookup_reloc): New function.
1729 (Dwarf_ranges_table::reloc_type_): New data member.
1730
06f30c9d
CC
17312013-06-27 Jing Yu <jingyu@google.com>
1732
1733 PR gold/15662
1734 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1735 function.
1736 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1737 (Target_powerpc::do_relax): Call the above.
1738
a2d7bf59
AM
17392013-06-27 Cary Coutant <ccoutant@google.com>
1740
1741 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1742 on garbage collected .opd section.
1743
17442013-06-27 Alan Modra <amodra@gmail.com>
1745
1746 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1747 is non-zero.
1748 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1749 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1750
32364e50
CC
17512013-06-14 Cary Coutant <ccoutant@google.com>
1752
1753 * resolve.cc (Symbol::override_base): Don't override st_type
1754 from plugin placeholder symbols.
1755 (Symbol_table::resolve): Likewise.
1756 (Symbol_table::should_override): Don't complain about TLS mismatch
1757 if the TO symbol is a plugin placeholder.
1758 * testsuite/Makefile.am (plugin_test_tls): New test.
1759 * testsuite/Makefile.in: Regenerate.
1760 * testsuite/plugin_test_tls.sh: New test script.
1761 * testsuite/two_file_test_2_tls.cc: New test source.
1762 * testsuite/two_file_test_tls.cc: New test source.
1763
7fb47cc9
CC
17642013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1765
1766 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1767 the maximum segment alignment is larger than the page size.
1768 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1769 correctly aligns the symbols with large alignemnt.
1770 * testsuite/Makefile.in: Regenerate.
1771 * testsuite/large_symbol_alignment.cc: New file.
1772
6934001a
CC
17732013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1774 Sriraman Tallam <tmsriram@google.com>
1775
1776 * options.h (sort_section): New option.
1777 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1778 Rename from Input_section_sort_section_name_special_ordering_compare.
1779 (Input_section_sort_section_name_compare): New struct.
1780 * output.cc (Output_section::Input_section_sort_section_name_compare::
1781 operator()): New function.
1782 (Output_section::sort_attached_input_sections): Use new sort function
1783 for .text if --sort-section=name is specified.
1784 * layout.cc (Layout::make_output_section):
1785 Add sorting by name when --sort-section=name is specified.
1786 * testsuite/Makefile.am (text_section_grouping): Test option
1787 --sort-section=name.
1788 * testsuite/Makefile.in: Regenerate.
1789 * testsuite/section_sorting_name.cc: New file.
1790 * testsuite/section_sorting_name.sh: New file.
1791
93acabad
CC
17922013-05-21 Cary Coutant <ccoutant@google.com>
1793
1794 * symtab.h (Symbol::is_cxx_vtable): New function.
1795 * target-reloc.h (relocate_section): Check for vtable symbol.
1796 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1797 * testsuite/Makefile.in: Regenerate.
1798 * testsuite/missing_key_func.cc: New test source.
1799 * testsuite/missing_key_func.sh: New test script.
1800
60e8b3fc
CC
18012013-05-21 Cary Coutant <ccoutant@google.com>
1802
2b64b551
RM
1803 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1804 type of enclosing symbol.
1805 (Relocate_info::location): Check symbol type when describing symbol.
1806 * object.h (Symbol_location_info): Remove unused line_number;
1807 add enclosing_symbol_type.
1808 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 1809
9df9de2c
CC
18102013-05-13 Cary Coutant <ccoutant@google.com>
1811
2b64b551
RM
1812 * configure.ac: Export DEFAULT_TARGET.
1813 * configure: Regenerate.
1814 * Makefile.in: Regenerate.
1815 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1816 * testsuite/Makefile.in: Regenerate.
1817 * testsuite/debug_msg.sh: Delete duplicate tests.
1818 Don't check undef_int error message match for powerpc where the
1819 source file and line number aren't available.
9df9de2c 1820
bbc5ae17
RM
18212013-05-10 Roland McGrath <mcgrathr@google.com>
1822
1823 * options.h (General_options): Add --rosegment-gap option.
1824 * options.cc (finalize): --rosegment-gap implies --rosegment.
1825 * layout.cc (set_segment_offsets): Let user option override
1826 target->rosegment_gap().
1827
0c6e6c39
RM
18282013-05-10 Roland McGrath <mcgrathr@google.com>
1829
1830 * options.h (General_options): Remove leading space from help
1831 messages for -nostdlib and --rosegment.
1832
cde7cb01
MR
18332013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1834
1835 PR ld/15365
1836 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1837
f31ae5b8
AM
18382013-05-03 Alan Modra <amodra@gmail.com>
1839
1840 * merge.cc (Output_merge_string::do_add_input_section): Correct
1841 scan for number of strings. Rename vars to avoid shadowing.
1842 Include missing terminator in input_size_.
1843
d3a7cd45
L
18442013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1845
1846 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1847 Restore empty string handling.
1848
6ad3daba
CC
18492013-05-01 Cary Coutant <ccoutant@google.com>
1850
1851 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1852 uninitialized warning.
1853
e31908b6
CC
18542013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1855
1856 * output.cc (Output_section::add_merge_input_section): Allow
1857 to merge sections if the alignment is more than character size.
1858 * merge.h (Output_merge_string::Output_merge_string): Remove
1859 assert.
1860 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1861 only not-null strings. Check the alignment of strings.
1862 * stringpool.h
1863 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1864 alignment as the argument.
1865 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1866 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1867 Align non-zero length strings according to the addralign_.
1868 (Stringpool_template<Stringpool_char>::set_string_offsets):
1869 Updating offsets according to the given alignment.
1870 * testsuite/Makefile.am (text_section_grouping): Test if string
1871 literals are getting merged.
1872 * testsuite/Makefile.in: Regenerate.
1873 * testsuite/merge_string_literals_1.c: New file.
1874 * testsuite/merge_string_literals_2.c: Ditto.
1875 * testsuite/merge_string_literals.sh: Ditto.
1876
0e804863
ILT
18772013-04-26 Ian Lance Taylor <iant@google.com>
1878
1879 * target-reloc.h (relocate_section): If the reloc offset is out of
1880 range, pass VIEW as NULL to relocate.relocate.
1881 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1882 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1883 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1884 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1885 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1886 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1887
e7c5ea40
CC
18882013-04-26 Geoff Pike <gpike@chromium.org>
1889
1890 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1891 * layout.cc (Hash_task): New class.
1892 (Layout::queue_build_id_tasks): New function.
1893 (Layout::write_build_id): Handle single-thread portion of build ID
1894 computation. (In some cases, all of it is single-threaded.) Replace
1895 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1896 functionality in fewer lines of code.
1897 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1898 * options.h (General_options): make "--build-id" default to tree
1899 rather than sha1. Add two new options related to --build-id=tree:
1900 --build-id-chunk-size-for-treehash and
1901 --build-id-min-file-size-for-treehash.
1902 * Makefile.am: add testing of --build-id=tree and related new options
1903 (these tests will be invoked by "make check").
1904 * Makefile.in: Regenerate.
1905
49926cd0
AM
19062013-04-25 Alan Modra <amodra@gmail.com>
1907
1908 * configure.tgt: Add powerpcle and powerpc64le.
1909
a4034750
AM
19102013-04-22 Alan Modra <amodra@gmail.com>
1911
1912 PR gold/15355
1913 * layout.cc (Layout::segment_precedes): Allow more than one
1914 segment with the same type and flags.
1915
e79c84aa
CC
19162013-04-15 Cary Coutant <ccoutant@google.com>
1917
1918 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1919 allocate space in file for BSS sections.
1920
2199fbe7
CC
19212013-04-15 Cary Coutant <ccoutant@google.com>
1922
1923 * script-sections.cc (Orphan_output_section): Reset address
1924 to zero after each orphaned section for relocatable links.
1925
502e8a84
CC
19262013-04-15 Cary Coutant <ccoutant@google.com>
1927
a4034750
AM
1928 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1929 section starting address for relocatable link.
1930 * testsuite/Makefile.am (script_test_11): New test.
1931 * testsuite/Makefile.in: Regenerate.
1932 * testsuite/script_test_11.c: New source file.
1933 * testsuite/script_test_11.t: New linker script.
502e8a84 1934
0cfdc767
AM
19352013-04-13 Alan Modra <amodra@gmail.com>
1936
1937 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1938 owner when sections are not adjacent and exceed group size.
1939 (Target_powerpc::group_sections): Handle corner case.
1940 (Target_powerpc::Branch_info::make_stub): Handle case where
1941 stub table doesn't exist due to branches in non-exec sections.
1942 (Target_powerpc::Relocate::relocate): Likewise.
1943
6830ee24
AM
19442013-04-11 Alan Modra <amodra@gmail.com>
1945
1946 PR gold/15354
1947 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1948 .branch_lt to match bfd ld. Adjust comments throughout file.
1949
54a3d865
ILT
19502013-04-04 Ian Lance Taylor <iant@google.com>
1951
1952 GCC PR c++/56840
1953 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1954 sections before checking whether they are included in the link.
1955
9993ba11
ST
19562013-03-29 Sriraman Tallam <tmsriram@google.com>
1957
1958 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1959 object before calling the plugin claim_file handler. Pass the elf
1960 object of the archive to the plugin. Delete the elf object if the
1961 plugin claims the file.
1962
ebacd51e
AM
19632013-03-21 Alan Modra <amodra@gmail.com>
1964
1965 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1966 segment when omagic.
1967
117be58f
AM
19682013-03-21 Alan Modra <amodra@gmail.com>
1969
1970 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1971 comparison warning.
1972 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1973 uninitialized" warning.
1974
32e2b61d
AM
19752013-03-20 Alan Modra <amodra@gmail.com>
1976
1977 * symtab.h (Symbol::clear_version): New function.
1978 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1979 is_needed by weak references. Clear version for symbols defined
1980 in as-needed objects that are not needed.
1981
b3ccdeb5
AM
19822013-03-15 Alan Modra <amodra@gmail.com>
1983
1984 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1985 static and public. Add report_err param. Return false for data refs.
1986 (Target_powerpc::rela_dyn_section): New overloaded function.
1987 (Target_powerpc::plt_, iplt_): Elucidate.
1988 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1989 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1990 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1991 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1992 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1993 push_branch and make_plt_entry for ifunc syms when
1994 reloc_needs_plt_for_ifunc.
1995 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1996 for ifunc unless reloc_needs_plt_for_ifunc.
1997
ad3d8a2f
AM
19982013-03-15 Alan Modra <amodra@gmail.com>
1999
2000 * gc.h (gc_process_relocs): Don't look through function descriptors.
2001 * icf.cc (get_section_contents): Do so here instead.
2002
4d9aa155
AM
20032013-03-13 Alan Modra <amodra@gmail.com>
2004
2005 * powerpc.cc (is_branch_reloc): Forward declare.
2006 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2007 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2008 false for 64-bit, true for 32-bit non-branch relocs.
2009 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2010 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2011 nm output.
2012 (icf_safe_test): Generate linker map file as well as nm output.
2013 (icf_safe_so_test): Likewise.
2014 * testsuite/Makefile.in: Regenerate.
2015 * testsuite/icf_test.sh: Parse linker map file to determine
2016 section folding.
2017 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2018 * testsuite/icf_safe_so_test.sh: Likewise.
2019 (X86_32_or_ARM_specific_safe_fold): Merge into..
2020 (arch_specific_safe_fold): ..this.
2021 (X86_64_specific_safe_fold): Delete unused function.
2022
57420c20
AM
20232013-03-12 Alan Modra <amodra@gmail.com>
2024
2025 * gc.h (gc_process_relocs): Look through function descriptors
2026 to determine shndx, symvalue and addend used by ICF. Tidy
2027 variable duplication.
2028
dc3714f3
AM
20292013-03-11 Alan Modra <amodra@gmail.com>
2030
2031 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2032 * layout.cc (Layout_task_runner::run): ..to here.
2033 * symtab.h (struct Symbol_location): Extract from..
2034 (class Symbol_table): ..here.
2035 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2036 * target.h (class Target): Add function_location and
2037 do_function_location functions.
2038 (class Sized_target): Add do_function_location.
2039 * object.h (class Sized_relobj_file): Move find_shdr..
2040 (class Object): ..to here.
2041 * object.cc: Likewise. Update to suit. Instantiate.
2042 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
2043 * powerpc.cc (class Powerpc_dynobj): New.
2044 (Target_powerpc::do_function_location): New function.
2045 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2046 (Powerpc_dynobj::do_read_symbols): New function.
2047 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2048
956b03bb
ILT
20492013-03-08 Ian Lance Taylor <iant@google.com>
2050
2051 * options.cc (General_options::string_to_object_format): Accept
2052 "default".
2053
4bead2d5
AM
20542013-03-08 Alan Modra <amodra@gmail.com>
2055
2056 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2057 pointer to Post_fde.
2058 (struct Post_fde): Move definition to here..
2059 * ehframe.cc (struct Post_fde): ..from here.
2060 (Cie::write): Don't alloc Post_fde.
2061 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2062
02e60bf7
AM
20632013-03-07 Alan Modra <amodra@gmail.com>
2064
2065 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2066 relocation referencing .LC0.
2067 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2068
8343f03a
AM
20692013-03-07 Alan Modra <amodra@gmail.com>
2070
2071 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2072 always_inline. Add assembly for powerpc to avoid GOT.
2073
3366d57c
AM
20742013-03-07 Alan Modra <amodra@gmail.com>
2075
2076 * testsuite/script_test_10.sh: Don't test .bss section
2077 header number.
2078
6c77229c
AM
20792013-03-06 Alan Modra <amodra@gmail.com>
2080
2081 * powerpc.cc (class Powerpc_relobj): Move some member functions.
2082 (Target_powerpc::symval_for_branch): Add symtab param. Update
2083 all callers. Handle folded sections.
2084 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
2085 to Powerpc_relobj.
2086 (Global_symbol_visitor_opd::operator()): Likewise.
2087
a39e4af6
AM
20882013-03-04 Alan Modra <amodra@gmail.com>
2089
2090 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
2091 * testsuite/Makefile.in: Regenerate.
2092
d5834edb
CC
20932013-03-01 Cary Coutant <ccoutant@google.com>
2094
2095 Add dwp support for v2 DWARF package file format.
2096 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2097 tu_length parameter. Adjust all callers.
2098 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2099 * dwp.cc: Include dwarf.h.
2100 (Section_bounds): New struct type.
2101 (Unit_set): New struct type.
2102 (Dwo_file::Dwo_file): Initialize new data member.
2103 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2104 Combine and rename to...
2105 (Dwo_file::read_unit_index): ...this.
2106 (Dwo_file::sized_read_compunit_index)
2107 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2108 (Dwo_file::sized_read_unit_index): ...this.
2109 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2110 parameters; add section_id parameter.
2111 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2112 (Dwo_file::add_unit_set): ...this.
2113 (Dwo_file::shndx_map_): Remove.
2114 (Dwo_file::sect_offsets_): New data member.
2115 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2116 (Dwp_output_file::add_section): Rename to...
2117 (Dwp_output_file::add_contribution): ...this.
2118 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2119 (Dwp_output_file::add_tu_set): Likewise.
2120 (Dwp_output_file::Contribution): New type.
2121 (Dwp_output_file::Section::contributions): New data member.
2122 (Dwp_output_file::Cu_or_tu_set): Remove.
2123 (Dwp_output_file::Section::Section): New ctor.
2124 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2125 (Dwp_output_file::Dwp_index::Section_table): New type.
2126 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2127 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2128 parameter.
2129 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2130 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2131 (Dwp_output_file::Dwp_index::section_table): New member function.
2132 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2133 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2134 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2135 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2136 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2137 (Dwp_output_file::Dwp_index::section_table_): New data member.
2138 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2139 (Dwp_output_file::add_output_section): New member function.
2140 (Dwp_output_file::write_new_section): New member function.
2141 (Dwp_output_file::write_contributions): New member function.
2142 (Dwp_output_file::section_id_map_): New data member.
2143 (class Dwo_id_info_reader): Remove.
2144 (class Unit_reader): New class.
2145 (get_dwarf_section_name): New function.
2146 (Dwo_file::read_executable): Adjust initializations of class data.
2147 (Dwo_file::read): Add support for v2 package file format.
2148 (Dwo_file::read_unit_index): Likewise.
2149 (Dwo_file::sized_read_unit_index): Likewise.
2150 (Dwo_file::copy_section): Likewise.
2151 (Dwo_file::add_unit_set): Likewise.
2152 (Dwp_output_file::add_output_section): Likewise.
2153 (Dwp_output_file::add_contribution): Likewise.
2154 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2155 for empty slot.
2156 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2157 file format.
2158 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2159 slot.
2160 (Dwp_output_file::initialize): Remove unused function.
2161 (Dwp_output_file::finalize): Add support for v2 package file format.
2162 (Dwp_output_file::write_index): Likewise.
2163 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2164 function prototype.
2165
a68a081d
CC
21662013-03-01 Cary Coutant <ccoutant@google.com>
2167
2168 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2169 function into class definition in header file.
2170 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2171 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2172 New function.
2173 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2174
9d5781f8
AM
21752013-02-28 Alan Modra <amodra@gmail.com>
2176
2177 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2178 * target.cc (Target::do_plt_fde_location): New function.
2179 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2180 accessor function, and constructor param.
2181 (struct Post_fde, Post_fdes): Declare.
2182 (Cie::write): Add post_fdes param.
2183 * ehframe.cc (Fde::write): Use plt_fde_location.
2184 (struct Post_fde): Define.
2185 (Cie::write): Stash FDEs added post merge mapping.
2186 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2187 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2188 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2189 other FDEs.
2190 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2191 (Target_powerpc::has_glink): New function.
2192 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2193 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2194 glink_eh_frame_fde_32, default_fde): New data.
2195 (Stub_table::eh_frame_added_): New var.
2196 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2197 Make const.
2198 (Stub_table::add_eh_frame): New function.
2199 (Output_data_glink::add_eh_frame): New function.
2200 (Target_powerpc::make_glink_section): Call add_eh_frame.
2201
214383dd
ILT
22022013-02-15 Ian Lance Taylor <iant@google.com>
2203
2204 * options.h (DEFINE_uint64_alias): Define.
2205 (class General_options): Add -Ttext-segment as an alias for
2206 -Ttext.
2207
91c2b899
AM
22082013-02-15 Alan Modra <amodra@gmail.com>
2209
2210 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2211 (Stub_table::do_write): ..here, two places.
2212 (Stub_table::plt_call_size): Use it here too.
2213
20e2a8aa
ILT
22142013-02-11 Ian Lance Taylor <iant@google.com>
2215
2216 * descriptors.cc (Descriptors::close_all): New function.
2217 * descriptors.h (class Descriptors): Declare close_all.
2218 (close_all_descriptors): New inline function.
2219 * plugin.cc: Include "descriptors.h".
2220 (Plugin_manager::cleanup): Call close_all_descriptors.
2221
8952bc69
AM
22222013-02-06 Alan Modra <amodra@gmail.com>
2223
2224 * README: Update coding style link.
2225
29bd8b6b
CC
22262013-01-28 Cary Coutant <ccoutant@google.com>
2227
a4034750
AM
2228 * dwp.cc (File_list): New typedef.
2229 (Dwo_name_info_reader): New class.
2230 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2231 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2232 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2233 (Dwo_file::read_executable): New function.
2234 (Dwo_file::read): Move common setup code to ...
2235 (Dwo_file::make_object): ... here.
2236 (dwp_options): Add --exec/-e.
2237 (usage): Likewise.
2238 (main): Likewise.
29bd8b6b 2239
c6ac678d
ST
22402013-01-24 Sriraman Tallam <tmsriram@google.com>
2241
2242 * layout.cc (Layout::layout): Check for option text_reorder.
2243 (Layout::make_output_section): Ditto.
2244 * options.h (text_reorder): New option.
2245 * output.cc (Input_section_sort_compare): Remove special ordering
2246 of section names.
2247 (Output_section::
2248 Input_section_sort_section_name_special_ordering_compare::
2249 operator()): New function.
2250 (Output_section::sort_attached_input_sections): Use new sort function
2251 for .text.
2252 * output.h (Input_section_sort_section_name_special_ordering_compare):
2253 New struct.
2254 * testsuite/Makefile.am (text_section_grouping): Test option
2255 --no-text-reorder
2256 * testsuite/Makefile.in: Regenerate.
2257 * testsuite/text_section_grouping.sh: Check order of functions without
2258 default text reordering.
2259
50701cc1
MF
22602013-01-18 Mike Frysinger <vapier@gentoo.org>
2261
2262 * options.h (General_options): Change default to true for new_dtags.
2263
b1b00fcc
MF
22642013-01-18 Mike Frysinger <vapier@gentoo.org>
2265
2266 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2267 when enable_new_dtags is false. Only add DT_RUNPATH when
2268 enable_new_dtags is true.
2269
ec5b8187
AM
22702013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2271
2272 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2273 used in declaration and definition consistent.
2274 (Target_powerpc::symval_for_branch): Ditto.
2275
a880d4c4
ST
22762013-01-16 Sriraman Tallam <tmsriram@google.com>
2277
2278 * testsuite/plugin_final_layout.cc: Fix comment.
2279
7c381248
ST
22802013-01-16 Sriraman Tallam <tmsriram@google.com>
2281
2282 * layout.cc (Layout::layout): Do not do default sorting for
2283 text sections when section ordering is specified.
2284 (make_output_section): Ditto.
2285 * testsuite/plugin_final_layout.cc: Name the function sections
2286 to catch reordering issues.
2287
e2458743
AM
22882013-01-15 Alan Modra <amodra@gmail.com>
2289
2290 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2291 plt-thread-safe.
2292
431ed302
AM
22932013-01-15 Alan Modra <amodra@gmail.com>
2294
2295 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2296 * testsuite/Makefile.in: Regenerate.
2297
0ec6429b
AM
22982013-01-14 Alan Modra <amodra@gmail.com>
2299
2300 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2301 * testsuite/Makefile.in: Regenerate.
2302
0bf402d5
ILT
23032013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2304
36af3926 2305 PR bfd/14430
0bf402d5
ILT
2306 Fix mingw gold build with plugins enabled
2307 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2308 * configure.ac: Export DLOPEN_LIBS and add headers check.
2309 * plugin.cc: Handle non-dlfcn case.
2310 * Makefile.in: Regenerate.
2311 * config.in: Regenerate.
2312 * configure: Regenerate.
2313 * testsuite/Makefile.in: Regenerate.
2314
9e9143bc
ST
23152013-01-09 Sriraman Tallam <tmsriram@google.com>
2316
2317 * output.h (sort_attached_input_sections): Change to be public.
2318 * script-sections.cc
2319 (Output_section_definition::set_section_addresses): Sort
2320 attached input sections according to section order before linker
2321 script assigns section addresses.
2322 (Orphan_output_section::set_section_addresses): Sort
2323 attached input sections according to section order before linker
2324 script assigns section addresses.
2325 * Makefile.am (final_layout.sh): Use a simple linker script to
2326 check if section ordering still works.
2327 * Makefile.in: Regenerate.
2328
679af368
ILT
23292013-01-09 Ben Cheng <bccheng@google.com>
2330
2331 * arm.cc (Target_arm::attributes_accept_div): New function.
2332 (Target_arm::attributes_forbid_div): New function.
2333 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2334 attribute using the same new functions as what bfd/elf32_arm.c
2335 does.
2336
3136a00e
CC
23372013-01-07 Cary Coutant <ccoutant@google.com>
2338
2339 PR gold/14993
2340 * output.cc (Output_section::add_input_section): For incremental
2341 updates, don't track input sections that are allocated from patch
2342 space.
2343
f2a6224b
L
23442013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2345 Ian Lance Taylor <iant@google.com>
2346
2347 PR gold/14897
2348 * configure.ac (--enable-ld): Removed.
2349 (install_as_default): Set to yes only for --enable-gold=default
2350 or --disable-ld.
2351 * configure: Regenerated.
2352
4f46f626
L
23532013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2354
2355 * options.h (General_options): Add -fuse-ld= for GCC linker
2356 option compatibility.
2357
26e4ef59
CC
23582013-01-04 Cary Coutant <ccoutant@google.com>
2359
2360 * configure.ac: Fix typo restoring CXXFLAGS.
2361 * configure: Regenerate.
2362
3d587466
CC
23632013-01-04 Cary Coutant <ccoutant@google.com>
2364
4f46f626
L
2365 * testsuite/Makefile.am (CXXLINK_S): New macro.
2366 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2367 * testsuite/Makefile.in: Regenerate.
3d587466 2368
44db6695
L
23692013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2370
2371 * version.cc (print_version): Update copyright year to 2013.
2372
edcac0c1
ILT
23732012-12-20 Ian Lance Taylor <iant@google.com>
2374
2375 * layout.cc (Layout::special_ordering_of_input_section): New
2376 function.
2377 (Layout::layout): If input section requires special ordering, must
2378 sort input sections.
2379 (Layout::make_output_section): May sort .text input sections.
2380 (Layout::is_section_name_prefix_grouped): Remove.
2381 * layout.h (class Layout): Declare
2382 special_ordering_of_input_section. Don't declare
2383 is_section_name_prefix_grouped.
2384 * output.cc (Output_section::add_input_section): Revert last
2385 change.
2386 (Output_section::Input_section_sort::match_file_name): Don't crash
2387 if called on output section data.
2388 (Output_section::Input_section_sort_compare): Sort based on
2389 special ordering.
2390 (Output_section::Input_section_sort_section_order_index_compare):
2391 Revert last patch.
2392 (Output_section::sort_attached_input_sections): Likewise.
2393
28f2a4ac
ST
23942012-12-18 Sriraman Tallam <tmsriram@google.com>
2395
edcac0c1 2396 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2397 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2398 * output.cc (Output_section::add_input_section): Check if section
2399 name contains special prefix. Keep input sections to sort such
2400 sections.
2401 (Output_section::Input_section_sort_section_order_index_compare
2402 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2403 (Output_section::sort_attached_input_sections): Add condition to
2404 Input_section_entry constructor call.
28f2a4ac
ST
2405 * testsuite/Makefile.am (text_section_grouping): New test.
2406 * testsuite/Makefile.in: Regenerate.
2407 * testsuite/text_section_grouping.cc: New file.
2408 * testsuite/text_section_grouping.sh: New file.
2409
5bf135a7
NC
24102012-12-17 Nick Clifton <nickc@redhat.com>
2411
2412 * Makefile.am: Add copyright notice.
2413 * NEWS: Likewise.
2414 * README: Likewise.
2415 * configure.ac: Likewise.
2416 * ftruncate.c: Likewise.
2417 * Makefile.in: Regenerate.
2418
59965708
CC
24192012-12-14 Cary Coutant <ccoutant@google.com>
2420
a4034750
AM
2421 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2422 --no-as-needed flag.
2423 (exception_separate_shared_12_test): Likewise.
2424 (incremental_copy_test): Likewise.
2425 * testsuite/Makefile.in: Regenerate.
59965708 2426
2a77e2ab
CC
24272012-12-14 Cary Coutant <ccoutant@google.com>
2428
2429 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2430 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2431
e3deeb9c
AM
24322012-12-12 Alan Modra <amodra@gmail.com>
2433
2434 * powerpc.cc (class Track_tls): New.
2435 (class Relocate, class Scan): Inherit Track_tls.
2436 (Target_powerpc::Scan::local, global): Track tls optimization
2437 and avoid creating plt entry for __tls_get_addr if all uses
2438 are optimized away.
2439 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2440
d8f5a274
AM
24412012-12-12 Alan Modra <amodra@gmail.com>
2442
2443 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2444 Replace no_toc_optimize with toc_optimize.
2445 * output.h (Output_section::input_sections): Provide non-const variant.
2446 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2447 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2448 accessors.
2449 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2450 (class Sort_toc_sections): New.
2451 (Target_powerpc::do_finalize_sections): Sort toc sections.
2452 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2453
4c8a1de1
RM
24542012-12-10 Roland McGrath <mcgrathr@google.com>
2455
2456 * testsuite/binary_unittest.cc (read_all): New function.
2457 (Sized_binary_test): Use it instead of ::read.
2458 * fileread.cc (do_read): Don't assume pread always reads the whole
2459 amount in a single call.
2460
edc27beb
AM
24612012-12-10 Alan Modra <amodra@gmail.com>
2462
2463 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2464 Set EM_PPC64 or EM_PPC here.
2465 (Target_selector_powerpc::do_recognize): Delete.
2466
906b9150
AM
24672012-12-10 Alan Modra <amodra@gmail.com>
2468
2469 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2470 stub_table_.
2471 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2472
418c15ae
RM
24732012-12-07 Roland McGrath <mcgrathr@google.com>
2474
2475 * testsuite/binary_unittest.cc (Sized_binary_test):
2476 Use open_descriptor rather than ::open.
2477
decdd3bc
AM
24782012-12-07 Alan Modra <amodra@gmail.com>
2479
2480 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2481 typedef and invalid_address constant.
2482 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2483 instantiate constants.
2484
db399005
ILT
24852012-12-06 Roland McGrath <mcgrathr@google.com>
2486
2487 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2488 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2489 * aclocal.m4: Regenerate.
2490 * configure: Regenerate.
2491 * Makefile.in: Regenerate.
2492 * testsuite/Makefile.in: Regenerate.
2493
aba6bc71
AM
24942012-12-07 Alan Modra <amodra@gmail.com>
2495
2496 * options.h (General_options): Add no_toc_optimize.
2497 * powerpc.cc (ok_lo_toc_insn): New function.
2498 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2499
9e69ed50
AM
25002012-12-06 Alan Modra <amodra@gmail.com>
2501
2502 * options.h (General_options): Add plt_align, plt_static_chain,
2503 plt_thread_safe. Update stub_group_size help text.
2504 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2505 for new plt_thread_safe_ var.
2506 (use_plt_offset): Correct comments.
2507 (Target_powerpc::do_relax): Look for thread creation symbols to
2508 determine default plt_thread_safe value. Clear plt call stubs
2509 as well as branch stubs each iteration.
2510 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2511 insn constants.
2512 (l, hi, ha, write_insn): Move earlier.
2513 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2514 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2515 plt stubs too.
2516 (Stub_table::update_size): Adjust.
2517 (Stub_table::prev_size, set_prev_size): Delete.
2518 (Stub_table::stub_align): Let --plt-align affect result.
2519 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2520 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2521 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2522 (Stub_table::do_write): Support more stub variants.
2523
f43ba157
AM
25242012-12-04 Alan Modra <amodra@gmail.com>
2525
2526 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2527 (Target_powerpc::do_define_standard_symbols): New function.
2528
34171bc5
AM
25292012-12-03 Alan Modra <amodra@gmail.com>
2530
2531 * output.h: Formatting, whitespace.
2532
dc9589e9 25332012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2534
2535 * layout.h (Layout::get_executable_sections): Declare.
2536 * layout.cc (Layout::get_executable_sections): New function.
2537 * arm.cc (Target_arm::group_sections): Use it.
2538 (Arm_output_section::group_sections): Delete now redundant test.
2539 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2540 param to handle relative relocs.
2541 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2542 (Output_data_reloc::add_absolute): Adjust.
2543 (Output_data_reloc::add_relative): New function.
2544 (Output_data::reset_data_size): New function.
2545 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2546 (Output_section::set_addralign): New function.
2547 (Output_section::checkpoint_set_addralign): New function.
2548 (Output_section::clear_section_offsets_need_adjustment): New function.
2549 (Output_section::input_sections): Make public.
2550 * powerpc.cc (class Output_data_brlt_powerpc): New.
2551 (class Stub_table, class Stub_control): New.
2552 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2553 stub_table_, set_stub_table, stub_table): New vectors and accessor
2554 functions.
2555 (Target_powerpc::do_may_relax, do_relax, push_branch,
2556 new_stub_table, stub_tables, brlt_section, group_sections,
2557 add_branch_lookup_table, find_branch_lookup_table,
2558 write_branch_lookup_table, make_brlt_section): New functions.
2559 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2560 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2561 branch_info_): New vars.
2562 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2563 make call stubs here.
2564 (Output_data_glink): Remove all call stub handling from this class.
2565 (Target_powerpc::Scan::local, global): Save interesting branch
2566 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2567 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2568 functions on final link.
2569 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2570 Handle long branch destinations too.
2571 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2572 do_plt_address_for_local): Adjust lookup of plt call stubs.
2573
627b30b7
AM
25742012-11-30 Alan Modra <amodra@gmail.com>
2575
2576 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2577 relocs against protected symbols when building 32-bit shared libs.
2578
40b469d7
AM
25792012-11-30 Alan Modra <amodra@gmail.com>
2580
2581 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2582 param. Call got_section() to make .got. Update all callers
2583 and their callers and so on.
2584
bb66a627
AM
25852012-11-30 Alan Modra <amodra@gmail.com>
2586
2587 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2588 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2589 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2590 value if it already exists.
2591
d2cf1c6c
L
25922012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2593
2594 PR gold/14858
2595 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2596
edccdf7c
RM
25972012-11-14 Roland McGrath <mcgrathr@google.com>
2598
2599 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2600 than bfc instruction for data sandboxing.
2601
6febeb74
AM
26022012-11-08 Alan Modra <amodra@gmail.com>
2603
2604 * po/POTFILES.in: Regenerate.
2605
0a6f1bf2
AM
26062012-11-05 Alan Modra <amodra@gmail.com>
2607
2608 * configure.ac: Apply 2012-09-10 change to config.in here.
2609 * configure: Regenerate.
2610
26a4e9cb
AM
26112012-11-05 Alan Modra <amodra@gmail.com>
2612
2613 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2614 (struct Opd_ent): Use "Address" rather than "Offset".
2615 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2616 (Target_powerpc::got_section): Make public.
2617 (Target_powerpc::scan_relocs): Move code setting symbols..
2618 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2619 Create _SDA_BASE_ only when referenced.
2620
cc928013
RM
26212012-11-02 Roland McGrath <mcgrathr@google.com>
2622
2623 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2624 from last change.
2625
50ed5eb1
RM
26262012-11-01 Roland McGrath <mcgrathr@google.com>
2627
62fe925a
RM
2628 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2629 for offset_in_output_section parameter.
2630 (Sized_target::relocate_special_relocatable): Likewise.
2631 * arm.cc (Target_arm::relocate_relocs): Likewise.
2632 (Target_arm::relocate_special_relocatable): Likewise.
2633 * i386.cc (Target_i386::relocate_relocs): Likewise.
2634 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2635 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2636 * target-reloc.h (relocate_relocs): Likewise.
2637 * testsuite/testfile.cc (Target_test): Likewise.
2638 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2639 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2640
2641 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2642 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2643
2644 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2645 parameter, which is unused in the [!F_SETFD] case.
2646
50ed5eb1
RM
2647 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2648 SYMNDX to off_t before comparing it to this->data_size().
2649 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2650 * incremental.cc (Output_section_incremental_inputs::do_write):
2651 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2652
2cadc0bf
RM
2653 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2654
3bfcb652
NC
26552012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2656
2657 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2658 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2659 in EABI_VER5.
2660
c1a8d56e
CC
26612012-10-29 Cary Coutant <ccoutant@google.com>
2662
2663 * dwp.cc (usage): Add file and exit status parameters;
2664 add --help and --version options.
2665 (print_version): New function.
2666 (main): Add --help and --version options.
2667
b2490a7b
L
26682012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2669
2670 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2671 final_layout_sequence.txt.
2672 * testsuite/Makefile.in: Regenerated.
2673
aa543512
L
26742012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2675
2676 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2677 COMPILE generated by automake.
2678 (LINK1): Likewise.
2679 (CXXCOMPILE1): Likewise.
2680 (CXXLINK1): Likewise.
2681 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2682 (LINK): Likewise.
2683 (CXXCOMPILE): Likewise.
2684 (CXXLINK): Likewise.
2685 * testsuite/Makefile.in: Regenerated.
2686
d361fafb
L
26872012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2688
2689 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2690 on bad fwrite return.
2691
598c7410
L
26922012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2693
2694 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2695 on val.
2696
35c813e2
CC
26972012-10-23 Cary Coutant <ccoutant@google.com>
2698
2699 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2700 * testsuite/Makefile.in: Regenerate.
2701 * testsuite/dwp_test.h: New source file.
2702 * testsuite/dwp_test_1.cc: New source file.
2703 * testsuite/dwp_test_1.s: New source file.
2704 * testsuite/dwp_test_1.sh: New source file.
2705 * testsuite/dwp_test_1b.cc: New source file.
2706 * testsuite/dwp_test_1b.s: New source file.
2707 * testsuite/dwp_test_2.cc: New source file.
2708 * testsuite/dwp_test_2.s: New source file.
2709 * testsuite/dwp_test_2.sh: New source file.
2710 * testsuite/dwp_test_main.cc: New source file.
2711 * testsuite/dwp_test_main.s: New source file.
2712
77429909
CC
27132012-10-23 Cary Coutant <ccoutant@google.com>
2714
2715 * dwp.h: New header file.
2716 * dwp.cc: New source file.
2717 * gold.h: Move shared declarations to system.h.
2718 * system.h: New header file.
2719 * Makefile.am: Add dwp.
2720 * Makefile.in: Regenerate.
2721
ed5d6712
CC
27222012-10-23 Cary Coutant <ccoutant@google.com>
2723
2724 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2725 Dwarf_info_reader::read_from_pointer.
2726 (Dwarf_pubnames_table::read_header): Likewise.
2727 (Dwarf_pubnames_table::next_name): Likewise.
2728 (Dwarf_die::read_attributes): Likewise.
2729 (Dwarf_die::skip_attributes): Likewise.
2730 (Dwarf_info_reader::read_from_pointer): New function template.
2731 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2732 (Dwarf_pubnames_table): Likewise.
2733 (Dwarf_info_reader::read_from_pointer): New function template.
2734 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2735 Dwarf_pubnames_table ctor.
2736
8787852d
CC
27372012-10-23 Cary Coutant <ccoutant@google.com>
2738
2739 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2740 abbrev_shndx.
2741 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2742 abbrev_shndx_.
2743 (Dwarf_info_reader::set_abbrev_shndx): New method.
2744 (Dwarf_info_reader::abbrev_shndx_): New data member.
2745
9fc236f3
CC
27462012-10-23 Cary Coutant <ccoutant@google.com>
2747
2748 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2749 from object, not parameters.
2750 (Dwarf_info_reader::parse): Likewise.
2751 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2752 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2753 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2754 methods.
2755
effe8365
CC
27562012-10-23 Cary Coutant <ccoutant@google.com>
2757
2758 * fileread.cc (Input_file::Input_file): New constructor.
2759 * fileread.h (class Input_file): Add new constructor.
2760
1698990d
AM
27612012-10-18 Alan Modra <amodra@gmail.com>
2762
2763 PR gold/14727
2764 * object.cc (Relobj::is_section_name_included): Also match
2765 .sdata personality section.
2766
168a4726
AM
27672012-10-18 Alan Modra <amodra@gmail.com>
2768
2769 * target-reloc.h (class Default_comdat_behavior): New, package up..
2770 (get_comdat_behaviour): ..this.
2771 (relocate_section): Add Relocate_comdat_behavior template arg,
2772 adjust code to suit.
2773 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2774 (Target_arm::scan_reloc_section): Likewise.
2775 * i386.cc (Target_i386::relocate_section): Likewise.
2776 * sparc.cc (Target_sparc::relocate_section): Likewise.
2777 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2778 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2779 * powerpc.cc (class Relocate_comdat_behavior): New.
2780 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2781 gold::relocate_section with new template arg.
2782
acc276d8
AM
27832012-10-18 Alan Modra <amodra@gmail.com>
2784
2785 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2786 dynamic relocs for GOT_TPREL got entries, without symbol if
2787 resolving locally.
2788 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2789 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2790 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2791
e10f9870
AM
27922012-10-17 Alan Modra <amodra@gmail.com>
2793
2794 PR gold/14726
2795 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2796
ae034989
ST
27972012-10-16 Sriraman Tallam <tmsriram@google.com>
2798
2799 * layout.cc (Layout::include_section): Keep sections marked
2800 SHF_EXCLUDE when doing relocatable links.
2801
f3a0ed29
AM
28022012-10-16 Alan Modra <amodra@gmail.com>
2803
2804 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2805 (Target_powerpc::do_finalize_sections): Call it.
2806 (Output_data_save_res): New class and supporting functions.
2807 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2808 normal symbols defined in object files.
2809
c6de8ed4
AM
28102012-10-12 Alan Modra <amodra@gmail.com>
2811
2812 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2813 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2814 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2815 section if scan_opd_relocs not yet called.
2816 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2817
03e25981
AM
28182012-10-12 Alan Modra <amodra@gmail.com>
2819
2820 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2821 add_local_ifunc_entry): Revert last change.
2822 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2823
c9824451
AM
28242012-10-05 Alan Modra <amodra@gmail.com>
2825
2826 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2827 do_plt_address_for_global): New functions.
2828 (Output_data_got_powerpc::do_write): Don't segfault when linking
2829 statically.
2830 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2831 add_local_ifunc_entry): Return true on adding entry..
2832 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2833 glink->add_entry call. Remove unused symtab param. Adjust calls.
2834 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2835 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2836 set up symbols here.
2837 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2838 syms here. Do so even when no .iplt. Don't segfault when linking
2839 statically.
2840 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2841 new variants without reloc param.
2842 (Glink_sym_ent::Glink_sym_ent): Likewise.
2843 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2844 reloc when refs will resolve to plt call stub.
2845 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2846 R_PPC_PLTREL24 to resolve locally.
2847 (Target_powerpc::Scan::global): Correct ifunc handling.
2848 (Target_powerpc::Relocate::relocate): Correct local sym glink
2849 lookup. Don't destroy "value" when we have a plt call stub,
2850 and when checking plt call validity.
2851 (Target_powerpc::do_dynsym_value): Simplify.
2852
19fec8c1
AM
28532012-10-05 Alan Modra <amodra@gmail.com>
2854
2855 * i386.cc (Output_data_plt_i386::address_for_global,
2856 address_for_local): Add plt offset to returned value. Adjust uses.
2857 * sparc.cc (Output_data_plt_sparc::address_for_global,
2858 address_for_local): Likewise.
2859 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2860 address_for_local): Likewise.
2861 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2862 address_for_local): Likewise.
2863 * target.h (Target::plt_address_for_global, plt_address_for_local):
2864 Update comment.
2865 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2866 (Output_data_got::Got_entry::write): Nor here.
2867 * output.h: Comment fix.
2868
e867b647
WL
28692012-10-02 Jiong Wang <jiwang@tilera.com>
2870
2871 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2872 global_offset_table_ value for larget got.
2873 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2874
e5d5f5ed
AM
28752012-09-29 Alan Modra <amodra@gmail.com>
2876
2877 * powerpc.cc (Target_powerpc::iplt_): New output section.
2878 (Target_powerpc::iplt_section, make_iplt_section,
2879 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2880 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2881 Target_powerpc::plt_entry_count): Count iplt entries too.
2882 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2883 reloc section in constructor. New params.
2884 (Target_powerpc::make_plt_section): Create reloc section here instead.
2885 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2886 functions.
2887 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2888 (Output_data_glink::add_entry, find_entry): New functions to
2889 deal with local syms.
2890 (Glink_sym_ent): Add support for local syms.
2891 (Output_data_glink::do_write): Handle ifunc plt entries.
2892 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2893 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2894 (Target_powerpc::Relocate::relocate): Likewise.
2895 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2896
ec4dbad3
AM
28972012-09-25 Alan Modra <amodra@gmail.com>
2898
2899 * object.h (Sized_relobj_file::adjust_local_symbol,
2900 do_adjust_local_symbol): New functions.
2901 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2902 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2903 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2904 and irregular opd entry spacing.
2905 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2906 (Global_symbol_visitor_opd): New functor.
2907 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2908 on deleted opd entries.
2909
5c0b3823
WL
29102012-09-15 Jiong Wang <jiwang@tilera.com>
2911
2912 * tilegx.cc: New file.
2913 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2914 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2915 * configure.tgt: Add entries for tilegx*.
2916 * configure.ac: Likewise.
2917 * Makefile.in: Rebuild.
2918 * configure: Likewise.
2919 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2920 tilegx.
2921
bfdfa4cd
AM
29222012-09-13 Alan Modra <amodra@gmail.com>
2923
2924 * target-reloc.h (scan_relocs): Call scan.local for relocs
2925 against symbols in discarded sections. Pass is_discarded
2926 param.
2927 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2928 Add is_discarded param.
2929 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2930 is_discarded to flag opd entry as discarded. Don't emit dyn
2931 relocs on such entries.
2932 (Target_powerpc::Scan::global): Similarly detect and handle
2933 such opd entries.
2934 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2935 opd_ent_. Update all uses.
2936 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2937 (Target_powerpc::relocate_section): Zero out discarded opd
2938 entry relocs.
2939
d77a0555
ILT
29402012-09-12 Ian Lance Taylor <iant@google.com>
2941
2942 PR gold/14570
2943 * output.cc: Rename Output_data_got template parameter from size
2944 to got_size for all functions. Compile all variants of
2945 Output_data_got.
2946 (Output_data_got::Got_entry::write): Correct use of size for
2947 symbol value. Use local_is_tls rather than casting to
2948 Sized_relobj_file.
2949 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2950 (class Sized_relobj_file): Add do_local_is_tls.
2951 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2952
815a1205
AM
29532012-09-11 Alan Modra <amodra@gmail.com>
2954
2955 PR gold/14566
2956 * layout.cc (Layout::set_segment_offsets): When using
2957 common-page-size alignment, ensure we are on a new max-page-size
2958 page.
2959 * output.cc (Output_segment::set_section_addresses): Use
2960 abi_pagesize, not common_pagesize for relro boundary.
2961 (Output_segment::set_offset): Likewise.
2962
bd73a62d
AM
29632012-09-11 Alan Modra <amodra@gmail.com>
2964
2965 * output.h (Output_data_got::add_global_tls, add_local_tls,
2966 add_local_tls_pair): New functions.
2967 (Output_data_got::add_local_pair_with_rel): Remove second
2968 reloc param. Expand comment.
2969 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2970 use_plt_or_tls_offset_, similarly for constructor param.
2971 (Output_data_got::Got_entry::write): Add got_index param.
2972 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2973 add_local_tls_pair): New functions.
2974 (Output_data_got::Got_entry::write): Handle tls symbols
2975 with use_plt_or_tls_offset_ set specially.
2976 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2977 (Output_data_got::do_write): Replace iterator with index, pass
2978 index to entry write function.
2979 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2980 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2981 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2982 call.
2983 * i386.cc (Target_i386::Scan::local): Likewise.
2984 * sparc.cc (Target_sparc::Scan::local): Likewise.
2985 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2986 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2987 do_tls_offset_for_global): New functions.
2988 (Target_powerpc::Scan::local): Correct TLS relocations and got
2989 entry values.
2990 (Target_powerpc::Scan::global): Don't emit unnecessary
2991 dynamic relocations on TLS GOT entries.
2992
00716ab1
AM
29932012-09-10 Matthias Klose <doko@ubuntu.com>
2994
2995 * config.in: Disable sanity check for kfreebsd.
2996
c891b3f9
SA
29972012-09-10 Sterling Augustine <saugustine@google.com>
2998
2999 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3000 (Gdb_index::pubtypes_read): New parameter.
3001 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3002 to calls.
3003 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3004 pubtypes_object_.
3005
e81fea4d
AM
30062012-09-09 Alan Modra <amodra@gmail.com>
3007
3008 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3009 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3010 * gc.h (gc_process_relocs): Call target gc_add_reference.
3011 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3012 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3013 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3014 unnecessary cast.
3015 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3016 to cater for when we don't need code offset. Update use.
3017 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3018 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3019 set_opd_valid): New functions.
3020 (Target_powerpc::do_gc_add_reference): New function.
3021 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3022 stashed refs.
3023 (Target_powerpc::do_gc_mark_symbol): New function.
3024
d2d60eef
CC
30252012-09-06 Cary Coutant <ccoutant@google.com>
3026
3027 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3028 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3029 (Dwarf_die::skip_attributes): Likewise.
3030 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3031 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3032 (main): Call it.
3033 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3034
32ed4573
L
30352012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3036
3037 * testsuite/script_test_3.t: Add .got.plt output section
3038 statement.
3039 * testsuite/script_test_4.t: Likewise.
3040
f4baf0d4
AM
30412012-09-05 Alan Modra <amodra@gmail.com>
3042
3043 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
3044 update all uses and lose "enum" when using type.
3045
864a1b56
AM
30462012-09-05 Alan Modra <amodra@gmail.com>
3047
3048 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3049 * configure: Regenerate.
3050 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3051 (plugin_final_layout.stdout): Likewise.
3052 (memory_test): Set page sizes to 0x1000.
3053 * testsuite/Makefile.in: Regenerate.
3054 * testsuite/discard_locals_test.sh: Add FIXME comment.
3055 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3056 * testsuite/pr14265.t: Add .got output section statement.
3057 * testsuite/script_test_2.t: Likewise.
3058 * testsuite/script_test_3.t: Likewise.
3059 * testsuite/script_test_4.t: Likewise.
3060 * testsuite/script_test_5.t: Likewise.
3061 * testsuite/script_test_6.t: Likewise.
3062 * testsuite/script_test_7.t: Likewise.
3063 * testsuite/script_test_9.t: Likewise.
3064
3ea0a085
AM
30652012-09-05 Alan Modra <amodra@gmail.com>
3066
3067 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3068 (Powerpc_relocate_functions::Status): New typedef.
3069 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3070 (Target_powerpc::Scan::local): Handle REL64.
3071 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3072 for REL32 and REL64.
3073 (Target_powerpc::symval_for_branch): New function, extracted from..
3074 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3075 checks. Report overflow errors.
3076
7404fe1b
AM
30772012-09-05 Alan Modra <amodra@gmail.com>
3078
3079 * object.h (Sized_relobj_file::emit_relocs): Delete.
3080 (Sized_relobj_file::emit_relocs_reltype): Delete.
3081 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
3082 relocate_relocs for --emit-relocs.
3083 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
3084 * output.h: Update comment.
3085 (Output_segment::first_section): New function.
3086 (Output_segment::first_section_load_address): Use first_section.
3087 * output.cc (Output_segment::first_section): New function extracted..
3088 (Output_segment::first_section_load_address): ..from here. Delete.
3089 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
3090 * target.h (Sized_target::relocate_for_relocatable): Likewise.
3091 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
3092 adjust call to target.h function.
3093 * i386.cc (Target_i386): Likewise.
3094 * sparc.cc (Target_sparc): Likewise.
3095 * x86_64.cc (Target_x86_64): Likewise.
3096 * powerpc.cc (Target_powerpc): Likewise.
3097 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
3098 first tls section has section symbol for optimised local dynamic
3099 output relocs.
3100 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
3101 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
3102 optimised tls code.
3103 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
3104 Rename to relocate_relocs. Update error message.
3105
957564c9
AS
31062012-09-04 Andreas Schwab <schwab@linux-m68k.org>
3107
3108 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
3109 --just-symbols.
3110
dd93cd0a
AM
31112012-08-31 Alan Modra <amodra@gmail.com>
3112
3113 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3114 (Powerpc_relobj::toc_base_offset): New stub function.
3115 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3116 got_mod_index_offset to tlsld_got_offset. Update all refs.
3117 (Target_powerpc::Relocate::enum skip_tls): New.
3118 (Target_powerpc::call_tls_get_addr_): New var.
3119 (Target_powerpc::is_branch_reloc): Move to file scope.
3120 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3121 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3122 New functions.
3123 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3124 (powerpc_info): Correct common_pagesize for ppc64.
3125 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3126 (Powerpc_relocate_functions): Add overflow check enums and functions.
3127 Add non-shift version of rela, rela_ua. Delete all rel public
3128 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3129 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3130 addr16_ha3, addr14 functions.
3131 (Output_data_got_powerpc::add_constant_pair): New function.
3132 (Output_data_got_powerpc::got_base_offset): Likewise.
3133 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3134 (instruction constants): Sort, add some more.
3135 (Output_data_glink::do_write): Add and use Address typedef. Use
3136 object->toc_base_offset() stub for 64-bit.
3137 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3138 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3139 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3140 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3141 Always treat .opd relocs as against locally defined symbol.
3142 Correct condition for RELATIVE relocs.
3143 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3144 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3145 for 32-bit syms with a plt entry. Correct ppc64 toc base
3146 calculations. Handle TLS relocs, and more. Add overflow
3147 checking and adjust for Powerpc_relocate_functions changes.
3148 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3149 Reinstate --emit-relocs code with FIXME.
3150
a1373b60
AM
31512012-08-30 Alan Modra <amodra@gmail.com>
3152
3153 * layout.cc (Layout::set_segment_offsets): Set p_align to
3154 abi_pagesize, not common_pagesize.
3155 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3156 to determine whether file header can go in segment.
3157
703d02da
AM
31582012-08-30 Alan Modra <amodra@gmail.com>
3159
3160 * output.h (Output_reloc::Output_reloc <output section>): Add
3161 is_relative param. Adjust calls.
3162 (Output_reloc::add_output_section_relative): New functions.
3163 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3164 is_relative.
3165 (Output_reloc::symbol_value): Handle SECTION_CODE.
3166
16164a6b
ST
31672012-08-24 Sriraman Tallam <tmsriram@google.com>
3168
3169 * gold.cc (queue_middle_tasks): Call layout again when unique
3170 segments for sections is desired.
3171 * layout.cc (Layout::Layout): Initialize new members.
3172 (Layout::get_output_section_flags): New function.
3173 (Layout::choose_output_section): Call get_output_section_flags.
3174 (Layout::layout): Make output section for mapping to a unique segment.
3175 (Layout::insert_section_segment_map): New function.
3176 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 3177 output sections marked so.
16164a6b
ST
3178 (Layout::segment_precedes): Check for unique segments when sorting.
3179 * layout.h (Layout::Unique_segment_info): New struct.
3180 (Layout::Section_segment_map): New typedef.
3181 (Layout::insert_section_segment_map): New function.
3182 (Layout::get_output_section_flags): New function.
3183 (Layout::is_unique_segment_for_sections_specified): New function.
3184 (Layout::set_unique_segment_for_sections_specified): New function.
3185 (Layout::unique_segment_for_sections_specified_): New member.
3186 (Layout::section_segment_map_): New member.
3187 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3188 Rename is_gc_pass_one to is_pass_one.
3189 Rename is_gc_pass_two to is_pass_two.
3190 Rename is_gc_or_icf to is_two_pass.
3191 Check for which pass based on whether symbols data is present.
3192 Make it two pass when unique segments for sections is desired.
3193 * output.cc (Output_section::Output_section): Initialize new
3194 members.
3195 * output.h (Output_section::is_unique_segment): New function.
3196 (Output_section::set_is_unique_segment): New function.
3197 (Output_section::is_unique_segment_): New member.
3198 (Output_section::extra_segment_flags): New function.
3199 (Output_section::set_extra_segment_flags): New function.
3200 (Output_section::extra_segment_flags_): New member.
3201 (Output_section::segment_alignment): New function.
3202 (Output_section::set_segment_alignment): New function.
3203 (Output_section::segment_alignment_): New member.
3204 (Output_segment::Output_segment): Initialize is_unique_segment_.
3205 (Output_segment::is_unique_segment): New function.
3206 (Output_segment::set_is_unique_segment): New function.
3207 (Output_segment::is_unique_segment_): New member.
3208 * plugin.cc (allow_unique_segment_for_sections): New function.
3209 (unique_segment_for_sections): New function.
3210 (Plugin::load): Add new functions to transfer vector.
3211 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3212 * Makefile.in: Regenerate.
3213 * testsuite/plugin_final_layout.sh: Check if unique segment
3214 functionality works.
3215 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3216 are available.
3217 (allow_unique_segment_for_sections): New global.
3218 (unique_segment_for_sections): New global.
3219 (claim_file_hook): Call allow_unique_segment_for_sections.
3220 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 3221
1e2bee4f
CC
32222012-08-22 Cary Coutant <ccoutant@google.com>
3223
3224 * layout.cc (Layout::include_section): Don't assert on GROUP
3225 sections with --emit-relocs.
3226
1d5dfe78
CC
32272012-08-21 Cary Coutant <ccoutant@google.com>
3228
3229 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3230 if --export-dynamic-symbol names an undef symbol.
3231
c9269dff
AM
32322012-08-18 Alan Modra <amodra@gmail.com>
3233
3234 * powerpc.cc: Formatting and white space.
3235 (Powerpc_relobj): Rename got2_section_ to special_.
3236 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3237 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3238 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3239 (Target_powerpc): Add Address typedef and invalid_address. Use
3240 throughout.
3241 (Target_powerpc::is_branch_reloc): New function.
3242 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3243 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3244 for dst_mask, value and addend.
3245 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3246 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3247 (Output_data_glink::do_write): Correct toc base. Don't try to use
3248 uint16_t for 24-bit offset. Use get_output_section_offset and
3249 check return.
3250 (Target_powerpc::Scan::local): Handle more relocs.
3251 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3252 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3253 Plug in toc restoring insn after plt calls. Translate branches
3254 to function descriptor symbols to corresponding entry point.
3255 (Target_powerpc::relocate_for_relocatable): Check return from
3256 get_output_section_offset.
3257 * symtab.h: Comment typo.
3258
b1759dce
ILT
32592012-08-14 Ian Lance Taylor <iant@google.com>
3260
3261 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3262 unsupported_relocal_local to call unsupported_reloc_global.
3263
b9b2ae8b
NC
32642012-08-14 Nick Clifton <nickc@redhat.com>
3265
3266 PR ld/14265
3267 * script-sections.cc (Sections_element::output_section_name): Add
3268 keep return parameter.
3269 (Output_section_element::match_name): Add keep return parameter.
3270 Return the value of the keep_ member.
3271 * script-sections.h (class Output_section): Update
3272 output_section_name prototype.
3273 * layout.cc (Layout::keep_input_section): New public member
3274 function.
3275 (Layout::choose_output_section): Pass keep parameter to
3276 output_section_name.
3277 * layout.h (class Layout): Add keep_input_section.
3278 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3279 sections.
3280 * testsuite/Makefile.am: Add a test.
3281 * testsuite/Makefile.in: Regenerate.
3282 * testsuite/pr14265.c: Source file for the test.
3283 * testsuite/pr14265.t: Linker script for the test.
3284 * testsuite/pr14265.sh: Shell script for the test.
3285
921b5322
AM
32862012-08-14 Alan Modra <amodra@gmail.com>
3287
3288 * target.h (Target::output_section_name): New function.
3289 (Target::do_output_section_name): New function.
3290 * layout.cc (Layout::choose_output_section): Call the above.
3291 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3292
6ce78956
AM
32932012-08-14 Alan Modra <amodra@gmail.com>
3294
3295 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3296 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3297 for replace_constant call.
3298 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3299 (Output_data_glink::do_print_to_mapfile): New function.
3300 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3301 (Target_powerpc::Relocate::relocate): Likewise.
3302
d1a8cabd
AM
33032012-08-14 Alan Modra <amodra@gmail.com>
3304
3305 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3306 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3307 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3308 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3309 all references to shndx_. Handle special case for R_PPC_PLTREL24
3310 here.
3311 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3312 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3313 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3314 here.
3315 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3316 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3317
d83ce4e3
AM
33182012-08-12 Alan Modra <amodra@gmail.com>
3319
3320 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3321 (glink insn constants): Use uint32_t.
3322 (Output_data_glink::add_entry): Use insert, not [] operator.
3323
cf43a2fe
AM
33242012-08-11 Alan Modra <amodra@gmail.com>
3325
3326 * object.h (Sized_relobj_file::find_shdr): New function.
3327 (Sized_relobj_file::find_special_sections): New function.
3328 * object.cc (Sized_relobj_file::find_shdr): New function.
3329 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3330 (Sized_relobj_file::find_special_sections): New function, split out..
3331 (Sized_relobj_file::do_read_symbols): ..from here.
3332 * output.h (Output_data_got::replace_constant): New function.
3333 (Output_data_got::num_entries): New function.
3334 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3335 (Output_data_got::got_offset): Protected rather than private.
3336 (Output_data_got::replace_got_entry): New function.
3337 * output.cc (Output_data_got::replace_got_entry): New function.
3338 * powerpc.cc (class Powerpc_relobj): New.
3339 (class Powerpc_relocate_functions): Delete all psymval variants or
3340 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3341 Implement _ha functions using corresponding _hi function.
3342 (Powerpc_relobj::find_special_sections): New function.
3343 (Target_powerpc::do_make_elf_object): New function.
3344 (class Output_data_got_powerpc): New.
3345 (class Output_data_glink): New.
3346 (class Powerpc_scan_relocatable_reloc): New.
3347 Many more changes througout file.
3348
3c892704
NC
33492012-08-09 Nick Clifton <nickc@redhat.com>
3350
3351 * po/vi.po: Updated Vietnamese translation.
3352
82435b3b
ILT
33532012-08-07 Ian Lance Taylor <iant@google.com>
3354
3355 * layout.cc (Layout::add_target_dynamic_tags): If
3356 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3357 plt_rel.
3358
a6dc81d2
NC
33592012-07-30 Nick Clifton <nickc@redhat.com>
3360
3361 * po/gold.pot: Updated template.
3362 * po/es.po: Updated Spanish translation.
3363
f1415016
CC
33642012-07-18 Cary Coutant <ccoutant@google.com>
3365
3366 PR gold/14344
3367 * configure.ac: Add check for -gpubnames support.
3368 * configure: Regenerate.
3369 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3370 support; force -gno-pubnames.
3371 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3372 support.
3373 (gdb_index_test_4): New test.
3374 * testsuite/Makefile.in: Regenerate.
3375 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3376 * testsuite/gdb_index_test_2.sh: Likewise.
3377 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3378 * testsuite/gdb_index_test_4.sh: New script.
3379 * testsuite/gdb_index_test_comm.sh: New script with common code;
3380 don't look for space after colon.
3381
b7fd7c37
ST
33822012-07-16 Sriraman Tallam <tmsriram@google.com>
3383
3384 * gold.cc (queue_middle_tasks): Update function order only after
3385 deferred objects due to plugins are processed.
3386
1f3212db
ILT
33872012-07-11 Ian Lance Taylor <iant@google.com>
3388
3389 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3390 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3391 (Target_arm::scan_reloc_for_stub): Likewise.
3392 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3393 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3394 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3395 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3396 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3397
81c82a68
ILT
33982012-07-10 Dodji Seketeli <dodji@redhat.com>
3399 Ian Lance Taylor <iant@google.com>
3400
3401 PR gold/14309
3402 * configure.ac: Test whether std::tr1::hash<off_t> works.
3403 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3404 needed.
3405 * output.h (class Output_fill): Add virtual destructor.
3406 * configure, config.in: Rebuild.
3407
eabc84f4
RM
34082012-06-22 Roland McGrath <mcgrathr@google.com>
3409
3410 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3411
370e30b6
RÁE
34122012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3413
3414 * plugin.cc (Plugin::load): Handle position independent executables.
3415
fb1b895d
CC
34162012-06-06 Cary Coutant <ccoutant@google.com>
3417
3418 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3419 add .debug_macro.
3420 (lines_only_debug_sections): Likewise.
3421 (gdb_fast_lookup_sections): New static array.
3422 (is_gdb_debug_section): Rename formal parameter.
3423 (is_lines_only_debug_section): Likewise.
3424 (is_gdb_fast_lookup_section): New function.
3425 (Layout::include_section): Check for ".zdebug_" prefix; pass
3426 section name suffix to is_gdb_debug_section, et al.; check for
3427 fast-lookup sections when building .gdb_index.
3428 * options.h (--strip-debug-gdb): Update GDB version number.
3429
7c0640fa
CC
34302012-06-06 Cary Coutant <ccoutant@google.com>
3431
3432 * configure.ac: Add check for fallocate.
3433 * configure: Regenerate.
3434 * config.in: Regenerate.
3435
3436 * options.h (class General_options): Add --mmap-output-file and
3437 --posix-fallocate options.
3438 * output.cc: (posix_fallocate): Remove; replace with...
3439 (gold_fallocate): New function.
3440 (Output_file::map_no_anonymous): Call gold_fallocate.
3441 (Output_file::map): Check --mmap-output-file option.
3442
2a49eb69
DK
34432012-06-05 Jing Yu <jingyu@google.com>
3444
3445 * gold.h (textdomain): Add do {} to empty while(0).
3446 (bindtextdomain): Likewise.
3447
fad072ac
CC
34482012-06-04 Cary Coutant <ccoutant@google.com>
3449
3450 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3451 has_dynsym_index.
3452
8cc69fb6
ST
34532012-05-25 Sriraman Tallam <tmsriram@google.com>
3454
3455 * symtab.cc (Symbol_table::define_special_symbol):
3456 Initialize *poldsym to prevent uninitialized variable errors.
3457
1be75daa
CC
34582012-05-23 Cary Coutant <ccoutant@google.com>
3459
3460 * layout.cc (Layout::section_name_mapping): Add rules to handle
3461 exact match on .data.rel.ro.local or .data.rel.ro.
3462 (Layout::output_section_name): Check for exact matches.
3463
9b689de0
CC
34642012-05-23 Cary Coutant <ccoutant@google.com>
3465
3466 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3467 more carefully.
3468
b24fdbf5
CC
34692012-05-22 Cary Coutant <ccoutant@google.com>
3470
3471 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3472 object before exporting symbol.
3473
e550e1a2
L
34742012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3475
3476 * testsuite/tls_test.cc: Include "config.h" first.
3477 * testsuite/tls_test_c.c: Likewise.
3478
df7b86aa
NC
34792012-05-17 Daniel Richard G. <skunk@iskunk.org>
3480 Nick Clifton <nickc@redhat.com>
3481
3482 PR 14072
3483 * configure.in: Add check that sysdep.h has been included before
3484 any system header files.
3485 * configure: Regenerate.
3486 * config.in: Regenerate.
3487
1007b503
CC
34882012-05-14 Cary Coutant <ccoutant@google.com>
3489
3490 * layout.cc (Layout::make_output_section): Mark .tdata section
3491 as RELRO.
3492 * testsuite/relro_test.cc: Add a TLS variable.
3493
fd885f3a
L
34942012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3495
3496 PR gold/14091
3497 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3498 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3499 R_X86_64_64.
3500
80f5885c
CC
35012012-05-08 Cary Coutant <ccoutant@google.com>
3502
3503 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3504 (lines_only_debug_sections): Likewise.
3505
2e702c99
RM
35062012-05-02 Roland McGrath <mcgrathr@google.com>
3507
3508 * nacl.cc: New file.
3509 * nacl.h: New file.
3510 * Makefile.am (CCFILES, HFILES): Add them.
3511 * Makefile.in: Regenerate.
3512 * i386.cc (Output_data_plt_i386_nacl): New class.
3513 (Output_data_plt_i386_nacl_exec): New class.
3514 (Output_data_plt_i386_nacl_dyn): New class.
3515 (Target_i386_nacl): New class.
3516 (Target_selector_i386_nacl): New class.
3517 (target_selector_i386): Use it instead of Target_selector_i386.
3518 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3519 (Target_x86_64_nacl): New class.
3520 (Target_selector_x86_64_nacl): New class.
3521 (target_selector_x86_64, target_selector_x32): Use it instead of
3522 Target_selector_x86_64.
3523 * arm.cc (Output_data_plt_arm_nacl): New class.
3524 (Target_arm_nacl): New class.
3525 (Target_selector_arm_nacl): New class.
3526 (target_selector_arm, target_selector_armbe): Use it instead of
3527 Target_selector_arm.
3528
3529 * target-select.cc (select_target): Take new Input_file* and off_t
3530 arguments, pass them on to recognize method of selector.
3531 * object.cc (make_elf_sized_object): Update caller.
3532 * parameters.cc (parameters_force_valid_target): Likewise.
3533 * incremental.cc (make_sized_incremental_binary): Likewise.
3534 * target-select.h: Update decl.
3535 (Target_selector::recognize): Take new Input_file* argument,
3536 pass it on to do_recognize.
3537 (Target_selector::do_recognize): Take new Input_file* argument.
3538 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3539 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3540 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3541 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3542
3543 * target.h (Target::Target_info): New members isolate_execinstr
3544 and rosegment_gap.
3545 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3546 * arm.cc (Target_arm::arm_info): Update initializer.
3547 * i386.cc (Target_i386::i386_info): Likewise.
3548 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3549 * sparc.cc (Target_sparc::sparc_info): Likewise.
3550 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3551 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3552 * layout.cc (Layout::attach_allocated_section_to_segment):
3553 Take new const Target* argument. If target->isolate_execinstr(), act
3554 like --rosegment.
3555 (Layout::find_first_load_seg): Take new const Target* argument;
3556 if target->isolate_execinstr(), reject PF_X segments.
3557 (Layout::relaxation_loop_body): Update caller.
3558 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3559 reset file offset to zero when we hit LOAD_SEG, and then do a second
3560 loop over the segments before LOAD_SEG to reassign offsets after
3561 addresses have been determined. Handle target->rosegment_gap().
3562 (Layout::attach_section_to_segment): Take new const Target* argument;
3563 pass it to attach_allocated_section_to_segment.
3564 (Layout::make_output_section): Update caller.
3565 (Layout::attach_sections_to_segments): Take new const Target* argument;
3566 pass it to attach_section_to_segment.
3567 * gold.cc (queue_middle_tasks): Update caller.
3568 * layout.h (Layout): Update method decls with new arguments.
3569
3570 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3571 Target_info pointer to use.
3572 (Target_arm::do_make_data_plt): New virtual method.
3573 (Target_arm::make_data_plt): New method that calls it.
3574 (Target_arm::make_plt_entry): Use it.
3575 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3576 for the section alignment.
3577 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3578 method.
3579 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3580 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3581 method.
3582 (Output_data_plt_arm::get_plt_entry_size): Call it.
3583 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3584 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3585 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3586 method.
3587 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3588 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3589 method instead of sizeof(plt_entry).
3590 (Output_data_plt_arm::add_entry): Likewise.
3591 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3592 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3593 than static method.
3594 (Target_arm::plt_entry_size): Likewise.
3595 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3596 Move to ...
3597 (Output_data_plt_arm_standard): ... here, new class.
3598 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3599 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3600 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3601
3602 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3603 Take additional argument for the PLT entry size.
3604 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3605 Use get_plt_entry_size method rather than plt_entry_size variable.
3606 (Output_data_plt_x86_64::reserve_slot): Likewise.
3607 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3608 (Output_data_plt_x86_64::add_entry): Likewise.
3609 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3610 (Output_data_plt_x86_64::address_for_global): Likewise.
3611 (Output_data_plt_x86_64::address_for_local): Likewise.
3612 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3613 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3614 Make method non-static.
3615 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3616 method.
3617 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3618 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3619 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3620 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3621 virtual method.
3622 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3623 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3624 virtual method.
3625 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3626 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3627 virtual method.
3628 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3629 (Output_data_plt_x86_64::plt_entry_size)
3630 (Output_data_plt_x86_64::first_plt_entry)
3631 (Output_data_plt_x86_64::plt_entry)
3632 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3633 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3634 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3635 (Output_data_plt_x86_64_standard): ... here, new class.
3636 (Target_x86_64::Target_x86_64): Take optional argument for the
3637 Target_info pointer to use.
3638 (Target_x86_64::do_make_data_plt): New virtual method.
3639 (Target_x86_64::make_data_plt): New method to call it.
3640 (Target_x86_64::init_got_plt_for_update): Use that.
3641 Call this->plt_->add_eh_frame method here.
3642 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3643 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3644 rather than static method.
3645 (Target_x86_64::plt_entry_size): Likewise.
3646 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3647 rather than plt_entry_size variable. Move guts of PLT filling to...
3648 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3649 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3650 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3651
3652 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3653 additional argument for the section alignment.
3654 Don't do add_eh_frame_for_plt here.
3655 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3656 non-static. Use get_plt_entry_size method rather than plt_entry_size
3657 variable.
3658 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3659 method.
3660 (Output_data_plt_i386::get_plt_entry_size): Call it.
3661 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3662 (Output_data_plt_i386::add_eh_frame): New method to call it.
3663 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3664 method.
3665 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3666 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3667 method.
3668 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3669 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3670 method instead of plt_entry_size.
3671 (Output_data_plt_i386::plt_entry_size)
3672 (Output_data_plt_i386::plt_eh_frame_fde_size)
3673 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3674 (Output_data_plt_i386_standard): ... here, new class.
3675 (Output_data_plt_i386_exec): New class.
3676 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3677 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3678 (Output_data_plt_i386::exec_plt_entry): Move to ...
3679 (Output_data_plt_i386_exec::plt_entry): ... here.
3680 (Output_data_plt_i386_dyn): New class.
3681 (Output_data_plt_i386::first_plt_entry): Move to ...
3682 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3683 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3684 (Output_data_plt_i386_dyn::plt_entry): ... here.
3685 (Target_i386::Target_i386): Take optional argument for the Target_info
3686 pointer to use.
3687 (Target_i386::do_make_data_plt): New virtual method.
3688 (Target_i386::make_data_plt): New method to call it.
3689 (Target_i386::make_plt_section): Use that.
3690 Call this->plt_->add_eh_frame method here.
3691 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3692 rather than plt_entry_size variable.
3693 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3694 (Output_data_plt_i386::address_for_local): Likewise.
3695 (Output_data_plt_i386::do_write): Likewise.
3696 Move guts of PLT filling to...
3697 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3698 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3699 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3700 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3701
b9b9f2ee
CC
37022012-05-01 Cary Coutant <ccoutant@google.com>
3703
3704 * dwarf_reader.cc (Dwarf_die::read_attributes)
3705 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3706 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3707 * reduced_debug_output.cc
3708 (Output_reduced_debug_info_section::get_die_end): Remove
3709 DW_FORM_GNU_ref_index. Add default case.
3710
57923f48
MW
37112012-04-26 Mark Wielaard <mjw@redhat.com>
3712
3713 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3714 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3715 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3716 DW_AT_high_pc as offset from DW_AT_low_pc.
3717
3718 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3719 * testsuite/Makefile.in: Regenerate.
3720 * testsuite/gdb_index_test_3.c: New test source file.
3721 * testsuite/gdb_index_test_3.sh: New test source file.
3722
2c54b4f4
ILT
37232012-04-25 Ian Lance Taylor <iant@google.com>
3724
3725 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3726 pointer.
3727 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3728 as a class, not a struct.
3729 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3730 (Target_arm::apply_cortex_a8_workaround): Likewise.
3731 * gc.h: Declare Reloc_types as a struct, not a class.
3732 * object.h: Declare Symbols_data as a struct.
3733 * reloc.h: Declare Read_relocs_data as a struct.
3734 * target.h: Declare Relocate_info as a struct.
3735
a5a5f7a3
DM
37362012-04-24 David S. Miller <davem@davemloft.net>
3737
3738 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3739 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3740 and R_SPARC_WPLT30.
3741
f038d496
CC
37422012-04-24 Cary Coutant <ccoutant@google.com>
3743
3744 * incremental-dump.cc (find_input_containing_global): Replace
3745 magic number with symbolic constant.
3746 (dump_incremental_inputs): Update version number.
3747 * incremental.cc (Output_section_incremental_inputs): Update version
3748 number; import symbolic constants from Incremental_inputs_reader.
3749 (Incremental_inputs::create_data_sections): Align relocations
3750 section correctly for 64-bit targets.
3751 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3752 constants; add padding.
3753 (Output_section_incremental_inputs::write_header): Add assert for
3754 header_size.
3755 (Output_section_incremental_inputs::write_input_files): Add assert
3756 for input_entry_size.
3757 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3758 add assert for object_info_size, input_section_entry_size,
3759 global_sym_entry_size.
3760 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3761 for data structure sizes; use them.
3762 (Incremental_input_entry_reader): Import symbolic constants from
3763 Incremental_inputs_reader; use them.
3764
a4d85145
DM
37652012-04-23 David S. Miller <davem@davemloft.net>
3766
3767 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3768 and elf_flags_set_.
3769 (Target_sparc::Target_sparc): Initialize new fields.
3770 (Target_sparc::do_make_elf_object): New function.
3771 (Target_sparc::do_adjust_elf_header): New function.
3772
1d509098
CC
37732012-04-23 Cary Coutant <ccoutant@google.com>
3774
3775 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3776 CU range table of gdb index.
3777
7ebeff7f
DM
37782012-04-20 David S. Miller <davem@davemloft.net>
3779
3780 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3781 instead of false.
3782
13cf9988
DM
37832012-04-16 David S. Miller <davem@davemloft.net>
3784
2a1079e8
DM
3785 * sparc.cc (Target_sparc::got_address): New function.
3786 (Sparc_relocate_functions::gdop_hix22): New function.
3787 (Sparc_relocate_functions::gdop_lox10): New function.
3788 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3789 relocs.
3790 (Target_sparc::Scan::local): Likewise if the global symbol is not
3791 preemptible and is not IFUNC.
3792 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3793 transformations for local and non-preemptible non-IFUNC global
3794 symbols.
3795
0bc964fc
DM
3796 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3797 writing out 64-bit part of ranges.
3798
661d7a80
DM
3799 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3800 -fpic and -fpie respectively.
3801 * Makefile.in: Regenerate.
3802
8c2bf391
DM
3803 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3804 (Target_sparc::Target_sparc): Initialize new field.
3805 (Target_sparc::do_plt_section_for_global): New function.
3806 (Target_sparc::do_plt_section_for_local): New function.
3807 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3808 (Target_sparc::make_plt_section): New function, broken out of
3809 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3810 (Target_sparc::make_plt_entry): Call make_plt_section.
3811 (Target_sparc::make_local_ifunc_plt_entry): New function.
3812 (Target_sparc::rela_ifunc_section): New function.
3813 (Target_sparc::plt_section): Remove const.
3814 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3815 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3816 and ifunc_count_ fields.
3817 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3818 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3819 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3820 (Output_data_plt_sparc::rela_ifunc): New function.
3821 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3822 (Output_data_plt_sparc::has_ifunc_section): New function.
3823 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3824 (Output_data_plt_sparc::address_for_global): New function.
3825 (Output_data_plt_sparc::address_for_local): New function.
3826 (Output_data_plt_sparc::plt_index_to_offset): New function.
3827 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3828 and entry_count.
3829 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3830 entry_count.
3831 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3832 R_SPARC_JMP_IREL to switch.
3833 (Target_sparc::Scan::check_non_pic): Likewise.
3834 (Target_sparc::Scan::local): Handle IFUNC symbols.
3835 (Target_sparc::Scan::local): Likewise.
3836 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3837 and plt_address_for_local.
3838 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3839 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3840
13cf9988
DM
3841 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3842 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3843 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3844 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3845 global relocs too.
3846 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3847 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3848 calls.
3849 * sparc.cc (Target_sparc::Scan::global): Likewise.
3850 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3851
31821be0
CC
38522012-04-16 Cary Coutant <ccoutant@google.com>
3853
3854 * archive.cc (Library_base::should_include_member): Check for
3855 --export-dynamic-symbol.
3856 * options.h (class General_options): Add --export-dynamic-symbol.
3857 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3858 --export-dynamic-symbol.
3859 (Symbol_table::gc_mark_undef_symbols): Likewise.
3860 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3861
2615994e
DM
38622012-04-12 David S. Miller <davem@davemloft.net>
3863
3864 * sparc.cc (Reloc::wdisp10): New relocation method.
3865 (Reloc::h34): Likewise.
3866 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3867 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3868 R_SPARC_WDISP10.
3869 (Target_sparc::Scan::local): Likewise.
3870 (Target_sparc::Scan::global): Likewise.
3871 (Target_sparc::Relocate::relocate): Likewise.
3872
6782735d
CC
38732012-04-09 Cary Coutant <ccoutant@google.com>
3874
3875 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3876 low_pc == 0.
3877
8c7a0b00
ILT
38782012-04-06 Ian Lance Taylor <iant@google.com>
3879
3880 * timer.cc: #include <unistd.h>.
3881
58797674
RM
38822012-04-06 Roland McGrath <mcgrathr@google.com>
3883
3884 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3885 * config.in: Regenerate.
3886 * configure: Regenerate.
3887
44350750
NC
38882012-04-05 Nick Clifton <nickc@redhat.com>
3889
3890 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3891 (AM_LC_MESSAGES): Add.
3892 * aclocal.m4: Regenerate.
3893 * config.in: Regenerate.
3894 * configure: Regenerate.
3895
c1027032
CC
38962012-03-21 Cary Coutant <ccoutant@google.com>
3897
3898 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3899 * Makefile.in: Regenerate.
3900 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3901 (Sized_elf_reloc_mapper::symbol_section): New function.
3902 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3903 (make_elf_reloc_mapper): New function.
3904 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3905 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3906 (Dwarf_abbrev_table::do_get_abbrev): New function.
3907 (Dwarf_ranges_table::read_ranges_table): New function.
3908 (Dwarf_ranges_table::read_range_list): New function.
3909 (Dwarf_pubnames_table::read_section): New function.
3910 (Dwarf_pubnames_table::read_header): New function.
3911 (Dwarf_pubnames_table::next_name): New function.
3912 (Dwarf_die::Dwarf_die): New function.
3913 (Dwarf_die::read_attributes): New function.
3914 (Dwarf_die::skip_attributes): New function.
3915 (Dwarf_die::set_name): New function.
3916 (Dwarf_die::set_linkage_name): New function.
3917 (Dwarf_die::attribute): New function.
3918 (Dwarf_die::string_attribute): New function.
3919 (Dwarf_die::int_attribute): New function.
3920 (Dwarf_die::uint_attribute): New function.
3921 (Dwarf_die::ref_attribute): New function.
3922 (Dwarf_die::child_offset): New function.
3923 (Dwarf_die::sibling_offset): New function.
3924 (Dwarf_info_reader::check_buffer): New function.
3925 (Dwarf_info_reader::parse): New function.
3926 (Dwarf_info_reader::do_parse): New function.
3927 (Dwarf_info_reader::do_read_string_table): New function.
3928 (Dwarf_info_reader::lookup_reloc): New function.
3929 (Dwarf_info_reader::get_string): New function.
3930 (Dwarf_info_reader::visit_compilation_unit): New function.
3931 (Dwarf_info_reader::visit_type_unit): New function.
3932 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3933 Sized_elf_reloc_mapper.
3934 (Sized_dwarf_line_info::symbol_section): Remove function.
3935 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3936 (Sized_dwarf_line_info::read_line_mappings): Remove object
3937 parameter, adjust callers.
3938 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3939 * dwarf_reader.h: Include <sys/types.h>.
3940 (class Track_relocs): Remove forward declaration.
3941 (class Elf_reloc_mapper): New class.
3942 (class Sized_elf_reloc_mapper): New class.
3943 (class Dwarf_abbrev_table): New class.
3944 (class Dwarf_range_list): New class.
3945 (class Dwarf_ranges_table): New class.
3946 (class Dwarf_pubnames_table): New class.
3947 (class Dwarf_die): New class.
3948 (class Dwarf_info_reader): New class.
3949 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3950 (Sized_dwarf_line_info::symbol_section): Remove member function.
3951 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3952 base class.
3953 * gdb-index.cc: New source file.
3954 * gdb-index.h: New source file.
3955 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3956 and .debug_types sections, call Layout::add_to_gdb_index.
3957 (Sized_relobj_incr::do_section_name): Implement.
3958 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3959 return type; Implement.
3960 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3961 return type.
3962 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3963 parameter list and return type.
3964 (Sized_incr_dynobj::do_section_contents): Likewise.
3965 * layout.cc: Include gdb-index.h.
3966 (Layout::Layout): Initialize gdb_index_data_.
3967 (Layout::init_fixed_output_section): Check for .gdb_index section.
3968 (Layout::add_to_gdb_index): New function. Instantiate.
3969 * layout.h: Add forward declaration for class Gdb_index.
3970 (Layout::add_to_gdb_index): New member function.
3971 (Layout::gdb_index_data_): New data member.
3972 * main.cc: Include gdb-index.h.
3973 (main): Print statistics for gdb index.
3974 * object.cc (Object::section_contents): Move code into
3975 do_section_contents.
3976 (need_decompressed_section): Check for sections needed when building
3977 gdb index.
3978 (build_compressed_section_map): Likewise.
3979 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3980 gdb index.
3981 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3982 sections; call Layout::add_to_gdb_index.
3983 (Sized_relobj_file::do_decompressed_section_contents): Call
3984 do_section_contents directly.
3985 * object.h (Object::do_section_contents): Adjust parameter list and
3986 return type.
3987 (Object::do_decompressed_section_contents): Call do_section_contents
3988 directly.
3989 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3990 return type.
3991 * options.h (class General_options): Add --gdb-index option.
3992 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3993 list and return type.
3994 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3995 * reloc.h (Track_relocs::checkpoint): New function.
3996 (Track_relocs::reset): New function.
3997
3998 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3999 New test cases.
4000 * testsuite/Makefile.in: Regenerate.
4001 * testsuite/gdb_index_test.cc: New test source file.
4002 * testsuite/gdb_index_test_1.sh: New test source file.
4003 * testsuite/gdb_index_test_2.sh: New test source file.
4004
647f1574
DK
40052012-03-19 Doug Kwan <dougkwan@google.com>
4006
4007 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 4008 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
4009 __exidx_start and __exidx_end. Make symbol table parameter
4010 anonymous as it is not used.
4011 * gold.cc (queue_middle_tasks): Call target hook to define any
4012 target-specific symbols.
4013 * target.h (Target::define_standard_symbols): New method.
4014 (Target::do_define_standard_symbols): Same.
4015 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4016 * testsuite/Makefile.in: Regenerate.
4017 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4018 and __exidx_end.
4019 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4020 relocations are generated for __exidx_start and __exidx_end.
4021
7c6109da
DK
40222012-03-16 Doug Kwan <dougkwan@google.com>
4023
4024 * testsuite/Makefile.am: Disable test initpri3b.
4025 * testsuite/Makefile.in: Regenerate.
4026
7b8957f8
DK
40272012-03-15 Doug Kwan <dougkwan@google.com>
4028
4029 * arm.cc (Target_arm::got_section): Make .got section read-only
4030 if -z now is given.
4031
14dc9ef7
ILT
40322012-03-15 Ian Lance Taylor <iant@google.com>
4033
4034 PR gold/13850
4035 * layout.cc (Layout::make_output_section): Correctly mark
4036 SHT_INIT_ARRAY, et. al., as relro.
4037
fa40b62a
DK
40382012-03-14 Doug Kwan <dougkwan@google.com>
4039
4040 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
4041 dynamic relocations for protected symbols in shared objects.
4042
fd325007
ILT
40432012-03-13 Ian Lance Taylor <iant@google.com>
4044
4045 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4046 keep the larger alignment.
4047
e8dd54e1
CC
40482012-03-12 Cary Coutant <ccoutant@google.com>
4049
4050 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4051 handling of DW_LNE_define_file.
4052
feb5f3b0
CC
40532012-03-12 Cary Coutant <ccoutant@google.com>
4054
4055 * reduced_debug_output.cc
4056 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4057 codes to switch.
4058
a1fb4256
CC
40592012-02-29 Cary Coutant <ccoutant@google.com>
4060
4061 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4062
5dd8762a
CC
40632012-02-29 Cary Coutant <ccoutant@google.com>
4064
4065 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4066 Call Object::decompressed_section_contents.
4067 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4068 New dtor.
4069 (Sized_dwarf_line_info::buffer_start_): New data member.
4070 * merge.cc (Output_merge_data::do_add_input_section): Call
4071 Object::decompressed_section_contents.
4072 (Output_merge_string::do_add_input_section): Likewise.
4073 * object.cc (need_decompressed_section): New function.
4074 (build_compressed_section_map): Decompress sections needed later.
4075 (Sized_relobj_file::do_decompressed_section_contents): New function.
4076 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4077 * object.h (Object::decompressed_section_contents): New function.
4078 (Object::discard_decompressed_sections): New function.
4079 (Object::do_decompressed_section_contents): New function.
4080 (Object::do_discard_decompressed_sections): New function.
4081 (Compressed_section_info): New type.
4082 (Compressed_section_map): Include decompressed section contents.
4083 (Sized_relobj_file::do_decompressed_section_contents): New function.
4084 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4085
7b5de7ee
CC
40862012-02-16 Cary Coutant <ccoutant@google.com>
4087
4088 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
4089 * testsuite/Makefile.in: Regenerate.
4090
f9fa4a63
CC
40912012-02-14 Cary Coutant <ccoutant@google.com>
4092
4093 * options.cc (General_options::finalize): Disallow -pie and -static.
4094
2c175ebc
DK
40952012-02-03 Doug Kwan <dougkwan@google.com>
4096
4097 * arm.cc (Arm_relocate_functions::abs8,
4098 Arm_relocate_functions::abs16): Use
4099 Bits::has_signed_unsigned_overflow32.
4100 (Arm_relocate_functions::thm_abs8): Correct range of
4101 overflow check.
4102 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
4103 in assertions.
4104
90cff06f
DK
41052012-02-02 Doug Kwan <dougkwan@google.com>
4106
4107 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
4108 position independent outputs, not just shared objects.
4109
63887f3d
L
41102012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4111
4112 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4113 * configure: Regenerated.
4114
bef2b434
ILT
41152012-01-27 Ian Lance Taylor <iant@google.com>
4116
4117 * reloc.h (Bits): New class with static functions, copied from
4118 namespace utils in arm.cc.
4119 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4120 instead.
4121
c335b55d
L
41222012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4123
4124 * incremental.cc (write_info_blocks): Correct relocation offset.
4125
41194d9f
L
41262012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4127
4128 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4129 (Relocate::tls_gd_to_le): Likewise.
4130
1bae613c
L
41312012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4132
4133 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4134
24482ca0
L
41352012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4136
4137 * configure.ac: Check if -mcmodel=medium works.
4138 * configure: Regenerated.
4139
c2c7840a
CC
41402012-01-24 Cary Coutant <ccoutant@google.com>
4141
4142 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4143 definition and ...
4144 (read_unsigned_LEB_128_x): ... this new function.
4145 (read_signed_LEB_128): Replaced with inline definition and ...
4146 (read_signed_LEB_128_x): ... this new function.
4147 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4148 (read_unsigned_LEB_128): Add inline definition.
4149 (read_signed_LEB_128_x): New function.
4150 (read_signed_LEB_128): Add inline definition.
4151 * testsuite/Makefile.am (leb128_unittest): New unit test.
4152 * testsuite/Makefile.in: Regenerate.
4153 * testsuite/leb128_unittest.cc: New unit test.
4154
833de760 41552012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
4156
4157 PR gold/13617
4158 * i386.cc (Target_i386::do_code_fill): When using a jmp
4159 instruction, pad with nop instructions.
4160 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4161
618d6666
L
41622012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4163
4164 * x86_64.cc (gc_process_relocs): Add typename on types used in
4165 template.
4166 (scan_relocs): Likewise.
4167 (relocate_section): Likewise.
4168 (apply_relocation): Likewise.
4169
3660ff06
L
41702012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4171
4172 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4173 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4174 under x32.
4175
fc51264f
L
41762012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4177
4178 * x86_64.cc: Initial support for x32.
4179
dd74ae06
CC
41802012-01-03 Cary Coutant <ccoutant@google.com>
4181
4182 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4183 Use abstract base class for GOT.
4184 * gold/output.h (class Output_data_got_base): New abstract base class.
4185 (class Output_data_got): Derive from new base class, adjust ctors.
4186 (Output_data_got::reserve_slot): Make virtual; rename to
4187 do_reserve_slot; Adjust callers.
4188 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4189 pointer to abstract base class.
4190 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4191
83896202
ILT
41922011-12-18 Ian Lance Taylor <iant@google.com>
4193
4194 * object.h (Relobj::local_symbol_value): New function.
4195 (Relobj::local_plt_offset): New function.
4196 (Relobj::local_has_got_offset): New function.
4197 (Relobj::local_got_offset): New function.
4198 (Relobj::set_local_got_offset): New function.
4199 (Relobj::do_local_symbol_value): New pure virtual function.
4200 (Relobj::do_local_plt_offset): Likewise.
4201 (Relobj::do_local_has_got_offset): Likewise.
4202 (Relobj::do_local_got_offset): Likewise.
4203 (Relobj::do_set_local_got_offset): Likewise.
4204 (Sized_relobj::do_local_has_got_offset): Rename from
4205 local_has_got_offset.
4206 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4207 (Sized_relobj::do_set_local_got_offset): Rename from
4208 set_local_got_offset.
4209 (Sized_relobj_file::do_local_plt_offset): Rename from
4210 local_plt_offset.
4211 (Sized_relobj_file::do_local_symbol_value): New function.
4212 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4213 local_plt_offset.
4214 * output.cc (Output_data_got::Got_entry::write): Change object to
4215 Relobj. Use local_symbol_value.
4216 (Output_data_got::add_global_with_rel): Change rel_dyn to
4217 Output_data_reloc_generic*. Use add_global_generic.
4218 (Output_data_got::add_global_with_rela): Remove. Change all
4219 callers to use add_global_with_rel.
4220 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4221 Output_data_reloc_generic*. Use add_global_generic.
4222 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4223 callers to use add_global_pair_with_rel.
4224 (Output_data_got::add_local): Change object to Relobj*.
4225 (Output_data_got::add_local_plt): Likewise.
4226 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4227 change rel_dyn to Output_data_reloc_generic*. Use
4228 add_local_generic.
4229 (Output_data_got::add_local_with_rela): Remove. Change all
4230 callers to use all_local_with_rel.
4231 (Output_data_got::add_local_pair_with_rel): Change object to
4232 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4233 add_output_section_generic.
4234 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4235 callers to use add_local_pair_with_rel.
4236 (Output_data_got::reserve_local): Change object to Relobj*.
4237 * output.h: (class Output_data_reloc_generic): Add pure virtual
4238 declarations for add_global_generic, add_local_generic,
4239 add_output_section_generic.
4240 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4241 functions for Output_data_reloc_generic. Update declarations for
4242 changes listed in output.cc.
4243 (class Output_data_got): Change template parameter to got_size.
4244 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4245 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4246 function.
4247 (Sized_relobj_incr::do_local_plt_offset): New function.
4248 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4249 add_global_generic.
4250
76677ad0
CC
42512011-12-17 Cary Coutant <ccoutant@google.com>
4252
4253 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4254 * resolve.cc (Symbol_table::resolve): Likewise.
4255 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4256 arrays.
4257 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4258
8b8dd8d5
ILT
42592011-12-16 Ian Lance Taylor <iant@google.com>
4260
4261 * output.h (Output_data_reloc_generic::add): Only call
4262 add_dynamic_reloc if this is a dynamic reloc section.
4263
d55525b9
L
42642011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4265
4266 PR gold/13505
4267 * target-reloc.h (apply_relocation): Replace <64, false> with
4268 <size, big_endian>.
4269
ff81c7c1
NC
42702011-11-25 Nick Clifton <nickc@redhat.com>
4271
4272 * po/it.po: New Italian translation.
4273
628f39be
SA
42742011-11-17 Sterling Augustine <saugustine@google.com>
4275
4276 * script.cc (script_include_directive): Implement.
4277 (read_script_file): New local variables name and search_path. Update
4278 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4279 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4280 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4281
98ef3ea4
SA
42822011-11-11 Sterling Augustine <saugustine@google.com>
4283
4284 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4285 (file_or_sections_cmd): Likewise.
4286
f4a8b6d7
DK
42872011-11-11 Doug Kwan <dougkwan@google.com>
4288
4289 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4290 if --just-symbols is given.
4291
29ab395d
DK
42922011-11-10 Doug Kwan <dougkwan@google.com>
4293
4294 PR gold/13362
4295 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4296 when processing data relocs.
4297 * reloc.h (Relocate_functions::rel_unaligned): New method.
4298 (Relocate_functions::pcrel_unaligned): Ditto.
4299 (Relocate_functions::rel32_unaligned): Ditto.
4300 (Relocate_functions::pcrel32_unaligned): Ditto.
4301
2c339f71
DK
43022011-11-09 Doug Kwan <dougkwan@google.com>
4303
4304 PR gold/13362
4305 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4306 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4307 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4308 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4309 (Relocate_functions::rel_unaligned): New.
4310 (Relocate_functions::rel32_unaligned): New.
4311 * target-reloc.h (relocate_for_relocatable): Add code to handle
4312 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4313 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4314 arm_unaligned_reloc_r): New targets.
4315 * testsuite/Makefile.in: Regenerate.
4316 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4317 linking.
4318
3f3cddf1
ILT
43192011-11-02 Ian Lance Taylor <iant@google.com>
4320
4321 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4322 NATIVE_LINKER.
4323 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4324 * options.cc (General_options::finalize): Use library search path
4325 from configure script if specified. If not native and no sysroot,
4326 only search TOOLLIBDIR.
4327 * options.h (Search_directory::Search_directory): Change name to
4328 const std::string&.
4329 (General_options::add_to_library_path_with_sysroot): Change arg to
4330 const std::string&.
4331 * configure, Makefile.in, config.in: Rebuild.
4332
a8e2273b
ILT
43332011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4334
4335 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4336 we are working around the ARM1176 Erratum.
4337 * options.h (General_options::fix_arm1176): Add option.
4338 * testsuite/Makefile.am: Add testcases, and keep current ones
4339 working.
4340 * testsuite/Makefile.in: Regenerate.
4341 * testsuite/arm_fix_1176.s: New file.
4342 * testsuite/arm_fix_1176.sh: Likewise.
4343
cd6eab1c
ILT
43442011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4345
4346 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4347 may_use_blx_.
4348 (Target_arm::may_use_blx): Remove method.
4349 (Target_arm::set_may_use_blx): Likewise.
4350 (Target_arm::may_use_v4t_interworking): New method.
4351 (Target_arm::may_use_v5t_interworking): Likewise.
4352 (Target_arm::may_use_blx_): Remove member variable.
4353 (Arm_relocate_functions::arm_branch_common): Check for v5T
4354 interworking.
4355 (Arm_relocate_functions::thumb_branch_common): Likewise.
4356 (Reloc_stub::stub_type_for_reloc): Likewise.
4357 (Target_arm::do_finalize_sections): Correct interworking checks.
4358 * testsuite/Makefile.am: Add new tests.
4359 * testsuite/Makefile.in: Regenerate.
4360 * testsuite/arm_farcall_arm_arm.s: New test.
4361 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4362 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4363 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4364 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4365 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4366 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4367 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4368
286adcf4
CC
43692011-10-31 Cary Coutant <ccoutant@google.com>
4370
4371 PR gold/13023
4372 * expression.cc (Expression::eval_with_dot): Add
4373 is_section_dot_assignment parameter.
4374 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4375 absolute and assigning to dot within a section.
4376 * script-sections.cc
4377 (Output_section_element_assignment::set_section_addresses): Pass
4378 dot_section to set_if_absolute.
4379 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4380 as is_section_dot_assignment flag to eval_with_dot.
4381 (Output_section_element_dot_assignment::set_section_addresses):
4382 Likewise.
4383 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4384 parameter. Also set value if relative to dot_section; set the
4385 symbol's output_section.
4386 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4387 parameter. Adjust all callers.
4388 (Expression::eval_maybe_dot): Likewise.
4389 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4390 Adjust all callers.
4391 * testsuite/script_test_2.t: Test assignment of an absolute value
4392 to dot within an output section element.
4393
9634ed06
CC
43942011-10-31 Cary Coutant <ccoutant@google.com>
4395
4396 * options.h (class General_options): Add --[no-]gnu-unique options.
4397 * symtab.cc (Symbol_table::sized_write_globals): Convert
4398 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4399
de4101c7
CC
44002011-10-31 Cary Coutant <ccoutant@google.com>
4401
4402 PR gold/13359
4403 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4404 unnecessary assertion.
4405 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4406
7257cc92
ST
44072011-10-31 Sriraman Tallam <tmsriram@google.com>
4408
4409 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4410 gc_mark_symbol.
4411 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4412 gc_mark_symbol.
4413 Change to just keep the section associated with symbol.
4414 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4415 they are externally visible and --export-dynamic is turned on.
4416 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4417
bfc34b3f
ILT
44182011-10-19 Ian Lance Taylor <iant@google.com>
4419
4420 PR gold/13163
4421 * script-sections.cc
4422 (Output_section_element_dot_assignment::needs_output_section): New
4423 function.
4424
ea0d8c47
ILT
44252011-10-19 Ian Lance Taylor <iant@google.com>
4426
4427 PR gold/13204
4428 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4429 --section-start option was seen.
4430 * options.h (General_options::any_section_start): New function.
4431
abd242a9
DM
44322011-10-18 David S. Miller <davem@davemloft.net>
4433
4434 PR binutils/13301
4435 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4436 member to track relocation locations that have moved during TLS
4437 reloc optimizations.
4438 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4439 (Target_sparc::Relocate::relocate): Adjust view down by 4
4440 bytes if it matches reloc_adjust_addr_.
4441 (Target_sparc::Relocate::relocate_tls): Always move the
4442 __tls_get_addr call delay slot instruction forward 4 bytes when
4443 performing relaxation.
4444
bab9090f
CC
44452011-10-18 Cary Coutant <ccoutant@google.com>
4446
4447 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4448 (Output_file::map_no_anonymous): Check for non-zero
4449 return code from posix_fallocate.
4450
f7c5b166
CC
44512011-10-17 Cary Coutant <ccoutant@google.com>
4452
4453 PR gold/13245
4454 * plugin.cc (is_visible_from_outside): Check for symbols
4455 referenced from dynamic objects.
4456 * resolve.cc (Symbol_table::resolve): Don't count references
4457 from dynamic objects as references from real ELF files.
4458 * testsuite/plugin_test_2.sh: Adjust expected result.
4459
b490c0bb
CC
44602011-10-17 Cary Coutant <ccoutant@google.com>
4461
4462 * gold.cc: Include timer.h.
4463 (queue_middle_tasks): Stamp time.
4464 (queue_final_tasks): Likewise.
4465 * main.cc (main): Store timer in parameters. Print timers
4466 for each pass.
4467 * parameters.cc (Parameters::Parameters): Initialize timer_.
4468 (Parameters::set_timer): New function.
4469 (set_parameters_timer): New function.
4470 * parameters.h (Parameters::set_timer): New function.
4471 (Parameters::timer): New function.
4472 (Parameters::timer_): New data member.
4473 (set_parameters_timer): New function.
4474 * timer.cc (Timer::stamp): New function.
4475 (Timer::get_pass_time): New function.
4476 * timer.h (Timer::stamp): New function.
4477 (Timer::get_pass_time): New function.
4478 (Timer::pass_times_): New data member.
4479
f475cf7b
CC
44802011-10-17 Cary Coutant <ccoutant@google.com>
4481
4482 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4483 task for members of lib groups.
4484
cdd7e244
CC
44852011-10-17 Cary Coutant <ccoutant@google.com>
4486
4487 PR gold/13288
4f95c8b4 4488 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
4489 (File_read::make_view): Move bounds check (replace with assert)...
4490 (File_read::find_or_make_view): ... to here.
4491
dfb45471
CC
44922011-10-12 Cary Coutant <ccoutant@google.com>
4493
4f95c8b4 4494 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
4495 ::read returns less than requested size.
4496
53bbcc1b
CC
44972011-10-10 Cary Coutant <ccoutant@google.com>
4498
4f95c8b4 4499 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
4500 Initialize defined_count_.
4501 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4502 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4503 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4504 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4505 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4506 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4507 member.
4508 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4509 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4510 Return zeroes instead of internal error.
4511
397b129b
CC
45122011-10-10 Cary Coutant <ccoutant@google.com>
4513
4514 PR gold/13249
4f95c8b4 4515 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4516 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4517 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4518 (Output_reloc::type_): Adjust size of bit field.
4519 (Output_reloc::use_plt_offset_): New bit field.
4520 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4521 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4522 flag. Adjust all callers.
4f95c8b4 4523 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4524 creating RELATIVE relocations.
4525
d5698657
NC
45262011-10-10 Nick Clifton <nickc@redhat.com>
4527
4528 * po/es.po: Updated Spanish translation.
4529 * po/fi.po: Updated Finnish translation.
4530
6a59a5c2
DN
45312011-10-03 Diego Novillo <dnovillo@google.com>
4532
4533 * options.cc (parse_uint): Fix dereference of RETVAL.
4534
f0558624
ST
45352011-09-29 Sriraman Tallam <tmsriram@google.com>
4536
4537 * layout.h (section_order_map_): New member.
4538 (get_section_order_map): New member function.
4539 * output.cc (Output_section::add_input_section): Check for patterns
4540 only when --section-ordering-file is specified.
4541 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4542 output_sections have been formed.
4543 * layout.cc (Layout_Layout): Initialize section_order_map_.
4544 * plugin.cc (update_section_order): Store order in order_map. Do not
4545 update the order.
4546 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4547 * testsuite/Makefile.in: Regenerate.
4548 * testsuite/plugin_section_order.c: New file.
4549 * testsuite/plugin_final_layout.cc: New file.
4550 * testsuite/plugin_final_layout.sh: New file.
4551
a7dac153
CC
45522011-09-29 Cary Coutant <ccoutant@google.com>
4553
4f95c8b4 4554 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4555 Check for NULL.
4f95c8b4 4556 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4557 symbols during incremental update.
4558 (Symbol_table::add_from_dynobj): Likewise.
4559
eebd87a5
ILT
45602011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4561 Ian Lance Taylor <iant@google.com>
4562
4563 * symtab.cc (Symbol_table::define_special_symbol): Always
4564 canonicalize version string.
4565
403a3331
CC
45662011-09-26 Cary Coutant <ccoutant@google.com>
4567
4f95c8b4
CC
4568 * gold.cc (queue_initial_tasks): Move option checks ...
4569 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
4570 some options; make others fatal.
4571
235061c2
CC
45722011-09-26 Cary Coutant <ccoutant@google.com>
4573
4574 gcc PR lto/47247
4575 * plugin.cc (get_symbols_v2): New function.
4576 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4577 (is_referenced_from_outside): New function.
4578 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4579 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4580 (get_symbols): Pass version parameter.
4581 (get_symbols_v2): New function.
4582 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4583 parameter.
4584 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4585 (onload): Add LDPT_GET_SYMBOLS_V2.
4586 (all_symbols_read_hook): Use get_symbols_v2; check for
4587 LDPR_PREVAILING_DEF_IRONLY_EXP.
4588 * testsuite/plugin_test_3.sh: Update expected results.
4589
dc87f620
ILT
45902011-09-23 Simon Baldwin <simonb@google.com>
4591
4592 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4593 configuration options.
4594 * configure: Regenerate.
4595 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4596 * Makefile.in: Regenerate.
4597 * testsuite/Makefile.in: Regenerate.
4598
a8279f82
ST
45992011-09-19 Sriraman Tallam <tmsriram@google.com>
4600
4601 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4602
0c9350c8
CC
46032011-09-19 Cary Coutant <ccoutant@google.com>
4604
4605 * incremental.cc (can_incremental_update): Fix typo in comment.
4606 * incremental.h (can_incremental_update): Likewise.
4607
aa06ae28
CC
46082011-09-18 Cary Coutant <ccoutant@google.com>
4609
4610 * incremental.cc (can_incremental_update): New function.
4611 * incremental.h (can_incremental_update): New function.
4612 * layout.cc (Layout::init_fixed_output_section): Call it.
4613 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4614 * object.cc (Sized_relobj_file::do_layout): Call
4615 can_incremental_update.
4616
ebb300b2
CC
46172011-09-13 Cary Coutant <ccoutant@google.com>
4618
4619 * configure.ac: Check for glibc support for gnu_indirect_function
4620 support with static linking, setting automake conditional
4621 IFUNC_STATIC.
4622 * Makefile.in: Regenerate.
4623 * configure: Regenerate.
4624
4625 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4626 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4627 for IFUNC_STATIC.
4628 * testsuite/Makefile.in: Regenerate.
4629
1206d0d5
CC
46302011-09-13 Cary Coutant <ccoutant@google.com>
4631
4632 * incremental.cc (Sized_relobj_incr::do_layout): Call
4633 report_comdat_group for kept comdat sections.
4634 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4635 * testsuite/Makefile.in: Regenerate.
4636 * testsuite/incr_comdat_test_1.cc: New source file.
4637 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4638 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4639 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4640
40b29874
ILT
46412011-09-13 Ian Lance Taylor <iant@google.com>
4642
4643 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4644 variable external_symbols_offset.
4645
1b045aac
ILT
46462011-09-12 Ian Lance Taylor <iant@google.com>
4647
4648 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4649 triggered if object has no symbols.
4650
24c6c55a
DM
46512011-09-09 David S. Miller <davem@davemloft.net>
4652
4653 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4654 (Output_fill_debug_line::do_write): Likewise.
4655
66570254
CC
46562011-08-29 Cary Coutant <ccoutant@google.com>
4657
4658 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4659 casts to match formatting specs.
4660 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4661
8ea8cd50
CC
46622011-08-26 Cary Coutant <ccoutant@google.com>
4663
4664 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4665 remaining hole size when allocating.
4666 (Layout::make_output_section): Set fill methods for debug sections.
4667 * layout.h (Free_list::Free_list_node): Move from private to
4668 public.
4669 (Free_list::set_min_hole_size): New function.
4670 (Free_list::begin, Free_list::end): New functions.
4671 (Free_list::min_hole_): New data member.
4672 * output.cc: Include dwarf.h.
4673 (Output_fill_debug_info::do_minimum_hole_size): New function.
4674 (Output_fill_debug_info::do_write): New function.
4675 (Output_fill_debug_line::do_minimum_hole_size): New function.
4676 (Output_fill_debug_line::do_write): New function.
4677 (Output_section::Output_section): Initialize new data member.
4678 (Output_section::set_final_data_size): Ensure patch space is larger
4679 than minimum hole size.
4680 (Output_section::do_write): Fill holes in debug sections.
4681 * output.h (Output_fill): New class.
4682 (Output_fill_debug_info): New class.
4683 (Output_fill_debug_line): New class.
4684 (Output_section::set_free_space_fill): New function.
4685 (Output_section::free_space_fill_): New data member.
4686 * testsuite/Makefile.am (incremental_test_3): Add
4687 --incremental-patch option.
4688 (incremental_test_4): Likewise.
4689 (incremental_test_5): Likewise.
4690 (incremental_test_6): Likewise.
4691 (incremental_copy_test): Likewise.
4692 (incremental_common_test_1): Likewise.
4693 * testsuite/Makefile.in: Regenerate.
4694
7cf80422
NC
46952011-08-26 Nick Clifton <nickc@redhat.com>
4696
4697 * po/es.po: Updated Spanish translation.
4698
c3f7b0e5
CC
46992011-08-01 Cary Coutant <ccoutant@google.com>
4700
4701 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4702 * gold/testsuite/Makefile.in: Regenerate.
4703 * gold/testsuite/justsyms_exec.c: New source file.
4704 * gold/testsuite/justsyms_lib.c: New source file.
4705
9590bf25
CC
47062011-08-01 Cary Coutant <ccoutant@google.com>
4707
4708 * layout.cc (Layout::set_segment_offsets): Don't realign text
4709 segment if -Ttext was specified.
4710 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4711 file type.
4712 * object.h (Sized_relobj_file::e_type): New function.
4713 (Sized_relobj_file::e_type_): New data member.
4714 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4715 base address for ET_EXEC files.
4716 * target.cc (Target::do_make_elf_object_implementation): Allow
4717 ET_EXEC files with --just-symbols option.
4718
dcd8d12e
CC
47192011-07-28 Cary Coutant <ccoutant@google.com>
4720
4721 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4722 Add thread_number parameter.
4723 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4724 * workqueue-threads.cc
4725 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4726 current thread if its thread number is greater than desired thread
4727 count.
4728 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4729 Add thread_number parameter.
4730 (Workqueue::should_cancel_thread): Likewise.
4731 (Workqueue::find_runnable_or_wait): Pass thread_number to
4732 should_cancel_thread.
4733 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4734 parameter.
4735
804eb480
ST
47362011-07-22 Sriraman Tallam <tmsriram@google.com>
4737
4738 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4739 only after checking if it cannot be forced local.
4740 * symtab.h (is_externally_visible): Check if the symbol is not forced
4741 local.
4742
f1ddb600
ILT
47432011-07-15 Ian Lance Taylor <iant@google.com>
4744
4745 * options.h (class General_options): Add --print-output-format.
4746 Move -EL next to -EB, for better --help output.
4747 * target-select.cc: Include <cstdio>, "options.h", and
4748 "parameters.h".
4749 (Target_selector::do_target_bfd_name): New function.
4750 (print_output_format): New function.
4751 * target-select.h (class Target_selector): Update declarations.
4752 (Target_selector::target_bfd_name): New function.
4753 (print_output_format): Declare.
4754 * main.cc: Include "target-select.h".
4755 (main): Handle --print-output-format.
4756 * gold.cc: Include "target-select.h".
4757 (queue_initial_tasks): Handle --print-output-format when there are
4758 no input files.
4759 * parameters.cc (parameters_force_valid_target): Give a better
4760 error message if -EB/-EL does not match target.
4761 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4762 function.
4763
7d172687
ILT
47642011-07-15 Ian Lance Taylor <iant@google.com>
4765
4766 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4767 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4768 (Output_data_plt_i386::do_write): Write address of .dynamic
4769 section to first entry in .got.plt section.
4770 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4771 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4772 Initialize layout_.
4773 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4774 section to first entry in .got.plt section.
4775 * layout.h (Layout::dynamic_section): New function.
4776
e9552f7e
ST
47772011-07-13 Sriraman Tallam <tmsriram@google.com>
4778
4779 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4780 to claim_file call.
4781 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4782 input_section_position_, and input_section_glob_.
4783 (read_layout_from_file): Call function section_ordering_specified.
4784 * layout.h (is_section_ordering_specified): New function.
4785 (section_ordering_specified): New function.
4786 (section_ordering_specified_): New boolean member.
4787 * main.cc(main): Call load_plugins after layout object is defined.
4788 * output.cc (Output_section::add_input_section): Use
4789 function section_ordering_specified to check if section ordering is
4790 needed.
4791 * output.cc (Output_section::add_relaxed_input_section): Use
4792 function section_ordering_specified to check if section ordering is
4793 needed.
4794 (Output_section::update_section_layout): New function.
4795 (Output_section::sort_attached_input_sections): Check if input section
4796 must be reordered.
4797 * output.h (Output_section::update_section_layout): New function.
4798 * plugin.cc (get_section_count): New function.
4799 (get_section_type): New function.
4800 (get_section_name): New function.
4801 (get_section_contents): New function.
4802 (update_section_order): New function.
58797674 4803 (allow_section_ordering): New function.
e9552f7e
ST
4804 (Plugin::load): Add the new interfaces to the transfer vector.
4805 (Plugin_manager::load_plugins): New parameter.
4806 (Plugin_manager::all_symbols_read): New parameter.
4807 (Plugin_manager::claim_file): New parameter. Save the elf object for
4808 unclaimed objects.
4809 (Plugin_manager::get_elf_object): New function.
4810 (Plugin_manager::get_view): Change to directly use the bool to check
4811 if get_view is called from claim_file_hook.
4812 * plugin.h (input_objects): New function
4813 (Plugin__manager::load_plugins): New parameter.
4814 (Plugin_manager::claim_file): New parameter.
4815 (Plugin_manager::get_elf_object): New function.
4816 (Plugin_manager::in_claim_file_handler): New function.
4817 (Plugin_manager::in_claim_file_handler_): New member.
4818 (layout): New function.
4819 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4820 handler with an extra parameter. Make the elf object before calling
4821 claim_file handler.
4822 * testsuite/plugin_test.c (get_section_count): New function pointer.
4823 (get_section_type): New function pointer.
4824 (get_section_name): New function pointer.
4825 (get_section_contents): New function pointer.
4826 (update_section_order): New function pointer.
4827 (allow_section_ordering): New function pointer.
4828 (onload): Check if the new interfaces exist.
4829
9446efde
ILT
48302011-07-13 Ian Lance Taylor <iant@google.com>
4831
4832 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4833 relro section.
4834 * x86_64.cc (Target_x86_64::got_section): Likewise.
4835 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4836 (relro_now_test_SOURCES): New variable.
4837 (relro_now_test_DEPENDENCIES): New variable.
4838 (relro_now_test_LDFLAGS): New variable.
4839 (relro_now_test_LDADD): New variable.
4840 (relro_now_test.so): New target.
4841 * testsuite/Makefile.in: Rebuild.
4842
07aa62f2
ILT
48432011-07-12 Ian Lance Taylor <iant@google.com>
4844
4845 PR gold/12980
4846 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4847 GLOB_DAT relocation rather than a RELATIVE relocation for a
4848 protected symbol when creating a shared library.
4849 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4850 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4851 * testsuite/protected_main_1.cc (main): Test that protected
4852 function has same address.
4853
e2153196
ILT
48542011-07-11 Ian Lance Taylor <iant@google.com>
4855
4856 PR gold/12979
4857 * options.h (class General_options): Add -Bgroup.
4858 * options.cc (General_options::finalize): If -Bgroup is set,
4859 default to --unresolved-symbols=report-all.
4860 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4861 * target-reloc.h (issue_undefined_symbol_error): Handle
4862 --unresolved-symbols=report-all.
4863
6daf5215
ILT
48642011-07-08 Ian Lance Taylor <iant@google.com>
4865
4866 PR gold/11985
4867 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4868 if linker script discards key sections.
4869 (Layout::create_dynamic_symtab): Likewise.
4870 (Layout::assign_local_dynsym_offsets): Likewise.
4871 (Layout::sized_create_version_sections): Likewise.
4872 (Layout::create_interp): Likewise.
4873 (Layout::finish_dynamic_section): Likewise.
4874 (Layout::set_dynamic_symbol_size): Likewise.
4875
beabb2c6
ILT
48762011-07-08 Ian Lance Taylor <iant@google.com>
4877
4878 PR gold/12386
4879 * options.h (class General_options): Add --unresolved-symbols.
4880 * target-reloc.h (issue_undefined_symbol_error): Check
4881 --unresolved-symbols. Add comments.
4882
9c16daf1
ILT
48832011-07-08 Ian Lance Taylor <iant@google.com>
4884
4885 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4886 expression more complex.
4887
191f1a2d
ILT
48882011-07-08 Ian Lance Taylor <iant@google.com>
4889
4890 PR gold/11317
4891 * target-reloc.h (issue_undefined_symbol_error): New inline
4892 function, broken out of relocate_section.
4893 (relocate_section): Call issue_undefined_symbol_error.
4894 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4895 there is no TLS segment if we are about to issue an undefined
4896 symbol error.
4897 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4898
62855347
ILT
48992011-07-08 Ian Lance Taylor <iant@google.com>
4900
4901 PR gold/12279
4902 * resolve.cc (Symbol_table::should_override): Add fromtype
4903 parameter. Change all callers. Give error when linking together
4904 TLS and non-TLS symbol.
4905 (Symbol_table::should_override_with_special): Add fromtype
4906 parameter. Change all callers.
4907 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4908 there is no TLS segment if we have reported some errors.
4909 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4910
67181c72
ILT
49112011-07-08 Ian Lance Taylor <iant@google.com>
4912
4913 PR gold/12372
4914 * target.h (Target::plt_address_for_global): New function.
4915 (Target::plt_address_for_local): New function.
4916 (Target::plt_section_for_global): Remove.
4917 (Target::plt_section_for_local): Remove.
4918 (Target::do_plt_address_for_global): New virtual function.
4919 (Target::do_plt_address_for_local): New virtual function.
4920 (Target::do_plt_section_for_global): Remove.
4921 (Target::do_plt_section_for_local): Remove.
4922 (Target::register_global_plt_entry): Add Symbol_table and Layout
4923 parameters.
4924 * output.cc (Output_data_got::Got_entry::write): Use
4925 plt_address_for_global and plt_address_for_local.
4926 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4927 address of output section.
4928 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4929 got_irelative_, and irelative_count_ fields. Update
4930 declarations.
4931 (Output_data_plt_i386::has_irelative_section): New function.
4932 (Output_data_plt_i386::entry_count): Add irelative_count_.
4933 (Output_data_plt_i386::set_final_data_size): Likewise.
4934 (class Target_i386): Add got_irelative_ and rel_irelative_
4935 fields. Update declarations.
4936 (Target_i386::Target_i386): Initialize new fields.
4937 (Target_i386::do_plt_address_for_global): New function replacing
4938 do_plt_section_for_global.
4939 (Target_i386::do_plt_address_for_local): New function replacing
4940 do_plt_section_for_local.
4941 (Target_i386::got_section): Create got_irelative_.
4942 (Target_i386::rel_irelative_section): New function.
4943 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4944 fields. Don't define __rel_iplt_{start,end}.
4945 (Output_data_plt_i386::add_entry): Add symtab and layout
4946 parameters. Change all callers. Use different PLT and GOT for
4947 IFUNC symbols.
4948 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4949 layout parameters. Change all callers. Use different PLT and
4950 GOT.
4951 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4952 (Output_data_plt_i386::rel_irelative): New function.
4953 (Output_data_plt_i386::address_for_global): New function.
4954 (Output_data_plt_i386::address_for_local): New function.
4955 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4956 IRELATIVE GOT when changing IFUNC GOT entries.
4957 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4958 reloc.
4959 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4960 if we didn't create an IRELATIVE GOT.
4961 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4962 plt_address_for_local.
4963 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4964 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4965 got_irelative_, and irelative_count_ fields. Update
4966 declarations.
4967 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4968 Initialize new fields. Remove symtab parameter. Change all
4969 callers.
4970 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4971 irelative_count_.
4972 (Output_data_plt_x86_64::has_irelative_section): New function.
4973 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4974 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4975 fields. Update declarations.
4976 (Target_x86_64::Target_x86_64): Initialize new fields.
4977 (Target_x86_64::do_plt_address_for_global): New function replacing
4978 do_plt_section_for_global.
4979 (Target_x86_64::do_plt_address_for_local): New function replacing
4980 do_plt_section_for_local.
4981 (Target_x86_64::got_section): Create got_irelative_.
4982 (Target_x86_64::rela_irelative_section): New function.
4983 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4984 all callers. Don't create __rel_iplt_{start,end}.
4985 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4986 parameters. Change all callers. Use different PLT and GOT for
4987 IFUNC symbols.
4988 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4989 layout parameters. Change all callers. Use different PLT and
4990 GOT.
4991 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4992 parameters. Change all callers. Use different PLT and GOT for
4993 IFUNC symbols.
4994 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4995 (Output_data_plt_x86_64::rela_irelative): New function.
4996 (Output_data_plt_x86_64::address_for_global): New function.
4997 (Output_data_plt_x86_64::address_for_local): New function.
4998 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4999 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5000 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5001 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5002 parameters.
5003 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5004 reloc.
5005 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5006 symbols if we didn't create an IRELATIVE GOT.
5007 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5008 plt_address_for_local.
5009 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5010 * testsuite/ifuncvar1.c: New test file.
5011 * testsuite/ifuncvar2.c: New test file.
5012 * testsuite/ifuncvar3.c: New test file.
5013 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5014 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5015 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5016 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5017 * testsuite/Makefile.in: Rebuild.
5018
33c15b45
CC
50192011-07-07 Cary Coutant <ccoutant@google.com>
5020
5021 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5022 (two_file_test_1_ndebug.o): Likewise.
5023 (two_file_test_1b_ndebug.o): Likewise.
5024 (two_file_test_2_ndebug.o): Likewise.
5025 (two_file_test_main_ndebug.o): Likewise.
5026 (incremental_test_2): Link with no-debug versions.
5027
f48b5fb7
CC
50282011-07-06 Cary Coutant <ccoutant@google.com>
5029
5030 * gold/incremental.cc
5031 (Output_section_incremental_inputs::write_info_blocks): Check for
5032 hidden and internal symbols.
5033
221597a5
CC
50342011-07-06 Cary Coutant <ccoutant@google.com>
5035
5036 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5037 Check disposition for startup file.
5038 (Incremental_inputs::report_command_line): Ignore
5039 --incremental-startup-unchanged option.
5040 * options.cc (General_options::parse_incremental_startup_unchanged):
5041 New function.
5042 (General_options::General_options): Initialize new data member.
5043 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
5044 (General_options): Add --incremental-startup-unchanged option.
5045 (General_options::incremental_startup_disposition): New function.
5046 (General_options::incremental_startup_disposition_): New data member.
5047
e24719f6
CC
50482011-07-06 Cary Coutant <ccoutant@google.com>
5049
5050 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5051 input file index to Script_info ctor.
5052 (Sized_incremental_binary::do_file_has_changed): Find the
5053 command-line argument for files named in scripts.
5054 * incremental.h (Script_info::Script_info): New ctor
5055 with input file index.
5056 (Script_info::input_file_index): New function.
5057 (Script_info::input_file_index_): New data member.
5058 (Incremental_binary::get_library): Add const.
5059 (Incremental_binary::get_script_info): Add const.
5060 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5061 * testsuite/Makefile.am (incremental_test_5): New test case.
5062 (incremental_test_6): New test case.
5063 * testsuite/Makefile.in: Regenerate.
5064
8f7c81e8
CC
50652011-07-06 Cary Coutant <ccoutant@google.com>
5066
5067 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5068 debug output when command lines differ.
5069
9fbd3822
CC
50702011-07-06 Cary Coutant <ccoutant@google.com>
5071
5072 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5073 --incremental-patch option.
5074 * layout.cc (Free_list::allocate): Extend allocation beyond original
5075 end if enabled.
5076 (Layout::make_output_section): Mark sections that should get
5077 patch space.
5078 * options.cc (parse_percent): New function.
5079 * options.h (parse_percent): New function.
5080 (DEFINE_percent): New macro.
5081 (General_options): Add --incremental-patch option.
5082 * output.cc (Output_section::Output_section): Initialize new data
5083 members.
5084 (Output_section::add_input_section): Print section name when out
5085 of patch space.
5086 (Output_section::add_output_section_data): Likewise.
5087 (Output_section::set_final_data_size): Add patch space when
5088 doing --incremental-full.
5089 (Output_section::do_reset_address_and_file_offset): Remove patch
5090 space.
5091 (Output_segment::set_section_list_addresses): Print debug output
5092 only if --incremental-update.
5093 * output.h (Output_section::set_is_patch_space_allowed): New function.
5094 (Output_section::is_patch_space_allowed_): New data member.
5095 (Output_section::patch_space_): New data member.
5096 * parameters.cc (Parameters::incremental_full): New function.
5097 * parameters.h (Parameters::incremental_full): New function
5098 * testsuite/Makefile.am (incremental_test_2): Add test for
5099 --incremental-patch option.
5100 * testsuite/Makefile.in: Regenerate.
5101 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
5102 (t18): Remove function body.
5103
f6cccc2c
DK
51042011-07-05 Doug Kwan <dougkwan@google.com>
5105
5106 PR gold/12771
5107 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
5108 Arm_Address type for relocation result.
5109 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
5110 overflow check.
5111 (Arm_relocate_functions::abs32): Use unaligned access.
5112 (Arm_relocate_functions::rel32): Ditto.
5113 (Arm_relocate_functions::prel31): Ditto.
5114 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5115 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5116 static data relocations.
5117 * testsuite/Makefile.in: Regnerate.
5118 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5119
28a13fec
ILT
51202011-07-05 Ian Lance Taylor <iant@google.com>
5121
5122 PR gold/12392
5123 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5124 symbols if necessary.
5125 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5126
24d47b34
ILT
51272011-07-05 Ian Lance Taylor <iant@google.com>
5128
5129 PR gold/12952
5130 * resolve.cc (Symbol::override_base_with_special): Simply override
5131 version with special symbol version, ignoring previous version.
5132
41f9cbbe
ILT
51332011-07-05 Ian Lance Taylor <iant@google.com>
5134
5135 * object.cc (Sized_relobj_file::include_section_group): Add
5136 information to comment about signature location.
5137
886288f1
ILT
51382011-07-02 Ian Lance Taylor <iant@google.com>
5139
5140 PR gold/12957
5141 * options.h (class General_options): Add -f and -F.
5142 * options.cc (General_options::finalize): Fatal error if -f/-F
5143 are used without -shared.
5144 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5145
ae3a6d4f
ILT
51462011-07-02 Ian Lance Taylor <iant@google.com>
5147
5148 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5149
21131061
ILT
51502011-07-01 Ian Lance Taylor <iant@google.com>
5151
5152 PR gold/12525
5153 PR gold/12952
5154 * resolve.cc (Symbol::override_base_with_special): Don't override
5155 the version if the overriding symbol has a different name.
5156 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5157 all callers. If we give an error about an undefined version,
5158 define the base version if necessary.
5159 * dynobj.h (class Versions): Update declaration.
5160 * testsuite/weak_alias_test_5.cc: New file.
5161 * testsuite/weak_alias_test.script: New file.
5162 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5163 and versioned_alias have the right value, and call t2.
5164 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5165 weak_alias_test_5.so.
5166 (weak_alias_test_LDADD): Likewise.
5167 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5168 * testsuite/Makefile.in: Rebuild.
5169
611062c0
ILT
51702011-07-01 Ian Lance Taylor <iant@google.com>
5171
5172 PR gold/12525
5173 * options.h (class General_options): Support -z notext.
5174 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5175 -Wl,-z,notext.
5176 (two_file_shared_nonpic.so): Likewise.
5177 (two_file_shared_mixed.so): Likewise.
5178 (two_file_shared_mixed_1.so): Likewise.
5179 (weak_undef_lib_nonpic.so): Likewise.
5180 (alt/weak_undef_lib_nonpic.so): Likewise.
5181 (tls_test_shared_nonpic.so): Likewise.
5182 * testsuite/Makefile.in: Rebuild.
5183
328c7c2f
ILT
51842011-07-01 Ian Lance Taylor <iant@google.com>
5185
5186 PR gold/12525
5187 * configure.ac: Test whether static linking works, setting
5188 the automake conditional HAVE_STATIC.
5189 * testsuite/Makefile.am: Disable tests using -static if
5190 HAVE_STATIC is not true.
5191 * configure, testsuite/Makefile.in: Rebuild.
5192
02d7cd44
ILT
51932011-07-01 Ian Lance Taylor <iant@google.com>
5194
5195 PR gold/12525
5196 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5197 Assert if we see DW_EH_PE_indirect.
5198 * target.h (Target::ehframe_datarel_base): New function.
5199 (Target::do_ehframe_datarel_base): New target function.
5200 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5201 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5202 function.
5203
07a60597
ILT
52042011-07-01 Ian Lance Taylor <iant@google.com>
5205
5206 PR gold/12571
5207 * options.h (class General_options): Add
5208 --ld-generated-unwind-info.
5209 * ehframe.cc (Fde::write): Add address parameter. Change all
5210 callers. If associated with PLT, fill in address and size.
5211 (Cie::set_output_offset): Only add merge mapping if there is an
5212 object.
5213 (Cie::write): Add address parameter. Change all callers.
5214 (Eh_frame::add_ehframe_for_plt): New function.
5215 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5216 input_offset_ fields into union u_, with new plt field.
5217 (Fde::Fde): Adjust for new union field.
5218 (Fde::Fde) [Output_data version]: New constructor.
5219 (Fde::add_mapping): Only add merge mapping if there is an object.
5220 (class Cie): Update declarations.
5221 (class Eh_frame): Declare add_ehframe_for_plt.
5222 * layout.cc (Layout::layout_eh_frame): Break out code into
5223 make_eh_frame_section, and call it.
5224 (Layout::make_eh_frame_section): New function.
5225 (Layout::add_eh_frame_for_plt): New function.
5226 * layout.h (class Layout): Update declarations.
5227 * merge.cc (Merge_map::add_mapping): Add assertion.
5228 * i386.cc: Include "dwarf.h".
5229 (class Output_data_plt_i386): Make first_plt_entry,
5230 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5231 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5232 and plt_eh_frame_fde.
5233 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5234 boundary. Call add_eh_frame_for_plt if appropriate.
5235 * x86_64.cc: Include "dwarf.h".
5236 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5237 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5238 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5239 and plt_eh_frame_fde.
5240 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5241 appropriate.
5242
14788a3f
ILT
52432011-06-29 Ian Lance Taylor <iant@google.com>
5244
5245 PR gold/12629
5246 * object.cc (Sized_relobj_file::layout_section): Change shdr
5247 parameter to be const.
5248 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5249 out of do_layout.
5250 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5251 appropriate. Call layout_eh_frame_section.
5252 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5253 sections.
5254 * object.h (class Sized_relobj_file): Update declarations.
5255
6c21fce1
ILT
52562011-06-29 Ian Lance Taylor <iant@google.com>
5257
37e41b03 5258 PR gold/12652
6c21fce1
ILT
5259 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5260 modifier.
5261 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5262
4d5e4e62
ILT
52632011-06-29 Ian Lance Taylor <iant@google.com>
5264
5265 PR gold/12675
5266 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5267 SHT_X86_64_UNWIND.
5268 * layout.cc (Layout::layout_eh_frame): Likewise.
5269
886f533a
ILT
52702011-06-29 Ian Lance Taylor <iant@google.com>
5271
5272 PR gold/12695
5273 * layout.cc (Layout::symtab_section_shndx): New function.
5274 * layout.h (class Layout): Declare symtab_section_shndx.
5275 * output.cc (Output_section::write_header): Call it.
5276
f3ae1b28
ILT
52772011-06-29 Ian Lance Taylor <iant@google.com>
5278
5279 PR gold/12818
5280 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5281 symbols which are not used in a relocation.
5282
aecf301f
ILT
52832011-06-28 Ian Lance Taylor <iant@google.com>
5284
5285 PR gold/12898
5286 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5287 script create indistinguishable segments.
5288 (Layout::set_segment_offsets): Use stable_sort when sorting
5289 segments. Pass this to Compare_segments constructor.
5290 * layout.h (class Layout): Make segment_precedes non-static.
5291 (class Compare_segments): Change from struct to class. Add
5292 layout_ field. Add constructor.
5293 * script-sections.cc
5294 (Script_sections::attach_sections_using_phdrs_clause): Rename
5295 local orphan to is_orphan. Don't report failure to put empty
5296 section in segment. On attachment failure, report name of
5297 section, and attach to first PT_LOAD segment.
5298
03ef7571
ILT
52992011-06-28 Ian Lance Taylor <iant@google.com>
5300
5301 PR gold/12934
5302 * target-select.cc (Target_selector::Target_selector): Add
5303 emulation parameter. Change all callers.
5304 (select_target_by_bfd_name): Rename from select_target_by_name.
5305 Change all callers.
5306 (select_target_by_emulation): New function.
5307 (supported_emulation_names): New function.
5308 * target-select.h (class Target_selector): Add emulation_ field.
5309 Update declarations.
5310 (Target_selector::recognize_by_bfd_name): Rename from
5311 recognize_by_name. Change all callers.
5312 (Target_selector::supported_bfd_names): Rename from
5313 supported_names. Change all callers.
5314 (Target_selector::recognize_by_emulation): New function.
5315 (Target_selector::supported_emulations): New function.
5316 (Target_selector::emulation): New function.
5317 (Target_selector::do_recognize_by_bfd_name): Rename from
5318 do_recognize_by_name. Change all callers.
5319 (Target_selector::do_supported_bfd_names): Rename from
5320 do_supported_names. Change all callers.
5321 (Target_selector::do_recognize_by_emulation): New function.
5322 (Target_selector::do_supported_emulations): New function.
5323 (select_target_by_bfd_name): Change name in declaration.
5324 (select_target_by_emulation): Declare.
5325 (supported_emulation_names): Declare.
5326 * parameters.cc (parameters_force_valid_target): Try to find
5327 target based on emulation from -m option.
5328 * options.h (class General_options): Change doc string for -m.
5329 * options.cc (help): Print emulations.
5330 (General_options::parse_V): Likewise.
5331 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5332 Add emulation parameter. Change all callers.
5333
200b2bb9
ILT
53342011-06-28 Ian Lance Taylor <iant@google.com>
5335
5336 * target.h (class Target): Add osabi_ field.
5337 (Target::osabi): New function.
5338 (Target::set_osabi): New function.
5339 (Target::Target): Initialize osabi_.
5340 (Target::do_adjust_elf_header): Make pure virtual.
5341 (Sized_target::do_adjust_elf_header): Declare.
5342 * target.cc (Sized_target::do_adjust_elf_header): New function.
5343 (class Sized_target): Instantiate all versions.
5344 * freebsd.h (class Target_freebsd): Remove.
5345 (Target_selector_freebsd::do_recognize): Call set_osabi on
5346 Target.
5347 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5348 (Target_selector_freebsd::set_osabi): Remove.
5349 * i386.cc (class Target_i386): Inherit from Sized_target rather
5350 than Target_freebsd.
5351 * x86_64.cc (class Target_x86_64): Likewise.
5352
b3ce541e
ILT
53532011-06-28 Ian Lance Taylor <iant@google.com>
5354
5355 * target.h (Target::can_check_for_function_pointers): Rewrite.
5356 Make non-virtual.
5357 (Target::can_icf_inline_merge_sections): Likewise.
5358 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5359 (Target::Target_info): Add can_icf_inline_merge_sections field.
5360 (Target::do_can_check_for_function_pointers): New virtual
5361 function.
5362 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5363 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5364 from can_check_for_function_pointers, move in file.
5365 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5366 section_may_have_icf_unsafe_poineters, move in file.
5367 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5368 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5369 Rename from can_check_for_function_pointers, move in file.
5370 (Target_i386::can_icf_inline_merge_sections): Remove.
5371 (Target_i386::i386_info): Initialize
5372 can_icf_inline_merge_sections.
5373 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5374 Initialize can_icf_inline_merge_sections.
5375 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5376 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5377 Rename from can_check_for_function_pointers, move in file.
5378 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5379 (Target_x86_64::x86_64_info): Initialize
5380 can_icf_inline_merge_sections.
5381 * testsuite/testfile.cc (Target_test::test_target_info):
5382 Likewise.
5383 * icf.cc (get_section_contents): Correct formatting.
5384
6d1c4efb
ILT
53852011-06-27 Ian Lance Taylor <iant@google.com>
5386
5387 * symtab.cc (Symbol::versioned_name): New function.
5388 (Symbol_table::add_to_final_symtab): Use versioned_name when
5389 appropriate.
5390 (Symbol_table::sized_write_symbol): Likewise.
5391 * symtab.h (class Symbol): Declare versioned_name.
5392 * stringpool.h (class Stringpool_template): Add variant of add
5393 which takes a std::basic_string.
5394 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5395 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5396 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5397 (ver_test_12.o): New target.
5398 * testsuite/Makefile.in: Rebuild.
5399
57eb9b50
DK
54002011-06-27 Doug Kwan <dougkwan@google.com>
5401
5402 * arm.cc (Arm_relocate_functions::thm_jump8,
5403 Arm_relocate_functions::thm_jump11): Use a wider signed
5404 type to compute offset.
5405 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5406 arm_thm_jump8.
5407 * testsuite/Makefile.in: Regenerate.
5408 * testsuite/arm_branch_in_range.sh: Check test results of
5409 arm_thm_jump11 and arm_thm_jump8.
5410 * testsuite/arm_thm_jump11.s: New test source file.
5411 * testsuite/arm_thm_jump11.t: New linker script.
5412 * testsuite/arm_thm_jump8.s: New test source file.
5413 * testsuite/arm_thm_jump8.t: New linker script.
5414
487b39df
ILT
54152011-06-24 Ian Lance Taylor <iant@google.com>
5416
5417 * layout.cc: Include "object.h".
5418 (ctors_sections_in_init_array): New static variable.
5419 (Layout::is_ctors_in_init_array): New function.
5420 (Layout::layout): Add entry to ctors_sections_in_init_array if
5421 appropriate.
5422 * layout.h (class Layout): Declare is_ctors_in_init_array.
5423 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5424 is_ctors_reverse_view is set.
5425 (Sized_relobj_file::write_sections): Add layout parameter. Change
5426 all callers. Set is_ctors_reverse_view field of View_size.
5427 (Sized_relobj_file::reverse_words): New function.
5428 * object.h (Sized_relobj_file::View_size): Add
5429 is_ctors_reverse_view field.
5430 (class Sized_relobj_file): Update declarations.
5431 * testsuite/initpri3.c: New test.
5432 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5433 initpri3b.
5434 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5435 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5436 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5437 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5438 * testsuite/Makefile.in: Rebuild.
5439
472076e4
CC
54402011-06-24 Cary Coutant <ccoutant@google.com>
5441
5442 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5443 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5444 (debug_msg_cdebug.err): New targets.
5445 * testsuite/Makefile.in: Regenerate.
5446 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5447 Fix checks for link with shared library.
5448
a60af0db
DK
54492011-06-24 Doug Kwan <dougkwan@google.com>
5450
5451 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5452 skip empty text sections.
5453 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5454
5393d741
ILT
54552011-06-22 Ian Lance Taylor <iant@google.com>
5456
5457 PR gold/12910
5458 * options.h (class General_options): Add --ctors-in-init-array.
5459 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5460 friends as SHT_PROGBITS for merging sections.
5461 (Layout::layout): Remove special handling of .init_array and
5462 friends. Don't sort if doing relocatable link. Sort for .ctors
5463 and .dtors if ctors_in_init_array.
5464 (Layout::make_output_section): Force correct section types for
5465 .init_array and friends. Don't sort if doing relocatable link,
5466 Don't sort .ctors and .dtors if ctors_in_init_array.
5467 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5468 (Layout::output_section_name): Add relobj parameter. Change all
5469 callers. Handle .ctors. and .dtors. in code rather than table.
5470 Handle .ctors and .dtors if ctors_in_init_array.
5471 (Layout::match_file_name): New function, moved from output.cc.
5472 * layout.h (class Layout): Update declarations.
5473 * output.cc: Include "layout.h".
5474 (Input_section_sort_entry::get_priority): New function.
5475 (Input_section_sort_entry::match_file_name): Just call
5476 Layout::match_file_name.
5477 (Output_section::Input_section_sort_init_fini_compare::operator()):
5478 Handle .ctors and .dtors. Sort by explicit priority rather than
5479 by name.
5480 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5481 * testsuite/initpri2.c: New test.
5482 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5483 (check_PROGRAMS): Add initpri2.
5484 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5485 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5486 * configure, testsuite/Makefile.in: Rebuild.
5487
e1f74f98
ILT
54882011-06-19 Ian Lance Taylor <iant@google.com>
5489
5490 PR gold/12880
5491 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5492 .interp section to a PT_INTERP segment even if we have seen a
5493 --dynamic-linker option. Don't do it if we have seen a PHDRS
5494 clause in a linker script.
5495 (Layout::finalize): Don't create a .interp section if we've
5496 already create a PT_INTERP segment.
5497 (Layout::create_interp): Always call choose_output_section (revert
5498 patch of 2011-06-17). Don't create PT_INTERP segment.
5499 * script-sections.cc
5500 (Script_sections::create_note_and_tls_segments): Add a .interp
5501 section to a PT_INTERP segment even if we have seen a
5502 --dynamic-linker option.
5503
766f91bb
ILT
55042011-06-18 Ian Lance Taylor <iant@google.com>
5505
5506 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5507 merely because a non-PT_LOAD segment has a dynamic reloc.
5508
0d212c3a
ILT
55092011-06-18 Ian Lance Taylor <iant@google.com>
5510
5511 * layout.cc (Layout::finish_dynamic_section): Don't create
5512 DT_FLAGS entry if not needed.
5513
911a5072
ILT
55142011-06-18 Ian Lance Taylor <iant@google.com>
5515
5516 PR gold/12745
5517 * layout.cc (Layout::layout_eh_frame): Correct handling of
5518 writable .eh_frame section.
5519
534b4e5f
ILT
55202011-06-17 Ian Lance Taylor <iant@google.com>
5521
5522 PR gold/12893
5523 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5524 symbol is redefined with the exact same object and value.
5525
10b4f102
ILT
55262011-06-17 Ian Lance Taylor <iant@google.com>
5527
5528 PR gold/12880
5529 * layout.h (class Layout): Add interp_segment_ field.
5530 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5531 (Layout::attach_allocated_section_to_segment): If making shared
5532 library, put .interp section in PT_INTERP segment.
5533 (Layout::finalize): Also call create_interp if -dynamic-linker
5534 option was used.
5535 (Layout::create_interp): Assert that there is no PT_INTERP
5536 segment. If not using a SECTIONS clause, use make_output_section.
5537 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5538 * script-sections.cc
5539 (Script_sections::create_note_and_tls_segments): If making shared
5540 library, put .interp section in PT_INTERP segment.
5541
a29b0dad
ILT
55422011-06-17 Ian Lance Taylor <iant@google.com>
5543
e588ea8d
ILT
5544 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5545 when making a shared library.
5546
55472011-06-17 Ian Lance Taylor <iant@google.com>
5548
5549 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5550 parameter. Change all callers. Don't issue warning about PC32
5551 against locally defined symbol.
a29b0dad 5552
9d3b0698
ILT
55532011-06-16 Ian Lance Taylor <iant@google.com>
5554
5555 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5556 occurs in same object.
5557
85b0f90c
AM
55582011-06-14 Alan Modra <amodra@gmail.com>
5559
5560 * po/POTFILES.in: Regenerate.
5561
a94907d9
ILT
55622011-06-09 Ian Lance Taylor <iant@google.com>
5563
5564 * script-sections.cc
5565 (Orphan_output_section::set_section_addresses): For a relocatable
5566 link set address to 0.
5567
4fb3a1c3
CC
55682011-06-09 Cary Coutant <ccoutant@google.com>
5569
5570 PR gold/12804
5571 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5572 used with --compress-debug-sections.
5573 * gold/object.cc (Sized_relobj_file::do_layout): Report
5574 uncompressed size of compressed input sections.
5575
61220854
CC
55762011-06-08 Cary Coutant <ccoutant@google.com>
5577
5578 PR gold/12804
5579 * testsuite/two_file_test_2_v1.cc: Change initialization of
5580 v2 to keep it in .data.
5581
e6455dfb
CC
55822011-06-07 Cary Coutant <ccoutant@google.com>
5583
5584 * common.cc (Symbol_table::do_allocate_commons_list): Call
5585 gold_fallback.
5586 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5587 (Errors::fallback): New function.
5588 (gold_fallback): New function.
5589 * errors.h (Errors::fallback): New function.
5590 * gold.cc (gold_exit): Change status parameter to enum; adjust
5591 all callers.
5592 (queue_initial_tasks): Call gold_fallback.
5593 * gold.h: Include cstdlib.
5594 (Exit_status): New enum type.
5595 (gold_exit): Change status parameter to enum.
5596 (gold_fallback): New function.
5597 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5598 (Layout::create_symtab_sections): Likewise.
5599 (Layout::create_shdrs): Likewise.
5600 * main.cc (main): Adjust call to gold_exit.
5601 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5602 (Output_data_got::add_got_entry_pair): Likewise.
5603 (Output_section::add_input_section): Likewise.
5604 (Output_section::add_output_section_data): Likewise.
5605 (Output_segment::set_section_list_addresses): Likewise.
5606 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5607
fb0e076f
CC
56082011-06-07 Cary Coutant <ccoutant@google.com>
5609
5610 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5611 for incremental links.
5612 * output.cc (Output_segment::set_section_list_addresses): Remove
5613 FIXME and test for TLS or BSS.
5614
a5ee4d5d
CC
56152011-06-07 Cary Coutant <ccoutant@google.com>
5616
5617 * testsuite/Makefile.am: Add incremental_copy_test,
5618 incremental_common_test_1.
5619 * testsuite/Makefile.in: Regenerate.
5620 * testsuite/common_test_1_v1.c: New source file.
5621 * testsuite/common_test_1_v2.c: New source file.
5622 * testsuite/copy_test_v1.cc: New source file.
5623
5146f448
CC
56242011-06-07 Cary Coutant <ccoutant@google.com>
5625
5626 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5627 update, allocate common from bss section's free list.
5628 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5629 linker-defined symbols.
5630 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5631 Skip GOT and PLT entries that are no longer referenced.
5632 (Output_section_incremental_inputs::write_info_blocks): Mark
5633 linker-defined symbols.
5634 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5635 * output.cc (Output_section::allocate): New function.
5636 * output.h (Output_section::allocate): New function.
5637 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5638 linker-defined symbols.
5639 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5640 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5641 (Symbol::init_base_output_data): Likewise.
5642 (Symbol::init_base_output_segment): Likewise.
5643 (Symbol::init_base_constant): Likewise.
5644 (Sized_symbol::init_output_data): Likewise.
5645 (Sized_symbol::init_output_segment): Likewise.
5646 (Sized_symbol::init_constant): Likewise.
5647 (Symbol_table::do_define_in_output_data): Likewise.
5648 (Symbol_table::do_define_in_output_segment): Likewise.
5649 (Symbol_table::do_define_as_constant): Likewise.
5650 * symtab.h (Symbol::is_predefined): New function.
5651 (Symbol::init_base_output_data): Add is_predefined parameter.
5652 (Symbol::init_base_output_segment): Likewise.
5653 (Symbol::init_base_constant): Likewise.
5654 (Symbol::is_predefined_): New data member.
5655 (Sized_symbol::init_output_data): Add is_predefined parameter.
5656 (Sized_symbol::init_output_segment): Likewise.
5657 (Sized_symbol::init_constant): Likewise.
5658 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5659
26d3c67d
CC
56602011-06-07 Cary Coutant <ccoutant@google.com>
5661
5662 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5663 instead of emit_copy_reloc.
5664 (Copy_relocs::emit_copy_reloc): Refactor.
5665 (Copy_relocs::make_copy_reloc): New function.
5666 (Copy_relocs::add_copy_reloc): Remove.
5667 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5668 section.
5669 (Copy_relocs::make_copy_reloc): New function.
5670 (Copy_relocs::add_copy_reloc): Remove.
5671 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5672 unchanged input files.
5673 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5674 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5675 Reserve BSS space for COPY relocations.
5676 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5677 (Output_section_incremental_inputs::write_info_blocks): Record
5678 whether a symbol is copied from a shared object.
5679 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5680 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5681 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5682 (Incremental_input_entry_reader::get_output_symbol_index): Add
5683 is_copy parameter.
5684 (Incremental_binary::emit_copy_relocs): New function.
5685 (Incremental_binary::do_emit_copy_relocs): New function.
5686 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5687 new data member.
5688 (Sized_incremental_binary::add_copy_reloc): New function.
5689 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5690 (Sized_incremental_binary::Copy_reloc): New struct.
5691 (Sized_incremental_binary::Copy_relocs): New typedef.
5692 (Sized_incremental_binary::copy_relocs_): New data member.
5693 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5694 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5695 * target.h (Sized_target::emit_copy_reloc): New function.
5696 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5697
7cdb37d9
CC
56982011-06-02 Cary Coutant <ccoutant@google.com>
5699
5700 PR gold/12163
5701 * gold/archive.cc (Archive::Archive): Initialize new data member.
5702 (Archive::include_all_members): Return if archive has already been
5703 included.
5704 * gold/archive.h (Archive::include_all_members_): New data member.
5705
cc643b88
NC
57062011-06-02 Nick Clifton <nickc@redhat.com>
5707
5708 * dynobj.h: Fix spelling mistake in comment.
5709 * output.cc: Likewise.
5710
f62a3ca7 57112011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 5712 Asier Llano
f62a3ca7
DK
5713
5714 PR gold/12826
cc643b88 5715 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
5716 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5717 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5718 redundant arm_exidx_test.so.
5719 * testsuite/Makefile.in: Regenerate.
5720 (check_SCRIPTS): Add pr12826.sh
5721 (check_DATA): Add pr12826.stdout
5722 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5723 * testsuite/pr12826.sh: New file.
5724 * testsuite/pr12826_1.s: Ditto.
5725 * testsuite/pr12826_1.s: Ditto.
5726
8dbe1edc
ILT
57272011-05-30 Ian Lance Taylor <iant@google.com>
5728
5729 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5730 sections.
5731
c49875be
ILT
57322011-05-29 Ian Lance Taylor <iant@google.com>
5733
5734 PR gold/12804
5735 * testsuite/Makefile.am: Use different file name for two_file_test
5736 temporary file for each incremental test.
5737 * testsuite/Makefile.in: Rebuild.
5738
69d53f7a
ILT
57392011-05-29 Ian Lance Taylor <iant@google.com>
5740
5741 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5742 binary input file is empty.
5743
41d0ab5f
ILT
57442011-05-27 Ian Lance Taylor <iant@google.com>
5745
5746 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5747 (ver_test_9.so): Likewise.
5748 * testsuite/Makefile.in: Rebuild.
5749
89d8a36b
CC
57502011-05-26 Cary Coutant <ccoutant@google.com>
5751
5752 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5753 * incremental.cc (Incremental_inputs::report_input_section): Fix
5754 comment, indentation.
5755 (Incremental_inputs::report_comdat_group): New function.
5756 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5757 of data for incremental input file entry.
5758 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5759 group count, COMDAT group signatures.
5760 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5761 an unchanged input file.
5762 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5763 Initialize new data member.
5764 (Incremental_object_entry::add_comdat_group): New function.
5765 (Incremental_object_entry::get_comdat_group_count): New function.
5766 (Incremental_object_entry::get_comdat_signature_key): New function.
5767 (Incremental_object_entry::groups_): New data member.
5768 (Incremental_inputs::report_comdat_group): New function.
5769 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5770 data for incremental input file entry.
5771 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5772 (Incremental_input_entry_reader::get_input_section): Adjust size of
5773 data for incremental input file entry.
5774 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5775 (Incremental_input_entry_reader::get_comdat_group_signature): New
5776 function.
5777 * object.cc (Sized_relobj::include_section_group): Report kept
5778 COMDAT groups for incremental links.
5779
1706a06f
ILT
57802011-05-24 David Meyer <pdox@google.com>
5781
5782 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5783 with name parameter. Add found_name parameter.
5784 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5785 * dirsearch.h (class Dirsearch): Update declaration.
5786
a10ae760
ILT
57872011-05-24 Ian Lance Taylor <iant@google.com>
5788
5789 * archive.cc (Library_base::should_include_member): Pull in object
5790 from archive if it defines the entry symbol.
5791 * parameters.cc (Parameters::entry): New function.
5792 * parameters.h (class Parameters): Declare entry.
5793 * output.h (class Output_file_header): Remove entry_ field.
5794 * output.cc (Output_file_header::Output_file_header): Remove entry
5795 parameter. Change all callers.
5796 (Output_file_header::entry): Use parameters->entry.
5797 * gold.cc (queue_middle_tasks): Likewise.
5798 * plugin.cc (Plugin_hook::run): Likewise.
5799
aa92d6ed
CC
58002011-05-24 Cary Coutant <ccoutant@google.com>
5801
5802 * gold.cc (queue_initial_tasks): Pass incremental base filename
5803 to Output_file::open_base_file; don't print error message.
5804 * incremental-dump.cc (main): Adjust call to
5805 Output_file::open_for_modification.
5806 * incremental-dump.cc (main): Likewise.
5807 * incremental.cc (Incremental_inputs::report_command_line):
5808 Ignore --incremental-base option when comparing command lines.
5809 Ignore parameter when given as separate argument.
5810 * options.h (class General_options): Add --incremental-base.
5811 * output.cc (Output_file::Output_file):
5812 (Output_file::open_base_file): Add base_name and writable parameters;
5813 read base file into new file; print error message here.
5814 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5815 callers.
5816 * output.h (Output_file::open_for_modification): Rename to...
5817 (Output_file::open_base_file): ...this; add base_name and
5818 writable parameters; adjust all callers.
5819 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5820 callers.
5821 * testsuite/Makefile.am (incremental_test_4): Test
5822 --incremental-base.
5823 * testsuite/Makefile.in: Regenerate.
5824
2eedd706
CC
58252011-05-24 Cary Coutant <ccoutant@google.com>
5826
5827 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5828 incremental_test_4.
5829 * testsuite/Makefile.in: Regenerate.
5830 * testsuite/two_file_test_1_v1.cc: New test source file.
5831 * testsuite/two_file_test_1b_v1.cc: New test source file.
5832 * testsuite/two_file_test_2_v1.cc: New test source file.
5833
0f1c85a6
CC
58342011-05-24 Cary Coutant <ccoutant@google.com>
5835
5836 * dynobj.h (Dynobj::do_dynobj): New function.
5837 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5838 flag and soname for shared objects.
5839 * incremental.cc (Incremental_inputs::report_object): Make
5840 either Incremental_object_entry or Incremental_dynobj_entry; add
5841 soname to string table.
5842 (Incremental_inputs::report_input_section): Add assertion.
5843 (Output_section_incremental_inputs::set_final_data_size): Adjust
5844 type of input file entry for shared libraries; adjust size of
5845 shared library info entry.
5846 (Output_section_incremental_inputs::write_input_files): Write
5847 as_needed flag for shared libraries.
5848 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5849 of input file entry for shared libraries; write soname.
5850 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5851 soname from incremental info.
5852 * incremental.h (enum Incremental_input_flags): Add
5853 INCREMENTAL_INPUT_AS_NEEDED.
5854 (Incremental_input_entry::Incremental_input_entry): Initialize new
5855 data member.
5856 (Incremental_input_entry::set_as_needed): New function.
5857 (Incremental_input_entry::as_needed): New function.
5858 (Incremental_input_entry::do_dynobj_entry): New function.
5859 (Incremental_input_entry::as_needed_): New data member.
5860 (Incremental_object_entry::Incremental_object_entry): Don't check
5861 for shared library.
5862 (Incremental_object_entry::do_type): Likewise.
5863 (class Incremental_dynobj_entry): New class.
5864 (Incremental_input_entry_reader::as_needed): New function.
5865 (Incremental_input_entry_reader::get_soname): New function.
5866 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5867 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5868 size of shared library info entry.
58797674 5869 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
5870 incremental link when adding DT_NEEDED entries.
5871 * object.h (Object::Object): Initialize new data member.
5872 (Object::dynobj): New function.
5873 (Object::set_as_needed): New function.
5874 (Object::as_needed): New function.
5875 (Object::do_dynobj): New function.
5876 (Object::as_needed_): New data member.
5877
6fa2a40b
CC
58782011-05-24 Cary Coutant <ccoutant@google.com>
5879
5880 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5881 info; adjust display of GOT entries.
5882 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5883 vector of input objects; remove file_status_.
5884 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5885 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5886 got_plt reader; call target hooks to reserve GOT entries.
5887 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5888 of input file info header and GOT info entry.
5889 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5890 relocation info.
5891 (Got_plt_view_info::got_descriptor): Remove.
5892 (Got_plt_view_info::sym_index): New data member.
5893 (Got_plt_view_info::input_index): New data member.
5894 (Local_got_offset_visitor::visit): Write input file index.
5895 (Global_got_offset_visitor::visit): Write 0 for input file index.
5896 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5897 with sym_index and input_index.
5898 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5899 incremental info GOT entry; replace got_descriptor with input_index.
5900 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5901 map from input file index to object.
5902 (Sized_relobj_incr::do_layout): Replace direct data member reference
5903 with accessor function.
5904 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5905 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5906 Adjust size of input file info header.
5907 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5908 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5909 (Incremental_input_entry_reader::get_input_section): Adjust size of
5910 input file info header.
5911 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5912 of incremental info GOT entry.
5913 (Incremental_got_plt_reader::get_got_desc): Remove.
5914 (Incremental_got_plt_reader::get_got_symndx): New function.
5915 (Incremental_got_plt_reader::get_got_input_index): New function.
5916 (Sized_incremental_binary::Sized_incremental_binary): Remove
5917 file_status_; add input_objects_.
5918 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5919 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5920 (Sized_incremental_binary::file_is_unchanged): Remove.
5921 (Sized_incremental_binary::set_input_object): New function.
5922 (Sized_incremental_binary::input_object): New function.
5923 (Sized_incremental_binary::file_status_): Remove.
5924 (Sized_incremental_binary::input_objects_): New data member.
5925 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5926 references.
5927 (Sized_relobj_incr::invalid_address): Move to base class.
5928 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5929 class.
5930 (Sized_relobj_incr::do_output_section_offset): Likewise.
5931 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5932 (Sized_relobj_incr::section_offsets_): Likewise.
5933 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5934 function.
5935 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5936 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5937 with accessor function.
5938 (Sized_relobj_file::do_layout): Likewise.
5939 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5940 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5941 (Sized_relobj_file::compute_final_local_value): Replace refs to
5942 section_offsets_ with accessor function.
5943 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5944 * object.h (Relobj::Relobj): Initialize new data members.
5945 (Relobj::add_dyn_reloc): New function.
5946 (Relobj::first_dyn_reloc): New function.
5947 (Relobj::dyn_reloc_count): New function.
5948 (Relobj::first_dyn_reloc_): New data member.
5949 (Relobj::dyn_reloc_count_): New data member.
5950 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5951 references.
5952 (Sized_relobj::Address): New typedef.
5953 (Sized_relobj::invalid_address): Move here from child class.
5954 (Sized_relobj::Sized_relobj): Initialize new data members.
5955 (Sized_relobj::sized_relobj): New function.
5956 (Sized_relobj::is_output_section_offset_invalid): Move here from
5957 child class.
5958 (Sized_relobj::get_output_section_offset): Likewise.
5959 (Sized_relobj::local_has_got_offset): Likewise.
5960 (Sized_relobj::local_got_offset): Likewise.
5961 (Sized_relobj::set_local_got_offset): Likewise.
5962 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5963 (Sized_relobj::clear_got_offsets): New function.
5964 (Sized_relobj::section_offsets): Move here from child class.
5965 (Sized_relobj::do_output_section_offset): Likewise.
5966 (Sized_relobj::do_set_section_offset): Likewise.
5967 (Sized_relobj::Local_got_offsets): Likewise.
5968 (Sized_relobj::local_got_offsets_): Likewise.
5969 (Sized_relobj::section_offsets_): Likewise.
5970 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5971 references.
5972 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5973 class.
5974 (Sized_relobj_file::sized_relobj): New function
5975 (Sized_relobj_file::local_has_got_offset): Move to base class.
5976 (Sized_relobj_file::local_got_offset): Likewise.
5977 (Sized_relobj_file::set_local_got_offset): Likewise.
5978 (Sized_relobj_file::get_output_section_offset): Likewise.
5979 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5980 (Sized_relobj_file::do_output_section_offset): Likewise.
5981 (Sized_relobj_file::do_set_section_offset): Likewise.
5982 (Sized_relobj_file::Local_got_offsets): Likewise.
5983 (Sized_relobj_file::local_got_offsets_): Likewise.
5984 (Sized_relobj_file::section_offsets_): Likewise.
5985 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5986 (all constructors).
5987 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5988 (Output_reloc::get_symbol_index): Likewise.
5989 (Output_reloc::local_section_offset): Likewise.
5990 (Output_reloc::get_address): Likewise.
5991 (Output_reloc::symbol_value): Likewise.
5992 (Output_data_got::reserve_slot): Move to class definition.
5993 (Output_data_got::reserve_local): New function.
5994 (Output_data_got::reserve_slot_for_global): Remove.
5995 (Output_data_got::reserve_global): New function.
5996 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5997 (all constructors, two instantiations).
5998 (Output_reloc::get_relobj): New function (two instantiations).
5999 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6000 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6001 (Output_data_reloc::add_global): Adjust type of relobj.
6002 (Output_data_reloc::add_global_relative): Likewise.
6003 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6004 (Output_data_reloc::add_local): Likewise.
6005 (Output_data_reloc::add_local_relative): Likewise.
6006 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6007 (Output_data_reloc::add_local_section): Likewise.
6008 (Output_data_reloc::add_output_section): Likewise.
6009 (Output_data_reloc::add_absolute): Likewise.
6010 (Output_data_reloc::add_target_specific): Likewise.
6011 (Output_data_got::reserve_slot): Move definition here.
6012 (Output_data_got::reserve_local): New function.
6013 (Output_data_got::reserve_global): New function.
6014 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6015 section_offsets_ with accessor function.
6016 (Sized_relobj_file::write_sections): Likewise.
6017 (Sized_relobj_file::do_relocate_sections): Likewise.
6018 * target.h (Sized_target::reserve_local_got_entry): New function.
6019 (Sized_target::reserve_global_got_entry): New function.
6020 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6021 (Target_x86_64::reserve_global_got_entry): New function.
6022 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6023
4829d394
CC
60242011-05-23 Cary Coutant <ccoutant@google.com>
6025
6026 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6027 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6028 bit when checking got_type.
6029 * incremental.cc (Sized_incremental_binary::setup_readers):
6030 Store symbol table and string table locations; initialize bit vector
6031 of file status flags.
6032 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6033 unchanged files.
6034 (Sized_incremental_binary::do_process_got_plt): New function.
6035 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6036 (Output_section_incremental_inputs::set_final_data_size): Record
6037 file index for each input file.
6038 (Output_section_incremental_inputs::write_got_plt): Store file index
6039 instead of input entry offset for each GOT entry.
6040 * incremental.h
6041 (Incremental_input_entry::Incremental_input_entry): Initialize new
6042 data member.
6043 (Incremental_input_entry::set_offset): Store file index.
6044 (Incremental_input_entry::get_file_index): New function.
6045 (Incremental_input_entry::file_index_): New data member.
6046 (Incremental_binary::process_got_plt): New function.
6047 (Incremental_binary::do_process_got_plt): New function.
6048 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6049 data members.
6050 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6051 (Sized_incremental_binary::set_file_is_unchanged): New function.
6052 (Sized_incremental_binary::file_is_unchanged): New function.
6053 (Sized_incremental_binary::do_process_got_plt): New function.
6054 (Sized_incremental_binary::file_status_): New data member.
6055 (Sized_incremental_binary::main_symtab_loc_): New data member.
6056 (Sized_incremental_binary::main_strtab_loc_): New data member.
6057 * output.cc (Output_data_got::Got_entry::write): Add case
6058 RESERVED_CODE.
6059 (Output_data_got::add_global): Call add_got_entry.
6060 (Output_data_got::add_global_plt): Likewise.
6061 (Output_data_got::add_global_with_rel): Likewise.
6062 (Output_data_got::add_global_with_rela): Likewise.
6063 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6064 (Output_data_got::add_global_pair_with_rela): Likewise.
6065 (Output_data_got::add_local): Call add_got_entry.
6066 (Output_data_got::add_local_plt): Likewise.
6067 (Output_data_got::add_local_with_rel): Likewise.
6068 (Output_data_got::add_local_with_rela): Likewise.
6069 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6070 (Output_data_got::add_local_pair_with_rela): Likewise.
6071 (Output_data_got::reserve_slot): New function.
6072 (Output_data_got::reserve_slot_for_global): New function.
6073 (Output_data_got::add_got_entry): New function.
6074 (Output_data_got::add_got_entry_pair): New function.
6075 (Output_section::add_output_section_data): Edit FIXME.
6076 * output.h
6077 (Output_section_data_build::Output_section_data_build): New
6078 constructor with size parameter.
6079 (Output_data_space::Output_data_space): Likewise.
6080 (Output_data_got::Output_data_got): Initialize new data member; new
6081 constructor with size parameter.
6082 (Output_data_got::add_constant): Call add_got_entry.
6083 (Output_data_got::reserve_slot): New function.
6084 (Output_data_got::reserve_slot_for_global): New function.
6085 (class Output_data_got::Got_entry): Add RESERVED_CODE.
6086 (Output_data_got::add_got_entry): New function.
6087 (Output_data_got::add_got_entry_pair): New function.
6088 (Output_data_got::free_list_): New data member.
6089 * target.h (Sized_target::init_got_plt_for_update): New function.
6090 (Sized_target::register_global_plt_entry): New function.
6091 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
6092 Initialize new data member; call init; add constructor with PLT count.
6093 (Output_data_plt_x86_64::init): New function.
6094 (Output_data_plt_x86_64::add_relocation): New function.
6095 (Output_data_plt_x86_64::reserve_slot): New function.
6096 (Output_data_plt_x86_64::free_list_): New data member.
6097 (Target_x86_64::init_got_plt_for_update): New function.
6098 (Target_x86_64::register_global_plt_entry): New function.
6099 (Output_data_plt_x86_64::add_entry): Allocate from free list for
6100 incremental updates.
6101 (Output_data_plt_x86_64::add_relocation): New function.
6102 * testsuite/object_unittest.cc (Object_test): Set default options.
6103
ec69d6da
ILT
61042011-05-16 Ian Lance Taylor <iant@google.com>
6105
6106 * options.h (class General_options): Make -i a synonym for -r.
6107
732e31de
ILT
61082011-05-16 Ian Lance Taylor <iant@google.com>
6109
6110 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6111
403676b5
CC
61122011-05-10 Cary Coutant <ccoutant@google.com>
6113
6114 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6115 strip_all (-s).
6116
5b7b7d6e
ILT
61172011-05-06 Ian Lance Taylor <iant@google.com>
6118
6119 * layout.cc (Layout::layout): If the output section flags change,
6120 update the ordering.
6121
f0f9babf
CC
61222011-04-25 Cary Coutant <ccoutant@google.com>
6123
6124 * incremental-dump.cc (dump_incremental_inputs): Print local
6125 symbol info for each input file.
6126 * incremental.cc
6127 (Output_section_incremental_inputs::set_final_data_size): Add local
6128 symbol info to input file entries in incremental info.
6129 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6130 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6131 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6132 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6133 implementation.
6134 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6135 (Sized_incr_relobj::do_relocate): Write the local symbols.
6136 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6137 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6138 Adjust size of input file header.
6139 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6140 (Incremental_inputs_reader::get_local_symbol_count): New function.
6141 (Incremental_inputs_reader::get_input_section): Adjust size of input
6142 file header.
6143 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6144 (Sized_incr_relobj::This): New typedef.
6145 (Sized_incr_relobj::sym_size): New const data member.
6146 (Sized_incr_relobj::Local_symbol): New struct.
6147 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6148 (Sized_incr_relobj::do_local_symbol_offset): New function.
6149 (Sized_incr_relobj::local_symbol_count_): New data member.
6150 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6151 (Sized_incr_relobj::local_symbol_index_): New data member.
6152 (Sized_incr_relobj::local_symbol_offset_): New data member.
6153 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6154 (Sized_incr_relobj::local_symbols_): New data member.
6155 * object.h (Relobj::output_local_symbol_count): New function.
6156 (Relobj::local_symbol_offset): New function.
6157 (Relobj::do_output_local_symbol_count): New function.
6158 (Relobj::do_local_symbol_offset): New function.
6159 (Sized_relobj::do_output_local_symbol_count): New function.
6160 (Sized_relobj::do_local_symbol_offset): New function.
6161
d0a9ace3
ILT
61622011-04-22 Vladimir Simonov <sv@sw.ru>
6163
6164 * descriptors.cc (set_close_on_exec): New function.
6165 (Descriptors::open): Use set_close_on_exec.
6166 * output.cc (S_ISLNK): Define if not defined.
6167
94a3fc8b
CC
61682011-04-22 Cary Coutant <ccoutant@google.com>
6169
6170 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6171 global symbol map.
6172 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6173 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6174 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6175 relocations.
6176 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6177 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6178 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6179 * incremental.h
6180 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6181 function.
6182 (Incremental_binary::apply_incremental_relocs): New function.
6183 (Incremental_binary::do_apply_incremental_relocs): New function.
6184 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6185 data member.
6186 (Sized_incremental_binary::add_global_symbol): New function.
6187 (Sized_incremental_binary::global_symbol): New function.
6188 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6189 (Sized_incremental_binary::symbol_map_): New data member.
6190 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6191 * target.h (Sized_target::apply_relocation): New function.
6192 * target-reloc.h (apply_relocation): New function.
6193 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6194
c87e4302
DK
61952011-04-22 Doug Kwan <dougkwan@google.com>
6196
6197 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6198 flag of a SHT_ARM_EXIDX section.
2e702c99 6199 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
6200 * testsuite/Makefile.in: Regenerate.
6201 * testsuite/arm_exidx_test.s: New file.
6202 * testsuite/arm_exidx_test.sh: Same.
6203
e7782cf6
CC
62042011-04-20 Cary Coutant <ccoutant@google.com>
6205
6206 PR gold/12689
6207 * archive.h (Incremental_archive_entry::Archive_member):
6208 Initialize arg_serial_ (second constructor).
6209
308ecdc7
ILT
62102011-04-17 Ian Lance Taylor <iant@google.com>
6211
6212 * object.cc (Relocate_info::location): Simplify location string.
6213 * errors.cc (Errors::error_at_location): Don't print program
6214 name.
6215 (Errors::warning_at_location): Likewise.
6216 (Errors::undefined_symbol): Likewise.
6217 * testsuite/debug_msg.sh: Update accordingly.
6218
bec5b579
CC
62192011-04-14 Cary Coutant <ccoutant@google.com>
6220
6221 * gold/layout.cc (Layout::symtab_section_offset): New function.
6222 * gold/layout.h (Layout::symtab_section_offset): New function.
6223 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6224
88597d34
ILT
62252011-04-12 Ian Lance Taylor <iant@google.com>
6226
6227 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6228 with MREMAP_MAYMOVE.
6229 * output.h (class Output_file): Add map_is_allocated_ field.
6230 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6231 not available, provide stubs. If mremap is not available, #define
6232 it to gold_mremap.
6233 (MREMAP_MAYMOVE): Define if not defined.
6234 (Output_file::Output_file): Initialize map_is_allocated_.
6235 (Output_file::resize): Check map_is_allocated_.
6236 (Output_file::map_anonymous): If mmap fails, use malloc.
6237 (Output_file::unmap): Don't do anything for an anonymous map.
6238 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6239 is not available, provide stubs.
6240 (File_read::View::~View): Use free rather than delete[].
6241 (File_read::make_view): Use malloc rather than new[]. If mmap
6242 fails, use malloc.
6243 (File_read::find_or_make_view): Use malloc rather than new[].
6244 * gold.h: Remove HAVE_REMAP code.
6245 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6246 exists. Rename mremap to gold_mremap. If mmap is not available
6247 don't do anything.
6248 * configure, config.in: Rebuild.
6249
11e361bc
ILT
62502011-04-11 Ian Lance Taylor <iant@google.com>
6251
6252 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6253 initialize local variable v.
6254
cdc29364
CC
62552011-04-11 Cary Coutant <ccoutant@google.com>
6256
6257 * archive.cc (Archive::include_member): Adjust call to
6258 report_object.
6259 (Add_archive_symbols::run): Track argument serial numbers.
6260 (Lib_group::include_member): Likewise.
6261 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6262 * archive.h (Incremental_archive_entry::Archive_member):
6263 Initialize arg_serial_.
6264 (Archive_member::arg_serial_): New data member.
6265 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6266 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6267 incremental link.
6268 (Sized_dynobj::do_for_all_local_got_entries): New function.
6269 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6270 function.
6271 * fileread.cc (get_mtime): New function.
6272 * fileread.h (get_mtime): New function.
6273 * gold.cc (queue_initial_tasks): Check for incremental update.
6274 (process_incremental_input): New function.
6275 (queue_middle_tasks): Don't force valid target for incremental
6276 update.
6277 * incremental-dump.cc (find_input_containing_global): Adjust
6278 size of symbol info entry.
6279 (dump_incremental_inputs): Dump argument serial number and
6280 in_system_directory flag; bias shndx by 1; print symbol names
6281 when dumping per-file symbol lists; use new symbol info readers.
6282 * incremental.cc
6283 (Output_section_incremental_inputs:update_data_size): New function.
6284 (Sized_incremental_binary::setup_readers): Setup input readers
6285 for each input file; build maps for files added from libraries
6286 and scripts.
6287 (Sized_incremental_binary::check_input_args): New function.
6288 (Sized_incremental_binary::do_check_inputs): Build map of argument
6289 serial numbers to input arguments.
6290 (Sized_incremental_binary::do_file_has_changed): Rename
6291 do_file_is_unchanged to this; compare file modification times.
6292 (Sized_incremental_binary::do_init_layout): New function.
6293 (Sized_incremental_binary::do_reserve_layout): New function.
6294 (Sized_incremental_binary::do_get_input_reader): Remove.
6295 (Sized_incremental_binary::get_symtab_view): New function.
6296 (Incremental_checker::can_incrementally_link_output_file): Remove.
6297 (Incremental_inputs::report_command_line): Exclude --debug options.
6298 (Incremental_inputs::report_archive_begin): Add parameter; track
6299 argument serial numbers; don't put input file entry for archive
6300 before archive members.
6301 (Incremental_inputs::report_archive_end): Put input file entry
6302 for archive after archive members.
6303 (Incremental_inputs::report_object): Add parameter; track argument
6304 serial numbers and in_system_directory flag.
6305 (Incremental_inputs::report_script): Add parameter; track argument
6306 serial numbers.
6307 (Output_section_incremental_inputs::set_final_data_size): Adjust
6308 size of symbol info entry; check for forwarding symbols.
6309 (Output_section_incremental_inputs::write_input_files): Write
6310 in_system_directory flag and argument serial number.
6311 (Output_section_incremental_inputs::write_info_blocks): Map section
6312 indices between incremental info and original input file; store
6313 input section index for each symbol.
6314 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6315 change operator() to visit().
6316 (class Global_got_offset_visitor): Likewise.
6317 (class Global_symbol_visitor_got_plt):
6318 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6319 classes.
6320 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6321 (Sized_incr_relobj::do_read_symbols): New function.
6322 (Sized_incr_relobj::do_layout): New function.
6323 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6324 (Sized_incr_relobj::do_add_symbols): New function.
6325 (Sized_incr_relobj::do_should_include_member): New function.
6326 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6327 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6328 (Sized_incr_relobj::do_section_size): New function.
6329 (Sized_incr_relobj::do_section_name): New function.
6330 (Sized_incr_relobj::do_section_contents): New function.
6331 (Sized_incr_relobj::do_section_flags): New function.
6332 (Sized_incr_relobj::do_section_entsize): New function.
6333 (Sized_incr_relobj::do_section_address): New function.
6334 (Sized_incr_relobj::do_section_type): New function.
6335 (Sized_incr_relobj::do_section_link): New function.
6336 (Sized_incr_relobj::do_section_info): New function.
6337 (Sized_incr_relobj::do_section_addralign): New function.
6338 (Sized_incr_relobj::do_initialize_xindex): New function.
6339 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6340 (Sized_incr_relobj::do_read_relocs): New function.
6341 (Sized_incr_relobj::do_gc_process_relocs): New function.
6342 (Sized_incr_relobj::do_scan_relocs): New function.
6343 (Sized_incr_relobj::do_count_local_symbols): New function.
6344 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6345 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6346 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6347 (Sized_incr_relobj::do_relocate): New function.
6348 (Sized_incr_relobj::do_set_section_offset): New function.
6349 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6350 (Sized_incr_dynobj::do_read_symbols): New function.
6351 (Sized_incr_dynobj::do_layout): New function.
6352 (Sized_incr_dynobj::do_add_symbols): New function.
6353 (Sized_incr_dynobj::do_should_include_member): New function.
6354 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6355 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6356 (Sized_incr_dynobj::do_section_size): New function.
6357 (Sized_incr_dynobj::do_section_name): New function.
6358 (Sized_incr_dynobj::do_section_contents): New function.
6359 (Sized_incr_dynobj::do_section_flags): New function.
6360 (Sized_incr_dynobj::do_section_entsize): New function.
6361 (Sized_incr_dynobj::do_section_address): New function.
6362 (Sized_incr_dynobj::do_section_type): New function.
6363 (Sized_incr_dynobj::do_section_link): New function.
6364 (Sized_incr_dynobj::do_section_info): New function.
6365 (Sized_incr_dynobj::do_section_addralign): New function.
6366 (Sized_incr_dynobj::do_initialize_xindex): New function.
6367 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6368 (make_sized_incremental_object): New function.
6369 (Incremental_library::copy_unused_symbols): New function.
6370 (Incremental_library::do_for_all_unused_symbols): New function.
6371 * incremental.h (enum Incremental_input_flags): New type.
6372 (class Incremental_checker): Remove.
6373 (Incremental_input_entry::Incremental_input_entry): Add argument
6374 serial number.
6375 (Incremental_input_entry::arg_serial): New function.
6376 (Incremental_input_entry::set_is_in_system_directory): New function.
6377 (Incremental_input_entry::is_in_system_directory): New function.
6378 (Incremental_input_entry::arg_serial_): New data member.
6379 (Incremental_input_entry::is_in_system_directory_): New data member.
6380 (class Script_info): Move here from script.h.
6381 (Script_info::Script_info): Add filename parameter.
6382 (Script_info::filename): New function.
6383 (Script_info::filename_): New data member.
6384 (Incremental_script_entry::Incremental_script_entry): Add argument
6385 serial number.
6386 (Incremental_object_entry::Incremental_object_entry): Likewise.
6387 (Incremental_object_entry::add_input_section): Build list of input
6388 sections with map to original shndx.
6389 (Incremental_object_entry::get_input_section_index): New function.
6390 (Incremental_object_entry::shndx_): New data member.
6391 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6392 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6393 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6394 serial number.
6395 (Incremental_inputs::report_archive_begin): Likewise.
6396 (Incremental_inputs::report_object): Likewise.
6397 (Incremental_inputs::report_script): Likewise.
6398 (class Incremental_global_symbol_reader): New class.
6399 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6400 and store flags and input file type.
6401 (Incremental_input_entry_reader::arg_serial): New function.
6402 (Incremental_input_entry_reader::type): Extract type from flags.
6403 (Incremental_input_entry_reader::is_in_system_directory): New function.
6404 (Incremental_input_entry_reader::get_input_section_count): Call
6405 accessor function for type.
6406 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6407 function for type; adjust size of global symbol entry.
6408 (Incremental_input_entry_reader::get_global_symbol_count): Call
6409 accessor function for type.
6410 (Incremental_input_entry_reader::get_object_count): Likewise.
6411 (Incremental_input_entry_reader::get_object_offset): Likewise.
6412 (Incremental_input_entry_reader::get_member_count): Likewise.
6413 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6414 (Incremental_input_entry_reader::get_member_offset): Likewise.
6415 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6416 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6417 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6418 (Incremental_input_entry_reader::get_global_symbol_reader): New
6419 function.
6420 (Incremental_input_entry_reader::get_output_symbol_index): New
6421 function.
6422 (Incremental_input_entry_reader::type_): Remove.
6423 (Incremental_input_entry_reader::flags_): New data member.
6424 (Incremental_inputs_reader::input_file_offset): New function.
6425 (Incremental_inputs_reader::input_file_index): New function.
6426 (Incremental_inputs_reader::input_file): Call input_file_offset.
6427 (Incremental_inputs_reader::input_file_at_offset): New function.
6428 (Incremental_relocs_reader::get_r_type): Reformat.
6429 (Incremental_relocs_reader::get_r_shndx): Reformat.
6430 (Incremental_relocs_reader::get_r_offset): Reformat.
6431 (Incremental_relocs_reader::data): New function.
6432 (Incremental_binary::Incremental_binary): Initialize new data members.
6433 (Incremental_binary::check_inputs): Add cmdline parameter.
6434 (Incremental_binary::file_is_unchanged): Remove.
6435 (Input_reader::arg_serial): New function.
6436 (Input_reader::get_unused_symbol_count): New function.
6437 (Input_reader::get_unused_symbol): New function.
6438 (Input_reader::do_arg_serial): New function.
6439 (Input_reader::do_get_unused_symbol_count): New function.
6440 (Input_reader::do_get_unused_symbol): New function.
6441 (Incremental_binary::input_file_count): New function.
6442 (Incremental_binary::get_input_reader): Change signature to use
6443 index instead of filename.
6444 (Incremental_binary::file_has_changed): New function.
6445 (Incremental_binary::get_input_argument): New function.
6446 (Incremental_binary::get_library): New function.
6447 (Incremental_binary::get_script_info): New function.
6448 (Incremental_binary::init_layout): New function.
6449 (Incremental_binary::reserve_layout): New function.
6450 (Incremental_binary::output_file): New function.
6451 (Incremental_binary::do_check_inputs): New function.
6452 (Incremental_binary::do_file_is_unchanged): Remove.
6453 (Incremental_binary::do_file_has_changed): New function.
6454 (Incremental_binary::do_init_layout): New function.
6455 (Incremental_binary::do_reserve_layout): New function.
6456 (Incremental_binary::do_input_file_count): New function.
6457 (Incremental_binary::do_get_input_reader): Change signature.
6458 (Incremental_binary::input_args_map_): New data member.
6459 (Incremental_binary::library_map_): New data member.
6460 (Incremental_binary::script_map_): New data member.
6461 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6462 new data members.
6463 (Sized_incremental_binary::output_section): New function.
6464 (Sized_incremental_binary::inputs_reader): Add const.
6465 (Sized_incremental_binary::symtab_reader): Add const.
6466 (Sized_incremental_binary::relocs_reader): Add const.
6467 (Sized_incremental_binary::got_plt_reader): Add const.
6468 (Sized_incremental_binary::get_symtab_view): New function.
6469 (Sized_incremental_binary::Inputs_reader): New typedef.
6470 (Sized_incremental_binary::Input_entry_reader): New typedef.
6471 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6472 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6473 (Sized_incremental_binary::do_file_has_changed): New function.
6474 (Sized_incremental_binary::do_init_layout): New function.
6475 (Sized_incremental_binary::do_reserve_layout): New function.
6476 (Sized_input_reader::Inputs_reader): Remove.
6477 (Sized_input_reader::Input_entry_reader): Remove.
6478 (Sized_input_reader::do_arg_serial): New function.
6479 (Sized_input_reader::do_get_unused_symbol_count): New function.
6480 (Sized_input_reader::do_get_unused_symbol): New function.
6481 (Sized_incremental_binary::do_input_file_count): New function.
6482 (Sized_incremental_binary::do_get_input_reader): Change signature;
6483 use index instead of filename.
6484 (Sized_incremental_binary::section_map_): New data member.
6485 (Sized_incremental_binary::input_entry_readers_): New data member.
6486 (class Sized_incr_relobj): New class.
6487 (class Sized_incr_dynobj): New class.
6488 (make_sized_incremental_object): New function.
6489 (class Incremental_library): New class.
6490 * layout.cc (Free_list::num_lists): New static data member.
6491 (Free_list::num_nodes): New static data member.
6492 (Free_list::num_removes): New static data member.
6493 (Free_list::num_remove_visits): New static data member.
6494 (Free_list::num_allocates): New static data member.
6495 (Free_list::num_allocate_visits): New static data member.
6496 (Free_list::init): New function.
6497 (Free_list::remove): New function.
6498 (Free_list::allocate): New function.
6499 (Free_list::dump): New function.
6500 (Free_list::print_stats): New function.
6501 (Layout_task_runner::run): Resize output file for incremental updates.
6502 (Layout::Layout): Initialize new data members.
6503 (Layout::set_incremental_base): New function.
6504 (Layout::init_fixed_output_section): New function.
6505 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6506 incremental updates.
6507 (Layout::create_gold_note): Do not create gold note section for
6508 incremental updates.
6509 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6510 for incremental updates.
6511 (Layout::set_section_offsets): For incremental updates, allocate space
6512 from free list.
6513 (Layout::create_symtab_sections): Layout with offsets relative to
6514 start of section; for incremental updates, allocate space from free
6515 list.
6516 (Layout::create_shdrs): For incremental updates, allocate space from
6517 free list.
6518 (Layout::finish_dynamic_section): For incremental updates, do not
6519 check --as-needed (fixed in subsequent patch).
6520 * layout.h (class Free_list): New class.
6521 (Layout::set_incremental_base): New function.
6522 (Layout::incremental_base): New function.
6523 (Layout::init_fixed_output_section): New function.
6524 (Layout::allocate): New function.
6525 (Layout::incremental_base_): New data member.
6526 (Layout::free_list_): New data member.
6527 * main.cc (main): Print Free_list statistics.
6528 * object.cc (Relobj::finalize_incremental_relocs): Add
6529 clear_counts parameter; clear counts only when clear_counts is set.
6530 (Sized_relobj::Sized_relobj): Initialize new base class.
6531 (Sized_relobj::do_layout): Don't report special sections.
6532 (Sized_relobj::do_for_all_local_got_entries): New function.
6533 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6534 symtab_off to all symbol table offsets.
6535 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6536 * object.h (class Got_offset_list): Move to top of file.
6537 (Object::Object): Allow case where input_file == NULL.
6538 (Object::~Object): Likewise.
6539 (Object::input_file): Assert that input_file != NULL.
6540 (Object::lock): Allow case where input_file == NULL.
6541 (Object::unlock): Likewise.
6542 (Object::is_locked): Likewise.
6543 (Object::token): Likewise.
6544 (Object::release): Likewise.
6545 (Object::is_incremental): New function.
6546 (Object::get_mtime): New function.
6547 (Object::for_all_local_got_entries): New function.
6548 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6549 (Object::set_is_in_system_directory): New function.
6550 (Object::is_in_system_directory): New function.
6551 (Object::do_is_incremental): New function.
6552 (Object::do_get_mtime): New function.
6553 (Object::do_for_all_local_got_entries): New function.
6554 (Object::is_in_system_directory_): New data member.
6555 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6556 (class Sized_relobj_base): New class.
6557 (class Sized_relobj): Derive from Sized_relobj_base.
6558 (class Sized_relobj::Symbols): Redeclare from base class.
6559 (class Sized_relobj::local_got_offset_list): Remove.
6560 (class Sized_relobj::Output_sections): Redeclare from base class.
6561 (class Sized_relobj::do_for_all_local_got_entries): New function.
6562 (class Sized_relobj::write_local_symbols): Add offset parameter.
6563 (class Sized_relobj::local_symbol_offset_): Update comment.
6564 (class Sized_relobj::local_dynsym_offset_): Update comment.
6565 * options.cc (Input_arguments::add_file): Remove const.
6566 * options.h (Input_file_argument::Input_file_argument):
6567 Initialize arg_serial_ (all constructors).
6568 (Input_file_argument::set_arg_serial): New function.
6569 (Input_file_argument::arg_serial): New function.
6570 (Input_file_argument::arg_serial_): New data member.
6571 (Input_arguments::Input_arguments): Initialize file_count_.
6572 (Input_arguments::add_file): Remove const.
6573 (Input_arguments::number_of_input_files): New function.
6574 (Input_arguments::file_count_): New data member.
6575 (Command_line::number_of_input_files): Call
6576 Input_arguments::number_of_input_files.
6577 * output.cc (Output_segment_headers::Output_segment_headers):
6578 Set current size.
6579 (Output_section::Input_section::current_data_size): New function.
6580 (Output_section::Output_section): Initialize new data members.
6581 (Output_section::add_input_section): Don't do merge sections for
6582 an incremental link; allocate space from free list for an
6583 incremental update.
6584 (Output_section::add_output_section_data): Allocate space from
6585 free list for an incremental update.
6586 (Output_section::update_data_size): New function.
6587 (Output_section::set_fixed_layout): New function.
6588 (Output_section::reserve): New function.
6589 (Output_segment::set_section_addresses): Remove const.
6590 (Output_segment::set_section_list_addresses): Remove const; allocate
6591 space from free list for an incremental update.
6592 (Output_segment::set_offset): Adjust size of RELRO segment for an
6593 incremental update.
6594 * output.h (Output_data::current_data_size): Move here from
6595 child classes.
6596 (Output_data::pre_finalize_data_size): New function.
6597 (Output_data::update_data_size): New function.
6598 (Output_section_headers::update_data_size): new function.
6599 (Output_section_data_build::current_data_size): Move to Output_data.
6600 (Output_data_strtab::update_data_size): New function.
6601 (Output_section::current_data_size): Move to Output_data.
6602 (Output_section::set_fixed_layout): New function.
6603 (Output_section::has_fixed_layout): New function.
6604 (Output_section::reserve): New function.
6605 (Output_section::update_data_size): New function.
6606 (Output_section::has_fixed_layout_): New data member.
6607 (Output_section::free_list_): New data member.
6608 (Output_segment::set_section_addresses): Remove const.
6609 (Output_segment::set_section_list_addresses): Remove const.
6610 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6611 New function.
6612 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6613 New function.
6614 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6615 parameter when calling Add_symbols constructor; store argument
6616 serial number for members of a lib group.
6617 (Add_symbols::locks): Allow case where token == NULL.
6618 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6619 (Read_member::~Read_member): New function.
6620 (Read_member::is_runnable): New function.
6621 (Read_member::locks): New function.
6622 (Read_member::run): New function.
6623 (Check_script::~Check_script): New function.
6624 (Check_script::is_runnable): New function.
6625 (Check_script::locks): New function.
6626 (Check_script::run): New function.
6627 (Check_library::~Check_library): New function.
6628 (Check_library::is_runnable): New function.
6629 (Check_library::locks): New function.
6630 (Check_library::run): New function.
6631 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6632 (Add_symbols::library_): New data member.
6633 (class Read_member): New class.
6634 (class Check_script): New class.
6635 (class Check_library): New class.
6636 * reloc.cc (Read_relocs::is_runnable): Allow case where
6637 token == NULL.
6638 (Read_relocs::locks): Likewise.
6639 (Scan_relocs::locks): Likewise.
6640 (Relocate_task::locks): Likewise.
6641 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6642 to clear counters.
6643 (Sized_relobj::incremental_relocs_scan): Fix comment.
6644 (Sized_relobj::do_relocate): Pass output file offset to
6645 write_local_symbols.
6646 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6647 from class declaration.
6648 * script.cc (read_input_script): Allocate Script_info; pass
6649 argument serial number to report_script.
6650 * script.h (class Script_info): Move to incremental.h.
6651 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6652 * symtab.h (Symbol_table::add_from_incrobj): New function.
6653 (Symbol_table::set_file_offset): New function.
6654
b961d0d7
CC
66552011-04-05 Cary Coutant <ccoutant@google.com>
6656
6657 * incremental-dump.cc (dump_incremental_inputs): Change signature
6658 to take a Sized_incremental_binary; change caller. Use readers
6659 in Sized_incremental_binary.
6660 * incremental.cc
6661 (Sized_incremental_binary::find_incremental_inputs_sections):
6662 Rename do_find_incremental_inputs_sections to this.
6663 (Sized_incremental_binary::setup_readers): New function.
6664 (Sized_incremental_binary::do_check_inputs): Check
6665 has_incremental_info_ flag; move setup code to setup_readers;
6666 use input readers.
6667 (Sized_incremental_binary::do_file_is_unchanged): New function.
6668 (Sized_incremental_binary::do_get_input_reader): New function.
6669 * incremental.h (class Incremental_binary): Move to end of file.
6670 (Incremental_binary::file_is_unchanged): New function.
6671 (Incremental_binary::do_file_is_unchanged): New function.
6672 (Incremental_binary::Input_reader): New class.
6673 (Incremental_binary::get_input_reader): New function.
6674 (class Sized_incremental_binary): Move to end of file.
6675 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6676 input section reader classes.
6677 (Sized_incremental_binary::has_incremental_info): New function.
6678 (Sized_incremental_binary::inputs_reader): New function.
6679 (Sized_incremental_binary::symtab_reader): New function.
6680 (Sized_incremental_binary::relocs_reader): New function.
6681 (Sized_incremental_binary::got_plt_reader): New function.
6682 (Sized_incremental_binary::do_file_is_unchanged): New function.
6683 (Sized_incremental_binary::Sized_input_reader): New class.
6684 (Sized_incremental_binary::get_input_reader): New function.
6685 (Sized_incremental_binary::find_incremental_inputs_sections):
6686 Rename do_find_incremental_inputs_sections to this.
6687 (Sized_incremental_binary::setup_readers): New function.
6688 (Sized_incremental_binary::has_incremental_info_): New data member.
6689 (Sized_incremental_binary::inputs_reader_): New data member.
6690 (Sized_incremental_binary::symtab_reader_): New data member.
6691 (Sized_incremental_binary::relocs_reader_): New data member.
6692 (Sized_incremental_binary::got_plt_reader_): New data member.
6693 (Sized_incremental_binary::current_input_file_): New data member.
6694
a869183f
PP
66952011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6696
6697 PR gold/12640
6698 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6699 violation.
6700
67012011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
6702
6703 * archive.cc (Archive::include_member): Adjust call to report_object.
6704 (Add_archive_symbols::run): Add script_info to call to
6705 report_archive_begin.
6706 (Lib_group::include_member): Adjust call to report_object.
6707 (Add_lib_group_symbols::run): Adjust call to report_object.
6708 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6709 blocks. Add object count for script input files.
6710 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6711 script_info parameter; change all callers.
6712 (Incremental_inputs::report_object): Add script_info parameter;
6713 change all callers.
6714 (Incremental_inputs::report_script): Store backpointer to
6715 incremental info entry.
6716 (Output_section_incremental_inputs::set_final_data_size): Record
6717 additional information for scripts.
6718 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6719 * incremental.h (Incremental_script_entry::add_object): New function.
6720 (Incremental_script_entry::get_object_count): New function.
6721 (Incremental_script_entry::get_object): New function.
6722 (Incremental_script_entry::objects_): New data member; adjust
6723 constructor.
6724 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6725 (Incremental_inputs::report_object): Add script_info parameter.
6726 (Incremental_inputs_reader::get_object_count): New function.
6727 (Incremental_inputs_reader::get_object_offset): New function.
6728 * options.cc (Input_arguments::add_file): Return reference to
6729 new input argument.
6730 * options.h (Input_argument::set_script_info): New function.
6731 (Input_argument::script_info): New function.
6732 (Input_argument::script_info_): New data member; adjust all
6733 constructors.
6734 (Input_file_group::add_file): Return reference to new input argument.
6735 (Input_file_lib::add_file): Likewise.
6736 (Input_arguments::add_file): Likewise.
6737 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6738 * script.cc (Parser_closure::Parser_closure): Add script_info
6739 parameter; adjust all callers.
6740 (Parser_closure::script_info): New function.
6741 (Parser_closure::script_info_): New data member.
6742 (read_input_script): Report scripts earlier to incremental info.
6743 (script_add_file): Set script_info in Input_argument.
6744 (script_add_library): Likewise.
6745 * script.h (Script_options::Script_info): Rewrite class.
6746
a869183f 67472011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
6748
6749 * archive.cc (Library_base::should_include_member): Move
6750 method here from class Archive.
6751 (Archive::Archive): Initialize base class.
6752 (Archive::should_include_member): Move to base class.
6753 (Archive::do_for_all_unused_symbols): New function.
6754 (Add_archive_symbols::run): Remove redundant access to
6755 incremental_inputs.
6756 (Lib_group::Lib_group): Initialize base class.
6757 (Lib_group::do_filename): New function.
6758 (Lib_group::include_member): Pass pointer to Lib_group to
6759 report_object.
6760 (Lib_group::do_for_all_unused_symbols): New function.
6761 (Add_lib_group_symbols::run): Report archive information for
6762 incremental links.
6763 * archive.h (class Library_base): New base class.
6764 (class Archive): Derive from Library_base.
6765 (Archive::filename): Move to base class.
6766 (Archive::set_incremental_info): Likewise.
6767 (Archive::incremental_info): Likewise.
6768 (Archive::Should_include): Likewise.
6769 (Archive::should_include_member): Likewise.
6770 (Archive::Armap_entry): Remove.
6771 (Archive::Unused_symbol_iterator): Remove.
6772 (Archive::unused_symbols_begin): Remove.
6773 (Archive::unused_symbols_end): Remove.
6774 (Archive::do_filename): New function.
6775 (Archive::do_get_mtime): New function.
6776 (Archive::do_for_all_unused_symbols): New function.
6777 (Archive::task_): Move to base class.
6778 (Archive::incremental_info_): Likewise.
6779 (class Lib_group): Derive from Library_base.
6780 (Lib_group::do_filename): New function.
6781 (Lib_group::do_get_mtime): New function.
6782 (Lib_group::do_for_all_unused_symbols): New function.
6783 (Lib_group::task_): Move to base class.
6784 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6785 function.
6786 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6787 function.
6788 * incremental.cc (Incremental_inputs::report_archive_begin):
6789 Use Library_base; call library's get_mtime; add incremental inputs
6790 entry before members.
6791 (class Unused_symbol_visitor): New class.
6792 (Incremental_inputs::report_archive_end): Use Library_base; use
6793 visitor class to record unused symbols; don't add incremental inputs
6794 entry after members.
6795 (Incremental_inputs::report_object): Use Library_base.
6796 * incremental.h
6797 (Incremental_archive_entry::Incremental_archive_entry): Remove
6798 unused Archive parameter.
6799 (Incremental_inputs::report_archive_begin): Use Library_base.
6800 (Incremental_inputs::report_archive_end): Likewise.
6801 (Incremental_inputs::report_object): Likewise.
6802 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6803 function.
6804 * object.h (Object::for_all_global_symbols): New function.
6805 (Object::do_for_all_global_symbols): New function.
6806 (Sized_relobj::do_for_all_global_symbols): New function.
6807 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6808 function.
6809 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6810 function.
6811
61ab3e40
ILT
68122011-03-27 Ian Lance Taylor <iant@google.com>
6813
6814 * archive.cc (Archive::interpret_header): Return -1 if something
6815 goes wrong. Change callers accordingly.
6816
30e1f9e6
CC
68172011-03-25 Cary Coutant <ccoutant@google.com>
6818
6819 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6820 * testsuite/Makefile.in: Regenerate.
6821
9370ce59 68222011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
6823
6824 * plugin.cc (get_view): New.
6825 (Plugin::load): Pass get_view to the plugin.
6826 (Plugin_manager::get_view): New.
6827
9312bb0a
ILT
68282011-03-21 Ian Lance Taylor <iant@google.com>
6829
6830 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 6831 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 6832
7e12ba9e
ST
68332011-03-21 Sriraman Tallam <tmsriram@google.com>
6834
6835 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6836 Change == to -eq.
6837 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6838 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6839 Change == to -eq.
6840 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6841 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6842
fd7a005d
ILT
68432011-03-14 Ian Lance Taylor <iant@google.com>
6844
6845 * script-sections.cc (Sort_output_sections::script_compare):
6846 Rename from is_before, change return type.
6847 (Sort_output_sections::operator()): Adjust accordingly.
6848
ed16fd1b
ILT
68492011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6850
6851 PR gold/12572
6852 * testsuite/odr_violation2.cc: Add comment to make all error line
6853 numbers double digits.
6854 * testsuite/debug_msg.sh: Adjust expected errors.
6855
71ff8986
ILT
68562011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6857
6858 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6859 but mark earlier ones as non-canonical
6860 (offset_to_iterator): Update search target and example
6861 (do_addr2line): Return extra lines in a vector*
6862 (format_file_lineno): Extract from do_addr2line
6863 (one_addr2line): Add vector* out-param
6864 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6865 when a lineno entry appeared last for its instruction
6866 (Dwarf_line_info): Add vector* out-param
6867 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6868 * symtab.cc (Odr_violation_compare): Include the lineno in the
6869 comparison again.
6870 (linenos_from_loc): New. Combine the canonical line for an
6871 address with its other lines.
6872 (True_if_intersect): New. Helper functor to make
6873 std::set_intersection a query.
6874 (detect_odr_violations): Compare sets of lines instead of just
6875 one line for each function. This became less deterministic, but
6876 has fewer false positives.
6877 * symtab.h: Declarations.
6878 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6879 mix an optimized and non-optimized object in the same binary
6880 (odr_violation2.so): Same.
6881 * testsuite/Makefile.in: Regenerate from Makefile.am.
6882 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6883 * testsuite/debug_msg.sh: Update line numbers and add
6884 assertions.
6885 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6886 non-optimized context.
6887 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6888 isn't inlined, and use OdrDerived in an optimized context.
6889 * testsuite/odr_header1.h: Defines OdrDerived, where
6890 optimization will change the
6891 first-instruction-in-the-destructor's file and line number.
6892 * testsuite/odr_header2.h: Defines OdrBase.
6893
a19fefdc
ILT
68942011-03-09 Ian Lance Taylor <iant@google.com>
6895
6896 * fileread.cc (File_read::clear_views): Don't delete the whole
6897 file view.
6898
ecb351e9
ILT
68992011-03-08 Ian Lance Taylor <iant@google.com>
6900
6901 PR gold/12525
6902 * fileread.cc: #include <climits>.
6903 (GOLD_IOV_MAX): Define.
6904 (File_read::read_multiple): Limit number of entries by iov_max.
6905 * fileread.h (class File_read): Always set max_readv_entries to
6906 128.
6907
b821d13c
ILT
69082011-03-07 Ian Lance Taylor <iant@google.com>
6909
6910 PR gold/12525
6911 * options.h (class General_options): Add -dy and -dn.
6912
89243142
CC
69132011-03-02 Cary Coutant <ccoutant@google.com>
6914
6915 * testsuite/script_test_9.t: Add TLS segment.
6916
d0773f31
ILT
69172011-03-02 Simon Baldwin <simonb@google.com>
6918
6919 * configure.ac: Add check for gnu_indirect_function support in
6920 the toolchain building binutils.
6921 * configure: Rebuild.
6922
9370ce59 69232011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
6924
6925 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6926 plugin only symbols.
6927 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6928 in plugin files as not needed in the symbol table.
6929
4cf7a849
ST
69302011-02-11 Sriraman Tallam <tmsriram@google.com>
6931
6932 * output.cc (Output_section::add_input_section): Delay fill
6933 generation for section ordering.
6934
b578bd7d
ILT
69352011-02-09 Ian Lance Taylor <iant@google.com>
6936
6937 PR gold/12316
6938 * object.h (class Sized_relobj): Remove clear_local_symbols.
6939 * reloc.cc (Sized_relobj::do_relocate): Don't call
6940 clear_local_symbols.
6941
9370ce59 69422011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
6943
6944 * plugin.cc (is_visible_from_outside): Return true for symbols
6945 in the -u option.
6946
55382fb7
ILT
69472011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6948
6949 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6950 filename.
6951
4e271fff
ST
69522011-02-02 Sriraman Tallam <tmsriram@google.com>
6953
6954 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 6955 to std::string.
4e271fff 6956 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 6957 section_name to be std::string.
4e271fff
ST
6958 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6959
d433c3ac
ILT
69602011-01-25 Ian Lance Taylor <iant@google.com>
6961
6962 * script.cc (script_add_extern): Rewrite to use
6963 add_symbol_reference.
6964
880473a6
DK
69652011-01-25 Doug Kwan <dougkwan@google.com>
6966
d433c3ac 6967 * icf.cc (get_section_contents): Always lock section's object.
880473a6 6968
f30f86fa
ILT
69692011-01-24 Ian Lance Taylor <iant@google.com>
6970
6971 * options.h (class General_options): Accept
6972 --no-detect-odr-violations.
6973
8e51a0b9
ILT
69742011-01-24 Ian Lance Taylor <iant@google.com>
6975
6976 * version.cc (version_string): Bump to 1.11.
6977
0f3b89d8
ILT
69782011-01-24 Ian Lance Taylor <iant@google.com>
6979
6980 * plugin.cc (class Plugin_rescan): Define new class.
6981 (Plugin_manager::claim_file): Set any_claimed_.
6982 (Plugin_manager::save_archive): New function.
6983 (Plugin_manager::save_input_group): New function.
6984 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6985 necessary.
6986 (Plugin_manager::new_undefined_symbol): New function.
6987 (Plugin_manager::rescan): New function.
6988 (Plugin_manager::rescannable_defines): New function.
6989 (Plugin_manager::add_input_file): Set any_added_.
6990 * plugin.h (class Plugin_manager): define new fields rescannable_,
6991 undefined_symbols_, any_claimed_, and any_added_. Declare
6992 Plugin_rescan as friend. Declare new functions.
6993 (Plugin_manager::Rescannable): Define type.
6994 (Plugin_manager::Rescannable_list): Define type.
6995 (Plugin_manager::Undefined_symbol_list): Define type.
6996 (Plugin_manager::Plugin_manager): Initialize new fields.
6997 * archive.cc (Archive::defines_symbol): New function.
6998 (Add_archive_symbols::run): Pass archive to plugins if any.
6999 * archive.h (class Archive): Declare defines_symbol.
7000 * readsyms.cc (Input_group::~Input_group): New function.
7001 (Finish_group::run): Pass input_group to plugins if any.
7002 * readsyms.h (class Input_group): Declare destructor.
7003 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7004 any.
7005
3bb951e5
ILT
70062011-01-10 Ian Lance Taylor <iant@google.com>
7007
7008 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7009 section as relro.
7010 (Layout::set_segment_offsets): Reset increase_relro before calling
7011 set_section_addresses a second time.
7012
0aa45fac
CC
70132011-01-04 Cary Coutant <ccoutant@google.com>
7014
7015 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7016 sections before NOBITS sections.
7017
0db46eb4
L
70182011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7019
7020 * version.cc (print_version): Update copyright to 2011.
7021
829c9745
CC
70222010-12-23 Cary Coutant <ccoutant@google.com>
7023
7024 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7025 of OS to this->add. Add OD parameter to second form of the function.
7026
7500420b
ILT
70272010-12-20 Ian Lance Taylor <iant@google.com>
7028
7029 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7030 second of two consecutive entries with same offset.
7031
f8e9a930
RW
70322010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7033
7034 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7035 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7036 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7037 to avoid unneeded links against $(LDADD).
7038 * testsuite/Makefile.in: Regenerate.
7039
2fbb4320
ILT
70402010-12-15 Ian Lance Taylor <iant@google.com>
7041
7042 PR gold/12324
7043 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
7044 for R_X86_64_32 and R_X86_64_PC32.
7045 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7046 ver_matching_def_pic.o.
7047 (ver_matching_def_pic.o): New target.
7048
fedb228d
RW
70492010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7050
7051 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7052 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7053 Move definition before File_read::View member definitions.
7054 (File_read::View::~View): Initialize and hold lock before
7055 updating current_mapped_bytes.
7056
9b547ce6
RW
70572010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7058
7059 * dwarf_reader.cc: Remove outdated comment.
7060 * gold-threads.cc: Fix typo in error message.
7061 * archive.cc: Fix typos in comments.
7062 * archive.h: Likewise.
7063 * arm-reloc-property.cc: Likewise.
7064 * arm-reloc-property.h: Likewise.
7065 * arm-reloc.def: Likewise.
7066 * arm.cc: Likewise.
7067 * attributes.h: Likewise.
7068 * cref.cc: Likewise.
7069 * ehframe.cc: Likewise.
7070 * fileread.h: Likewise.
7071 * gold.h: Likewise.
7072 * i386.cc: Likewise.
7073 * icf.cc: Likewise.
7074 * incremental.h: Likewise.
7075 * int_encoding.cc: Likewise.
7076 * layout.h: Likewise.
7077 * main.cc: Likewise.
7078 * merge.h: Likewise.
7079 * object.cc: Likewise.
7080 * object.h: Likewise.
7081 * options.cc: Likewise.
7082 * readsyms.cc: Likewise.
7083 * reduced_debug_output.cc: Likewise.
7084 * reloc.cc: Likewise.
7085 * script-sections.cc: Likewise.
7086 * sparc.cc: Likewise.
7087 * symtab.h: Likewise.
7088 * target-reloc.h: Likewise.
7089 * target.cc: Likewise.
7090 * target.h: Likewise.
7091 * timer.cc: Likewise.
7092 * timer.h: Likewise.
7093 * x86_64.cc: Likewise.
7094
83e17bd5
CC
70952010-12-09 Cary Coutant <ccoutant@google.com>
7096
7097 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
7098 stack.
7099 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
7100 parameter; change all callers.
7101 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
7102 * options.h (warn_execstack): New option.
7103
017257f8
DK
71042010-12-07 Doug Kwan <dougkwan@google.com>
7105
7106 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
7107 like function call relocations.
7108
c20cbc06
ILT
71092010-12-07 Ian Lance Taylor <iant@google.com>
7110
7111 * archive.cc (Archive::get_elf_object_for_member): Permit
7112 punconfigured to be NULL.
7113 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7114 (Archive::include_member): Pass NULL to get_elf_object_for_member
7115 if we searched for the archive and this is the first included
7116 object.
7117
4dbfafcc
ILT
71182010-12-01 Ian Lance Taylor <iant@google.com>
7119
7120 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7121 track_relocs_type_ field.
7122 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7123 Set track_relocs_type_.
7124 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7125 contents when using RELA relocs.
7126 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7127 reloc_map_.
7128 * reloc.cc (Track_relocs::next_addend): New function.
7129 * reloc.h (class Track_relocs): Declare next_addend.
7130
e5e19edd
ILT
71312010-12-01 Ian Lance Taylor <iant@google.com>
7132
7133 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7134 virtual destructor.
7135
9a5ce24c
ILT
71362010-12-01 Ian Lance Taylor <iant@google.com>
7137
7138 * README: Update compilers known to work and fail.
7139
c7791212
NC
71402010-11-23 Matthias Klose <doko@ubuntu.com>
7141
7142 * configure.in: For --enable-gold, handle value `default' instead of
7143 `both*'. Always install ld as ld.bfd, install as ld if gold is
7144 not the default.
7145 * configure: Regenerate.
7146
0ad220c9
DK
71472010-11-18 Doug Kwan <dougkwan@google.com>
7148
7149 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7150 and right_alignment to be zero. Store result alignment only if it is
7151 greater than existing alignment.
7152
ab8056e0
CC
71532010-11-16 Cary Coutant <ccoutant@google.com>
7154
7155 PR gold/12220
7156 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7157 Check for ".zdebug_line".
7158
fd064a5b
CC
71592010-11-16 Doug Kwan <dougkwan@google.com>
7160 Cary Coutant <ccoutant@google.com>
7161
7162 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7163 by reference; adjust all callers.
7164 * output.cc (Output_segment::set_section_addresses): Adjust references
7165 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7166 list is empty.
7167 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7168 end at page boundary.
7169
6fc6ea19
CC
71702010-11-16 Cary Coutant <ccoutant@google.com>
7171
7172 PR gold/12220
7173 * layout.cc (Layout::choose_output_section): Transform names of
7174 compressed sections even when using a script with a SECTIONS clause.
7175 (Layout::output_section_name): Remove code to transform
7176 compressed debug section names.
7177 * output.cc (Output_section::add_input_section): Use uncompressed
7178 section size when tracking input sections.
7179
95a2c8d6
RS
71802010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7181
7182 * symtab.h (Symbol::NON_PIC_REF): Remove.
7183 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7184 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7185 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7186 (Symbol::use_plt_offset): Take a flags argument and pass it
7187 directly to needs_dynamic_reloc. Restrict check for undefined
7188 weak symbols to function calls.
7189 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7190 (Target_arm::Scan::global): Use it.
7191 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7192 (Target_arm::Relocate::relocate): Likewise.
7193 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7194 parameter with an r_type parameter. Use get_reference_flags
7195 to get the flags.
7196 (Target_arm::Relocate::relocate): Update accordingly.
7197 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7198 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7199 (Target_i386::Scan::global): Likewise.
7200 (Target_i386::Relocate::relocate): Likewise.
7201 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7202 parameter with an r_type parameter. Use get_reference_flags
7203 to get the flags.
7204 (Target_i386::Relocate::relocate): Update accordingly.
7205 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7206 (Target_powerpc::Scan::global): Use it.
7207 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7208 (Target_powerpc::Relocate::relocate): Likewise.
7209 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7210 (Target_sparc::Scan::global): Use it.
7211 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7212 (Target_sparc::Relocate::relocate): Likewise.
7213 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7214 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7215 (Target_x86_64::Scan::global): Likewise.
7216 (Target_x86_64::Relocate::relocate): Likewise.
7217
f625ae50
DK
72182010-11-08 Doug Kwan <dougkwan@google.com>
7219 Cary Coutant <ccoutant@google.com>
7220
7221 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7222 (Arm_exidx_merge_section::section_contents_): New data member.
7223 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7224 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 7225 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
7226 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7227 in parameters instead of calling Object::section_contents without
7228 locking.
7229 (Arm_output_section::group_section): New parameter TASK. Pass it
7230 to callees that need locking objects.
7231 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7232 to lock EXIDX input sections. Fix a formatting issue. Call
7233 Arm_exidx_merged_section::build_contents to create merged section
7234 contents.
7235 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7236 to lock object of stub table owner.
7237 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7238 TEXT_SIZE to initialize data member TEXT_SIZE_.
7239 (Arm_exidx_input_section::addralign): Fix typo in comment.
7240 (Arm_exidx_input_section::text_size): New method.
7241 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7242 that require locking objects. Lock objects before scanning for stubs
7243 and updating local symbols.
7244 (Arm_input_section<big_endian>::init): Copy contents of original
7245 input section.
2e702c99 7246 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
7247 original input section instead of calling Object::section_contents
7248 without locking.
7249 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7250 size without calling Object::section_size().
7251 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7252 for size. Allocate a buffer for merged EXIDX entries.
7253 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7254 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7255 building code to Arm_exidx_merged_section::build_contetns. Write
7256 out contetns in buffer instead of building it on the fly.
7257 (Arm_relobj::make_exidx_input_section): Also pass text section size
7258 to Arm_exidx_input_section constructor.
7259 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7260 (Arm_dynobj::do_read_symbols): Fix memory leak.
7261 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7262 * target.h: (class Task): Add forward declaration.
7263 (Target::relax): Add new parameter TASK and pass it to
7264 Target::do_relax().
7265 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7266
5f9bcf58
CC
72672010-11-05 Cary Coutant <ccoutant@google.com>
7268
7269 PR gold/10708
7270 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7271 object when reading from the file.
7272 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7273 second layout pass.
7274 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7275 when reading section contents.
7276 (get_section_contents): Likewise.
7277 (icf::find_identical_sections): Likewise.
7278 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7279 object when reading from the file.
7280 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7281 the object when doing deferred section layout.
7282
e597fa08
NC
72832010-11-03 Nick Clifton <nickc@redhat.com>
7284
7285 PR gold/12001
7286 * script.h (class Symbol_assignment: name): New member. Returns
7287 the name of the symbol.
7288 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7289 Returns true if the given symbol name is on the list of
7290 assignments wating to be processed.
7291 * archive.cc (should_incldue_member): If the symbol is undefined,
7292 check to see if it is on the list of symbols pending assignment.
7293
3f9a3278
ILT
72942010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7295
7296 * script-sections.cc (Script_sections::find_memory_region): Check
7297 for a NULL output section pointer.
7298
d06fb4d1
DK
72992010-10-29 Doug Kwan <dougkwan@google.com>
7300
7301 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7302 Output_section::add_relaxed_input_section.
7303 * output.cc (Output_section::add_relaxed_input_section): Add new
7304 arguments LAYOUT and NAME. Set section order index.
7305 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7306 Copy section order index.
7307 * output.h (Output_section::add_relaxed_input_section): Add new
7308 arguments LAYOUT and NAME.
7309
90e24de5
ILT
73102010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7311
7312 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7313 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7314 * testsuite/Makefile.in: Regenerate.
7315
c9484ea5
DK
73162010-10-20 Doug Kwan <dougkwan@google.com>
7317
7318 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7319 without SHF_LINK_ORDER flags.
7320 * layout.cc (Layout::choose_output_section): Do not filter
7321 SHF_LINK_ORDER flag in a relocatable link.
7322
5bc2f5be
CC
73232010-10-17 Cary Coutant <ccoutant@google.com>
7324
7325 * output.h (Output_segment::set_section_addresses): Change function
7326 signature. Update all callers.
7327 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7328 sections.
7329 (Output_segment::set_section_addresses): Align after last TLS
7330 section. Add padding before last relro section instead of after.
7331
0c91cf04
DK
73322010-10-17 Doug Kwan <dougkwan@google.com>
7333
7334 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7335 GOT output section to be writable.
7336
8c21d9d3
CC
73372010-10-14 Cary Coutant <ccoutant@google.com>
7338
7339 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7340 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7341 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7342 mode.
7343 * incremental.cc (report_command_line): Ignore all forms of
7344 --incremental.
7345 * layout.cc (Layout::Layout): Check parameters for incremental link
7346 mode.
7347 * options.cc (General_options::parse_incremental): New function.
7348 (General_options::parse_no_incremental): New function.
7349 (General_options::parse_incremental_full): New function.
7350 (General_options::parse_incremental_update): New function.
7351 (General_options::incremental_mode_): New data member.
7352 (General_options::finalize): Check incremental_mode_.
7353 * options.h (General_options): Update help text for --incremental.
7354 Add --no-incremental, --incremental-full, --incremental-update.
7355 (General_options::Incremental_mode): New enum type.
7356 (General_options::incremental_mode): New function.
7357 (General_options::incremental_mode_): New data member.
7358 * parameters.cc (Parameters::incremental_mode_): New data member.
7359 (Parameters::set_options): Set incremental_mode_.
7360 (Parameters::set_incremental_full): New function.
7361 (Parameters::incremental): New function.
7362 (Parameters::incremental_update): New function.
7363 (set_parameters_incremental_full): New function.
7364 * parameters.h (Parameters::set_incremental_full): New function.
7365 (Parameters::incremental): New function.
7366 (Parameters::incremental_update): New function.
7367 (Parameters::incremental_mode_): New data member.
7368 (set_parameters_incremental_full): New function.
7369 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7370 incremental link mode.
7371 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7372 (Sized_relobj::do_relocate_sections): Likewise.
7373 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7374 option.
7375 * testsuite/Makefile.in: Regenerate.
7376 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7377
bb32aa18 73782010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7379
7380 * script-sections.h (class Script_sections): Make
7381 Sections_elements typedef public.
7382 * script-sections.cc (class Sort_output_sections): Add elements_
7383 field. Add constructor which sets it; change all callers.
7384 (Sort_output_sections::is_before): New function.
7385 (Sort_output_sections::operator()): Call is_before.
7386 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7387 conditional.
7388 * testsuite/script_test_10.sh: New test. Test script section
7389 order.
7390 * testsuite/script_test_10.t: Likewise.
7391 * testsuite/script_test_10.s: Likewise.
7392 * testsuite/Makefile.am: Wrap the cross linker tests and the
7393 common tests into NATIVE_OR_CROSS_LINKER.
7394 (check_SCRIPTS): Add script_test_10.sh.
7395 (check_DATA): Add script_test_10.stdout.
7396 (script_test_10.o, script_test_10): New targets.
7397 (script_test_10.stdout): New target.
7398 * configure, testsuite/Makefile.in: Regenerate.
7399
3cef7179
ILT
74002010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7401
7402 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7403 error for the deprecated relocations.
7404 (Target_arm::Scan::global): Likewise.
7405 (Target_arm::Relocate::relocate): Likewise.
7406
7411e9a8
RS
74072010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7408
7409 * fileread.cc (Input_file::find_file): Initialize *found_name
7410 and *namep when using the fallback search for case 4.
7411
6a9da32a
CC
74122010-10-11 Cary Coutant <ccoutant@google.com>
7413
7414 * options.h (class General_options): Redefine -z lazy as an alias for
7415 the negation of -z now.
7416
ac897c20
ILT
74172010-10-11 Ian Lance Taylor <iant@google.com>
7418
7419 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7420 binding.
7421
ea5cae92
NC
74222010-10-06 Nick Clifton <nickc@redhat.com>
7423
7424 * script-sections.cc(class Memory_region): Remove
7425 current_lma_offset_ field. Rename current_vma_offset_ to
7426 current_offset_. Add last_section_ field.
7427 (Memory_region::get_current_vma_address): Rename to
7428 get_current_address.
7429 (Memory_region::get_current_lma_address): Delete.
7430 (Memory_region::increment_vma_offset): Rename to
7431 increment_offset.
7432 (Memory_region::increment_lma_offset): Delete.
7433 (Memory_region::attributes_compatible): New method. Returns
7434 true if the provided section is compatible with the region.
7435 (Memory_region::get_last_section): New method. Returns the last
7436 section to use the region.
7437 (Memory_region::set_last_section): New method. Stores the last
7438 section to use the region.
7439 (Script_sections::block_in_region): New method. Returns true if
7440 a block of memory is contained within a region.
7441 (Script_sections::find_memory_region): New method. Locates a
7442 memory region to be used to set a VMA or LMA address.
7443 (Output_section_definition::set_section_addresses): Add code to
7444 check for addresses set by memory regions.
7445 (Output_segment::set_section_addresses): Remove memory region
7446 walking code.
7447 (Script_sections::create_segment): Add a warning if a header
7448 segment is created outside of any region.
7449 * script-sections.h (class Script_sections): Add prototypes for
7450 find_memory_region and block_in_region methods.
7451 * testsuite/memory_test.s: Use .long instead of .word.
7452 * testsuite/memory_test.t: Add some more output sections.
7453 * testsuite/memory_test.sh: Update expected output.
7454
a9bfd952
DK
74552010-10-02 Doug Kwan <dougkwan@google.com>
7456
7457 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7458 defintion to symtab.h
7459 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7460 declaration to defintion.
7461
bacff3ab
NC
74622010-10-01 Nick Clifton <nickc@redhat.com>
7463
7464 * expression.cc (eval): Replace dummy argument with NULL.
7465 (eval_maybe_dot): Check for a NULL result section pointer.
7466 (Symbol_expression::value): Likewise.
7467 (Dot_expression::value): Likewise.
7468 (BINARY_EXPRESSION): Likewise.
7469 (Max_expression::value): Likewise.
7470 (Min_expression::value): Likewise.
7471 (Absolute_expression::value): Likewise.
7472 (Addr_expression::value_from_output_section): Likewise.
7473 (Loaddddr_expression::value_from_output_section): Likewise.
7474 (Segment_start_expression::value): Likewise.
7475 * script-sections.cc
7476 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7477 argument with NULL.
7478 (Sections_elememt_dot_assignment::set_section_addresses):
7479 Likewise.
7480 (Output_data_expression::do_write_to_buffer): Likewise.
7481 (Output_section_definition::finalize_symbols): Likewise.
7482 (Output_section_definition::set_section_addresses): Likewise.
7483
f81bc8b5
DK
74842010-09-30 Doug Kwan <dougkwan@google.com>
7485
7486 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7487
c95e9f27
ST
74882010-09-28 Sriraman Tallam <tmsriram@google.com>
7489
7490 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 7491 function.
c95e9f27
ST
7492 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7493 virtual function.
7494 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7495 virtual function.
7496 * icf.cc (get_section_contents): Inline merge sections only when
7497 target allows it.
7498
3cac54d2
RW
74992010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7500
7501 * configure: Regenerate.
7502
2904037a
ILT
75032010-09-17 Ian Lance Taylor <iant@google.com>
7504
7505 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7506 * testsuite/Makefile.am (memory_test.o): New target.
7507 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7508 memory_test.t.
7509 * testsuite/Makefile.in: Rebuild.
2904037a 7510
bca7fb63
DK
75112010-09-17 Doug Kwan <dougkwan@google.com>
7512
7513 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7514 defintion if relocation uses GOT entries of the symbol.
7515 * testsuite/icf_safe_test.sh: Fix test.
7516 * testsuite/icf_safe_so_test.sh: Fix test.
7517
4ef28648
CC
75182010-09-16 Cary Coutant <ccoutant@google.com>
7519
7520 * script_sections.cc (class Memory_region): Remove "NULL" from
7521 vector initializations.
7522
793990de
CC
75232010-09-15 Cary Coutant <ccoutant@google.com>
7524
7525 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7526 Resolve forwarding symbols.
7527
81e015e2
DK
75282010-09-15 Doug Kwan <dougkwan@google.com>
7529
7530 * gold/testsuite/script_test_3.t: Add ARM special sections.
7531 * gold/testsuite/script_test_4.t: Same.
7532 * gold/testsuite/script_test_5.t: Same.
7533 * gold/testsuite/script_test_6.t: Same.
7534 * gold/testsuite/script_test_7.t: Same.
7535 * gold/testsuite/script_test_7.t: Same.
7536 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7537
36171d64
CC
75382010-09-14 Cary Coutant <ccoutant@google.com>
7539
7540 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7541 (Target_x86_64::Relocate::relocate_tls): Replace check for
7542 saw_tls_block_reloc_ with test for executable section.
7543
d89051bd
CC
75442010-09-12 Cary Coutant <ccoutant@google.com>
7545
7546 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7547 position-independent executables to shared libraries need dynamic
7548 relocations.
7549 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7550 position-independent executables.
7551 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7552 * testsuite/Makefile.in: Regenerate.
7553
fca41f0f
NC
75542010-09-10 Nick Clifton <nickc@redhat.com>
7555
7556 PR gold/11997
7557 * testsuite/memory_test.t: Discard any sections that are not
7558 needed.
7559
6695e4b3
L
75602010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7561
7562 PR gold/11996
7563 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7564 "This::" to work around a bug in gcc 4.2.
7565
7566 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7567
0f72bf6f
RÁE
75682010-09-09 Rafael Espindola <espindola@google.com>
7569
7570 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7571 sections with different PF_X flags in the same segment.
7572 (Layout::find_first_load_seg): Search all segments to find the first
7573 one.
7574 * options.h (rosegment): New.
7575
75762010-09-08 Rafael Espindola <espindola@google.com>
a6577478 7577
05a79166 7578 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 7579
aa98ff75
DK
75802010-09-08 Doug Kwan <dougkwan@google.com>
7581
7582 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7583 (Arm_relobj::do_relocate_sections): Add new parameter for output
7584 file to match the parent.
7585 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7586 of local symbols instead of input values. Update code to track
7587 changes in gold::relocate_section.
7588 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7589 (Sized_relobj::compute_final_local_value_internal): New methods.
7590 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7591 body into private version of Sized_relobj::compute_final_local_value.
7592 Call the inline method.
7593 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7594 merged symbol value if there is one.
7595 (Symbol_value::has_output_value): New method defintiion.
7596 (Sized_relobj::Compute_final_local_value_status): New enum type.
7597 (Sized_relobj::compute_final_local_value): New methods.
7598 (Sized_relobj::compute_final_local_value_internal): New methods.
7599 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7600 and arm_cortex_a8.sh.
7601 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7602 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7603 New tests.
7604 * Makefile.in: Regenerate.
7605 * testsuite/arm_bl_out_of_range.s: Update test.
7606 * testsuite/thumb_bl_out_of_range.s: Ditto.
7607 * testsuite/thumb_blx_out_of_range.s: Ditto.
7608 * testsuite/arm_branch_out_of_range.sh: New file.
7609 * testsuite/arm_cortex_a8.sh: Ditto.
7610 * testsuite/arm_cortex_a8_b.s: Ditto.
7611 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7612 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7613 * testsuite/arm_cortex_a8_bl.s: Ditto.
7614 * testsuite/arm_cortex_a8_blx.s: Ditto.
7615 * testsuite/arm_cortex_a8_local.s: Ditto.
7616 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7617 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7618
05a79166
L
76192010-09-08 Rafael Espindola <espindola@google.com>
7620
7621 * Makefile.am (memory_test.stdout): Run readelf with -W.
7622 * Makefile.in: Regenerate.
7623 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7624 64 bit output.
7625
33dbc701
RÁE
76262010-09-08 Rafael Espindola <espindola@google.com>
7627
7628 * script-sections.cc (Script_sections::add_memory_region): Convert
7629 field precision to int.
7630 * script.cc (script_set_section_region, script_set_section_region):
7631 Convert field precision to int.
7632
731ca54a
RÁE
76332010-09-08 Rafael Espindola <espindola@google.com>
7634
7635 * arm.cc (do_finalize_sections): Create the __exidx_start and
7636 __exdix_end symbols even when the section is missing.
7637
7f8cd844
NC
76382010-09-08 Nick Clifton <nickc@redhat.com>
7639
7640 * README: Remove claim that MEMORY is not supported.
7641 * expression.cc (script_exp_function_origin)
7642 (script_exp_function_length): Move from here to ...
7643 * script.cc: ... here.
7644 (script_set_section_region, script_add_memory)
7645 (script_parse_memory_attr, script_include_directive): New
7646 functions.
7647 * script-sections.cc
7648 (class Memory_region): New class.
7649 (class Output_section_definition): Add set_memory_region,
7650 set_section_vma, set_section_lma and get_section_name methods.
7651 (class Script_Sections): Add add_memory_region,
7652 find_memory_region, find_memory_region_origin,
7653 find_memory_region_length and set_memory_region methods.
7654 Have set_section_addresses method walk the list of set memory
7655 regions.
7656 Extend the print methos to display memory regions.
7657 * script-sections.h: Add prototypes for new methods.
7658 Add enum for MEMORY region attributes.
7659 * yyscript.y: Add support for parsing MEMORY regions.
7660 * script-c.h: Add prototypes for new functions.
7661 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7662 * testsuite/Makefile.in: Regenerate.
7663 * testsuite/memory_test.sh: New script.
7664 * testsuite/memory_test.s: New assembler source file.
7665 * testsuite/memory_test.t: New linker script.
7666
a4649286
DK
76672010-08-27 Doug Kwan <dougkwan@google.com>
7668
7669 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7670 reference override an existing dynamic weak reference.
7671 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7672 * testsuite/Makefile.in: Regenerate.
7673 * testsuite/dyn_weak_ref.sh: New file.
7674 * testsuite/dyn_weak_ref_1.c: Ditto.
7675 * testsuite/dyn_weak_ref_2.c: Ditto.
7676
b56648ad
ILT
76772010-08-27 Ian Lance Taylor <iant@google.com>
7678
7679 * incremental.h (class Incremental_input_entry): Add virtual
7680 destructor.
7681
809313cb
ILT
76822010-08-27 Ian Lance Taylor <iant@google.com>
7683
7684 * testsuite/start_lib_test_3.c: Mark t3 as used.
7685
11e32464
NC
76862010-08-27 Nick Clifton <nickc@redhat.com>
7687
7688 * options.cc (version_script): Fix small typo in previous
7689 whitespace tidyup.
7690
ca09d69a
NC
76912010-08-25 Nick Clifton <nickc@redhat.com>
7692
7693 * archive.cc: Formatting fixes: Remove whitespace between
7694 typename and following asterisk. Remove whitespace between
7695 function name and opening parenthesis.
7696 * archive.h: Likewise.
7697 * arm.cc: Likewise.
7698 * attributes.cc: Likewise.
7699 * attributes.h: Likewise.
7700 * common.cc: Likewise.
7701 * copy-relocs.cc: Likewise.
7702 * dirsearch.h: Likewise.
7703 * dynobj.cc: Likewise.
7704 * ehframe.cc: Likewise.
7705 * ehframe.h: Likewise.
7706 * expression.cc: Likewise.
7707 * fileread.cc: Likewise.
7708 * fileread.h: Likewise.
7709 * gc.h: Likewise.
7710 * gold-threads.cc: Likewise.
7711 * gold.cc: Likewise.
7712 * i386.cc: Likewise.
7713 * icf.h: Likewise.
7714 * incremental-dump.cc: Likewise.
7715 * incremental.cc: Likewise.
7716 * layout.cc: Likewise.
7717 * layout.h: Likewise.
7718 * main.cc: Likewise.
7719 * merge.cc: Likewise.
7720 * merge.h: Likewise.
7721 * object.cc: Likewise.
7722 * object.h: Likewise.
7723 * options.cc: Likewise.
7724 * options.h: Likewise.
7725 * output.cc: Likewise.
7726 * output.h: Likewise.
7727 * plugin.cc: Likewise.
7728 * plugin.h: Likewise.
7729 * powerpc.cc: Likewise.
7730 * reloc.cc: Likewise.
7731 * script-c.h: Likewise.
7732 * script-sections.cc: Likewise.
7733 * script.cc: Likewise.
7734 * stringpool.cc: Likewise.
7735 * symtab.cc: Likewise.
7736 * symtab.h: Likewise.
7737 * target.cc: Likewise.
7738 * timer.cc: Likewise.
7739 * timer.h: Likewise.
7740 * version.cc: Likewise.
7741 * x86_64.cc: Likewise.
7742
b8fa8750
NC
77432010-08-24 Nick Clifton <nickc@redhat.com>
7744
7745 PR 11899
7746 * layout.cc (segment_precedes): Sort segments by their physical
7747 addresses, if they have been set.
7748
9919d93b
CC
77492010-08-23 Cary Coutant <ccoutant@google.com>
7750
7751 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7752 symbols data.
7753 (Lib_group::include_member): Unlock object after deleting its
7754 symbols data.
7755 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7756 the bug fixed here.
7757
97b4be1c
CC
77582010-08-19 Neil Vachharajani <nvachhar@google.com>
7759 Cary Coutant <ccoutant@google.com>
7760
7761 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7762 constructor, and set_blocker.
7763 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7764 readsyms_blocker_.
7765 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7766 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7767 * testsuite/Makefile.am (start_lib_test): New test case.
7768 * testsuite/Makefile.in: Regenerate.
7769 * testsuite/start_lib_test_main.c: New file.
7770 * testsuite/start_lib_test_1.c: New file.
7771 * testsuite/start_lib_test_2.c: New file.
7772 * testsuite/start_lib_test_3.c: New file.
7773
dd0b1884
ILT
77742010-08-19 Ian Lance Taylor <iant@google.com>
7775
7776 * Makefile.in: Rebuild with automake 1.11.1.
7777 * aclocal.m4: Likewise.
7778 * testsuite/Makefile.in: Likewise.
7779
7223e9ca
ILT
77802010-08-19 Ian Lance Taylor <iant@google.com>
7781
7782 PR 10893
7783 * i386.cc (class Output_data_plt_i386): Update declarations.
7784 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7785 local_ifuncs_ fields.
7786 (Target_i386::do_plt_section_for_global): New function.
7787 (Target_i386::do_plt_section_for_local): New function.
7788 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7789 parameter; change all callers. Initialize global_ifuncs_ and
7790 local_ifuncs_. If doing a static link define __rel_iplt_start and
7791 __rel_iplt_end.
7792 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7793 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7794 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7795 symbols.
7796 (Target_i386::make_plt_section): New function, broken out of
7797 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7798 (Target_i386::make_plt_entry): Call make_plt_section.
7799 (Target_i386::make_local_ifunc_plt_entry): New function.
7800 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7801 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7802 R_386_IRELATIVE to switch.
7803 (Target_i386::Scan::global): Likewise.
7804 (Target_i386::Relocate::relocate): Likewise.
7805 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7806 switch.
7807 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7808 (Target_x86_64::do_plt_section_for_global): New function.
7809 (Target_x86_64::do_plt_section_for_local): New function.
7810 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7811 parameter; change all callers. If doing a static link define
7812 __rela_iplt_start and __rela_iplt_end.
7813 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7814 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7815 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7816 to point to .plt.
7817 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7818 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7819 switch.
7820 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7821 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7822 R_X86_64_IRELATIVE to switch.
7823 (Target_x86_64::Scan::global): Likewise.
7824 (Target_x86_64::Relocate::relocate): Likewise.
7825 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7826 switch.
7827 * target.h (class Target): Add plt_section_for_global and
7828 plt_section_for_local functions. Add do_plt_section_for_global
7829 and do_plt_section_for_local virtual functions.
7830 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7831 clarifying comments.
7832 (Symbol::use_plt_offset): Handle IFUNC symbol.
7833 * object.cc (Sized_relobj::Sized_relobj): Initialize
7834 local_plt_offsets_.
7835 (Sized_relobj::local_has_plt_offset): New function.
7836 (Sized_relobj::local_plt_offset): New function.
7837 (Sized_relobj::set_local_plt_offset): New function.
7838 (Sized_relobj::do_count): Handle IFUNC symbol.
7839 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7840 a bit away from input_shndx_ field. Add set_is_func_symbol and
7841 is_ifunc_symbol functions.
7842 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7843 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7844 local_plt_offsets_ field.
7845 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7846 * output.h (class Output_section_data): Add non-const
7847 output_section function.
7848 (class Output_data_got): Update declarations.
7849 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7850 Add use_plt_offset parameter to global and local constructors.
7851 Change all callers. Change local_sym_index_ field to 31 bits.
7852 Change GSYM_CODE and CONSTANT_CODE accordingly.
7853 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7854 doing a static link don't set sh_link field.
7855 (Output_data_got::Got_entry::write): Use PLT offset if
7856 appropriate.
7857 (Output_data_got::add_global_plt): New function.
7858 (Output_data_got::add_local_plt): New function.
7859 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7860 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7861 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7862 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7863 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7864 IFUNC conditional.
7865 * testsuite/ifunc-sel.h: New file.
7866 * testsuite/ifuncmain1.c: New file.
7867 * testsuite/ifuncmain1vis.c: New file.
7868 * testsuite/ifuncmod1.c: New file.
7869 * testsuite/ifuncdep2.c: New file.
7870 * testsuite/ifuncmain2.c: New file.
7871 * testsuite/ifuncmain3.c: New file.
7872 * testsuite/ifuncmod3.c: New file.
7873 * testsuite/ifuncmain4.c: New file.
7874 * testsuite/ifuncmain5.c: New file.
7875 * testsuite/ifuncmod5.c: New file.
7876 * testsuite/ifuncmain6pie.c: New file.
7877 * testsuite/ifuncmod6.c: New file.
7878 * testsuite/ifuncmain7.c: New file.
7879 * configure, testsuite/Makefile.in: Rebuild.
7880
56f75c03
ILT
78812010-08-18 Ian Lance Taylor <iant@google.com>
7882
7883 * incremental.cc
7884 (Output_section_incremental_inputs::write_input_files): Add cast
7885 to avoid signed/unsigned comparison warning.
7886 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7887
55455f89
CC
78882010-08-12 Cary Coutant <ccoutant@google.com>
7889
7890 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7891
e2054bcb
ILT
78922010-08-13 Ian Lance Taylor <iant@google.com>
7893
7894 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7895
74f67560
DK
78962010-08-12 Cary Coutant <ccoutant@google.com>
7897 Doug Kwan <dougkwan@google.com>
7898
7899 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7900 defintion overrides non-weak undef, remember that the original undef
7901 is not weak.
7902 * symtab.cc (Symbol_table::sized_write_global): For undef without
7903 an original weak binding, set binding to global in output.
7904 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7905 * testsuite/Makefile.in: Regenerate.
7906 * testsuite/strong_ref_weak_def.sh: New file.
7907 * testsuite/strong_ref_weak_def_1.c: Ditto.
7908 * testsuite/strong_ref_weak_def_2.c: Ditto.
7909
d1238d12
CC
79102010-08-12 Cary Coutant <ccoutant@google.com>
7911
7912 * testsuite/incremental_test.sh: Rewrite.
7913 * testsuite/incremental_test_1.c: Rewrite.
7914 * testsuite/incremental_test_2.c: Rewrite.
7915
0e70b911
CC
79162010-08-12 Cary Coutant <ccoutant@google.com>
7917
7918 * arm.cc (Target_arm::got_size): Add const.
7919 (Target_arm::got_entry_count): New function.
7920 (Target_arm::plt_entry_count): New function.
7921 (Target_arm::first_plt_entry_offset): New function.
7922 (Target_arm::plt_entry_size): New function.
7923 (Output_data_plt_arm::entry_count): New function.
7924 (Output_data_plt_arm::first_plt_entry_offset): New function.
7925 (Output_data_plt_arm::get_plt_entry_size): New function.
7926 * i386.cc (Target_i386::got_size): Add const.
7927 (Target_i386::got_entry_count): New function.
7928 (Target_i386::plt_entry_count): New function.
7929 (Target_i386::first_plt_entry_offset): New function.
7930 (Target_i386::plt_entry_size): New function.
7931 (Output_data_plt_i386::entry_count): New function.
7932 (Output_data_plt_i386::first_plt_entry_offset): New function.
7933 (Output_data_plt_i386::get_plt_entry_size): New function.
7934 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7935 find_incremental_inputs_sections. Dump incremental_got_plt section.
7936 * incremental.cc: Include target.h.
7937 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7938 parameter. Adjust all callers. Find incremental_got_plt section.
7939 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7940 section.
7941 (Output_section_incremental_inputs::set_final_data_size): Calculate
7942 size of incremental_got_plt section.
7943 (Output_section_incremental_inputs::do_write): Write the
7944 incremental_got_plt section.
7945 (Got_plt_view_info): New struct.
7946 (Local_got_offset_visitor): New class.
7947 (Global_got_offset_visitor): New class.
7948 (Global_symbol_visitor_got_plt): New class.
7949 (Output_section_incremental_inputs::write_got_plt): New function.
7950 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7951 Add parameter. Adjust all callers.
7952 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7953 (Incremental_inputs::got_plt_section): New function.
7954 (Incremental_inputs::got_plt_section_): New data member.
7955 (Incremental_got_plt_reader): New class.
7956 * layout.cc (Layout::create_incremental_info_sections): Add the
7957 incremental_got_plt section.
7958 * object.h (Got_offset_list::get_list): New function.
7959 (Got offset_list::for_all_got_offsets): New function.
7960 (Sized_relobj::local_got_offset_list): New function.
7961 * powerpc.cc (Target_powerpc::got_size): Add const.
7962 (Target_powerpc::got_entry_count): New function.
7963 (Target_powerpc::plt_entry_count): New function.
7964 (Target_powerpc::first_plt_entry_offset): New function.
7965 (Target_powerpc::plt_entry_size): New function.
7966 (Output_data_plt_powerpc::entry_count): New function.
7967 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7968 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7969 * sparc.cc (Target_sparc::got_size): Add const.
7970 (Target_sparc::got_entry_count): New function.
7971 (Target_sparc::plt_entry_count): New function.
7972 (Target_sparc::first_plt_entry_offset): New function.
7973 (Target_sparc::plt_entry_size): New function.
7974 (Output_data_plt_sparc::entry_count): New function.
7975 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7976 (Output_data_plt_sparc::get_plt_entry_size): New function.
7977 * symtab.h (Symbol::got_offset_list): New function.
7978 (Symbol_table::for_all_symbols): New function.
7979 * target.h (Sized_target::got_entry_count): New function.
7980 (Sized_target::plt_entry_count): New function.
7981 (Sized_target::plt_entry_size): New function.
7982 * x86_64.cc (Target_x86_64::got_size): Add const.
7983 (Target_x86_64::got_entry_count): New function.
7984 (Target_x86_64::plt_entry_count): New function.
7985 (Target_x86_64::first_plt_entry_offset): New function.
7986 (Target_x86_64::plt_entry_size): New function.
7987 (Output_data_plt_x86_64::entry_count): New function.
7988 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7989 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7990
09ec0418
CC
79912010-08-12 Cary Coutant <ccoutant@google.com>
7992
7993 * archive.cc: Include incremental.h.
7994 (Archive::Archive): Initialize incremental_info_.
7995 (Archive::include_member): Record archive members in incremental info.
7996 (Add_archive_symbols::run): Record begin and end of an archive in
7997 incremental info.
7998 (Lib_group::include_member): Record objects in incremental info.
7999 * archive.h (Incremental_archive_entry): Forward declaration.
8000 (Archive::set_incremental_info): New member function.
8001 (Archive::incremental_info): New member function.
8002 (Archive::Unused_symbol_iterator): New class.
8003 (Archive::unused_symbols_begin): New member function.
8004 (Archive::unused_symbols_end): New member function.
8005 (Archive::incremental_info_): New data member.
8006 * incremental-dump.cc (find_input_containing_global): New function.
8007 (dump_incremental_inputs): Dump new incremental info sections.
8008 * incremental.cc: Include symtab.h.
8009 (Output_section_incremental_inputs): New class.
8010 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8011 new incremental info sections.
8012 (Sized_incremental_binary::do_check_inputs): Likewise.
8013 (Incremental_inputs::report_archive): Remove.
8014 (Incremental_inputs::report_archive_begin): New function.
8015 (Incremental_inputs::report_archive_end): New function.
8016 (Incremental_inputs::report_object): New function.
8017 (Incremental_inputs::finalize_inputs): Remove.
8018 (Incremental_inputs::report_input_section): New function.
8019 (Incremental_inputs::report_script): Rewrite.
8020 (Incremental_inputs::finalize): Do nothing but finalize string table.
8021 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8022 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8023 (Incremental_inputs::create_data_sections): New function.
8024 (Incremental_inputs::relocs_entsize): New function.
8025 (Output_section_incremental_inputs::set_final_data_size): New function.
8026 (Output_section_incremental_inputs::do_write): New function.
8027 (Output_section_incremental_inputs::write_header): New function.
8028 (Output_section_incremental_inputs::write_input_files): New function.
8029 (Output_section_incremental_inputs::write_info_blocks): New function.
8030 (Output_section_incremental_inputs::write_symtab): New function.
8031 * incremental.h (Incremental_script_entry): Forward declaration.
8032 (Incremental_object_entry): Forward declaration.
8033 (Incremental_archive_entry): Forward declaration.
8034 (Incremental_inputs): Forward declaration.
8035 (Incremental_inputs_header_data): Remove.
8036 (Incremental_inputs_header): Remove.
8037 (Incremental_inputs_header_write): Remove.
8038 (Incremental_inputs_entry_data): Remove.
8039 (Incremental_inputs_entry): Remove.
8040 (Incremental_inputs_entry_write): Remove.
8041 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
8042 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
8043 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8044 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
8045 Likewise.
8046 (Incremental_input_entry): New class.
8047 (Incremental_script_entry): New class.
8048 (Incremental_object_entry): New class.
8049 (Incremental_archive_entry): New class.
8050 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8051 (Incremental_inputs::report_inputs): Remove.
8052 (Incremental_inputs::report_archive): Remove.
8053 (Incremental_inputs::report_archive_begin): New function.
8054 (Incremental_inputs::report_archive_end): New function.
8055 (Incremental_inputs::report_object): Change prototype.
8056 (Incremental_inputs::report_input_section): New function.
8057 (Incremental_inputs::report_script): Change prototype.
8058 (Incremental_inputs::get_reloc_count): New function.
8059 (Incremental_inputs::set_reloc_count): New function.
8060 (Incremental_inputs::create_data_sections): New function.
8061 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8062 (Incremental_inputs::inputs_section): New function.
8063 (Incremental_inputs::symtab_section): New function.
8064 (Incremental_inputs::relocs_section): New function.
8065 (Incremental_inputs::get_stringpool): Add const.
8066 (Incremental_inputs::command_line): Add const.
8067 (Incremental_inputs::inputs): Remove.
8068 (Incremental_inputs::command_line_key): New function.
8069 (Incremental_inputs::input_file_count): New function.
8070 (Incremental_inputs::input_files): New function.
8071 (Incremental_inputs::relocs_entsize): New function.
8072 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8073 (Incremental_inputs::finalize_inputs): Remove.
8074 (Incremental_inputs::Input_info): Remove.
8075 (Incremental_inputs::lock_): Remove.
8076 (Incremental_inputs::inputs_): Change type.
8077 (Incremental_inputs::inputs_map_): Remove.
8078 (Incremental_inputs::current_object_entry_): New data member.
8079 (Incremental_inputs::inputs_section_): New data member.
8080 (Incremental_inputs::symtab_section_): New data member.
8081 (Incremental_inputs::relocs_section_): New data member.
8082 (Incremental_inputs::reloc_count_): New data member.
8083 (Incremental_inputs_reader): New class.
8084 (Incremental_symtab_reader): New class.
8085 (Incremental_relocs_reader): New class.
8086 * layout.cc (Layout::finalize): Move finalization of incremental info
8087 and creation of incremental info sections to follow finalization of
8088 symbol table. Set offsets for postprocessing sections.
8089 (Layout::create_incremental_info_sections): Call
8090 Incremental_inputs::create_data_sections. Add incremental symtab
8091 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
8092 sections to layout after input sections.
8093 * layout.h (struct Timespec): Forward declaration.
8094 (Layout::incremental_inputs): Add const.
8095 (Layout::create_incremental_info_sections): Add parameter.
8096 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
8097 * object.cc: Include incremental.h.
8098 (Relobj::finalize_incremental_relocs): New function.
8099 (Sized_relobj::do_layout): Record input sections in incremental info.
8100 * object.h (Object::output_section): New function.
8101 (Object::output_section_offset): Moved from Relobj.
8102 (Object::get_incremental_reloc_base): New function.
8103 (Object::get_incremental_reloc_count): New function.
8104 (Object::do_output_section): New function.
8105 (Object::do_output_section_offset): Moved from Relobj.
8106 (Object::do_get_incremental_reloc_base): New function.
8107 (Object::do_get_incremental_reloc_count): New function.
8108 (Object::Object): Initialize new data members.
8109 (Relobj::output_section): Renamed do_output_section and moved to
8110 protected.
8111 (Relobj::output_section_offset): Moved to Object.
8112 (Relobj::do_get_incremental_reloc_base): New function.
8113 (Relobj::do_get_incremental_reloc_count): New function.
8114 (Relobj::allocate_incremental_reloc_counts): New function.
8115 (Relobj::count_incremental_reloc): New function.
8116 (Relobj::finalize_incremental_relocs): New function.
8117 (Relobj::next_incremental_reloc_index): New function.
8118 (Relobj::reloc_counts_): New data member.
8119 (Relobj::reloc_bases_): New data member.
8120 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8121 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8122 (Sized_relobj::incremental_relocs_scan): New function.
8123 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8124 (Sized_relobj::incremental_relocs_write): New function.
8125 (Sized_relobj::incremental_relocs_write_reltype): New function.
8126 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8127 incremental link.
8128 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8129 archives and object files elsewhere.
8130 (Add_symbols::run): Report object files here.
8131 (Finish_group::run): Report end of archive at end of group.
8132 * reloc.cc: Include layout.h, incremental.h.
8133 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8134 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8135 (Sized_relobj::incremental_relocs_scan): New function.
8136 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8137 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8138 (Sized_relobj::incremental_relocs_write): New function.
8139 (Sized_relobj::incremental_relocs_write_reltype): New function.
8140 * script.cc (read_input_script): Rewrite test for incremental link.
8141 Change call to Incremental_inputs::report_script.
8142 * symtab.h (Symbol_table::first_global_index): New function.
8143 (Symbol_table::output_count): New function.
8144
ce0d1972
DK
81452010-08-12 Doug Kwan <dougkwan@google.com>
8146
8147 * arm.cc (Target_arm::merge_object_attributes): Check command line
8148 options --no-wchar-size-warning and --no-enum-size-warning.
8149 * options.h (General_options): Add ld-compatible options
8150 --no-enum-size-warning and --no-wchar-size-warning.
8151
6e5710ce
ILT
81522010-08-04 Ian Lance Taylor <iant@google.com>
8153
8154 * x86_64.cc (Target_x86_64::Scan::local): Use
8155 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8156 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8157 (Target_x86_64::Scan::global): Likewise.
8158 (Target_x86_64::Relocate::relocate): Likewise.
8159 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8160 Likewise.
8161
fef830db
CC
81622010-08-03 Cary Coutant <ccoutant@google.com>
8163
8164 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8165 to reserve space in merged_strings vector. Keep total input size
8166 for stats.
8167 (Output_merge_string::do_print_merge_stats): Print total input size.
8168 * merge.h (Output_merge_string): Add input_size_ field.
8169 * stringpool.cc (Stringpool_template::string_length): Move
8170 implementations out of Stringpool_template class and place in
8171 stringpool.h.
8172 * stringpool.h (string_length): Move out of Stringpool_template.
8173
1e3811b0
ILT
81742010-08-03 Ian Lance Taylor <iant@google.com>
8175
8176 PR 11712
8177 * layout.cc (relaxation_loop_body): If address of load segment is
8178 set, adjust address to include headers if possible.
8179
7af0c620
ILT
81802010-08-03 Ian Lance Taylor <iant@google.com>
8181
8182 * version.cc (version_string): Bump to 1.10.
8183
22f0da72
ILT
81842010-08-03 Ian Lance Taylor <iant@google.com>
8185
8186 PR 11805
8187 * layout.h (enum Output_section_order): Define.
8188 (class Layout): Update declarations.
8189 * layout.cc (Layout::get_output_section): Add order parameter.
8190 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8191 is_first_non_relro parameters. Change all callers.
8192 (Layout::choose_output_section): Likewise.
8193 (Layout::add_output_section_data): Likewise.
8194 (Layout::make_output_section): Likewise. Set order.
8195 (Layout::default_section_order): New function.
8196 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8197 * output.cc (Output_section::Output_section): Initialize order_.
8198 Don't initialize deleted fields.
8199 (Output_segment::Output_segment): Don't initialize deleted
8200 fields.
8201 (Output_segment::add_output_section_to_load): New function
8202 replacing add_output_section. Change all callers to call this or
8203 add_output_section_to_nonload.
8204 (Output_segment::add_output_section_to_nonload): New function.
8205 (Output_segment::remove_output_section): Rewrite.
8206 (Output_segment::add_initial_output_data): Likewise.
8207 (Output_segment::has_any_data_sections): Likewise.
8208 (Output_segment::is_first_section_relro): Likewise.
8209 (Output_segment::maximum_alignment): Likewise.
8210 (Output_segment::has_dynamic_reloc): New function replacing
8211 dynamic_reloc_count. Change all callers.
8212 (Output_segment::has_dynamic_reloc_list): New function replacing
8213 dynamic_reloc_count_list. Change all callers.
8214 (Output_segment::set_section_addresses): Rewrite.
8215 (Output_segment::set_offset): Rewrite.
8216 (Output_segment::find_first_and_last_list): Remove.
8217 (Output_segment::set_tls_offsets): Rewrite.
8218 (Output_segment::first_section_load_address): Likewise.
8219 (Output_segment::output_section_count): Likewise.
8220 (Output_segment::section_with_lowest_load_address): Likewise.
8221 (Output_segment::write_section_headers): Likewise.
8222 (Output_segment::print_sections_to_map): Likewise.
8223 * output.h (class Output_data): Remove dynamic_reloc_count_
8224 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8225 (Output_data::add_dynamic_reloc): Rewrite.
8226 (Output_data::has_dynamic_reloc): New function.
8227 (Output_data::dynamic_reloc_count): Remove.
8228 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8229 is_last_relro_, is_first_non_relro_, is_interp_,
8230 is_dynamic_linker_section_ fields. Add order and set_order
8231 functions. Remove is_relro_local, set_is_relro_local,
8232 is_last_relro, set_is_last_relro, is_first_non_relro,
8233 set_is_first_non_relro functions, is_interp, set_is_interp,
8234 is_dynamic_linker_section, and set_is_dynamic_linker_section
8235 functions.
8236 (class Output_segment): Change Output_data_list from std::list to
8237 std:;vector. Add output_lists_ field. Remove output_data_ and
8238 output_bss_ fields. Update declarations.
8239
3ff2ccb0
ILT
82402010-08-02 Ian Lance Taylor <iant@google.com>
8241
8242 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8243 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8244 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8245
88a4108b
ILT
82462010-08-02 Ian Lance Taylor <iant@google.com>
8247
8248 PR 11855
8249 * script.cc (Script_options::Script_options): Initialize
8250 symbol_definitions_ and symbol_references_.
8251 (Script_options::add_symbol_assignment): Update
8252 symbol_definitions_ and symbol_references_.
8253 (Script_options::add_symbol_reference): New function.
8254 (script_symbol): New function.
8255 * script.h (class Script_options): Add symbol_definitions_ and
8256 symbol_references_ fields.
8257 (Script_options::referenced_const_iterator): New type.
8258 (Script_options::referenced_begin): New function.
8259 (Script_options::referenced_end): New function.
8260 (Script_options::is_referenced): New function.
8261 (Script_options::any_unreferenced): New function.
8262 * script-c.h (script_symbol): Declare.
8263 * yyscript.y (exp): Call script_symbol.
8264 * symtab.cc: Include "script.h".
8265 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8266 Change all callers. Check symbols referenced by scripts.
8267 (Symbol_table::add_undefined_symbols_from_command_line): Add
8268 layout parameter. Change all callers.
8269 (Symbol_table::do_add_undefined_symbols_from_command_line):
8270 Likewise. Break out loop body. Check symbols referenced by
8271 scripts.
8272 (Symbol_table::add_undefined_symbol_from_command_line): New
8273 function broken out of
8274 do_add_undefined_symbols_from_command_line.
8275 * symtab.h (class Symbol_table): Update declarations.
8276 * archive.cc: Include "layout.h".
8277 (Archive::should_include_member): Add layout parameter. Change
8278 all callers. Check for symbol mentioned in expression.
8279 * archive.h (class Archive): Update declaration.
8280 * object.cc (Sized_relobj::do_should_include_member): Add layout
8281 parameter.
8282 * object.h (Object::should_include_member): Add layout parameter.
8283 Change all callers.
8284 (Object::do_should_include_member): Add layout parameter.
8285 (class Sized_relobj): Update declaration.
8286 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8287 parameter.
8288 * dynobj.h (class Sized_dynobj): Update declaration.
8289 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8290 layout parameter.
8291 * plugin.h (class Sized_pluginobj): Update declaration.
8292
5f1ab67a
ILT
82932010-08-02 Ian Lance Taylor <iant@google.com>
8294
8295 PR 11866
8296 * output.cc (Output_segment::set_offset): Search for the first and
8297 last sections rather than assuming that the list is in order.
8298 (Output_segment::find_first_and_last_list): New function.
8299 * output.h (class Output_segment): Update declarations.
8300 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8301 (relro_strip_test_SOURCES): New variable.
8302 (relro_strip_test_DEPENDENCIES): New variable.
8303 (relro_strip_test_LDFLAGS): New variable.
8304 (relro_strip_test_LDADD): New variable.
8305 (relro_strip_test.so): New target.
8306
a8df5856
ILT
83072010-08-02 Ian Lance Taylor <iant@google.com>
8308
8309 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8310 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8311 (Target_i386::got_tlsdesc_section): New function.
8312 (Target_i386::got_section): Create space for GOT entries for
8313 TLSDESC relocations.
8314 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8315 R_386_TLS_GOTDESC.
8316 (Target_i386::Scan::global): Likewise.
8317 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8318 using TLSDESC GOT.
8319 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8320 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8321 (Target_x86_64::got_tlsdesc_section): New function.
8322 (Target_x86_64::got_section): Create space for GOT entries for
8323 TLSDESC relocations.
8324 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8325 R_386_TLS_GOTDESC.
8326 (Target_x86_64::Scan::global): Likewise.
8327 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8328 using TLSDESC GOT.
8329
0c10a0a6
ILT
83302010-08-02 Ian Lance Taylor <iant@google.com>
8331
8332 * testsuite/final_layout.sh: Use dc to convert from hex to
8333 decimal.
8334
41cbeecc
ST
83352010-07-29 Sriraman Tallam <tmsriram@google.com>
8336
8337 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8338 paramter to the call to gold::gc_process_relocs.
8339 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8340 paramter to the call to gold::gc_process_relocs.
8341 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8342 parameter to the call to gold::gc_process_relocs.
8343 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8344 template parameter to the call to gold::gc_process_relocs.
8345 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8346 paramter to the call to gold::gc_process_relocs.
8347 * gc.h (get_embedded_addend_size): New function.
8348 (gc_process_relocs): Save the size of the reloc for use by ICF.
8349 * icf.cc (get_section_contents): Get the addend from the text section
8350 for SHT_REL relocation sections.
8351 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8352 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8353 * int_encoding.h (read_from_pointer): New overloaded function.
8354 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8355 * testsuite/icf_sht_rel_addend_test.sh: New file.
8356 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8357 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8358
6ea55b82
RW
83592010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8360
8361 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8362 * Makefile.in: Regenerate.
8363 * testsuite/Makefile.in: Regenerate.
8364
9691462b
ILT
83652010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8366
8367 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8368 * gold/testsuite/debug_msg.cc: Likewise.
8369 * gold/testsuite/odr_violation1.cc
8370 * gold/testsuite/odr_violation2.cc
8371
76897331
CC
83722010-07-21 Cary Coutant <ccoutant@google.com>
8373
8374 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8375 string, and length fields.
8376 (Output_merge_string::Merged_strings_list): New type.
8377 (Output_merge_string::Merged_strings_lists): New typedef.
8378 (Output_merge_string): Replace merged_strings_ with
8379 merged_strings_lists_.
8380 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8381 Merged_strings_list per input object and section. Don't store pointer
8382 to the string. Don't store length with each merged string entry.
8383 (Output_merge_string::finalize_merged_data): Loop over list of merged
8384 strings lists. Recompute length of each merged string.
8385
78384e8f
CC
83862010-07-15 Cary Coutant <ccoutant@google.com>
8387
8388 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8389 here.
8390
783659f9
ILT
83912010-07-14 Ian Lance Taylor <iant@google.com>
8392
8393 * descriptors.cc (Descriptors::open): Report correct name in error
8394 message.
8395
131687b4
DK
83962010-07-13 Doug Kwan <dougkwan@google.com>
8397
8398 * arm.cc (Arm_input_section::Arm_input_section): For a
8399 SHT_ARM_EXIDX section, always keeps the input sections.
8400 (Arm_input_section::set_exidx_section_link): New method.
8401 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8402 has_errors_ to false.
8403 (Arm_exidx_input_section::has_errors,
8404 Arm_exidx_input_section::set_has_errors): New methods.
8405 (Arm_exidx_input_section::has_errors_): New data member.
8406 (Arm_relobj::get_exidx_shndx_list): New method.
8407 (Arm_output_section::append_text_sections_to_list): Do not skip
8408 section without SHF_EXECINSTR.
8409 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8410 errors.
2e702c99 8411 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8412 section header. Make error messages more verbose. Check for
8413 a non-executable section linked to an EXIDX section.
8414 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8415 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8416 check that there is no deferred EXIDX section if we exit early.
8417 Instead of not making an EXIDX section in case of an error, make one
8418 and set the has_errors flag of it.
8419 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8420 in a relocatable link.
8421 (Target_arm::do_relax): Look for the EXIDX output section instead of
8422 assuming that it is called .ARM.exidx.
2e702c99 8423 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8424 section list. Do not check for SHF_EXECINSTR section flags but
8425 skip any input section with errors.
8426 * output.cc (Output_section::Output_section): Initialize
8427 always_keeps_input_sections_ to false.
8428 (Output_section::add_input_section): Check for
8429 always_keeps_input_sections_.
8430 * output.h (Output_section::always_keeps_input_sections,
8431 Output_section::set_always_keeps_input_sections): New methods.
8432 (Output_section::always_keeps_input_sections): New data member.
8433
69517287
RÁE
84342010-07-13 Rafael Espindola <espindola@google.com>
8435
8436 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8437 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8438
82742395
ILT
84392010-07-13 Philip Herron <herron.philip@googlemail.com>
8440 Ian Lance Taylor <iant@google.com>
8441
8442 * output.h (Output_section_lookup_maps::add_merge_section):
8443 Correct check of whether value was inserted.
8444 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8445 (Output_section_lookup_maps::add_relaxed_input_section):
8446 Likewise.
8447 * arm.cc (Target_arm::got_section): Remove used local os.
8448 * i386.cc (Target_i386::got_section): Likewise.
8449 * x86_64.cc (Target_x86_64::got_section): Likewise.
8450 * sparc.cc (Target_sparc::got_section): Likewise.
8451 (Target_sparc::relocate): Remove unused local have_got_offset.
8452 * powerpc.cc (Target_powerpc::relocate): Likewise.
8453
f2d707b5
ILT
84542010-07-13 Ian Lance Taylor <iant@google.com>
8455
241531d6
ILT
8456 * compressed_output.cc (zlib_decompress): Fix signature in
8457 !HAVE_ZLIB_H case.
8458
f2d707b5
ILT
8459 * archive.cc (Archive::include_member): Unlock an external member
8460 of a thin archive. Don't bother to delete an object we know is
8461 NULL.
8462
a2e47362
CC
84632010-07-12 Cary Coutant <ccoutant@google.com>
8464
8465 * compressed_output.cc (zlib_decompress): New function.
8466 (get_uncompressed_size): New function.
8467 (decompress_input_section): New function.
8468 * compressed_output.h (get_uncompressed_size): New function.
8469 (decompress_input_section): New function.
8470 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8471 Handle compressed debug sections.
8472 * layout.cc (is_compressed_debug_section): New function.
8473 (Layout::output_section_name): Map compressed section names to
8474 canonical names.
8475 * layout.h (is_compressed_debug_section): New function.
8476 (is_debug_info_section): Recognize compressed debug sections.
8477 * merge.cc: Include compressed_output.h.
8478 (Output_merge_data::do_add_input_section): Handle compressed
8479 debug sections.
8480 (Output_merge_string::do_add_input_section): Handle compressed
8481 debug sections.
8482 * object.cc: Include compressed_output.h.
8483 (Sized_relobj::Sized_relobj): Initialize new data members.
8484 (build_compressed_section_map): New function.
8485 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8486 * object.h (Object::section_is_compressed): New method.
8487 (Object::do_section_is_compressed): New method.
8488 (Sized_relobj::Compressed_section_map): New type.
8489 (Sized_relobj::do_section_is_compressed): New method.
8490 (Sized_relobj::compressed_sections_): New data member.
8491 * output.cc (Output_section::add_input_section): Handle compressed
8492 debug sections.
8493 * reloc.cc: Include compressed_output.h.
8494 (Sized_relobj::write_sections): Handle compressed debug sections.
8495
ce279a62
CC
84962010-07-08 Cary Coutant <ccoutant@google.com>
8497
8498 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8499 weak when resolving to a dynamic def.
8500 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8501 for weak undef/dynamic def cases. Adjust callers.
8502 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8503 undef_binding_weak_.
8504 (Symbol_table::sized_write_globals): Adjust symbol binding.
8505 (Symbol_table::sized_write_symbol): Add binding parameter.
8506 * symtab.h (Symbol::set_undef_binding): New method.
8507 (Symbol::is_undef_binding_weak): New method.
8508 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8509 (Symbol_table::should_override): Add new parameter.
8510 (Symbol_table::sized_write_symbol): Add new parameter.
8511
8512 * testsuite/weak_undef_file1.cc: Add new test case.
8513 * testsuite/weak_undef_file2.cc: Fix header comment.
8514 * testsuite/weak_undef_test.cc: Add new test case.
8515
b2286c10
DK
85162010-06-29 Doug Kwan <dougkwan@google.com>
8517
8518 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8519 Initialize USE_SYMBOL_.
8520 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8521 definition.
8522 (Arm_reloc_property::uses_symbol_): New data member declaration.
8523 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8524 uses symbol value and symbol is undefined but not weakly undefined.
8525
4802450a
RÁE
85262010-06-28 Rafael Espindola <espindola@google.com>
8527
8528 * plugin.cc (Plugin::load): Use dlerror.
8529
e5ca47ba
ILT
85302010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8531
8532 * symtab.cc (detect_odr_violations): When reporting an ODR
8533 violation, report an object where the symbol is defined.
8534
8a75a161
DK
85352010-06-25 Doug Kwan <dougkwan@google.com>
8536
8537 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8538 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8539 definition.
8540 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8541 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8542 target hook to detect function points.
8543 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8544 * icf.h (Icf::check_section_for_function_pointers): Change type of
8545 parameter SECTION_NAME to const reference to std::string. Use
8546 target hook to determine if section may have unsafe pointers.
8547 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8548 method definition.
8549
42218b9f
RÁE
85502010-06-21 Rafael Espindola <espindola@google.com>
8551
8552 * fileread.cc (Input_file::find_fie): New
8553 (Input_file::open): Use Input_file::find_fie.
8554 * fileread.h (Input_file::find_fie): New
8555 * plugin.cc (set_extra_library_path): New.
8556 (Plugin::load): Add set_extra_library_path to the transfer vector.
8557 (Plugin_manager::set_extra_library_path): New.
8558 (Plugin_manager::add_input_file): Use the extra search path if set.
8559 (set_extra_library_path(): New.
8560 * plugin.h (Plugin_manager): Add set_extra_library_path and
8561 extra_search_path_.
8562
a0506cca
CC
85632010-06-19 Cary Coutant <ccoutant@google.com>
8564
8565 * layout.cc (gdb_sections): Add .debug_types.
8566 (lines_only_debug_sections): Likewise.
8567
6508b958
RÁE
85682010-06-18 Rafael Espindola <espindola@google.com>
8569
8570 * plugin.cc (add_input_file,add_input_library)
8571 (Plugin_manager::add_input_file): Make filename arguments const.
8572 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8573 const.
8574
3e235302
DK
85752010-06-16 Doug Kwan <dougkwan@google.com>
8576
8577 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8578 .ARM.attributes section if we have not merged any input
8579 attributes sections.
8580
106e8a6c
DK
85812010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8582
8583 * arm.cc: Allow combining objects with no EABI version
8584 information.
8585
91ff43fe
RÁE
85862010-06-15 Rafael Espindola <espindola@google.com>
8587
8588 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8589
68ed838c
ILT
85902010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8591
8592 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8593 (struct iovec): Correct !HAVE_READV definition.
8594
f3a2388f
CC
85952010-06-10 Cary Coutant <ccoutant@google.com>
8596
8597 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8598 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8599 reloc sections.
8600 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8601
8602 PR 11683
8603 * symtab.h (Symbol::is_placeholder): New member function.
8604 * target-reloc.h (relocate_section): Check for placeholder symbols.
8605
8606 * testsuite/Makefile.am (plugin_test_8): New test.
8607 (plugin_test_9): New test.
8608 * testsuite/Makefile.in: Regenerate.
8609
e1df38aa
NC
86102010-06-09 Nick Clifton <nickc@redhat.com>
8611
8612 * yyscript.y (input_list_element): Allow strings prefixed with
8613 the '-' character. Treat these as libraries.
8614 * script.cc (script_add_library): New function. Adds a library
8615 specified by "-l<name>" found in an input script.
8616 * script-c.h: Add prototype for script_add_library.
8617
25bbe950
DK
86182010-06-07 Doug Kwan <dougkwan@google.com>
8619
8620 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8621 Restrict stub-group size to be within long conditional branch
8622 range when working around cortex-A8 erratum.
8623
0f32ea4c
ILT
86242010-06-07 Damien Diederen <dd@crosstwine.com>
8625
8626 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8627 #ifdef typo.
8628
8fe2a369
ST
86292010-06-03 Sriraman Tallam <tmsriram@google.com>
8630
8631 PR gold/11658
8632 * output.cc
8633 (Output_section::Input_section_sort_entry::compare_section_ordering):
8634 Change to return non-zero correctly.
8635 (Output_section::Input_section_sort_section_order_index_compare
8636 ::operator()): Change to fix ambiguity in comparisons.
8637
6e9ba2ca
ST
86382010-06-01 Sriraman Tallam <tmsriram@google.com>
8639
8640 * gold.h (is_wildcard_string): New function.
8641 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8642 (Layout::layout_eh_frame): Ditto.
8643 (Layout::find_section_order_index): New method.
8644 (Layout::read_layout_from_file): New method.
8645 * layout.h (Layout::find_section_order_index): New method.
8646 (Layout::read_layout_from_file): New method.
8647 (Layout::input_section_position_): New private member.
8648 (Layout::input_section_glob_): New private member.
8649 * main.cc (main): Call read_layout_from_file here.
8650 * options.h (--section-ordering-file): New option.
8651 * output.cc (Output_section::input_section_order_specified_): New
8652 member.
8653 (Output_section::Output_section): Initialize new member.
8654 (Output_section::add_input_section): Add new parameter.
8655 Keep input sections when --section-ordering-file is used.
8656 (Output_section::set_final_data_size): Sort input sections when
8657 section ordering file is specified.
8658 (Output_section::Input_section_sort_entry): Add new parameter.
8659 Check sorting type.
8660 (Output_section::Input_section_sort_entry::compare_section_ordering):
8661 New method.
8662 (Output_section::Input_section_sort_compare::operator()): Change to
8663 consider section_order_index.
8664 (Output_section::Input_section_sort_init_fini_compare::operator()):
8665 Change to consider section_order_index.
8666 (Output_section::Input_section_sort_section_order_index_compare
8667 ::operator()): New method.
8668 (Output_section::sort_attached_input_sections): Change to sort
8669 according to section order when specified.
e1df38aa
NC
8670 (Output_section::add_input_section<32, true>): Add new parameter.
8671 (Output_section::add_input_section<64, true>): Add new parameter.
8672 (Output_section::add_input_section<32, false>): Add new parameter.
8673 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
8674 * output.h (Output_section::add_input_section): Add new parameter.
8675 (Output_section::input_section_order_specified): New
8676 method.
8677 (Output_section::set_input_section_order_specified): New method.
8678 (Input_section::Input_section): Initialize section_order_index_.
8679 (Input_section::section_order_index): New method.
8680 (Input_section::set_section_order_index): New method.
8681 (Input_section::section_order_index_): New member.
8682 (Input_section::Input_section_sort_section_order_index_compare): New
8683 struct.
8684 (Output_section::input_section_order_specified_): New member.
8685 * script-sections.cc (is_wildcard_string): Delete and move modified
8686 method to gold.h.
8687 (Output_section_element_input::Output_section_element_input): Modify
8688 call to is_wildcard_string.
8689 (Output_section_element_input::Input_section_pattern
8690 ::Input_section_pattern): Ditto.
8691 (Output_section_element_input::Output_section_element_input): Ditto.
8692 * testsuite/Makefile.am (final_layout): New test case.
8693 * testsuite/Makefile.in: Regenerate.
8694 * testsuite/final_layout.cc: New file.
8695 * testsuite/final_layout.sh: New file.
8696
3537c84b
RÁE
86972010-06-01 Rafael Espindola <espindola@google.com>
8698
8699 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8700
105b6afd
RÁE
87012010-06-01 Rafael Espindola <espindola@google.com>
8702
8703 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8704 visibility of symbols.
8705
29e11421
DK
87062010-05-27 Doug Kwan <dougkwan@google.com>
8707
8708 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8709 from start of output section instead of address for a local symbol
8710 in a merged or relaxed section when doing a relocatable link.
8711
5e0f337e
RÁE
87122010-05-26 Rafael Espindola <espindola@google.com>
8713
703d02da 8714 PR 11604
5e0f337e
RÁE
8715 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8716 adding sections the garbage collector removed.
8717 * gold/testsuite/Makefile.am: Add test.
8718 * gold/testsuite/Makefile.in: Regenerate.
8719 * gold/testsuite/plugin_test_7.sh: New.
8720 * gold/testsuite/plugin_test_7_1.c: New.
8721 * gold/testsuite/plugin_test_7_2.c: New.
8722
f4187277
RÁE
87232010-05-26 Rafael Espindola <espindola@google.com>
8724
8725 * script-sections.cc (Output_section_definition::set_section_addresses):
8726 Check for --section-start.
8727
5c388529
DK
87282010-05-26 Doug Kwan <dougkwan@google.com>
8729
8730 * arm.cc (Arm_scan_relocatable_relocs): New class.
8731 (Target_arm::relocate_special_relocatable): New method.
8732 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8733 (Arm_relocate_functions::thumb_branch_common): Same.
8734 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8735 instead of Default_scan_relocatable_relocs.
8736 * target-reloc.h (relocate_for_relocatable): Let target handle
8737 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8738 * target.h (Sized_target::relocate_special_relocatable): New method.
8739
bca1c3ae
ILT
87402010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8741
8742 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8743
0439c796
DK
87442010-05-23 Doug Kwan <dougkwan@google.com>
8745
8746 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8747 instead of a cast.
8748 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8749 with a direct branch, not a conditional branch, to a stub.
8750 * merge.cc (Output_merge_base::record_input_section): New method
8751 defintion.
8752 (Output_merge_data::do_add_input_section): Record input section if
8753 keeps-input-sections flag is set.
8754 (Output_merge_string::do_add_input_section): Ditto.
8755 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8756 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8757 INPUT_SECTIONS_.
8758 (Output_merge_base::keeps_input_sections,
8759 Output_merge_base::set_keeps_input_sections,
8760 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8761 method definitions.
8762 (Output_merge_base::Input_sections): New type declaration.
8763 (Output_merge_base::input_sections_begin,
8764 Output_merge_base::input_sections_end,
8765 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8766 (Output_merge_base::bool keeps_input_sections_,
8767 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8768 Output_merge_base::input_sections_): New data members.
8769 (Output_merge_data::do_set_keeps_input_sections): New method
8770 defintion.
8771 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8772 * output.cc (Output_section::Input_section::relobj): Move method
8773 defintion from class declaration to here and handle merge sections.
8774 (Output_section::Input_section::shndx): Ditto.
8775 (Output_section::Output_section): Remove initializations of removed
8776 data members and initialize new data member LOOKUP_MAPS_.
8777 (Output_section::add_input_section): Set keeps-input-sections flag
8778 for a newly created merge output section as appropriate. Adjust code
8779 to use Output_section_lookup_maps class.
8780 (Output_section::add_relaxed_input_section): Adjst code for lookup
8781 maps code refactoring.
2e702c99 8782 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
8783 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8784 class. If adding input section to a newly created merge output
8785 section fails, remove the new merge section.
8786 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 8787 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 8788 (Output_section::find_merge_section): Ditto.
0439c796 8789 (Output_section::build_lookup_maps): New method defintion.
2e702c99 8790 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
8791 Output_section_lookup_maps class.
8792 (Output_section::get_input_sections): Export merge sections. Adjust
8793 code to use Output_section_lookup_maps class.
8794 (Output_section:::add_script_input_section): Adjust code to use
8795 Output_section_lookup_maps class. Update lookup maps for merge
8796 sections also.
8797 (Output_section::discard_states): Use Output_section_lookup_maps.
8798 (Output_section::restore_states): Same.
8799 * output.h (Merge_section_properties): Move class defintion out of
8800 Output_section.
8801 (Output_section_lookup_maps): New class.
8802 (Output_section::Input_section::is_merge_section): New method
8803 defintion.
8804 (Output_section::Input_section::relobj): Move defintion out of class
8805 defintion. Declare method only.
8806 (Output_section::Input_section::shndx): Ditto.
8807 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 8808 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
8809 (Output_section::Merge_section_by_properties_map,
8810 Output_section::Output_section_data_by_input_section_map,
8811 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8812 Remove types.
2e702c99 8813 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
8814 KEEPS_INPUT_SECTIONS.
8815 (Output_section::build_lookup_maps): New method declaration.
8816 (Output_section::merge_section_map_,
8817 Output_section::merge_section_by_properties_map_,
8818 Output_section::relaxed_input_section_map_,
8819 Output_section::is_relaxed_input_section_map_valid_): Remove data
8820 members.
8821 (Output_section::lookup_maps_): New data member.
8822
76295588
L
88232010-05-21 Doug Kwan <dougkwan@google.com>
8824
8825 PR gold/11619
8826 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8827 avoid a compilation error.
8828
d103a984
RÁE
88292010-05-19 Rafael Espindola <espindola@google.com>
8830
8831 * script-sections.cc (Output_section_definition::allocate_to_segment):
8832 Update the phdrs_list even when the output section is NULL.
8833 * testsuite/Makefile.am: Add test.
8834 * testsuite/Makefile.in: Regenerate.
8835 * testsuite/script_test_9.cc: New.
8836 * testsuite/script_test_9.sh: New.
8837 * testsuite/script_test_9.t: New.
8838
6625d24e
DK
88392010-05-19 Doug Kwan <dougkwan@google.com>
8840
8841 * arm.cc (Arm_input_section::original_size): New method.
8842 (Arm_input_section::do_addralign): Add a cast.
8843 (Arm_input_section::do_output_offset): Remove static cast.
8844 (Arm_input_section::original_addralign,
8845 Arm_input_section::original_size_): Change type to uint32_t.
8846 (Arm_input_section::init): Add safe casts for section alignment
8847 and size.
8848 (Arm_input_section::set_final_data_size): Do not set address and
8849 offset of stub table.
8850 (Arm_output_section::fix_exidx_coverage): Change use of of
8851 Output_section::Simple_input_section to that of
8852 Output_section::Input_section.
8853 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8854 except for the first pass.
8855 * output.cc (Output_section::get_input_sections): Change type of
8856 input_sections to std::list<Input_section>.
8857 (Output_section::add_script_input_section): Rename from
8858 Output_section::add_simple_input_section. Change type of SIS
8859 parameter from Simple_input_section to Input_section.
8860 * output.h (Output_section::Simple_input_section): Remove class.
8861 (Output_section::Input_section): Change class visibility to public.
8862 (Output_section::Input_section::addralign): Use stored alignments
8863 for special input sections if set.
8864 (Output_section::Input_section::set_addralign): New method.
8865 (Output_section::get_input_sections): Change parameter type from
8866 list of Simple_input_section to list of Input_section.
8867 (Output_section::add_script_input_section): Rename from
8868 Output_section::add_simple_input_section. Change first parameter's
8869 type from Simple_input_section to Input_section and remove the
8870 second and third parameters.
8871 * script-sections.cc (Input_section::Input_section_list): Change
8872 type to list of Output_section::Input_section/
8873 (Input_section_info::Input_section_info): Change parameter type of
8874 INPUT_SECTION to Output_section::Input_section.
8875 (Input_section_info::input_section): Change return type.
8876 (Input_section_info::input_section_): Change type to
8877 Output_section::Input_section.
8878 (Output_section_element_input::set_section_addresses): Adjust code
8879 to use Output_section::Input_section instead of
8880 Output_section::Simple_input_section. Adjust code for renaming
8881 of Output_section::add_simple_input_section.
8882 (Orphan_output_section::set_section_addresses): Ditto.
8883
e1e82ea4
RW
88842010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8885
8886 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8887 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8888
91e75c8a
RÁE
88892010-05-18 Rafael Espindola <espindola@google.com>
8890
8891 * options.cc (General_options::finalize): Handle -nostdlib.
8892 * options.h (nostdlib): New option.
8893 * script.cc (script_add_search_dir): Handle -nostdlib.
8894
da59ad79
DK
88952010-05-12 Doug Kwan <dougkwan@google.com>
8896
8897 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8898 attributes section only if there no attributes section after merging.
8899 (Target_arm::merge_object_attributes): Move value of
e1df38aa 8900 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
8901 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8902 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8903 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8904 and arm_attr_merge_7.stdout.
8905 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8906 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8907 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8908 arm_attr_merge_7b.o): New rules.
8909 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8910 arm_attr_merge_7
8911 * testsuite/Makefile.in: Regenerate.
8912 * testsuite/arm_attr_merge.sh: New file.
8913 * testsuite/arm_attr_merge_[67][ab].s: Same.
8914
3e01a7fd
NC
89152010-05-05 Nick Clifton <nickc@redhat.com>
8916
8917 * po/es.po: Updated Spanish translation.
8918
7ad2014a
L
89192010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8920
8921 * Makefile.am (install-exec-local): Properly install gold as
8922 default cross linker.
8923 * Makefile.in: Regenerated.
8924
4fda8867
NC
89252010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8926 Nick Clifton <nickc@redhat.com>
8927
8928 * configure.ac (install_as_default): Define and set to false
8929 unless --enable-gold or --enable-gold=both/gold has been
8930 specified.
8931 * configure: Regenerate.
8932
8933 * Makefile.am (install-exec-local): Install the executable as
8934 'ld.gold'. If install_as_default is true then also install it as
8935 'ld'.
8936 * Makefile.in: Regenerated.
8937
bd288ea2
ILT
89382010-04-24 Ian Lance Taylor <iant@google.com>
8939
8940 * layout.cc (Layout::layout_reloc): In relocatable link don't
8941 combine reloc sections for grouped sections.
8942
ef38fd8a
ST
89432010-04-23 Sriraman Tallam <tmsriram@google.com>
8944
8945 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8946 sections that are not ordinary to icf.
8947 * icf.cc (get_section_contents): Handle relocation pointing to section
8948 with no object or shndx information.
8949 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8950 * testsuite/Makefile.in: Regenerate.
8951 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8952 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8953
f6973bdc
ILT
89542010-04-22 Ian Lance Taylor <iant@google.com>
8955
8956 * expression.cc (Expression::Expression_eval_info): Add
8957 result_alignment_pointer field.
8958 (Expression::eval_with_dot): Add result_alignment_pointer
8959 parameter. Change all callers.
8960 (Expression::eval_maybe_dot): Likewise.
8961 (class Binary_expression): Add alignment_pointer parameter to
8962 left_value and right_value. Change all callers.
8963 (BINARY_EXPRESSION): Set result alignment.
8964 (class Trinary_expression): Add alignment_pointer parameter to
8965 arg2_value and arg3_value. Change all callers.
8966 (Trinary_cond::value): Set result alignment.
8967 (Max_expression::value, Min_expression::value): Likewise.
8968 (Align_expression::value): Likewise.
8969 * script-sections.cc (class Sections_element): Add dot_alignment
8970 parameter to set_section_addresses virtual function. Update
8971 instantiations.
8972 (class Output_section_element): Likewise.
8973 (Script_sections::create_segments): Add dot_alignment parameter.
8974 Change all callers.
8975 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8976 (Script_sections::set_phdrs_clause_addresses): Likewise.
8977 * script-sections.h: Update declarations.
8978 * script.h: Update declarations.
8979 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8980 min_p_align.
8981 * testsuite/script_test_3.t: Set large alignment.
8982 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8983 segment has expected alignment.
8984
9c9c98a5
NC
89852010-04-22 Nick Clifton <nickc@redhat.com>
8986
8987 * po/gold.pot: Updated by the Translation project.
8988 * po/vi.po: Updated Vietnamese translation.
8989
2253bfba
L
89902010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8991
8992 * testsuite/Makefile.am (check_PROGRAMS): Add
8993 icf_virtual_function_folding_test.
8994 * testsuite/Makefile.in: Regenerated.
8995
85fdf906
AH
89962010-04-15 Andrew Haley <aph@redhat.com>
8997
8998 * options.h (merge_exidx_entries): New option.
8999 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9000 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9001 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9002 (Target_arm::merge_exidx_entries): New function.
9003 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9004 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9005 to Arm_exidx_fixup constructor.
9006 Add new arg, merge_exidx_entries.
9007 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9008 Arm_output_section::fix_exidx_coverage.
9009
ce97fa81
ST
90102010-04-18 Sriraman Tallam <tmsriram@google.com>
9011
9012 * icf.cc (get_section_contents): Check for preemptible functions.
9013 Ignore addend when appropriate.
9014 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9015 section folded.
9016 (add_from_relobj): Check for section folded.
9017 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9018 * symtab.h (should_add_dynsym_entry): Add new parameter.
9019 * target-reloc.h (scan_relocs): Check for section folded.
9020 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9021 Check reloc types for function pointers in shared objects.
9022 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9023 case.
9024 (icf_preemptible_functions_test): New test case.
9025 (icf_string_merge_test): New test case.
9026 * testsuite.Makefile.in: Regenerate.
9027 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9028 bar_glob. Refactor code.
9029 * testsuite/icf_preemptible_functions_test.cc: New file.
9030 * testsuite/icf_preemptible_functions_test.sh: New file.
9031 * testsuite/icf_string_merge_test.cc: New file.
9032 * testsuite/icf_string_merge_test.sh: New file.
9033 * testsuite/icf_virtual_function_folding_test.cc: New file.
9034 * testsuite/icf_virtual_function_folding_test.sh: New file.
9035
04ceb17c
DK
90362010-04-14 Doug Kwan <dougkwan@google.com>
9037
9038 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
9039 for local symbol recounting if we remove a section due to ICF.
9040 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
9041 there are no regular objects in input.
9042
153e7da4
DK
90432010-04-13 Doug Kwan <dougkwan@google.com>
9044
9045 * arm.cc (Arm_input_section::set_final_data_size): Compute
9046 accurate final data size instead of using current data size.
9047
4dbd9faf
DK
90482010-04-09 Doug Kwan <dougkwan@google.com>
9049
9050 * layout.cc (Layout::choose_output_section): Handle script section
9051 types.
9052 (Layout::make_output_section_for_script): Add section type parameter.
9053 Handle script section types.
9054 * layout.h (Layout::make_output_section_for_script): Add section
9055 type parameter.
9056 * output.cc (Output_section::Output_section): Initialize data member
9057 is_noload_.
9058 (Output_section::do_reset_address_and_file_offset): Do not set address
9059 to 0 if section is a NOLOAD section.
9060 * output.h (Output_section::is_noload): New method.
9061 (Output_section::set_is_noload): Ditto.
9062 (Output_section::is_noload_): New data member.
9063 * script-c.h (Script_section_type): New enum type.
9064 (struct Parser_output_section_header): Add new file section_type.
9065 * script-sections.cc (Sections_element::output_section_name): Add
9066 parameter for returning script section type.
9067 (Output_section_definition::output_section_name): Ditto.
9068 (Output_section_definition::section_type)P; New method.
9069 (Output_section_definiton::script_section_type_name): Ditto.
9070 (Output_section_definition::script_section_type_): New data member.
9071 (Output_section_definition::Output_section_definition): Initialize
9072 data member Output_section_definition::script_section_type_.
9073 (Output_section_definition::create_sections): Pass script section type
9074 to Layout::make_output_section_for_script.
9075 (Output_section_definition::output_section_name): Return script
9076 section type to caller.
9077 (Output_section_definition::set_section_address): Do not advance
9078 dot value and load address if section type is NOLOAD. Set address
9079 of NOLOAD sections regardless of section flags.
9080 (Output_section_definition::print): Print section type if it is
9081 not SCRIPT_SECTION_TYPE_NONE.
9082 (Output_section_definition::section_type): New method.
9083 (Output_section_definition::script_section_type_name): Ditto.
9084 (Script_sections::output_section_name): Add new parameter
9085 PSECTION_TYPE for returning script section type. Pass it to
9086 section elements. Handle discard sections.
9087 (Sort_output_sections::operator()): Handle NOLOAD sections.
9088 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 9089 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
9090 returning script section type.
9091 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
9092 INFO and NOLOAD.
9093 * yyscript.y (union): Add new field SECTION_TYPE.
9094 (COPY, DSECT, INFO, NOLOAD): New tokens.
9095 (opt_address_and_section_type): Change type to output_section_header.
9096 (section_type): New non-terminal
9097 (section_header): Handle section type.
2253bfba 9098 (opt_address_and_section_type): Return section type value.
4dbd9faf 9099
721ea635
L
91002010-04-09 H.J. Lu <hongjiu.lu@intel.com>
9101
9102 * testsuite/plugin_common_test_1.c (foo): Add prototype.
9103 * testsuite/plugin_common_test_2.c (foo): Likewise.
9104
6bf924b0
DK
91052010-04-08 Doug Kwan <dougkwan@google.com>
9106
9107 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
9108 Output_merge_data.
9109 * output.cc (Output_section::add_merge_input_section): Simplify
9110 code and return status of Output_merge_base::add_input_section.
e1df38aa 9111 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
9112 returns true.
9113
24af6f92
DK
91142010-04-07 Doug Kwan <dougkwan@google.com>
9115
9116 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9117 if section is marked as containing instructions but has no mapping
9118 symbols.
9119 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9120 correct section index.
9121 (Arm_relobj::find_linked_text_section): Ditto.
9122
00698fc5
CC
91232010-04-07 Cary Coutant <ccoutant@google.com>
9124
9125 * archive.cc (include_member): Destroy Read_symbols_data object before
9126 releasing file.
9127 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9128 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9129 (Read_symbols_data::~Read_symbols_data) New destructor.
9130 (Section_relocs::Section_relocs) New constructor.
9131 (Section_relocs::~Section_relocs) New destructor.
9132 (Read_relocs_data::Read_relocs_data) New constructor.
9133 (Read_relocs_data::~Read_relocs_data) New destructor.
9134 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9135 pointers to NULL after deleting.
9136
7296d933
DK
91372010-04-07 Doug Kwan <dougkwan@google.com>
9138
9139 * arm.cc: Replace "endianity" with "endianness" in comments.
9140 (Arm_exidx_cantunwind): Ditto.
9141 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9142 (Arm_relobj::merge_flags_and_attributes): New method.
9143 (Arm_relobj::merge_flags_and_attributes_): New data member.
9144 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9145 (Arm_relobj::scan_sections_for_stubs): Ditto.
9146 (Arm_relobj::do_read_symbols): Check to see if we really want to
9147 merge processor-specific flags and attributes. Exit early if
9148 an object is empty except for section names and the undefined symbol.
9149 (Target_arm::do_finalize_sections): Move check for ELF format to
9150 Arm_relobj::do_read_symbols. Merge processor specific flags and
9151 attributes from a regular object only when we have determined that
9152 it is aapropriate. Do not create an .ARM.attributes section in
9153 output if there is no regular input object.
9154 (Target_arm::merge_processor_specific_flags): Check
9155 --warn-mismatch before printing any error.
9156 (Target_arm::merge_object_attributes): Ditto.
9157 * gold.cc (queue_middle_tasks): Handle the case in which there is
9158 no regular object in input.
9159 * options.cc (General_options::parse_EB): New method.
9160 (General_options::parse_EL): Same.
9161 (General_options::General_options): Initialize endianness_.
9162 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9163 New options.
9164 (General_options::Endianness): New enum.
9165 (General_options::endianness): New method.
9166 (General_options::endianness_): New data member.
9167 * parameters.cc (Parameters::set_options): Check target endianness.
9168 (Parameters::set_target_once): Ditto.
9169 (Parameters::check_target_endianness): New method.
9170 (parameters_force_valid_target): If either -EL or -EB is specified,
9171 use it to define endianness of default target.
9172 * parameters.h (Parameters::check_target_endianness): New method
9173 declaration.
9174 * target.h (class Target): Change "endianity" to "endianness"
9175 in comments.
9176
efc8d4f2
RW
91772010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9178
9179 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9180 * configure: Regenerate.
9181 * Makefile.in: Regenerate.
9182 * testsuite/Makefile.in: Regenerate.
9183
be234d88
CC
91842010-04-06 Cary Coutant <ccoutant@google.com>
9185
9186 gcc PR lto/42757
9187 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9188 prevailing definitions of common symbols.
9189 * testsuite/plugin_test_6.sh: New test case.
9190 * testsuite/plugin_common_test_1.c: New test case.
9191 * testsuite/plugin_common_test_2.c: New test case.
9192 * testsuite/Makefile.am (plugin_test_6): New test case.
9193 * testsuite/Makefile.in: Regenerate.
9194
bd32c6bd
NC
91952010-04-06 Nick Clifton <nickc@redhat.com>
9196
9197 * po/vi.po: New Vietnamese translation.
9198
323c532f
DK
91992010-03-30 Doug Kwan <dougkwan@google.com>
9200
9201 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9202
4fcd97eb
DK
92032010-03-25 Doug Kwan <dougkwan@google.com>
9204
9205 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9206 to avoid a conversion warning on a 32-bit host.
9207
4ebf39db
ILT
92082010-03-24 Ian Lance Taylor <iant@google.com>
9209
9210 * testsuite/script_test_3.t: Add a TLS segment.
9211 * testsuite/Makefile.am (check_PROGRAMS): Add
9212 tls_phdrs_script_test.
9213 (tls_phdrs_script_test_SOURCES): Define.
9214 (tls_phdrs_script_test_DEPENDENCIES): Define.
9215 (tls_phdrs_script_test_LDFLAGS): Define.
9216 (tls_phdrs_script_test_LDADD): Define.
9217 * testsuite/Makefile.in: Rebuild.
9218
4a599bdd
CC
92192010-03-23 Cary Coutant <ccoutant@google.com>
9220
9221 * fileread.cc (find_or_make_view): Fix comment.
9222
6c93b22c
ILT
92232010-03-23 Ian Lance Taylor <iant@google.com>
9224
9225 * script-sections.cc (class Orphan_section_placement): Define
9226 PLACE_TLS and PLACE_TLS_BSS.
9227 (Orphan_section_placement::Orphan_section_placement): Initialize
9228 new places.
9229 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9230 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9231 (tls_script_test_SOURCES): Define.
9232 (tls_script_test_DEPENDENCIES): Define.
9233 (tls_script_test_LDFLAGS): Define.
9234 (tls_script_test_LDADD): Define.
9235 * testsuite/Makefile.in: Rebuild.
9236
a2c7281b
DK
92372010-03-22 Doug Kwan <dougkwan@google.com>
9238
9239 * arm.cc (Arm_relocate_functions::abs8,
9240 Arm_relocate_functions::abs16): Use correct check for overflow
9241 specified in the ARM ELF specs.
9242 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9243 target of a BLX instruction specially.
9244 (Reloc_stub::stub_type_for_reloc): Ditto.
9245 (Relocate::relocate): Use symbolic names instead of numeric relocation
9246 codes to report error.
9247 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9248 workaround.
9249 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9250 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9251 thumb2_blx_out_of_range.stdout
9252 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9253 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9254 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9255 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9256 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9257 thumb2_blx_in_range, thumb2_blx_in_range.o,
9258 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9259 thumb2_blx_out_of_range.o): New rules.
2e702c99 9260 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
9261 thumb2_blx_in_range and thumb2_blx_out_of_range.
9262 * testsuite/Makefile.in: Regenerate.
9263 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9264 * testsuite/thumb_blx_in_range.s: New file.
9265 * testsuite/thumb_blx_out_of_range.s: New file.
9266
b0193076
RÁE
92672010-03-22 Rafael Espindola <espindola@google.com>
9268
9269 * archive.cc (Should_include): Move to archive.h.
9270 (should_include_member): Make it a member of Archive.
9271 (Lib_group): New.
9272 (Add_lib_group_symbols): New.
9273 * archive.h: Include options.h.
9274 (Archive_member): Moved from Archive.
9275 (Should_include): Moved from archive.cc.
9276 (Lib_group): New.
9277 (Add_lib_group_symbols): New.
9278 * dynobj.cc (do_should_include_member): New.
9279 * dynobj.h (do_should_include_member): New.
9280 * gold.cc (queue_initial_tasks): Update call to queue.
9281 * main.cc (main): Print lib group stats.
9282 * object.cc (do_should_include_member): New.
9283 * object.h: Include archive.h.
9284 (Object::should_include_member): New.
9285 (Object::do_should_include_member): New.
9286 (Sized_relobj::do_should_include_member): New.
9287 * options.cc (General_options::parse_start_lib): New.
9288 (General_options::parse_end_lib): New.
9289 (Input_arguments::add_file): Handle lib groups.
9290 (Input_arguments::start_group): Check we are not in a lib.
9291 (Input_arguments::start_lib): New.
9292 (Input_arguments::end_lib): New.
9293 * options.h (General_options): Add start_lib and end_lib.
9294 (Input_argument::lib_): New.
9295 (Input_argument::lib): New.
9296 (Input_argument::is_lib): New.
9297 (Input_file_lib): New.
9298 (Input_arguments::in_lib_): New.
9299 (Input_arguments::in_lib): New.
9300 (Input_arguments::start_lib): New.
9301 (Input_arguments::end_lib_): New.
9302 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9303 in unused members as preempted.
9304 (Sized_pluginobj::do_should_include_member): New.
9305 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9306 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9307 return the blocker.
9308 (Read_symbols::do_whole_lib_group): New.
9309 (Read_symbols::do_lib_group): New.
9310 (Read_symbols::do_read_symbols): Handle lib groups.
9311 (Read_symbols::get_name): Handle lib groups.
9312 * readsyms.h (Read_symbols): Add an archive member pointer.
9313 (Read_symbols::do_whole_lib_group): New.
9314 (Read_symbols::do_lib_group): New.
9315 (Read_symbols::member_): New.
9316 * script.cc (read_input_script): Update call to queue_soon.
9317
d099120c
DK
93182010-03-19 Doug Kwan <dougkwan@google.com>
9319
9320 * arm.cc (Stub_table::Stub_table): Initialize new data members
9321 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9322 (Stub_table::add_reloc_stub): Assign stub offset and update
9323 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9324 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9325 New data members.
2e702c99 9326 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9327 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9328 instead of going over all reloc stubs.
2e702c99 9329 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9330 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9331 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9332 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9333 Stringpool_template::offset_.
9334 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9335 Stringpool_template::offset_ to zero.
9336
1aa37384
DK
93372010-03-15 Doug Kwan <dougkwan@google.com>
9338
9339 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9340 offset_.
9341 (Stringpool_template::new_key_offset): New method.
9342 (Stringpool_template::add_string): Assign offsets when adding new
9343 strings.
9344 (Stringpool_template::set_string_offsets): Do not set string offsets
9345 when not optimizing.
9346 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9347 member size_.
2e702c99
RM
9348 (Chunked_vector::clear): Clear size_.
9349 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9350 (Chunked_vector::size): Return size_.
9351 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9352 (Chunked_vector::size_): New data member.
1aa37384
DK
9353 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9354 (Stringpool_template::new_key_offset): New method declaration.
9355 (Stringpool_template::offset_): New data member.
9356
b672b057
RÁE
93572010-03-15 Rafael Espindola <espindola@google.com>
9358
9359 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9360 Add_symbols' constructor.
9361 * readsyms.h (Add_symbols): Remove the input_group member.
9362
b6848d3c
ILT
93632010-03-10 Ian Lance Taylor <iant@google.com>
9364
9365 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9366 target to ask whether a reference to a symbol requires a stack
9367 split.
9368 * target.h (Target::is_call_to_non_split): New function.
9369 (Target::do_is_call_to_non_split): Declare virtual function.
9370 * target.cc: Include "symtab.h".
9371 (Target::do_is_call_to_non_split): New function.
9372 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9373
a2a5469e
CC
93742010-03-10 Cary Coutant <ccoutant@google.com>
9375
9376 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9377 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9378 (File_read::open[2]): Add whole_file_view_ to list of views.
9379 (File_read::make_view): Remove test of whole_file_view_.
9380 (File_read::find_or_make_view): Create whole_file_view_ if
9381 necessary.
9382 (File_read::clear_views): Replace bool parameter with enum;
9383 adjust all callers. Don't delete views with permanent data;
9384 do delete cached views and views from archives if
9385 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9386 if clearing the corresponding view.
9387 * fileread.h (File_read::Clear_views_mode): New enum.
9388 (File_read::View::is_permanent_view): New method.
9389 (File_read::clear_views): Replace bool parameter
9390 with enum; adjust all callers.
9391 * options.h (General_options): Change keep_files_mapped option;
9392 add map_whole_files.
9393 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9394 releasing the file.
9395 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9396 the file.
9397
8861f32b
DM
93982010-03-10 David S. Miller <davem@davemloft.net>
9399
9400 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9401
d62d0f5f
ST
94022010-03-09 Sriraman Tallam <tmsriram@google.com>
9403
9404 * icf.cc (get_section_contents): Add '@' marker after processing the
9405 merge reloc.
9406
9177756d
DK
94072010-03-08 Doug Kwan <dougkwan@google.com>
9408
9409 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9410 due to a conversion warning.
9411 (Arm_relobj::update_output_local_symbol_count): Check for local
9412 symbol with unset output index.
9413
9e9e071b
ILT
94142010-03-05 Ian Lance Taylor <iant@google.com>
9415
9416 * options.h (class General_options): Add --spare-dynamic-tags.
9417 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9418 --spare-dynamic-tags.
9419
a81ee015
ILT
94202010-03-05 Ian Lance Taylor <iant@google.com>
9421
9422 * incremental.cc: Include "libiberty.h".
9423
44ec90b9
RO
94242010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9425
9426 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9427 function, is_info_ member.
9428 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9429 (Versions::Versions): Update caller.
9430 (Versions::define_base_version): Likewise.
9431 (Versions::add_def): Likewise.
9432
0897ed3b
ST
94332010-03-03 Sriraman Tallam <tmsriram@google.com>
9434
9435 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9436 (Scan::possible_function_pointer_reloc): New function.
9437 (Scan::local_reloc_may_be_function_pointer): Change to call
9438 possible_function_pointer_reloc.
9439 (Scan::global_reloc_may_be_function_pointer): Ditto.
9440 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9441 relocations in ".data.rel.ro._ZTV" section.
9442 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9443 * testsuite/icf_safe_so_test.cc: Ditto.
9444 * testsuite/icf_safe_test.cc: Ditto.
9445 * testsuite/icf_safe_test.sh: Ditto.
9446
d3bbad62
ILT
94472010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9448 Ian Lance Taylor <iant@google.com>
9449
9450 * target-reloc.h (relocate_section): Check the symbol table index
9451 for -1U before setting the local symbol index.
9452 (scan_relocatable_relocs): If copying the relocation, record that
9453 the local symbol is required.
9454 * object.h (Symbol_value::is_output_symtab_index_set): New
9455 function.
9456 (Symbol_value::may_be_discarded_from_output_symtab): New
9457 function.
9458 (Symbol_value::has_output_symtab_entry): New function.
9459 (Symbol_value::needs_output_symtab_entry): Remove.
9460 (Symbol_value::output_symtab_index): Make sure the symbol index is
9461 set.
9462 (Symbol_value::set_output_symtab_index): Make sure the symbol
9463 index is not set. Make sure the new index is valid.
9464 (Symbol_value::set_must_have_output_symtab_entry): New function.
9465 (Symbol_value::has_output_dynsym_entry): New function.
9466 (Symbol_value::set_output_dynsym_index): Make sure the new index
9467 is valid.
9468 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9469 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9470 local symbol if permitted.
9471 (Sized_relobj::do_finalize_local_symbols): Call
9472 is_output_symtab_index_set rather than needs_output_symtab_entry.
9473 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9474 rather than needs_output_symtab_entry. Call
9475 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9476 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9477 is_output_symtab_index_set rather than needs_output_symtab_entry.
9478 * testsuite/discard_locals_relocatable_test.c: New file.
9479 * testsuite/discard_locals_test.sh: Test -r.
9480 * testsuite/Makefile.am (check_DATA): Add
9481 discard_locals_relocatable_test1.syms,
9482 discard_local_relocatable_test2.syms.
9483 (MOSTLYCLEANFILES): Likewise. Also add
9484 discard_locals_relocatable_test1.lout and
9485 discard_locals_relocatable_test2.out.
9486 (discard_locals_relocatable_test1.syms): New target.
9487 (discard_locals_relocatable_test.o): New target.
9488 (discard_locals_relocatable_test1.out): New target.
9489 (discard_locals_relocatable_test2.syms): New target.
9490 (discard_locals_relocatable_test2.out): New target.
9491 (various): Add missing ../ld-new dependencies.
9492 * testsuite/Makefile.in: Rebuild.
9493
7e8ccf26
NC
94942010-03-03 Nick Clifton <nickc@redhat.com>
9495
9496 * po/fi.po: New Finnish translation.
9497
2a0ff005
DK
94982010-03-01 Doug Kwan <dougkwan@google.com>
9499
9500 * layout.cc (Layout::Layout): Force section types of .init_array*,
9501 .preinit_array* and .fini_array* sections.
9502 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9503 Fix check of return value of std::string::find.().
9504 (Output_section::Input_section_sort_compare::operator()): Remove
9505 comment about .init_array.
9506 (Output_section::Input_section_sort_init_fini_compare::operator()):
9507 New method.
9508 (Output_section::sort_attached_input_sections): Handle .init_array
9509 and .fini_array specially.
9510 * output.h (Output_section::Inut_section_sort_compare): Update
9511 comment.
9512 (Output_section::Input_section_sort_init_fini_compare): New struct.
9513
c3e4ae29
DK
95142010-02-26 Doug Kwan <dougkwan@google.com>
9515
9516 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9517 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9518 * testsuite/debug_msg.sh: Avoid matching source line number for
9519 use of global variable undef_int.
9520
2fd9ae7a
DK
95212010-02-26 Doug Kwan <dougkwan@google.com>
9522
9523 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9524 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9525 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9526 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9527 * options.cc (General_options::General_options): Initialize member
9528 fix_v4bx_.
9529 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9530 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9531 and rm_no_fix_v4bx.stdout
9532 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9533 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9534 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9535 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9536 and arm_no_fix_v4bx.
9537 * Makefile.in: Regenerate.
9538 * testsuite/arm_fix_v4bx.s: New file.
9539 * testsuite/arm_fix_v4bx.sh: Ditto.
9540
67ec7d0b
DK
95412010-02-24 Doug Kwan <dougkwan@google.com>
9542
9543 * arm.cc (Target_arm::got_section): Make the .got section the first
9544 non RELRO section in the data segment.
9545 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9546 suffixes of section names.
9547
10165461
DK
95482010-02-24 Doug Kwan <dougkwan@google.com>
9549
9550 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9551 flags and attributes merging if an input file is a binary file.
9552 * fileread.cc (Input_file::open): Record format of original file.
9553 * fileread.h (Input_file::Format): New enum type.
2e702c99 9554 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9555 (Input_file::format): New method definition.
9556 (Input_file::format_):: New data member.
9557
4a54abbb
DK
95582010-02-24 Doug Kwan <dougkwan@google.com>
9559
9560 * arm.cc (Arm_output_data_got): New class.
9561 (ARM_TCB_SIZE): New constant
9562 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9563 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9564 If user uses a script with a SECTIONS clause, issue only a warning
9565 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9566 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9567 garbage collection.
9568 (Target_arm::got_mode_index_entry): Handle static linking.
9569 (Target_arm::Scan::local): Ditto.
9570 (Target_arm::Scan::global): Ditto.
9571 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9572 all incorrectly implemented relocations.
e1df38aa 9573 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
9574 Arm_output_section::fix_exidx_coverage.
9575 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9576 from ".ARM.exidx." and ".ARM.extab.".
9577
ca419a6f
ILT
95782010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9579
9580 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9581 section if it does not already exist.
9582 * attributes.cc (Attributes_section_data::Attributes_section_data):
9583 Don't crash if size is zero.
9584
135b9c78
ILT
95852010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9586 Ian Lance Taylor <iant@google.com>
9587
9588 * gold.cc (queue_middle_tasks): If no input files were opened,
9589 exit.
9590 * workqueue.h (Task_function::Task_function): Assert that there is
9591 a blocker.
9592
bb0bfe4f
DK
95932010-02-22 Doug Kwan <dougkwan@google.com>
9594
9595 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9596 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9597 types to avoid warnings due to different uint64_t implementations
9598 on different hosts.
9599
2a2b6d42
DK
96002010-02-21 Doug Kwan <dougkwan@google.com>
9601
9602 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9603 handling of the maximum backward branch offset.
2e702c99 9604 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
9605 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9606 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 9607 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
9608 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9609 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9610 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9611 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9612 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9613 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9614 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9615 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9616 thumb2_bl_out_of_range.o): New rules.
9617 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9618 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9619 thumb2_bl_out_of_range
9620 * testsuite/Makefile.in: Regenerate.
9621 * testsuite/arm_bl_in_range.s: New file.
9622 * testsuite/arm_bl_out_of_range.s: Ditto.
9623 * testsuite/arm_branch_in_range.sh: Ditto.
9624 * testsuite/arm_branch_range.t: Ditto.
9625 * testsuite/thumb2_branch_range.t: Ditto.
9626 * testsuite/thumb_bl_in_range.s: Ditto.
9627 * testsuite/thumb_bl_out_of_range.s: Ditto.
9628 * testsuite/thumb_branch_range.t: Ditto.
9629
b487ad64
ST
96302010-02-20 Sriraman Tallam <tmsriram@google.com>
9631
9632 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9633 Add reloc offset information.
9634 * icf.cc (get_section_contents): Change iterators to point to the new
9635 vectors. Add reloc offset information to the contents.
9636 * icf.h (Icf::Sections_reachable_info): New typedef.
9637 (Icf::Sections_reachable_list): New typedef.
9638 (Icf::Offset_info): New typedef.
9639 (Icf::Reloc_info): New struct typedef.
9640 (Icf::Reloc_info_list): New typedef.
9641 (Icf::symbol_reloc_list): Delete method.
9642 (Icf::addend_reloc_list): Delete method.
9643 (Icf::section_reloc_list): Delete method.
9644 (Icf::reloc_info_list): New method.
9645 (Icf::reloc_info_list_): New member.
9646
f96accdf
DK
96472010-02-19 Doug Kwan <dougkwan@google.com>
9648
9649 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9650 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9651 * arm.cc (Arm_relocation_functions): New forward declaration.
9652 (Target_arm::Target_arm): Initialize new data members
9653 got_mod_index_offset_ and tls_base_symbol_defined_.
9654 (Target_arm::Relocate::relocate_tls): New method.
9655 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9656 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9657 New methods.
2e702c99 9658 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
9659 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9660 (Target_arm::got_mod_index_offset_,
9661 Target_arm::tls_base_symbol_defined_): New data members.
9662 (Target_arm::Scan::local, Target::Scan::global,
9663 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9664 relocations.
9665
c8761b9a
DK
96662010-02-18 Doug Kwan <dougkwan@google.com>
9667
9668 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9669 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9670 text section as a parameter becuase some broken tools may not set
9671 the link in section header.
9672 (Target_arm::has_got_section): New method.
9673 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9674 without any mapping symbol as data only. Remove warning.
9675 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9676 link in its section header, try to discover the link by inspecting the
9677 REL31 relocation at the beginning of the section.
9678 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9679 in error message.
9680 (Target_arm::Scan::global): Treat any reference to the symbol
9681 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9682
21bb3914
ST
96832010-02-12 Sriraman Tallam <tmsriram@google.com>
9684
9685 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9686 (Scan::global_reloc_may_be_function_pointer): New function.
9687 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9688 (Scan::global_reloc_may_be_function_pointer): New function.
9689 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9690 (Scan::global_reloc_may_be_function_pointer): New function.
9691 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9692 (Scan::global_reloc_may_be_function_pointer): New function.
9693 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9694 (Scan::global_reloc_may_be_function_pointer): New function.
9695 (Scan::possible_function_pointer_reloc): New function.
9696 (Target_x86_64::can_check_for_function_pointers): New function.
9697 * gc.h (gc_process_relocs): Scan relocation types to determine if
9698 function pointers were taken for targets that support it.
9699 * icf.cc (Icf::find_identical_sections): Include functions for
9700 folding in safe ICF whose pointer is not taken.
9701 * icf.h (Secn_fptr_taken_set): New typedef.
9702 (fptr_section_id_): New member.
9703 (section_has_function_pointers): New function.
9704 (set_section_has_function_pointers): New function.
9705 (check_section_for_function_pointers): New function.
9706 * options.h: Fix comment for safe ICF option.
9707 * target.h (can_check_for_function_pointers): New function.
9708 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9709 Modify icf_safe_test for X86-64.
9710 * testsuite/Makefile.in: Regenerate.
9711 * testsuite/icf_safe_so_test.cc: New file.
9712 * testsuite/icf_safe_so_test.sh: New file.
9713 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9714 (main): Change to take pointer to function kept_func_3.
9715 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9716 folding is done correctly for X86-64.
9717
0da6fa6c
DM
97182010-02-12 David S. Miller <davem@davemloft.net>
9719
9720 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9721 is_symbolless parameter.
9722 (Output_reloc<SHT_REL>::is_symbolless): New.
9723 (Output_reloc<SHT_REL>::is_symbolless_): New.
9724 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9725 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9726 (Output_reloc<SHT_RELA>::is_symbolless): New.
9727 (Output_data_reloc::add_global): Handle is_symbolless.
9728 (Output_data_reloc::add_global_relative): Likewise.
9729 (Output_data_reloc::add_local): Likewise.
9730 (Output_data_reloc::add_local_relative): Likewise.
9731 (Output_data_reloc::add_symbolless_global_addend): New.
9732 (Output_data_reloc::add_symbolless_local_addend): New.
9733 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9734 is_symbolless.
9735 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9736 instead of ->is_relative_
9737 (Output_reloc::write): Likewise.
9738 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9739 (Output_reloc::write_rel): Simplify.
9740
9741 * sparc.cc (Target_sparc::Scan::local): Use
9742 ->add_symbolless_local_addend as needed.
9743 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9744 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9745 based upon relocation offset.
9746
e4782e83
DK
97472010-02-11 Doug Kwan <dougkwan@google.com>
9748
9749 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9750 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9751 beginning of function.
9752 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9753 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9754 parameter is_32bit in calls to should_apply_static_reloc.
9755 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9756 (check_DATA): Add arm_abs_global.stdout.
9757 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9758 arm_abs_global.stdout): New rules.
9759 (MOSTLLYCLEANFILES): Add arm_abs_global
9760 * Makefile.in: Regenerate.
9761 * testsuite/arm_abs_global.s: New file.
9762 * testsuite/arm_abs_global.sh: Ditto.
9763 * testsuite/arm_abs_lib.s: Ditto.
9764
93ceb764
ILT
97652010-02-11 Ian Lance Taylor <iant@google.com>
9766
9767 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9768 Read_relocs task.
9769 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9770 Allocate_commons_task first.
9771 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9772 task, rather than symtab_lock_.
9773 (Gc_process_relocs::~Gc_process_relocs): New function.
9774 (Gc_process_relocs::is_runnable): Check this_blocker_.
9775 (Gc_process_relocs::locks): Use next_blocker_ rather than
9776 blocker_.
9777 (Scan_relocs::~Scan_relocs): New function.
9778 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9779 symtab_lock_.
9780 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9781 next_blocker_.
9782 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9783 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9784 constructor accordingly.
9785 (class Gc_process_relocs): Likewise.
9786 (class Scan_relocs): Likewise.
9787 * common.h (class Allocate_commons_task): Remove symtab_lock_
9788 field, and corresponding constructor parameter.
9789 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9790 symtab_lock_.
9791 (Allocate_commons_task::locks): Likewise.
9792
114dfbe1
ILT
97932010-02-11 Ian Lance Taylor <iant@google.com>
9794
9795 * gold-threads.h (class Once): Define.
9796 (class Initialize_lock): Rewrite as child of Once.
9797 * gold-threads.cc (class Once_initialize): Define.
9798 (once_pointer_control): New static variable.
9799 (once_pointer, once_arg): New static variables.
9800 (c_run_once): New static function.
9801 (Once::Once, Once::run_once, Once::internal_run): New functions.
9802 (class Initialize_lock_once): Remove.
9803 (initialize_lock_control): Remove.
9804 (initialize_lock_pointer): Remove.
9805 (initialize_lock_once): Remove.
9806 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9807 (Initialize_lock::initialize): Rewrite.
9808 (Initialize_lock::do_run_once): New function.
9809 * archive.cc (Archive::interpret_header): Only clear name if it is
9810 not already empty.
9811 * fileread.cc: Include "gold-threads.h"
9812 (file_counts_lock): New static variable.
9813 (file_counts_initialize_lock): Likewise.
9814 (File_read::release): Only increment counts when using --stats.
9815 Use a lock around the increment.
9816 * parameters.cc (class Set_parameters_target_once): Define.
9817 (set_parameters_target_once): New static variable.
9818 (Parameters::Parameters): Move here from parameters.h.
9819 (Parameters::set_target): Rewrite.
9820 (Parameters::set_target_once): New function.
9821 (Parameters::clear_target): Move here and rewrite.
9822 * parameters.h (class Parameters): Update declarations. Add
9823 set_parameters_target_once_ field.
9824 (Parameters::Parameters): Move to parameters.cc.
9825 (Parameters::clear_target): Likewise.
9826 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9827 task.
9828 (Start_group::~Start_group): New function.
9829 (Start_group::is_runnable): New function.
9830 (Start_group::locks, Start_group::run): New functions.
9831 (Finish_group::run): Change saw_undefined to size_t.
9832 * readsyms.h (class Start_group): Define.
9833 (class Finish_group): Change saw_undefined_ field to size_t.
9834 (Finish_group::Finish_group): Remove saw_undefined and
9835 this_blocker parameters. Change all callers.
9836 (Finish_group::set_saw_undefined): New function.
9837 (Finish_group::set_blocker): New function.
9838 * symtab.h (class Symbol_table): Change saw_undefined to return
9839 size_t. Change saw_undefined_ field to size_t.
9840 * target-select.cc (Set_target_once::do_run_once): New function.
9841 (Target_selector::Target_selector): Initialize set_target_once_
9842 field. Don't initialize lock_ and initialize_lock_ fields.
9843 (Target_selector::instantiate_target): Rewrite.
9844 (Target_selector::set_target): New function.
9845 * target-select.h (class Set_target_once): Define.
9846 (class Target_selector): Update declarations. Make
9847 Set_target_once a friend. Remove lock_ and initialize_lock_
9848 fields. Add set_target_once_ field.
9849
fa17a3f4
ILT
98502010-02-10 Ian Lance Taylor <iant@google.com>
9851
9852 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9853 queueing any tasks.
9854 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9855 (queue_middle_tasks): Add all blockers before queueing any tasks.
9856 (queue_final_tasks): Likewise.
9857 * token.h (Task_token::add_blockers): New function.
9858 * object.h (Input_objects::number_of_relobjs): New function.
9859
c7177d31
ILT
98602010-02-10 Ian Lance Taylor <iant@google.com>
9861
5de0e392
ILT
9862 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9863 shared, not if not position independent.
9864 * x86_64.cc (Relocate::relocate_tls): Likewise.
9865 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9866 (tls_pie_pic_test): New target.
9867 * testsuite/Makefile.in: Rebuild.
9868
c7177d31
ILT
9869 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9870 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9871 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9872 * testsuite/Makefile.in: Rebuild.
9873
684b268a
DM
98742010-02-09 David S. Miller <davem@davemloft.net>
9875
9876 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9877 R_SPARC_RELATIVE using ->add_local_relative().
9878 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9879
612a8d3d
DM
9880 * output.h (Output_data_dynamic::add_section_size): New method
9881 that takes two Output_data objects.
9882 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9883 entry param. Handle it in initializers.
9884 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9885 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9886 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9887 arg.
9888 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9889 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9890 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9891 for dynrel_includes_plt.
9892 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9893 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9894 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9895 before .rela.plt
9896 (Target_sparc::do_finalize_sections): Update to pass true for
9897 dynrel_includes_plt.
9898 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9899 output before .rela.plt
9900 (Target_powerpc::do_finalize_sections): Update to pass true for
9901 dynrel_includes_plt when 32-bit.
9902
cb1be87e
DK
99032010-02-08 Doug Kwan <dougkwan@google.com>
9904
9905 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9906 method.
9907 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9908 Arm_relobj::scan_section_for_cortex_a8_stubs,
9909 Arm_relobj::do_relocation_section): Instead of calling
9910 Output_section::output_address, use faster
9911 Arm_relobj::simple_input_section_output_address.
9912
705b5121
DM
99132010-02-08 David S. Miller <davem@davemloft.net>
9914
9915 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9916 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9917 relocation helper function.
9918
024c4466
DM
9919 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9920 just like R_SPARC_GOT{10,13,22}.
9921 (Target_sparc::Scan::local): Likewise.
9922 (Target_sparc::Relocate:relocate): Likewise.
9923
9109c078
ILT
99242010-02-06 Ian Lance Taylor <iant@google.com>
9925
9926 * configure.ac: Rewrite targetobjs duplicate removal code to use
9927 only shell constructs.
9928 * configure: Rebuild.
9929
cf846138
DK
99302010-02-05 Doug Kwan <dougkwan@google.com>
9931
9932 PR 11247
9933 * arm.cc (Arm_relobj::section_is_scannable): New method.
9934 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9935 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9936
6cfaf60b
DK
99372010-02-04 Doug Kwan <dougkwan@google.com>
9938
9939 PR 11247
9940 * arm-reloc-property.cc (cstdio): Include.
9941 * configure.ac (targetobjs): Remove duplicates.
9942 * configure: Regenerate.
9943 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9944 big and little endian version for a given address size.
9945
5c57f1be
DK
99462010-02-03 Doug Kwan <dougkwan@google.com>
9947
9948 * arm-reloc-property.cc
9949 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9950 definition.
9951 * arm-reloc-property.h
9952 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9953 New method definition.
9954 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9955 declaration.
9956 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9957 overflow to N.
9958 (GOT_PREL): Change implemented to Y.
9959 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9960 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9961 (Arm_relocate_functions::movw_abs_nc): Remove method.
9962 (Arm_relocate_functions::movt_abs): Ditto.
9963 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9964 (Arm_relocate_functions::thm_movt_abs): Ditto.
9965 (Arm_relocate_functions::movw_rel_nc): Ditto.
9966 (Arm_relocate_functions::movw_rel): Ditto.
9967 (Arm_relocate_functions::movt_rel): Ditto.
9968 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9969 (Arm_relocate_functions:thm_movw_rel): Ditto.
9970 (Arm_relocate_functions:thm_movt_rel): Ditto.
9971 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9972 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9973 New method definitions.
9974 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9975 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9976 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9977 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9978 (Target_arm::Relocate::relocate): Check for non-static or
9979 unimplemented relocation code and exit early. Change calls to
9980 Target_arm::reloc_uses_thumb_bit and
9981 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9982 instead. Refactor code to handle similar relocations to increase
9983 code sharing. Remove check for unsupported relocation code in switch
9984 statement.
9985 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9986 relocation property table to find out size. Change error message to
9987 print out the name of a relocation code instead of the numeric value.
9988 (Target_arm::scan_reloc_for_stub): Use relocation property table
9989 instead of calling Target_arm::reloc_uses_thumb_bit().
9990
218c5831
DK
99912010-02-02 Doug Kwan <dougkwan@google.com>
9992
9993 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9994 types of relaxed input section.
9995
0d31c79d
DK
99962010-02-02 Doug Kwan <dougkwan@google.com>
9997
9998 * Makefile.am (HFILES): Add arm-reloc-property.h.
9999 (DEFFILES): New.
2e702c99
RM
10000 (TARGETSOURCES): Add arm-reloc-property.cc
10001 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
10002 (libgold_a_SOURCES): $(DEFFILES)
10003 * Makefile.in: Regenerate.
10004 * arm-reloc-property.cc: New file.
10005 * arm-reloc-property.h: New file.
10006 * arm-reloc.def: New file.
10007 * arm.cc: Update comments.
10008 (arm-reloc-property.h): New included header.
10009 (arm_reloc_property_table): New global variable.
10010 (Target_arm::do_select_as_default_target): New method definition.
10011 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10012 arm-reloc-property to targ_extra_obj.
10013 * parameters.cc (set_parameters_target): Call
10014 Target::select_as_default_target().
10015 * target.h (Target::select_as_default_target): New method definition.
10016 (Target::do_select_as_default_target): Same.
10017
546c7457
DK
100182010-02-01 Doug Kwan <dougkwan@google.com>
10019
10020 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10021 first_output_text_section_.
10022 (Arm_exidx_fixup::first_output_text_section): New method definition.
10023 (Arm_exidx_fixup::first_output_text_section_): New data member.
10024 (Arm_exidx_fixup::process_exidx_section): Record the first text
10025 output section seen.
10026 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10027 and entsize in output section header.
10028
11b861d5
DK
100292010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10030
10031 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10032 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10033 (Arm_relocate_functions::thm_alu11): New Method.
10034 (Arm_relocate_functions::thm_pc8): New Method.
10035 (Arm_relocate_functions::thm_pc12): New Method.
10036 (Target_arm::Scan::local): Handle the relocations.
10037 (Target_arm::Scan::global): Likewise.
10038 (Target_arm::Relocate::relocate): Likewise.
10039 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10040
c9a2c125
DK
100412010-01-29 Doug Kwan <dougkwan@google.com>
10042
10043 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
10044 of relocation types as ld.
10045
1521477a
DK
100462010-01-29 Doug Kwan <dougkwan@google.com>
10047
10048 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10049 to public.
10050 (Arm_relocate_functions::thumb_branch_common): Ditto.
10051 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10052 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10053 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10054 Arm_relocate_functions::jump24): Remove.
10055 (Target_arm::Relocate::relocate): Adjust code to call
10056 Arm_relocation_functions::arm_branch_common and
10057 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 10058 wrappers. Merge switch-cases together to reduce source code size.
1521477a 10059
e7eca48c
DK
100602010-01-29 Doug Kwan <dougkwan@google.com>
10061
10062 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10063 output_local_symbol_count_needs_update_.
10064 (Arm_relobj::output_local_symbol_count_needs_update,
10065 Arm_relobj::set_output_local_symbol_count_needs_update,
10066 Arm_relobj::update_output_local_symbol_count): New methods.
10067 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10068 member.
10069 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10070 of pointed function as in a R_ARM_PREL31 relocation.
10071 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10072 for output local symbol count updating.
10073 (Target_arm::do_relax): Update output local symbol counts in objects
10074 if necessary.
10075 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10076
02961d7e
ILT
100772010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10078
10079 * arm.cc: Added support for the ARM relocations:
10080 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
10081 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
10082 (Arm_relocate_functions::movw_rel_nc): Renamed (was
10083 movw_prel_nc).
10084 (Arm_relocate_functions::movw_rel): New method.
10085 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
10086 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
10087 thm_movw_prel_nc).
10088 (Arm_relocate_functions::thm_movw_rel): New method.
10089 (Arm_relocate_functions::thm_movt_rel): Renamed (was
10090 thm_movt_prel).
10091 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
10092 relocations.
10093 (Target_arm::Scan::global): Likewise.
10094 (Target_arm::Relocate::relocate): Likewise.
10095 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10096 Likewise.
10097
b10d2873
ILT
100982010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10099
10100 * arm.cc: Added support for ARM group relocations.
10101 (Target_arm::reloc_needs_sym_origin): New method.
10102 (Arm_relocate_functions::calc_grp_kn): New method.
10103 (Arm_relocate_functions::calc_grp_residual): New method.
10104 (Arm_relocate_functions::calc_grp_gn): New method.
10105 (Arm_relocate_functions::arm_grp_alu): New Method.
10106 (Arm_relocate_functions::arm_grp_ldr): New Method.
10107 (Arm_relocate_functions::arm_grp_ldrs): New Method.
10108 (Arm_relocate_functions::arm_grp_ldc): New Method.
10109 (Target_arm::Scan::local): Handle the ARM group relocations.
10110 (Target_arm::Scan::global): Likewise.
10111 (Target_arm::Relocate::relocate): Likewise.
10112 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10113 Likewise.
10114
2b328d4e
DK
101152010-01-26 Doug Kwan <dougkwan@google.com>
10116
10117 * arm.cc (set): Include.
10118 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10119 pointer type.
2e702c99 10120 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
10121 (Arm_output_section::append_text_sections_to_list): New method.
10122 (Arm_output_section::fix_exidx_coverage): Ditto.
10123 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 10124 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
10125 Relobj::set_section_offset() instead of
10126 Sized_relobj::invalidate_section_offset().
2e702c99 10127 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
10128 parameter for section headers. Ignore relocation sections for
10129 unallocated sections and EXIDX sections.
10130 (Target_arm::fix_exidx_coverage): New method.
10131 (Target_arm::output_section_address_less_than): New type.
10132 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10133 linked text section instead of the EXIDX section.
10134 (Arm_output_section::create_stub_group): Add an assertion to check
10135 that this is not an EXIDX output section.
10136 (Arm_output_section::append_text_sections_to_list): New method.
10137 (Arm_output_section::fix_exidx_coverage): Ditto.
10138 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 10139 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
10140 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10141 first pass.
10142 (Target_arm::fix_exidx_coverage): New method.
10143 * object.h (Relobj::set_output_section): New method.
10144 (Sized_relobj::invalidate_section_offset): Remove method.
10145 (Sized_relobj::do_invalidate_section_offset): Remove method.
10146 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10147
c7f3c371
DK
101482010-01-25 Doug Kwan <dougkwan@google.com>
10149
10150 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10151 Fix warning due to signed and unsigned comparison on a 32-bit host.
10152
8923b24c
DK
101532010-01-22 Doug Kwan <dougkwan@google.com>
10154
10155 * arm.cc (Target_arm::do_relax): Record an output section for section
10156 offset adjustment it contains any stub table that has changed.
10157 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10158 offsets in an output section if necessary.
10159 * output.cc (Output_section::Output_section): Initialize
10160 section_offsets_need_adjustments_.
10161 (Output_section::add_input_section_for_script): Renamed to
10162 Output_section::add_simple_input_section.
10163 (Output_section::save_states): Add a comment.
10164 (Output_section::discard_states): New method defintion.
10165 (Output_section::adjust_section_offsets): Same.
10166 * output.h (Output_section::add_input_section_for_script): Renamed to
10167 Output_section::add_simple_input_section.
10168 (Output_section::discard_states): New method declaration.
10169 (Output_section::adjust_section_offsets): Same.
10170 (Output_section::section_offsets_need_adjustment,
10171 Output_section::set_section_offsets_need_adjustment): New method
10172 definitions.
10173 (Output_section::section_offsets_need_adjustment_): New data member.
10174 * script-sections.cc
10175 (Output_section_element_input::set_section_address): Adjust code for
10176 renaming of Output_section::add_input_section_for_script.
10177 (Orphan_output_section::set_section_address): Same.
10178
9b2fd367
DK
101792010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10180
10181 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10182 Fix_v4bx enum values .
10183 * gold/options.h (General_options): New option definitions.
10184 (General_options::fix_v4bx): New method.
10185 (General_options::Fix_v4bx): New enum.
10186 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10187 (General_options::parse_fix_v4bx_interworking): New method.
10188
80d0d023
DK
101892010-01-22 Doug Kwan <dougkwan@google.com>
10190
10191 * arm.cc (Arm_exidx_fixup): New class.
10192
af2cdeae
DK
101932010-01-21 Doug Kwan <dougkwan@google.com>
10194
10195 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10196 classes.
10197 (Arm_exidx_section_offset_map): New type.
10198
993d07c1
DK
101992010-01-21 Doug Kwan <dougkwan@google.com>
10200
10201 * arm.cc (Arm_exidx_input_section): New class.
10202 (Arm_relobj::exidx_input_section_by_link,
10203 Arm_relobj::exidx_input_section_by_shndx,
10204 Arm_relobj::make_exidx_input_section): New methods.
10205 (read_arm_attributes_section): Remove.
10206 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10207 information about them.
10208 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10209 to here.
10210
5ac169d4
DK
102112010-01-20 Doug Kwan <dougkwan@google.com>
10212
10213 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10214 Input_section_specifier to Section_id.
10215 (Target_arm::new_arm_input_section: Adjust code for change of key
10216 type.
10217 (Target_arm::find_arm_input_section): Ditto.
10218 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10219 (Section_id): Remove.
10220 (Garbage_collection::Section_id_hash): Remove.
10221 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10222 (Section_id): Remove.
10223 (Icf::Section_id_hash): Remove.
10224 * object.h (Section_id, Const_section_id, Section_id_hash,
10225 Const_section_id_hash): New type definitions.
10226 * output.cc (Output_section::add_relaxed_input_section): Change to
10227 use Const_section_id instead of Input_section_specifier as key type.
10228 (Output_section::add_merge_input_section): Ditto.
10229 (Output_section::build_relaxation_map): Change to use Section_id
10230 instead of Input_section_specifier as key type.
2e702c99 10231 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
10232 Ditto.
10233 (Output_section::convert_input_sections_to_relaxed_sections): Change
10234 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 10235 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
10236 (Output_section::find_relaxed_input_section): Ditto.
10237 * output.h (Input_section_specifier): Remove class.
10238 (Output_section::Output_section_data_by_input_section_map): Change
10239 key type to Const_section_id.
10240 (Output_section::Output_relaxed_input_section_by_input_section_map):
10241 Ditto.
10242 (Output_section::Relaxation_map): Change key type to Section_id.
10243
a2162063
ILT
102442010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10245
10246 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10247 (class Arm_v4bx_stub): New class.
10248 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10249 (Stub_factory::make_arm_v4bx_stub): New method.
10250 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10251 (Stub_table::empty): Handle v4bx stubs.
10252 (Stub_table::add_arm_v4bx_stub): New method.
10253 (Stub_table::find_arm_v4bx_stub): New method.
10254 (Arm_relocate_functions::v4bx): New method.
10255 (Target_arm::fix_v4bx): New method.
10256 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10257 (Stub_table::relocate_stubs): Likewise.
10258 (Stub_table::do_write): Likewise.
10259 (Stub_table::update_data_size_and_addralign): Likewise.
10260 (Stub_table::finalize_stubs): Likewise.
10261 (Target_arm::Scan::local): Likewise.
10262 (Target_arm::Scan::global): Likewise.
10263 (Target_arm::do_finalize_sections): Likewise.
10264 (Target_arm::Relocate::relocate): Likewise.
10265 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10266 Likewise.
10267 (Target_arm::scan_reloc_for_stub): Likewise.
10268 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10269
5696ab0b
ILT
102702010-01-19 Ian Lance Taylor <iant@google.com>
10271
10272 * output.cc (Output_section_headers::do_sized_write): Write large
10273 segment count to sh_info field.
10274 (Output_file_header::do_sized_write): For large segment count,
10275 write PN_XNUM to e_phnum field.
10276
800d0f56
ILT
102772010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10278
10279 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10280 (Arm_relocate_functions::thm_jump8): New function.
10281 (Arm_relocate_functions::thm_jump11): New function.
10282 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10283 R_ARM_THM_JUMP11.
10284 (Target_arm::Scan::global): Likewise.
10285 (Target_arm::Relocate::relocate): Likewise.
10286 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10287 Likewise.
10288
41263c05
DK
102892010-01-14 Doug Kwan <dougkwan@google.com>
10290
10291 * arm.cc (map, utility): Include headers.
10292 (Target_arm::apply_cortex_a8_workaround): New method.
10293 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10294 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10295 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10296 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10297 the --[no-]fix-cortex-a8 command line options.
10298 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10299 (Target_arm::relocate_stub): Use addend in instruction template.
10300 * options.h (DEFINE_bool): Set the user-set flag.
10301 (General_options): Add --[no-]-fix-cortex options.
10302 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10303 : Update fast look-up map after conversion.
41263c05 10304
459e9b03
ST
103052010-01-14 Sriraman Tallam <tmsriram@google.com>
10306
10307 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10308 in the first pass of do_layout.
10309
b521dfe4
DK
103102010-01-13 Doug Kwan <dougkwan@google.com>
10311
10312 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10313 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10314 apparent compiler problem of not folding static constant integral
10315 data members of elfcpp::Elf_sizes<32>.
10316
44272192
DK
103172010-01-13 Doug Kwan <dougkwan@google.com>
10318
10319 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10320 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10321 Arm_relobj::scan_section_for_cortex_a8_erratum,
10322 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10323 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10324 sections to scan for relocation stubs into a new method
10325 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10326 relocation and Cortex-A8 stub scanning.
10327 (Target_arm::do_relax): Force stubs to be after stubbed sections
10328 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10329 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10330 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10331
44b71ece
ILT
103322010-01-12 Ian Lance Taylor <iant@google.com>
10333
10334 * target-reloc.h (visibility_error): New inline function.
10335 (relocate_section): Call visibility_error.
10336 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10337 (MOSTLYCLEANFILES): Likewise.
10338 (protected_4_pic.o, protected_3.err): New targets.
10339 * testsuite/protected_4.cc: New file.
10340
a120bc7f
DK
103412010-01-12 Doug Kwan <dougkwan@google.com>
10342
10343 * arm.cc (Cortex_a8_reloc): New class.
10344 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10345 and cortex_a8_relocs_info_.
10346 (Target_arm::fix_cortex_a8): New method definition.
10347 (Target_arm::Cortex_a8_relocs_info): New type.
10348 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10349 New data member declarations.
10350 (Target_arm::scan_reloc_for_stub): Record information about
10351 relocations for THUMB branches that might be exempted from the
10352 Cortex-A8 workaround.
10353 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10354 at the beginning of a relaxation pass.
10355
20138696
DK
103562010-01-12 Doug Kwan <dougkwan@google.com>
10357
10358 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10359 (Arm_relobj::Mapping_symbol_position,
10360 Arm_reloj::Mapping_symbol_position_less,
10361 Arm_relobj::Mapping_symbols_info): New types.
10362 (Target_arm::is_mapping_symbol_name): New method definition.
10363 (Arm_relobj::do_count_local_symbols): Save information about mapping
10364 symbols.
10365
089d69dc
DK
103662010-01-11 Doug Kwan <dougkwan@google.com>
10367
10368 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10369 Arm_relocate_functions::thumb32_branch_upper,
10370 Arm_relocate_functions::thumb32_branch_lower,
10371 Arm_relocate_functions::thumb32_cond_branch_offset,
10372 Arm_relocate_functions::thumb32_cond_branch_upper,
10373 Arm_relocate_functions::thumb32_cond_branch_lower,
10374 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10375 branch offset encoding.
10376 (Arm_relocate_functions::thumb_branch_common): Use new branch
10377 offset encoding methods to avoid code duplication.
10378 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10379 (Stub_addend_reader::operator()): Use new branch encoding method
10380 to avoid code duplication.
10381
99e5bff2
DK
103822010-01-11 Doug Kwan <dougkwan@google.com>
10383
10384 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10385 (Target_arm::do_finalize_sections): Define special EXIDX section
10386 symbols only if referenced.
10387 * gc.h (Garbage_collection::add_reference): New method.
10388 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10389 code duplication.
10390
98e090bd
ILT
103912010-01-11 Ian Lance Taylor <iant@google.com>
10392
d0a91bd8
ILT
10393 * script.cc (Version_script_info::build_expression_list_lookup):
10394 Change complaing about duplicate wildcard match from error to
10395 warning.
10396
98e090bd
ILT
10397 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10398 of 2009-12-30.
10399 (Version_script_info::Version_script_info): Initialize globs_,
10400 default_version_, default_is_global_, and exact_. Don't
10401 initialize globals_ or locals_.
10402 (Version_script_info::build_lookup_tables): Build local symbols
10403 first.
10404 (Version_script_info::unquote): New function.
10405 (Version_script_info::add_exact_match): New function.
10406 (Version_script_info::build_expression_list_lookup): Remove lookup
10407 parameter. Add is_global parameter. Change all callers. Handle
10408 wildcard pattern specially. Unquote pattern. Call
10409 add_exact_match.
10410 (Version_script_info::get_name_to_match): New function.
10411 (Version_script_info::get_symbol_version): New function.
10412 (Version_script_info::get_symbol_version_helper): Remove.
10413 (Version_script_info::check_unmatched_names): Call unquote.
10414 * script.h (class Version_script_info): Change get_symbol_version
10415 to be non-inline and add is_global parameter; change all callers.
10416 Rewrite symbol_is_local. Update declarations. Define struct
10417 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10418 Remove globals_ and locals_ members. Add exact_, globs_,
10419 default_version_, is_global_.
10420 (Version_script_info::Glob): Remove pattern, add expression and
10421 is_global. Update constructor. Change all callers.
10422 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10423 default version.
10424 (Versions::symbol_section_contents): If a symbol is undefined, or
10425 defined in a dynamic object, set the version index to
10426 VER_NDX_LOCAL.
10427 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10428 symbol_is_local.
10429 (Symbol_table::add_from_pluginobj): Likewise.
10430 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10431
d56962d3
DK
104322010-01-11 Doug Kwan <dougkwan@google.com>
10433
10434 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10435 (incremental_dump_LDADD): Add linking option for libintl.
10436 * Makefile.in: Regenerate.
10437
94e6ee91
L
104382010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10439
10440 PR gold/11144
10441 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10442 instead of -Ds.
10443 * testsuite/Makefile.in: Regenerated.
10444
e96c574b
DK
104452010-01-10 Doug Kwan <dougkwan@google.com>
10446
10447 * options.h (DEFINE_var): Use parentheses around argument varname__
10448 in macro body to avoid any unintended subsequent substitutions.
10449
7198066b
ILT
104502010-01-10 Ian Lance Taylor <iant@google.com>
10451
ba4d53bf
ILT
10452 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10453 candidates before doing symbol resolution.
10454
7198066b
ILT
10455 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10456 ODR candidates if only one is weak.
10457
a2beed37
ILT
104582010-01-08 Ian Lance Taylor <iant@google.com>
10459
10460 * script.cc (Version_script_info::build_expression_list_lookup):
10461 Don't warn about ambiguous version, just record the ambiguity.
10462 (Version_script_info::get_symbol_version_helper): Give error if
10463 version is ambiguous.
10464
2fb7225c
DK
104652010-01-08 Doug Kwan <dougkwan@google.com>
10466
10467 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10468 prev_data_size_ and prev_addralign_. Remove initializer for
10469 deleted data member has_been_changed_.
10470 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10471 to determine if the table is empty.
10472 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10473 Remove.
10474 (Stub_table::add_reloc_stub): Define method in class definition
10475 instead of just declaring it there.
10476 (Stub_table::add_cortex_a8_stub): New method definition.
10477 (Stub_table::update_data_size_and_addralign): Ditto.
10478 (Stub_table::finalize_stubs): Ditto.
10479 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10480 (Stub_table::do_addralign_): Return address alignment in the
10481 (Stub_table::do_reset_address_and_file_offset): Define method in
10482 class definition instead of declaring it there. Set current data
10483 size to be the data size of the previous pass.
10484 (Stub_table::set_final_data_size): Use current data size as the
10485 final data size.
10486 (Stub_table::relocate_stub): Change parameter type of stub from
10487 Reloc_stub pointer to Stub pointer.
10488 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10489 (Stub_table::Cortex_a8_stub_list): New typedef.
10490 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10491 Stub_table::prev_addralign_): New data member.
10492 (Arm_relobj::Arm_relobj): Initialize data member
10493 section_has_cortex_a8_workaround_.
10494 (Arm_relobj::section_has_cortex_a8_workaround,
10495 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10496 definitions.
10497 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10498 declarations.
10499 (Target_arm::relocate_stub): Change parameter type of stub from
10500 Reloc_stub pointer to Stub pointer.
10501 (Insn_template::size, Insn_template::alignment): Handle
10502 THUMB16_SPECIAL_TYPE.
10503 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10504 Stub_table::update_data_size_and_addralign,
10505 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10506 definitions.
10507 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10508 (Stub_table::do_write): Ditto.
10509 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10510
880cd20d
ILT
105112010-01-08 Ian Lance Taylor <iant@google.com>
10512
10513 PR 11108
10514 * symtab.h (class Symbol): Remove fields is_target_special_ and
10515 has_plt_offset_. Add field is_defined_in_discarded_section_.
10516 (Symbol::is_defined_in_discarded_section): New function.
10517 (Symbol::set_is_defined_in_discarded_section): New function.
10518 (Symbol::has_plt_offset): Rewrite.
10519 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10520 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10521 Don't initialize is_target_special_ or has_plt_offset_.
10522 Initialize is_defined_in_discarded_section_.
10523 (Symbol_table::add_from_relobj): If appropriate, set
10524 is_defined_in_discarded_section.
10525 * resolve.cc (Symbol::override_base_with_special): Don't test
10526 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10527 * target-reloc.h (relocate_section): Do special handling for
10528 symbols defined in discarded sections for global symbols as well
10529 as local symbols.
10530
2703e3eb
ILT
105312010-01-08 Ian Lance Taylor <iant@google.com>
10532
10533 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10534 the SHT_SYMTAB case.
10535
339d40a3
ILT
105362010-01-08 Ian Lance Taylor <iant@google.com>
10537
10538 * object.cc (Sized_relobj::do_layout): Don't get confused if
10539 layout_eh_frame returns NULL.
10540
abecea76
ILT
105412010-01-08 Ian Lance Taylor <iant@google.com>
10542
10543 PR 11084
10544 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10545 dynamic symbol table, use the normal symbol table.
10546 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10547 symbol table.
10548
6b7dd3f3
ILT
105492010-01-08 Ian Lance Taylor <iant@google.com>
10550
10551 PR 11072
10552 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10553 sections.
10554
36c50e63
L
105552010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10556
10557 * version.cc (print_version): Change to "Copyright 2010".
10558
e291e7b9
ILT
105592010-01-08 Ian Lance Taylor <iant@google.com>
10560
10561 PR 10287
10562 PR 11063
10563 * i386.cc (class Target_i386): Change return type of plt_section
10564 to be non-const.
10565 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10566 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10567 tls_desc_rel_ field.
10568 (Output_data_plt_i386::rel_tls_desc): New function.
10569 (Target_i386::rel_tls_desc_section): New function.
10570 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10571 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10572 R_386_TLS_DESC reloc in rel_tls_desc_section.
10573 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10574 Define struct Tlsdesc_info.
10575 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10576 (Target_x86_64::do_reloc_symbol_index): New function.
10577 (Target_x86_64::add_tlsdesc_info): New function.
10578 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10579 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10580 tlsdesc_rel_ field.
10581 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10582 all callers.
10583 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10584 (Target_x86_64::rela_tlsdesc_section): New function.
10585 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10586 handling.
10587 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10588 (Target_x86_64::do_reloc_addend): New function.
10589 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10590 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10591 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10592 (Output_reloc::type): New function.
10593 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10594 (Output_reloc::is_target_specific): New function.
10595 (Output_reloc::target_arg): New function.
10596 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10597 absolute relocs and target specific relocs.
10598 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10599 add_target_specific.
10600 (class Output_data_reloc) [SHT_RELA]: Likewise.
10601 * output.cc (Output_reloc::Output_reloc): Add four new versions
10602 for absolute relocs and target specific relocs.
10603 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10604 (Output_reloc::get_symbol_index): Likewise.
10605 (Output_reloc::local_section_offset): Check that local_sym_index_
10606 is not TARGET_CODE or 0.
10607 (Output_reloc::symbol_value): Likewise.
10608 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10609 reloc.
10610 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10611 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10612 functions.
10613 * layout.cc (add_target_dynamic_tags): Use output section for
10614 DT_PLTRELSZ and DT_JMPREL.
10615
3a44184e
ILT
106162010-01-07 Ian Lance Taylor <iant@google.com>
10617
10618 PR 11061
10619 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10620 function.
10621 (class Output_data_reloc_generic): Define.
10622 (class Output_data_reloc_base): Change base class to
10623 Output_data_reloc_generic. Change add() method to call
10624 bump_relative_reloc_count for a relative reloc. Remove
10625 sort_relocs_ field.
10626 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10627 to sort_relocs().
10628 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10629 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10630 appropriate.
10631 * layout.h (class Layout): Update declaration.
10632
ea715a34
ILT
106332010-01-07 Ian Lance Taylor <iant@google.com>
10634
10635 * output.h (class Output_data): Add const version of
10636 output_section and do_output_section.
10637 (class Output_section_data): Add const version of
10638 do_output_section.
10639 (class Output_section): Likewise.
10640 * layout.cc (Layout::add_target_dynamic_tags): New function.
10641 * layout.h (class Layout): Update declarations.
10642 * arm.cc (Target_arm::do_finalize_sections): Use
10643 add_target_dynamic_tags.
10644 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10645 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10646 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10647 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10648
659948a4
ILT
106492010-01-07 Ian Lance Taylor <iant@google.com>
10650
10651 PR 11042
10652 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10653 object as needed.
10654
9d3b86f6
ILT
106552010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10656 Ian Lance Taylor <iant@google.com>
10657
10658 PR 11019
10659 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10660 Xindex::read_symtab_xindex.
10661
bb0d3eb0
DK
106622010-01-07 Doug Kwan <dougkwan@google.com>
10663
10664 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10665 (Insn_template::thumb16_bcond_insn): New method declaration.
10666 (Insn_template): Fix spelling.
10667 (Stub::thumb16_special): New method declaration.
10668 (Stub::do_write): Define virtual method which was previously pure
10669 virtual.
10670 (Stub::do_thumb16_special): New method declaration.
10671 (Stub::do_fixed_endian_write): New template member.
10672 (Reloc_stub::do_write): Remove.
10673 (Reloc_stub::do_fixed_endian_write): Remove.
10674 (Cortex_a8_stub): New class definition.
10675 (Stub_factory::make_cortex_a8_stub): New method definition.
10676 (Stub_factory::Stub_factory): Add missing static storage class
10677 qualifier for elf32_arm_stub_a8_veneer_blx.
10678
ffeef7df
ILT
106792010-01-07 Ian Lance Taylor <iant@google.com>
10680
dc3f80fe
ILT
10681 PR 10980
10682 * options.h (class General_options): Add --warn-unresolved-symbols
10683 and --error-unresolved-symbols.
10684 * errors.cc (Errors::undefined_symbol): Implement
10685 --warn-unresolved-symbols.
10686
ffeef7df
ILT
10687 * options.h (class General_options): Add -z text and -z textoff.
10688 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10689
f1ec9ded
ST
106902010-01-06 Sriraman Tallam <tmsriram@google.com>
10691
10692 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10693 (Garbage_collection::cident_sections): New function.
10694 (Garbage_collection::add_cident_section): New function.
10695 (Garbage_collection::cident_sections_): New member.
10696 (gc_process_relocs): Add references to sections whose names are C
10697 identifiers.
10698 * gold.h (cident_section_start_prefix): New constant.
10699 (cident_section_stop_prefix): New constant.
10700 (is_cident): New function.
10701 * layout.cc (Layout::define_section_symbols): Replace string constants
10702 with the newly defined constants.
10703 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10704 C identifiers.
10705 * testsuite/Makefile.am: Add gc_orphan_section_test.
10706 * testsuite/Makefile.in: Regenerate.
10707 * testsuite/gc_orphan_section_test.cc: New file.
10708 * testsuite/gc_orphan_section_test.sh: New file.
10709
6eda8c29
ILT
107102010-01-06 Ian Lance Taylor <iant@google.com>
10711
b9674e17
ILT
10712 PR 10980
10713 * options.h (class General_options): Add --warn-shared-textrel.
10714 * layout.cc (Layout::finish_dynamic_section): Implement
10715 --warn-shared-textrel.
10716
6eda8c29
ILT
10717 PR 10980
10718 * options.h (class General_options): Add --warn-multiple-gp.
10719
32dcd44e
ILT
107202010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10721
10722 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10723 $(THREADSLIB) and $(LIBDL).
10724 * Makefile.in: Rebuild.
10725
a192ba05
ILT
107262010-01-06 Ian Lance Taylor <iant@google.com>
10727
10728 PR 10980
10729 * options.cc (General_options::parse_section_start): New function.
10730 (General_options::section_start): New function.
10731 (General_options::General_options): Initialize all members.
10732 * options.h: Include <map>
10733 (class General_options): Add --section-start. Add section_starts_
10734 member.
10735 * layout.cc (Layout::attach_allocated_section_to_segment): If
10736 --section-start was used, set the address of the segment. Remove
10737 local sort_sections.
10738 (Layout::relaxation_loop_body): If the address of the load segment
10739 has been set by --section-start, don't use it.
10740 * output.h (Output_segment::update_flags_for_output_section): New
10741 function.
10742 * output.cc (Output_segment::add_output_section): Call
10743 update_flags_for_output_section.
10744
dde3f402
ILT
107452010-01-05 Ian Lance Taylor <iant@google.com>
10746
62dfdd4d
ILT
10747 PR 10980
10748 * options.h (class General_options): Add --undefined-version.
10749 * script.cc (struct Version_expression): Add was_matched_by_symbol
10750 field.
10751 (Version_script_info::matched_symbol): New function.
10752 (Version_script_info::get_symbol_version_helper): Call
10753 matched_symbol.
10754 (Version_script_info::check_unmatched_names): New function.
10755 * script.h (class Version_script_info): Update declarations.
10756 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10757
9c4ae156
ILT
10758 * options.h (class General_options): Use DEFINE_bool_alias for
10759 allow_multiple_definition.
10760 * resolve.cc (Symbol_table::should_override): Don't test
10761 allow_multiple_definition.
10762
dde3f402
ILT
10763 PR 10980
10764 * options.h (class General_options): Add --cref.
10765 * main.cc (main): Print cref table if --cref. Don't close mapfile
10766 until after printing cref table.
10767 * cref.cc: Include "symtab.h".
10768 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10769 (Cref_table_compare::operator()): New function.
10770 (Cref_inputs::gather_cref): New function.
10771 (filecol): New static const.
10772 (Cref_inputs::print_cref): New function.
10773 (Cref::print_cref): New function.
10774 * cref.h: Include <cstdio>.
10775 (class Cref): Update declarations.
10776 * mapfile.h (Mapfile::file): New function.
10777 * object.h (class Object): Define Symbols. Declare virtual
10778 do_get_global_symbols.
10779 (Object::get_global_symbols): New function.
10780 * object.cc (Input_objects::add_object): Pass object to cref_ if
10781 --cref.
10782 (Input_objects::archive_start): Likewise.
10783 (Input_objects::archive_stop): Likewise.
10784 (Input_objects::print_cref): New function.
10785 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10786 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10787 --cref.
10788 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10789 function.
10790 * plugin.h (class Sized_pluginobj): Update declarations.
10791
8781f709
ILT
107922010-01-05 Ian Lance Taylor <iant@google.com>
10793
10794 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10795 to is_default_version. Rename insdef to insdefault.
10796 (Symbol_table::add_from_relobj): Rename def to is_default_version
10797 and local to is_forced_local.
10798 (Symbol_table::add_from_pluginobj): Likewise.
10799 (Symbol_table::add_from_dynobj): Likewise.
10800 (Symbol_table::define_special_symbol): Rename insdef to
10801 insdefault.
10802
fe35d28d
ILT
108032010-01-04 Ian Lance Taylor <iant@google.com>
10804
30bc8c46
ILT
10805 PR 10980
10806 * options.h (class General_options): Add
10807 --allow-multiple-definition and -z muldefs.
10808 * resolve.cc (Symbol_table::should_override): Don't warn about a
10809 multiple symbol definition if --allow-multiple-definition or -z
10810 muldefs.
10811
7eaea549
ILT
10812 PR 10980
10813 * options.h (class General_options): Add --add-needed and
10814 --copy-dt-needed-entries. Tweak --as-needed help entry.
10815 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10816 error if --copy-dt-needed-entries aka --add-needed is used and
10817 would cause a change in behaviour.
10818
fe35d28d
ILT
10819 PR 10980
10820 * options.h (class General_options): Add -G as a short version of
10821 --shared. Add no-op options -assert, -g, and -i.
10822
55a2bb35
ST
108232010-01-04 Sriraman Tallam <tmsriram@google.com>
10824
10825 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10826 check for .text or .gnu.linkonce.t sections.
10827 * icf.cc (Icf::find_identical_sections): Ditto.
10828 Change the detection for mangled function name within the section
10829 name.
10830 * icf.h (is_section_foldable_candidate): New function.
10831
719328e1
ILT
108322009-12-30 Ian Lance Taylor <iant@google.com>
10833
10834 PR 10980
10835 * options.h (class General_options): Permit two dashes with
10836 --retain-symbols-file.
10837
d7bb5745
ILT
108382009-12-30 Ian Lance Taylor <iant@google.com>
10839
403a15dd
ILT
10840 PR 10979
10841 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10842 don't put the file header and segment headers in the text
10843 segment.
10844
eda294df
ILT
10845 PR 10979
10846 * common.cc (Sort_commons::operator()): Stabilize sort when both
10847 entries are NULL.
10848 (Symbol_table::do_allocate_commons_list): When allocating common
10849 symbols, skip a symbol which is no longer common.
10850 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10851 an object before checking its type.
10852 * testsuite/common_test_2.c: New file.
10853 * testsuite/common_test_3.c: New file.
10854 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10855 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10856 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10857 (common_test_2_pic.o, common_test_2.so): New targets.
10858 (common_test_3_pic.o, common_test_3.so): New targets.
10859 * testsuite/Makefile.in: Rebuild.
10860
d7bb5745
ILT
10861 PR 10979
10862 * script.cc (read_input_script): If we see a new SECTIONS clause,
10863 and we have added an input section, give an error.
10864 * layout.h (class Layout): Add have_added_input_section function.
10865 Add have_added_input_section_ field.
10866 * layout.cc (Layout::Layout): Initialize
10867 have_added_input_section_.
10868 (Layout::layout): Set have_added_input_section_.
10869 (Layout::layout_eh_frame): Likewise.
10870
fc59c572
ILT
108712009-12-30 Ian Lance Taylor <iant@google.com>
10872
10873 PR 10931
10874 * options.h (class General_options): Add --sort-common option.
10875 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10876 * common.cc (Sort_common): Add sort_order parameter to
10877 constructor. Add sort_order_ field.
10878 (Sort_commons::operator): Check sort_order_.
10879 (Symbol_table::allocate_commons): Determine the sort order.
10880 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10881 Change all callers.
10882 (Symbol_table::do_allocate_commons_list): Likewise.
10883
1c74fab0
ILT
108842009-12-30 Ian Lance Taylor <iant@google.com>
10885
10886 PR 10916
10887 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10888 symbols from this object, don't change the visibility of an
10889 undefined symbol.
10890 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10891
6affe781
ILT
108922009-12-30 Ian Lance Taylor <iant@google.com>
10893
10894 PR 10861
10895 * script.h (class Version_script_info): Define Language enum.
10896 Update declarations. Define Glob, Exact, and Lookup types. Add
10897 new fields globals_, locals_, and is_finalized_.
10898 * script.cc: Various formatting fixes.
10899 (class Parser_closure): Change language_stack_ from a vector of
10900 std::string to one of Version_script_info::Language. Adjust all
10901 uses accordingly.
10902 (class Lazy_demangler): Remove.
10903 (struct Version_expression): Change language from std::string to
10904 Version_script_info::Language.
10905 (Version_script_info::Version_script_info): New function.
10906 (Version_script_info::~Version_script_info): Don't call clear.
10907 (Version_script_info::finalize): New function.
10908 (Version_script_info::build_lookup_tables): New function.
10909 (Version_script_info::build_expression_list_lookup): New
10910 function.
10911 (Version_script_info::get_symbol_version_helper): Rewrite to use
10912 lookup tables.
10913 (Version_script_info::print_expression_list): Adjust to use
10914 Version_script_info::Language.
10915 (script_push_lex_into_version_mode): Check that the version script
10916 has not been finalized.
10917 (version_script_push_lang): Change language string to
10918 Version_script_info::Language.
10919 * options.cc (Command_line::version_script): New function.
10920 * options.h (class General_options): Add finalize_dynamic_list
10921 function. Change version_script from declaration to definition.
10922 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10923 * testsuite/version_script.map: Remove duplicate def of foo.
10924 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10925 version_script.map.
10926 * testsuite/Makefile.in: Rebuild.
10927
818bf354
ILT
109282009-12-30 Ian Lance Taylor <iant@google.com>
10929
10930 PR 10843
10931 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10932 if the input symbol index is 0, make the output symbol index 0.
10933
ebcc8304
ILT
109342009-12-30 Ian Lance Taylor <iant@google.com>
10935
10936 PR 10670
10937 * options.h (class General_options): Add -x/--discard-all.
10938 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10939 --discard-all. If the local symbol needs a dynamic entry, check
10940 that before handling --discard-locals.
10941
176fe33f
ILT
109422009-12-30 Ian Lance Taylor <iant@google.com>
10943
bb321bb1
ILT
10944 PR 10450
10945 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10946 flags to PF_R.
10947 (Output_segment::add_output_section): Don't change the flags if
10948 the type is PT_TLS.
10949
176fe33f
ILT
10950 PR 10450
10951 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10952 GNU hash table if they need a dynamic value. Otherwise, don't add
10953 them if they are defined in a dynamic object or are forced local.
10954
e8cd95c7
ILT
109552009-12-29 Ian Lance Taylor <iant@google.com>
10956
1b81fb71
ILT
10957 PR 10450
10958 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10959 .gnu.hash table for a 32-bit target.
10960
8d6d383d
ILT
10961 PR 10450
10962 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10963 regular and a dynamic object only needs a dynamic symbol table
10964 entry if it is externally visible.
10965
e785ec03
ILT
10966 PR 10450
10967 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10968 constructor. Add global_offset_table_ field.
10969 (Target_i386::got_section): Set global_offset_table_.
10970 (Target_i386::do_finalize_sections): Set global_offset_table_
10971 size.
10972 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10973 in constructor. Add global_offset_table_ field.
10974 (Target_x86_64::got_section): Set global_offset_table_.
10975 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10976 size.
10977
1a2dff53
ILT
10978 * layout.cc (Layout::Layout): Initialize increase_relro_.
10979 (Layout::get_output_section): Add is_relro, is_last_relro, and
10980 is_first_non_relro parameters. Change all callers.
10981 (Layout::choose_output_section): Likewise.
10982 (Layout::add_output_section_data): Likewise.
10983 (Layout::make_output_section): Likewise.
10984 (Layout::set_segment_offsets): Clear increase_relro when using a
10985 linker script.
10986 * layout.h (class Layout): Add increase_relro method. Add
10987 increase_relro_ field. Update declarations.
10988 * output.cc (Output_section::Output_section): Initialize
10989 is_last_relro_ and is_first_non_relro_.
10990 (Output_segment::add_output_section): Group relro sections is
10991 do_sort is true. Handle is_last_relro and is_first_non_relro.
10992 (Output_segment::maximum_alignment): Remove relro handling.
10993 (Output_segment::set_section_addresses): Add increase_relro
10994 parameter. Change all callers. Add initial alignment to align
10995 relro sections on separate page. Remove old relro handling.
10996 (Output_segment::set_section_list_addresses): Remove in_relro
10997 parameter. Change all callers.
10998 (Output_segment::set_offset): Add increase parameter. Change all
10999 callers. Remove old relro handling.
11000 * output.h (class Output_section): Add new methods: is_last_relro,
11001 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11002 Add is_last_relro_ and is_first_non_relro_ fields.
11003 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11004 Create separate .got.plt section. Call increase_relro.
11005 * x86_64.cc (Target_x86_64::got_section): Likewise.
11006 * testsuite/relro_script_test.t: Add .got.plt.
11007
f0ba79e2
ILT
11008 PR 10450
11009 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11010 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11011 (Layout::finalize): Call set_dynamic_symbol_size.
11012 (Layout::set_dynamic_symbol_size): New function.
11013 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11014 set_dynamic_symbol_size.
11015
e8cd95c7
ILT
11016 PR 10450
11017 * output.h (class Output_section): Add is_entsize_zero_ field.
11018 * output.cc (Output_section::Output_section): Initialize
11019 is_entsize_zero_.
11020 (Output_section::set_entsize): If two different entsizes are
11021 requested, force it to zero.
11022 (Output_section::add_input_section): Set flags for .debug_str
11023 before updating section flags. Set entsize.
11024 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11025 and SHF_STRING if all input sections have those flags.
11026
3e1b9a8a
RÁE
110272009-12-29 Rafael Espindola <espindola@google.com>
11028
11029 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
11030 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11031 reporting.
3e1b9a8a 11032
3dcad376
ST
110332009-12-29 Sriraman Tallam <tmsriram@google.com>
11034
11035 * options.cc (General_options::parse_version): Allow -v to exit
11036 without an error if there is nothing to link.
11037
084e2665
ILT
110382009-12-29 Ian Lance Taylor <iant@google.com>
11039
11040 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
11041 using a version of gcc before 4.1.
11042 * configure: Rebuild.
11043
250acde3
CD
110442009-12-28 Chris Demetriou <cgd@google.com>
11045
11046 * attributes.cc (Output_attributes_section_data::do_write): Use
11047 std::vector::front rather than std::vector::data.
11048
99fff23b
ILT
110492009-12-28 Ian Lance Taylor <iant@google.com>
11050
11051 * symtab.h (class Symbol_table): Add enum Defined.
11052 * resolve.cc (Symbol_table::should_override): Add defined
11053 parameter. Change all callers. Test whether object is NULL
11054 before calling a method on it.
11055 (Symbol_table::report_resolve_problem): Add defined parameter.
11056 Change all callers.
11057 (Symbol_table::should_override_with_special): Likewise.
11058 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11059 parameter. Change all callers.
11060 (Symbol_table::do_define_in_output_data): Likewise.
11061 (Symbol_table::define_in_output_segment): Likewise.
11062 (Symbol_table::do_define_in_output_segment): Likewise.
11063 (Symbol_table::define_as_constant): Likewise.
11064 (Symbol_table::do_define_as_constant): Likewise.
11065 * script.h (class Symbol_assignment): Add is_defsym parameter to
11066 constructor; change all callers.
11067 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11068 parameter. Change all callers. Add is_defsym_ field.
11069 (class Parser_closure): Add parsing_defsym parameter to
11070 constructor; change all callers. Add parsing_defsym accessor
11071 function. Add parsing_defsym_ field.
11072
556bd683
ILT
110732009-12-28 Ian Lance Taylor <iant@google.com>
11074
11075 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 11076 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 11077
1782c879
ILT
110782009-12-23 Ian Lance Taylor <iant@google.com>
11079
11080 * i386.cc (Target_i386::do_calls_non_split): Recognize
11081 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
11082 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
11083 -fsplit-stack prologue when using %r11.
1782c879 11084
329ca2b1
ST
110852009-12-21 Sriraman Tallam <tmsriram@google.com>
11086
11087 * options.cc (General_options::parse_version): Make -v continue and do
11088 the link like GNU ld does.
11089
d675ff46
RÁE
110902009-12-17 Rafael Avila de Espindola <espindola@google.com>
11091
11092 * Makefile.am (CCFILES): Add timer.cc.
11093 (HFILES): Add timer.h.
11094 * configure.ac: Check for sysconf and times.
11095 * main.cc: include timer.h.
11096 (main): Use Timer instead of get_run_time.
11097 * timer.cc: New.
11098 * timer.h: New.
11099 * workqueue.cc: include timer.h.
11100 (Workqueue::find_and_run_task):
11101 Report user, sys and wall time.
11102 * Makefile.in: Regenerate.
11103 * config.in: Regenerate.
11104 * configure: Regenerate.
11105
d6344fb5
DK
111062009-12-16 Doug Kwan <dougkwan@google.com>
11107
11108 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
11109 sections.
11110 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11111 relaxed input sections.
11112 * output.cc (Output_section::find_relaxed_input_section): Change
11113 return type to Output_relaxed_input_section pointer. Adjust code
11114 for new type of relaxed_input_section_map_.
11115 * output.h (Output_section::find_relaxed_input_section): Change
11116 return type to Output_relaxed_input_section pointer.
11117 (Output_section::Output_relaxed_input_section_by_input_section_map):
11118 New type.
11119 (Output_section::relaxed_input_section_map_): Change type to
11120 Output_section::Output_relaxed_input_section_by_input_section_map.
11121 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11122 input section.
11123
0e0d5469
ILT
111242009-12-15 Ian Lance Taylor <iant@google.com>
11125
11126 * layout.cc (Layout::create_shstrtab): Only write out after input
11127 sections if we are compressing debug sections.
11128
0649a889
ILT
111292009-12-15 Ian Lance Taylor <iant@google.com>
11130
11131 * archive.cc (Archive::add_symbols): Only look up a symbol without
11132 a version if there is, in fact, a version.
11133
2ea97941
ILT
111342009-12-14 Ian Lance Taylor <iant@google.com>
11135
11136 Revert -Wshadow changes, all changes from:
11137 2009-12-11 Doug Kwan <dougkwan@google.com>
11138 2009-12-11 Nick Clifton <nickc@redhat.com>
11139 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11140
b0eec2cc
DK
111412009-12-11 Doug Kwan <dougkwan@google.com>
11142
11143 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11144 due to -Wshadow.
11145 * attributes.cc (Object_attribute::size): Ditto.
11146 (Attributes_section_data::size): Ditto.
11147 (Attributes_section_data::Attributes_section_data): Ditto.
11148 (Output_attributes_section_data::do_write): Ditto.
11149 * attributes.h (Object_attribute::set_type): Ditto.
11150 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11151
91d6fa6a
NC
111522009-12-11 Nick Clifton <nickc@redhat.com>
11153
11154 * archive.cc: Fix shadowed variable warnings.
11155 * arm.cc: Likewise.
11156 * compressed_output.cc: Likewise.
11157 * compressed_output.h: Likewise.
11158 * configure: Likewise.
11159 * dwarf_reader.cc: Likewise.
11160 * dynobj.cc: Likewise.
11161 * dynobj.h: Likewise.
11162 * ehframe.cc: Likewise.
11163 * ehframe.h: Likewise.
11164 * errors.cc: Likewise.
11165 * expression.cc: Likewise.
11166 * fileread.cc: Likewise.
11167 * fileread.h: Likewise.
11168 * freebsd.h: Likewise.
11169 * i386.cc: Likewise.
11170 * icf.cc: Likewise.
11171 * incremental.h: Likewise.
11172 * layout.cc: Likewise.
11173 * layout.h: Likewise.
11174 * mapfile.cc: Likewise.
11175 * merge.cc: Likewise.
11176 * merge.h: Likewise.
11177 * object.cc: Likewise.
11178 * object.h: Likewise.
11179 * options.h: Likewise.
11180 * output.cc: Likewise.
11181 * output.h: Likewise.
11182 * parameters.cc: Likewise.
11183 * plugin.cc: Likewise.
11184 * powerpc.cc: Likewise.
11185 * reduced_debug_output.cc: Likewise.
11186 * reduced_debug_output.h: Likewise.
11187 * reloc.cc: Likewise.
11188 * reloc.h: Likewise.
11189 * resolve.cc: Likewise.
11190 * script-sections.cc: Likewise.
11191 * script.cc: Likewise.
11192 * script.h: Likewise.
11193 * sparc.cc: Likewise.
11194 * symtab.cc: Likewise.
11195 * symtab.h: Likewise.
11196 * target-select.cc: Likewise.
11197 * target-select.h: Likewise.
11198 * token.h: Likewise.
11199 * workqueue.cc: Likewise.
11200 * workqueue.h: Likewise.
11201 * x86_64.cc: Likewise.
11202
a0351a69
DK
112032009-12-10 Doug Kwan <dougkwan@google.com>
11204
11205 * arm.cc (attributes.h): New include.
11206 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11207 (Arm_relobj::~Arm_relobj): Delete object pointed by
11208 attributes_section_data_.
11209 (Arm_relobj::attributes_section_data): New method definition.
11210 (Arm_relobj::attributes_section_data_): New data member declaration.
11211 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11212 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11213 attributes_section_data_.
11214 (Arm_dynobj::attributes_section_data): New method definition.
11215 (Arm_dynobj::attributes_section_data_): New data member declaration.
11216 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11217 initialization value of may_use_blx_ to false.
2e702c99 11218 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
11219 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11220 object attributes to compute results instead of hard-coding.
11221 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11222 Target_arm::get_secondary_compatible_arch,
11223 Target_arm::set_secondary_compatible_arch
11224 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11225 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11226 New method declarations.
11227 (Target_arm::get_aeabi_object_attribute): New method definition.
11228 (Target_arm::attributes_section_data_): New data member declaration.
11229 (read_arm_attributes_section): New template definition.
11230 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11231 (Arm_dynobj::do_read_symbols): Ditto.
11232 (Target_arm::do_finalize_sections): Merge attributes sections from
11233 input. Check for BLX use after attributes section merging.
11234 Fix __exidx_start and __exidx_end visibility. Create an
11235 .ARM.attributes section if necessary.
11236 (Target_arm::get_secondary_compatible_arch,
11237 Target_arm::set_secondary_compatible_arch,
11238 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11239 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 11240 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
11241 New method definitions.
11242
b59befec
ILT
112432009-12-09 Ian Lance Taylor <iant@google.com>
11244
11245 * plugin.cc (Plugin::load): Don't cast from void* to a function
11246 pointer.
11247
1276bc89
ILT
112482009-12-09 Ian Lance Taylor <iant@google.com>
11249
11250 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11251 information fields.
11252
2f2de248
L
112532009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11254
11255 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11256 Replace two_file_shared_1.so with two_file_shared_2.so.
11257 * testsuite/Makefile.in: Regenerated.
11258
4f787271
DK
112592009-12-08 Doug Kwan <dougkwan@google.com>
11260
11261 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11262 (HFILES): Add attributes.h and int_encoding.h.
11263 * Makefile.in: Regenerate.
11264 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11265 function definitions to int_encoding.cc
11266 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11267 prototypes to int_encoding.h
11268 * reduced_debug_output.cc (int_encoding.h): New include.
11269 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11270 function definitions to int_encoding.cc
11271 (insert_into_vector, read_from_pointer): Move template definitions to
11272 int_encoding.h
11273 * attributes.cc: New file.
11274 * attributes.h: New file.
11275 * int_encoding.cc: New file.
11276 * int_encoding.h: New file.
11277
20b52f1a
RÁE
112782009-12-07 Rafael Avila de Espindola <espindola@google.com>
11279
11280 PR gold/11055
11281 * incremental-dump.cc (dump_incremental_inputs): New.
11282 (main): Use dump_incremental_inputs.
11283
53d7974c
L
112842009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11285
11286 PR gold/10893
11287 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11288 checking elfcpp::STT_FUNC.
11289 (Target_i386::Relocate::relocate): Likewise.
11290 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11291
11292 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11293 symbols from shared libraries into normal FUNC symbols.
11294
11295 * symtab.h (Symbol): Add is_func and use it.
11296
05a352e6
DK
112972009-12-05 Doug Kwan <dougkwan@google.com>
11298
11299 * arm.cc (Target_arm::arm_info): Initialize new fields
11300 attributes_section and attributes_vendor.
11301 * i386.cc (Target_i386::i386_info): Same.
11302 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11303 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11304 fields attributes_section and attributes_vendor.
53d7974c 11305 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11306 * target.h (Target::attributes_section, Target::attributes_vendor,
11307 Target::is_attributes_section, Target::attribute_arg_type,
11308 Target::attributes_order): New method definitions.
11309 (Target::Target_info::attributes_section,
11310 Target::Target_info::attributes_vendor): New fields.
11311 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11312 virtual method definitions.
11313 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11314 attributes_section and attributes_vendor.
11315 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11316
f4e5969c
DK
113172009-12-05 Doug Kwan <dougkwan@google.com>
11318
11319 * arm.cc: Update comments about interworking and stub generation.
11320 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11321 considered as non-PIC.
11322 (Arm_relocate_functions::base_abs): Fix formatting.
11323 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11324 of function to use GOT entry address instead of offset.
11325 (Target_arm::Scan::global): Issue an error if a symbol would need a
11326 PLT does not get one because it is untyped. Remove code to create
11327 dynamic symbols for relative branches.
11328 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11329 takes unsigned integer instead of boolean.
11330
1abce4a6
L
113312009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11332
11333 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11334 (two_file_test_LDADD): Likewise.
11335 (common_test_1_LDADD): Likewise.
11336 (exception_test_LDADD) Likewise.
11337 (weak_test_LDADD): Likewise.
11338 (many_sections_test_LDADD): Likewise.
11339 (initpri1_LDADD): Likewise.
11340 (script_test_1_LDADD): Likewise.
11341 (script_test_2_LDADD): Likewise.
11342 (justsyms_LDADD): Likewise.
11343 (binary_test_LDADD): Likewise.
11344 (large_LDADD): Likewise.
11345 * testsuite/Makefile.in: Regenerated.
11346
adcf2816 113472009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11348
adcf2816
L
11349 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11350 (Symbol_table::override_with_special): Likewise.
11351 (Symbol_table::add_from_object): Likewise.
11352
28e67f5d
RÁE
113532009-12-04 Rafael Avila de Espindola <espindola@google.com>
11354
11355 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11356 Don't set the data_offset twice.
11357
ae10a101
RÁE
113582009-12-04 Rafael Avila de Espindola <espindola@google.com>
11359
11360 * testsuite/Makefile.in: Regenerate.
11361
f59f41f3
DK
113622009-12-03 Doug Kwan <dougkwan@google.com>
11363
11364 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11365 (Target_arm::do_finalize_sections): Add parameter for symbol table
11366 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11367 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11368 parameter for symbol table pointer.
11369 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11370 an additional parameter for a pointer to symbol table.
11371 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11372 parameter for a symbol table pointer.
11373 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11374 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11375 Ditto.
11376 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11377 parameter for a symbol table pointer.
11378
ca55d848
RÁE
113792009-12-03 Rafael Avila de Espindola <espindola@google.com>
11380
11381 * incremental.cc (Incremental_inputs_header)
11382 (Incremental_inputs_header_write, Incremental_inputs_entry)
11383 (Incremental_inputs_entry_write): Move ...
11384 * incremental.h (Incremental_inputs_header)
11385 (Incremental_inputs_header_write, Incremental_inputs_entry)
11386 (Incremental_inputs_entry_write): here.
11387
3aec4f9c
RÁE
113882009-12-02 Rafael Avila de Espindola <espindola@google.com>
11389
11390 * incremental.cc (make_sized_incremental_binary): Set the target.
11391 Error if it is incompatible.
11392 * output.h (Output_file): Add filename method.
11393
9c0ae74d
RÁE
113942009-12-02 Rafael Avila de Espindola <espindola@google.com>
11395
11396 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11397 from the get_* methods.
11398
a45500ae
RÁE
113992009-12-02 Rafael Avila de Espindola <espindola@google.com>
11400
11401 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11402 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11403 Write 0 for the data_offset of scripts.
11404
325e6408
RÁE
114052009-12-02 Rafael Avila de Espindola <espindola@google.com>
11406
11407 * testsuite/Makefile.am: Add the incremental_test.sh test.
11408 * testsuite/incremental_test.sh: New.
11409 * testsuite/incremental_test_1.c: New.
11410 * testsuite/incremental_test_2.c: New.
11411
954c3e2e
RÁE
114122009-12-01 Rafael Avila de Espindola <espindola@google.com>
11413
703d02da 11414 * incremental-dump.cc (main): Fix typos.
954c3e2e 11415
f8086623
RÁE
114162009-11-27 Rafael Avila de Espindola <espindola@google.com>
11417
11418 PR gold/11025
11419 * incremental-dump.cc (main): Use llu to print 64 bit values.
11420
3b0dd6ac
L
114212009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11422 H.J. Lu <hongjiu.lu@intel.com>
11423
11424 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11425 $(LIBDL).
11426 (incremental_dump_LDADD): Likewise.
11427 * Makefile.in: Regenerated.
11428
a6d1ef57 114292009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11430
a6d1ef57
DK
11431 Revert:
11432
11433 2009-11-25 Doug Kwan <dougkwan@google.com>
11434
11435 * arm.cc (Target_arm::Target_arm): Move method definition
11436 outside of class definition. Add code to handle
11437 --target1-rel, --target1-abs and --target2= options.
11438 (Target_arm::get_reloc_reloc_type): Change method to be
11439 non-static and const.
11440 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11441 New data member declaration.
11442 (Target_arm::Scan::local, Target_arm::Scan::global,
11443 Target_arm::Relocate::relocate,
11444 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11445 Adjust call to Target_arm::get_real_reloc_type.
11446 (Target_arm::get_real_reloc_type): Use command line options
11447 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11448 * options.h (--target1-rel, --target1-abs, --target2): New
11449 ARM-only options.
11450
50aeb7d4
DK
114512009-11-25 Doug Kwan <dougkwan@google.com>
11452
11453 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11454 class definition. Add code to handle --target1-rel, --target1-abs
11455 and --target2= options.
11456 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11457 and const.
11458 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11459 member declaration.
11460 (Target_arm::Scan::local, Target_arm::Scan::global,
11461 Target_arm::Relocate::relocate,
11462 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11463 call to Target_arm::get_real_reloc_type.
11464 (Target_arm::get_real_reloc_type): Use command line options to
11465 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11466 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11467 options.
11468
51938283
DK
114692009-11-25 Doug Kwan <dougkwan@google.com>
11470
11471 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11472 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11473 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11474 formatting.
11475 (Arm_relocate_functions::thm_call): Replace body with a call to
11476 Arm_relocate_functions::thumb_branch_common.
11477 (Arm_relocate_functions::thm_jump24,
11478 Arm_relocate_functions::thm_xpc22): New method definitions.
11479 (Arm_relocate_functions::thumb_branch_common): New method definition.
11480 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11481 operator.
11482 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11483 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11484
e2b8f3c4
RÁE
114852009-11-24 Rafael Avila de Espindola <espindola@google.com>
11486
11487 * Makefile.am: Build incremental-dump
11488 * Makefile.in: Regenerate.
11489 * incremental-dump.cc: New.
11490 * incremental.cc (Incremental_inputs_header_data,
11491 Incremental_inputs_entry_data): Move to incremental.h
11492 * incremental.h: (Incremental_inputs_header_data,
11493 Incremental_inputs_entry_data): Move from incremental.cc
11494
bcba9aec
RÁE
114952009-11-24 Rafael Avila de Espindola <espindola@google.com>
11496
11497 * incremental.cc (Incremental_inputs_header,
11498 Incremental_inputs_header_write, Incremental_inputs_entry,
11499 Incremental_inputs_entry_write): Add a typedef with the data type.
11500
7c3afe08
RÁE
115012009-11-24 Rafael Avila de Espindola <espindola@google.com>
11502
11503 * incremental.cc (Incremental_inputs_header,
11504 Incremental_inputs_header_write, Incremental_inputs_entry,
11505 Incremental_inputs_entry_write): Update comment about which
11506 type has the filed descriptions.
11507
d204b6e9
DK
115082009-11-15 Doug Kwan <dougkwan@google.com>
11509
11510 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11511 (Arm_relocate_functions::arm_branch_common): Change method defintion
11512 in class definition to a method declaration and update list of formal
11513 parameters.
11514 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11515 Arm_relocation_functions::jump24): Adjust call to
11516 Arm_relocate_functions::arm_branch_common. Update list of formal
11517 parameters.
11518 (Arm_relocate_functions::xpc25): New method definition.
11519 (Arm_relocate_functions::arm_branch_common): Move method defintion
11520 out from class definition. Use stubs for mode-switching and extending
11521 branch ranges.
11522 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11523 specially. Change code to enable use of stubs in ARM branches.
11524
43d12afe
DK
115252009-11-10 Doug Kwan <dougkwan@google.com>
11526
11527 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11528 in method declaration.
11529 (Target_arm::relocate_stub): New method declaration.
11530 (Target_arm::default_target): Change to return a pointer instead of
11531 a const reference.
11532 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11533 Target_arm::default_target.
11534 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11535 method definition.
11536 (Target_arm::relocate_section): Adjust view.
11537 (Target_arm::relocate_stub): New method definition.
11538
ac33a407
DK
115392009-11-10 Doug Kwan <dougkwan@google.com>
11540
11541 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11542 a format warning.
11543 * incremental.cc (open_incremental_binary): Initialized local
11544 variables to avoid warnings.
11545 * object.cc (make_elf_object): Ditto.
11546 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11547 a format warning.
e1df38aa 11548
88ee28e9
L
11549009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11550
11551 PR gold/10930
11552 * testsuite/plugin_test.c: Include "config.h".
11553
2daedcd6
DK
115542009-11-09 Doug Kwan <dougkwan@google.com>
11555
11556 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11557 (arm_symbol_value): Remove.
11558 (Arm_relocate_functions::arm_branch_common,
11559 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11560 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11561 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11562 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11563 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11564 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11565 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11566 Arm_relocate_functions::thm_mobw_abs_nc,
11567 Arm_relocate_functions::thm_mov_abs,
11568 Arm_relocate_functions::movw_prel_nc,
11569 Arm_relocate_functions::thm_movt_abs,
11570 Arm_relocate_functions::movt_prel,
11571 Arm_relocate_functions::thm_movw_prel_nc,
11572 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11573 (Target_arm::Relocate::relocate): Only decompose address into two
11574 parts if relocation type uses the thumb-bit and pass the actual
11575 bit instead of a flag indicating that the thumb-bit is used. Adjust
11576 calls to methods in Arm_relocate_functions for this change.
11577
1276bc89 115782009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
11579
11580 PR 10925
11581 * reloc.cc: Instantiate
11582 Sized_relobj::initialize_input_to_output_maps and
11583 Sized_relobj:free_input_to_output_maps.
11584
e53ad1b5
ILT
115852009-11-06 Ian Lance Taylor <iant@google.com>
11586
11587 PR 10876
11588 * defstd.cc (in_segment): Set only_if_ref true for "end".
11589
eb44217c
DK
115902009-11-06 Doug Kwan <dougkwan@google.com>
11591
11592 * arm.cc (class Reloc_stub): Correct a comment.
11593 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11594 (Target_arm::scan_section_for_stubs): New method declaration.
11595 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11596 Change methods from private to protected.
11597 (Target_arm::do_may_relax): New method definition.
11598 (Target_arm::do_relax, Target_arm::group_sections,
11599 Target_arm::scan_reloc_for_stub,
11600 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11601 (Target_arm::arm_input_section_map_): New data member declaration.
11602 (Target_arm::scan_reloc_for_stub,
11603 Target_arm::scan_reloc_section_for_stubs,
11604 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11605 Target_arm::do_relax): New method definitions.
11606
5d329b7d
ILT
116072009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11608
11609 * configure.ac: Check for (struct stat)::st_mtim
11610 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11611 * config.in: Regenerate.
11612 * configure: Regenerate.
11613
96a0d71b
ILT
116142009-11-05 Ian Lance Taylor <iant@google.com>
11615
11616 PR 10910
11617 * output.cc (Output_segment::add_output_section): Add missing
11618 return statement.
11619
594c8e5e
ILT
116202009-11-04 Ian Lance Taylor <iant@google.com>
11621
11622 PR 10880
11623 * object.h (class Object): Add is_needed and set_is_needed
11624 methods. Add is_needed_ field. Make bool fields into bitfields.
11625 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11626 defined in a dynamic object and referenced by a regular object,
11627 set is_needed for the dynamic object.
11628 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11629 if the file is marked with as_needed and it is not needed.
11630
22b127cc
ILT
116312009-11-04 Ian Lance Taylor <iant@google.com>
11632
11633 PR 10887
11634 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11635 tags if data is discarded by linker script.
11636 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11637 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11638 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11639 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11640
f5c870d2
ILT
116412009-11-04 Ian Lance Taylor <iant@google.com>
11642
11643 * layout.cc (Layout::get_output_section): Add is_interp and
11644 is_dynamic_linker_section parameters. Change all callers.
11645 (Layout::choose_output_section): Likewise.
11646 (Layout::make_output_section): Likewise.
11647 (Layout::add_output_section_data): Add is_dynamic_linker_section
11648 parameter. Change all callers.
11649 * layout.h (class Layout): Update declarations.
11650 * output.h (class Output_section): Add is_interp, set_is_interp,
11651 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11652 Add is_interp_, is_dynamic_linker_section_ fields. Change
11653 generate_code_fills_at_write_ to a bitfield.
11654 * output.cc (Output_section::Output_sections): Initialize new
11655 fields.
11656 (Output_segment::add_output_section): Add do_sort parameter.
11657 Change all callers.
11658
1ae4d23b
ILT
116592009-11-03 Ian Lance Taylor <iant@google.com>
11660
11661 PR 10860
11662 * options.h (class General_options): Add --warn-common.
11663 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11664 merging two common symbols.
11665 (Symbol_table::should_override): Handle --warn-common when merging
11666 a common symbol with a defined symbol. Use report_resolve_problem
11667 for multiple definitions.
11668 (Symbol_table::report_resolve_problem): New function.
11669 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11670
55da9579
DK
116712009-11-03 Doug Kwan <dougkwan@google.com>
11672
11673 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11674 stub_factory_.
11675 (Target_arm::stub_factory): New method definition.
11676 (Target_arm::new_arm_input_section,
11677 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11678 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 11679 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
11680 New type definitions.
11681 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11682 member declarations.
11683 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11684 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11685 New method definitions.
11686
37a9ac43
ILT
116872009-11-03 Ian Lance Taylor <iant@google.com>
11688
11689 * options.h (class General_options): Add --warn_constructors.
11690
b3d6a3d4
ILT
116912009-11-03 Ian Lance Taylor <iant@google.com>
11692
11693 PR 10893
11694 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11695 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11696
934b01dd
ILT
116972009-11-03 Ian Lance Taylor <iant@google.com>
11698
11699 PR 10895
11700 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11701 --msgid-bugs-address.
11702 (install-pdf): New target.
11703 (install-data_yes): Look up one directory to find mkinstalldirs.
11704
03c1939b
L
117052009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11706
11707 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11708 tree.
11709
ebd95253
DK
117102009-10-30 Doug Kwan <dougkwan@google.com>
11711
11712 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11713
e9bbb538
DK
117142009-10-30 Doug Kwan <dougkwan@google.com>
11715
11716 * arm.cc (Stub_addend_reader): New struct template definition
11717 and partial specializations.
11718 (Stub_addend_reader::operator()): New method definition for a
11719 partially specialized template.
11720
d5b40221
DK
117212009-10-30 Doug Kwan <dougkwan@google.com>
11722
11723 * arm.cc (Arm_relobj::processor_specific_flags): New method
11724 definition.
11725 (Arm_relobj::do_read_symbols): New method declaration.
11726 (Arm_relobj::processor_specific_flags_): New data member declaration.
11727 (Arm_dynobj): New class definition.
11728 (Target_arm::do_finalize_sections): Add input_objects parameter.
11729 (Target_arm::do_adjust_elf_header): New method declaration.
11730 (Target_arm::are_eabi_versions_compatible,
11731 (Target_arm::merge_processor_specific_flags): New method declaration.
11732 (Target_arm::do_make_elf_object): New overloaded method definitions
11733 and declaration.
11734 (Arm_relobj::do_read_symbols): New method definition.
11735 (Arm_dynobj::do_read_symbols): Ditto.
11736 (Target_arm::do_finalize_sections): Add input_objects parameters.
11737 Merge processor-specific flags from all input objects.
11738 (Target_arm::are_eabi_versions_compatible,
11739 Target_arm::merge_processor_specific_flags,
11740 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11741 New method definitions.
11742 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11743 Input_objects pointer type parameter.
11744 * layout.cc (Layout::finalize): Pass input objects to target's.
11745 finalize_sections function.
11746 * output.cc (Output_file_header::do_sized_write): Set ELF file
11747 header's processor-specific flags.
11748 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11749 Input_objects pointer type parameter.
11750 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11751 * target.h (Input_objects): New forward class declaration.
11752 (Target::processor_specific_flags,
11753 Target::are_processor_specific_flags_sect): New method definitions.
11754 (Target::finalize_sections): Add input_objects parameter.
11755 (Target::Target): Initialize processor_specific_flags_ and
11756 are_processor_specific_flags_set_.
11757 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11758 parameter.
11759 (Target::set_processor_specific_flags): New method definition.
11760 (Target::processor_specific_flags_,
11761 Target::are_processor_specific_flags_set_): New data member
11762 declarations.
11763 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11764 Input_objects pointer type parameter.
11765
ebabffbd
DK
117662009-10-30 Doug Kwan <dougkwan@google.com>
11767
11768 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11769
ad0f2072
ILT
117702009-10-28 Ian Lance Taylor <iant@google.com>
11771
11772 * object.h (class Relobj): Drop options parameter from
11773 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11774 do_scan_relocs, do_relocate. Change all callers.
11775 (class Sized_relobj): Drop options parameters from
11776 do_gc_process_relocs, do_scan_relocs, do_relocate,
11777 do_relocate_sections, relocate_sections, emit_relocs_scan,
11778 emit_relocs_scan_reltype. Change all callers.
11779 (struct Relocate_info): Remove options field and all references to
11780 it.
11781 * reloc.h (class Read_relocs): Remove options constructor
11782 parameter and options_ field. Change all callers.
11783 (class Gc_process_relocs, class Scan_relocs): Likewise.
11784 (class Relocate_task): Likewise.
11785 * target-reloc.h (scan_relocs): Remove options parameter. Change
11786 all callers.
11787 (scan_relocatable_relocs): Likewise.
11788 * target.h (class Sized_target): Remove options parameter from
11789 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11790 all callers.
11791 * gc.h (gc_process_relocs): Remove options parameter. Change all
11792 callers.
11793 * arm.cc: Update functions to remove options parameters.
11794 * i386.cc: Likewise.
11795 * powerpc.cc: Likewise.
11796 * sparc.cc: Likewise.
11797 * x86_64.cc: Likewise.
11798 * testsuite/testfile.cc: Likewise.
11799
8ffa3667
DK
118002009-10-28 Doug Kwan <dougkwan@google.com>
11801
11802 * arm.cc (Arm_relobj): New class definition.
e1df38aa 11803 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
11804 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11805 New method definitions.
11806
40f36857
CC
118072009-10-28 Cary Coutant <ccoutant@google.com>
11808
11809 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11810 (Plugin::cleanup_done_): New member.
11811 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11812 (Plugin_manager::cleanup_done_): Remove.
11813 (Plugin_manager::add_input_file): Edit error message.
11814 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11815 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11816
2c849493
ILT
118172009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11818
11819 * fileread.cc: (File_read::View::~View): Use the new
11820 data_ownership_ filed.
11821 (File_read::~File_read): Dispose the new whole_file_view_.
11822 (File_read::open): Mmap the whole file if needed.
11823 (File_read::open): Use whole_file_view_ instead of contents_.
11824 (File_read::find_view): Use whole_file_view_ if applicable.
11825 (File_read::do_read): Use whole_file_view_ instead of contents_.
11826 (File_read::make_view): Use whole_file_view_ instead of contents_,
11827 update File_read::View::View call.
11828 (File_read::find_or_make_view): Update File_read::View::View
11829 call.
11830 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11831 remove contents_
11832 (File_read::View::Data_ownership): New enum.
11833 (File_read::View::View): Replace bool mapped_ with Data_ownership
11834 argument.
11835 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11836 (File_read::View::data_ownership_): New field.
11837 (File_read::contents_): Remove (replaced by whole_file_view_).
11838 (File_read::whole_file_view_): New field.
11839 * options.h (class General_options): Add --keep-files-mapped.
11840
24998053
CC
118412009-10-27 Cary Coutant <ccoutant@google.com>
11842
11843 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11844 * testsuite/Makefile.am (plugin_test_5): New test case.
11845 * testsuite/Makefile.in: Regenerate.
11846
72adc4fa
DK
118472009-10-25 Doug Kwan <dougkwan@google.com>
11848
11849 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11850 from private to protected to allow access by child class.
11851 (Sized_relobj::do_relocate_sections): New method declaration.
11852 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 11853 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
11854 Sized_relobj::relocate_sections. Instantiate template explicitly
11855 for different target sizes and endianity.
11856
07f508a2
DK
118572009-10-24 Doug Kwan <dougkwan@google.com>
11858
11859 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11860 (Arm_input_section::as_arm_input_section): New method.
11861 (Arm_output_section): New class definition.
11862 (Arm_output_section::create_stub_group,
11863 Arm_output_section::group_sections): New method definitions.
11864
10ad9fe5
DK
118652009-10-22 Doug Kwan <dougkwan@google.com>
11866
11867 * arm.cc (Arm_input_section): New class definition.
11868 (Arm_input_section::init, Arm_input_section:do_write,
11869 Arm_input_section::set_final_data_size,
11870 Arm_input_section::do_reset_address_and_file_offset): New method
11871 definitions.
11872
56ee5e00
DK
118732009-10-21 Doug Kwan <dougkwan@google.com>
11874
11875 * arm.cc (Stub_table, Arm_input_section): New forward class
11876 declarations.
11877 (Stub_table): New class defintion.
11878 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11879 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11880 New method definition.
11881
b569affa
DK
118822009-10-21 Doug Kwan <dougkwan@google.com>
11883
11884 * arm.cc: Update copyright comments.
11885 (Target_arm): New forward class template declaration.
11886 (Arm_address): New type.
11887 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11888 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11889 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11890 constants.
11891 (Insn_template): Same.
11892 (DEF_STUBS): New macro.
11893 (Stub_type): New enum type.
11894 (Stub_template): New class definition.
11895 (Stub): Same.
11896 (Reloc_stub): Same.
11897 (Stub_factory): Same.
11898 (Target_arm::Target_arm): Initialize may_use_blx_ and
11899 should_force_pic_veneer_.
11900 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11901 Target_arm::should_force_pic_veneer,
11902 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11903 Target_arm::using_thumb_only, Target_arm:;default_target): New
11904 method defintions.
11905 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11906 New data member declarations.
11907 (Insn_template::size, Insn_template::alignment): New method defintions.
11908 (Stub_template::Stub_template): New method definition.
11909 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11910 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11911 (Stub_factory::Stub_factory): New method definition.
11912 * gold.h (string_hash): New template.
11913 * output.h (Input_section_specifier::hash_value): Use
11914 gold::string_hash.
11915 (Input_section_specifier::string_hash): Remove.
11916 * stringpool.cc (Stringpool_template::string_hash): Use
11917 gold::string_hash.
11918
6c172549
DK
119192009-10-20 Doug Kwan <dougkwan@google.com>
11920
11921 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11922 symbols of relaxed input sections.
11923 * output.h (Output_section::find_relaxed_input_section): Make
11924 method public.
11925
c5617f2f
DK
119262009-10-16 Doug Kwan <dougkwan@google.com>
11927
11928 * dynobj.cc (Versions::Versions): Initialize version_script_.
11929 Only insert base version symbol definition for a shared object
11930 if version script defines any version versions.
11931 (Versions::define_base_version): New method definition.
11932 (Versions::add_def): Check that base version is not needed.
11933 (Versions::add_need): Define base version lazily.
11934 * dynobj.h (Versions::define_base_version): New method declaration.
11935 (Versions::needs_base_version_): New data member declaration.
11936 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11937 (check_DATA): Add no_version_test.stdout.
11938 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11939 New make rules.
11940 * testsuite/Makefile.in: Regenerate.
11941 * testsuite/no_version_test.c: New file.
11942 * testsuite/no_version_test.sh: Ditto.
11943
3c12dcdb
DK
119442009-10-16 Doug Kwan <dougkwan@google.com>
11945
11946 * expression.cc (class Segment_start_expression): New class definition.
11947 (Segment_start_expression::value): New method definition.
11948 (script_exp_function_segment_start): Return a new
11949 Segment_start_expression.
11950 * gold/script-c.h (script_saw_segment_start_expression): New function
11951 prototype.
11952 * script-sections.cc (Script_sections::Script_sections): Initialize
11953 SAW_SEGMENT_START_EXPRESSION_ to false.
11954 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11955 and -Tbbs options to specify section addresses if given in
11956 command line and no SEGMENT_START expression is seen in a script.
11957 * script-sections.h (Script_sections::saw_segment_start_expression,
11958 Script_sections::set_saw_segment_start_expression): New method
11959 definition.
11960 (Script_sections::saw_segment_start_expression_): New data member
11961 declaration.
11962 * script.cc (script_saw_segment_start_expression): New function.
11963 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11964 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11965 script_test_7.sh and script_test_8.sh.
11966 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11967 script_test_8.stdout.
11968 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11969 (script_test_6, script_test_6.stdout, script_test_7,
11970 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11971 * Makefile.in: Regenerate.
11972 * testsuite/script_test_6.sh: New file.
11973 * testsuite/script_test_6.t: Same.
11974 * testsuite/script_test_7.sh: Same.
11975 * testsuite/script_test_7.t: Same.
11976 * testsuite/script_test_8.sh: Same.
11977
64b1ae37
DK
119782009-10-16 Doug Kwan <dougkwan@google.com>
11979
11980 * output.cc (Output_segment::set_section_list_address): Cast
11981 expressions to unsigned long long type to avoid format warnings.
11982
661be1e2
ILT
119832009-10-15 Ian Lance Taylor <iant@google.com>
11984
12edd763 11985 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 11986 dot assignment to script_sections_.
12edd763
ILT
11987 * script-sections.cc (Script_sections::add_dot_assignment):
11988 Initialize if necessary.
11989
68b6574b
ILT
11990 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11991 program headers with no load segment if there is a linker script.
11992
661be1e2
ILT
11993 * layout.cc (Layout::set_segment_offsets): Align the file offset
11994 to the segment aligment for -N or -n with no load segment.
11995 * output.cc (Output_segment::add_output_section): Don't crash if
11996 the first section is a TLS section.
11997 (Output_segment::set_section_list_addresses): Print an error
11998 message if the address moves backward in a linker script.
11999 * script-sections.cc
12000 (Output_section_element_input::set_section_addresses): Don't
12001 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12002 (Orphan_output_section::set_section_addresses): Likewise.
12003
f15f61a7
DK
120042009-10-15 Doug Kwan <dougkwan@google.com>
12005
12006 * layout.cc (Layout::finish_dynamic_section): Generate tags
12007 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12008 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12009 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12010
82bb573a
ILT
120112009-10-14 Ian Lance Taylor <iant@google.com>
12012
12013 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12014 fields.
12015 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12016 data_shdr fields of relinfo.
12017 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12018 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12019 R_386_TLS_LDO_32, adjust based on section flags.
12020 (Target_i386::Relocate::fix_up_ldo): Remove.
12021
374ad285
ILT
120222009-10-13 Ian Lance Taylor <iant@google.com>
12023
12024 Add support for -pie.
12025 * options.h (class General_options): Add -pie and
12026 --pic-executable.
12027 (General_options::output_is_position_independent): Test -pie.
12028 (General_options::output_is_executable): Return true if not shared
12029 and not relocatable.
12030 (General_options::output_is_pie): Remove.
12031 * options.cc (General_options::finalize): Reject incompatible uses
12032 of -pie.
12033 * gold.cc (queue_middle_tasks): A -pie link is not static.
12034 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12035 * symtab.cc (Symbol::final_value_is_known): Return false if
12036 output_is_position_independent.
12037 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
12038 output_is_position_independent.
12039 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
12040 output_is_position_independent.
12041 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
12042 output_is_position_independent.
12043 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
12044 two_file_pie_test.
12045 (basic_pie_test.o, basic_pie_test): New targets.
12046 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12047 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12048 (two_file_pie_test): New target.
12049 * testsuite/Makefile.in: Rebuild.
12050 * README: Remove note saying that -pie is not supported.
12051
c6585162
ILT
120522009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12053
12054 * options.h (class General_options): Add -init and -fini.
12055 * layout.cc (Layout::finish_dynamic_section): Emit
12056 given init and fini functions.
12057
032ce4e9
ST
120582009-10-13 Sriraman Tallam <tmsriram@google.com>
12059
12060 * gc.h (gc_process_relocs): Check if icf is enabled using new
12061 function.
12062 * gold.cc (queue_initial_tasks): Likewise.
12063 (queue_middle_tasks): Likewise.
12064 * object.cc (do_layout): Likewise.
12065 * symtab.cc (is_section_folded): Likewise.
12066 * main.cc (main): Likewise.
12067 * reloc.cc (Read_relocs::run): Likewise.
12068 (Sized_relobj::do_scan_relocs): Likewise.
12069 * icf.cc (is_function_ctor_or_dtor): New function.
12070 (Icf::find_identical_sections): Check if function is ctor or dtor when
12071 safe icf is chosen.
12072 * options.h (General_options::icf): Change option to be an enum.
12073 (Icf_status): New enum.
12074 (icf_enabled): New method.
12075 (icf_safe_folding): New method.
12076 (set_icf_status): New method.
12077 (icf_status_): New variable.
12078 * (options.cc) (General_options::finalize): Set icf_status_.
12079 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12080 icf_test and icf_keep_unique_test to use the --icf enum flag.
12081 * testsuite/icf_safe_test.sh: New file.
e1df38aa 12082 * testsuite/icf_safe_test.cc: New file.
032ce4e9 12083
f345227a
ST
120842009-10-12 Sriraman Tallam <tmsriram@google.com>
12085
12086 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
12087 includes to gc.h and icf.h.
12088 * arm.cc: Include gc.h.
12089 * gold.cc: Likewise.
12090 * i386.cc: Likewise.
12091 * powerpc.cc: Likewise.
12092 * sparc.cc: Likewise.
12093 * x86_64.cc: Likewise.
12094 * gc.h: Include icf.h.
12095
1c7814ed
ILT
120962009-10-11 Ian Lance Taylor <iant@google.com>
12097
12098 * plugin.cc: Include "gold.h" before other header files.
12099
ae3b5189
CD
121002009-10-10 Chris Demetriou <cgd@google.com>
12101
12102 * options.h (Input_file_argument::Input_file_type): New enum.
12103 (Input_file_argument::is_lib_): Replace with...
12104 (Input_file_argument::type_): New member.
12105 (Input_file_argument::Input_file_argument): Take Input_file_type
12106 'type' rather than boolean 'is_lib' as second argument.
12107 (Input_file_argument::is_lib): Use type_.
12108 (Input_file_argument::is_searched_file): New function.
12109 (Input_file_argument::may_need_search): Handle is_searched_file.
12110 * options.cc (General_options::parse_library): Support -l:filename.
12111 (General_options::parse_just_symbols): Update for Input_file_argument
12112 changes.
12113 (Command_line::process): Likewise.
12114 * archive.cc (Archive::get_file_and_offset): Likewise.
12115 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12116 * script.cc (read_script_file, script_add_file): Likewise.
12117 * fileread.cc (Input_file::Input_file): Likewise.
12118 (Input_file::will_search_for): Handle is_searched_file.
12119 (Input_file::open): Likewise.
12120 * readsyms.cc (Read_symbols::get_name): Likewise.
12121 * testsuite/Makefile.am (searched_file_test): New test.
12122 * testsuite/Makefile.in: Regenerate.
12123 * testsuite/searched_file_test.cc: New file.
12124 * testsuite/searched_file_test_lib.cc: New file.
12125
f3048a1d
ILT
121262009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12127 Ian Lance Taylor <iant@google.com>
12128
12129 * descriptor.cc: Include <cstdio> and "binary-io.h".
12130 (Descriptors::open): Open the files in binary mode always.
12131 * script.cc (Lex::get_token): Treat \r as whitespace.
12132
d4780e57
ILT
121332009-10-09 Ian Lance Taylor <iant@google.com>
12134
12135 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12136
d9a893b8
ILT
121372009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12138 Ian Lance Taylor <iant@google.com>
12139
12140 * configure.ac: Check for readv function also.
12141 * fileread.cc (readv): Define if not HAVE_READV.
12142 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12143 does not exist.
12144 * config.in: Regenerate.
12145 * configure: Regenerate.
12146
c0a62865
DK
121472009-10-09 Doug Kwan <dougkwan@google.com>
12148
12149 * layout.cc (Layout::make_output_section): Call target hook to make
12150 ordinary output section.
12151 (Layout::finalize): Adjust parameter list of call the
12152 Target::may_relax().
12153 * layout.h (class Layout::section_list): New method.
12154 * merge.h (Output_merge_base::entsize): Change visibility to public.
12155 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12156 New methods.
12157 (Output_merge_string::do_is_string): New method.
12158 * object.cc (Sized_relobj::do_setup): renamed from
12159 Sized_relobj::set_up.
12160 * object.h (Sized_relobj::adjust_shndx,
12161 Sized_relobj::initializ_input_to_output_maps,
12162 Sized_relobj::free_input_to_output_maps): Change visibilities to
12163 protected.
12164 (Sized_relobj::setup): Virtualize.
12165 (Sized_relobj::do_setup): New method declaration.
12166 (Sized_relobj::invalidate_section_offset,
12167 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12168 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12169 * options.cc (parse_int): New function.
12170 * options.h (parse_int): New declaration.
12171 (DEFINE_int): New macro.
12172 (stub_group_size): New option.
12173 * output.cc (Output_section::Output_section): Initialize memebers
12174 merge_section_map_, merge_section_by_properties_map_,
12175 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12176 (Output_section::add_input_section): Handled deferred code-fill
12177 generation and remove an old comment.
12178 (Output_section::add_relaxed_input_section): New method definition.
12179 (Output_section::add_merge_input_section): Use merge section by
12180 properties map to speed to search. Update merge section maps
12181 as appropriate.
12182 (Output_section::build_relaxation_map): New method definition.
12183 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12184 Same.
12185 (Output_section::relax_input_section): Renamed to
12186 Output_section::convert_input_sections_to_relaxed_sections and change
12187 interface to take a vector of pointers to relaxed sections.
12188 (Output_section::find_merge_section,
12189 Output_section::find_relaxed_input_section): New method definitions.
12190 (Output_section::is_input_address_mapped,
12191 Output_section::output_offset, Output_section::output_address):
12192 Use output section data maps to speed up searching.
12193 (Output_section::find_starting_output_address): Add comments.
12194 (Output_section::do_write,
12195 Output_section::write_to_postprocessing_buffer): Do code-fill
12196 generation as appropriate.
12197 (Output_section::get_input_sections): Invalidate relaxed input section
12198 map.
12199 (Output_section::restore_states): Adjust type of checkpoint .
12200 Invalidate relaxed input section map.
12201 * output.h (Output_merge_base): New class declaration.
12202 (Input_section_specifier): New class defintion.
12203 (class Output_relaxed_input_section) Change base class to
12204 Output_section_data_build.
12205 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12206 base class initializer.
12207 (Output_section::add_relaxed_input_section): New method declaration.
12208 (Output_section::Input_section): Change visibility to protected.
2e702c99 12209 (Output_section::Input_section::relobj,
c0a62865
DK
12210 Output_section::Input_section::shndx): Handle relaxed input sections.
12211 Output_section::input_sections) Change visibility to protected. Also
12212 define overload to return a non-const pointer.
12213 (Output_section::Merge_section_properties): New class defintion.
12214 (Output_section::Merge_section_by_properties_map,
12215 Output_section::Output_section_data_by_input_section_map,
12216 Output_section::Relaxation_map): New types.
12217 (Output_section::relax_input_section): Rename method to
12218 Output_section::convert_input_sections_to_relaxed_sections and change
12219 interface to take a vector of relaxed section pointers.
12220 (Output_section::find_merge_section,
12221 Output_section::find_relaxed_input_section,
12222 Output_section::build_relaxation_map,
12223 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12224 New method declarations.
12225 (Output_section::merge_section_map_
12226 Output_section::merge_section_by_properties_map_,
12227 Output_section::relaxed_input_section_map_,
12228 Output_section::is_relaxed_input_section_map_valid_,
12229 Output_section::generate_code_fills_at_write_): New data members.
12230 * script-sections.cc
12231 (Output_section_element_input::set_section_addresses): Call
12232 current_data_size and addralign methods of relaxed input sections.
12233 (Orphan_output_section::set_section_addresses): Call current_data_size
12234 and addralign methods of relaxed input sections.
12235 * symtab.cc (Symbol_table::compute_final_value): Extract template
12236 from the body of Symbol_table::sized_finalize_symbol.
12237 (Symbol_table::sized_finalized_symbol): Call
12238 Symbol_table::compute_final_value.
12239 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12240 (Symbol_table::compute_final_value): New templated method declaration.
12241 * target.cc (Target::do_make_output_section): New method defintion.
12242 * target.h (Target::make_output_section): New method declaration.
12243 (Target::relax): Add more parameters for input objects, symbol table
12244 and layout. Adjust call to do_relax.
12245 (Target::do_make_output_section): New method declaration.
12246 (Target::do_relax): Add parameters for input objects, symbol table
12247 and layout.
12248
d446d6c4
ILT
122492009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12250
12251 * pread.c: Include stdio.h.
12252
bc06c745
ILT
122532009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12254
12255 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12256 defined.
12257
75aea3d0
ILT
122582009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12259
12260 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12261 Change read_shndx type to unsigned int.
12262 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12263 int.
12264 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12265 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12266 Change read_shndx type to unsigned int.
12267 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12268 int.
12269 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12270 * layout.cc (Layout::create_symtab_sections): Cast the result of
12271 local_symcount * symsize to off_t in the gold_assert.
12272
be8fcb75
ILT
122732009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12274
12275 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12276 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12277 R_ARM_BASE_ABS.
12278 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12279 (Arm_relocate_functions::thm_abs5): New function.
12280 (Arm_relocate_functions::abs12): New function.
12281 (Arm_relocate_functions::abs16): New function.
12282 (Arm_relocate_functions::base_abs): New function.
12283 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12284 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12285 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12286 R_ARM_BASE_ABS.
12287 (Scan::global): Likewise.
12288 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12289 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12290 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12291 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12292 R_ARM_BASE_ABS.
12293
c2a122b6
ILT
122942009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12295
12296 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12297 (Arm_relocate_functions::movt_prel): New function.
12298 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12299 (Arm_relocate_functions::thm_movt_prel): New function.
12300 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12301 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12302 (Scan::global, Relocate::relocate): Likewise.
12303 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12304
c4aa1e2d
ILT
123052009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12306
12307 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12308 Incremental_checker.
12309 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12310 unsigned int.
12311 (class Incremental_inputs_header): New class.
12312 (Incremental_inputs_header_writer): Edit comment.
12313 (Incremental_inputs_entry): New class.
12314 (Incremental_inputs_entry_writer): Edit comment.
12315 (Sized_incremental_binary::do_find_incremental_inputs_section):
12316 Add *strtab_shndx parameter, fill it.
12317 (Sized_incremental_binary::do_check_inputs): New method.
12318 (Incremental_checker::can_incrementally_link_output_file): Use
12319 Sized_incremental_binary::check_inputs.
12320 (Incremental_inputs::report_command_line): Save command line in
12321 command_line_.
12322 * incremental.h:
12323 (Incremental_binary::find_incremental_inputs_section): New
12324 method.
12325 (Incremental_binary::do_find_incremental_inputs_section): Add
12326 strtab_shndx parameter.
12327 (Incremental_binary::do_check_inputs): New pure virtual method.
12328 (Sized_incremental_binary::do_check_inputs): Declare.
12329 (Incremental_checker::Incremental_checker): Add incremental_inputs
12330 parameter, use it to initialize incremental_inputs_.
12331 (Incremental_checker::incremental_inputs_): New field.
12332 (Incremental_checker::command_line): New method.
12333 (Incremental_checker::inputs): New method.
12334 (Incremental_checker::command_line_): New field.
12335
c549a694
ILT
123362009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12337
12338 * incremental.cc: Include <cstdarg> and "target-select.h".
12339 (vexplain_no_incremental): New function.
12340 (explain_no_incremental): New function.
12341 (Incremental_binary::error): New method.
12342 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12343 method.
12344 (make_sized_incremental_binary): New function.
12345 (open_incremental_binary): New function.
12346 (can_incrementally_link_file): Add checks if output is ELF and has
12347 inputs section.
12348 * incremental.h: Include "elfcpp_file.h" and "output.h".
12349 (Incremental_binary): New class.
12350 (Sized_incremental_binary): New class.
12351 (open_incremental_binary): Declare.
12352 * object.cc (is_elf_object): Use
12353 elfcpp::Elf_recognizer::is_elf_file.
12354 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12355 * output.h (Output_file::filesize): New method.
12356
fd3c5f0b
ILT
123572009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12358
12359 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12360 New function.
12361 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12362 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12363 function.
12364 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12365 function.
12366 (Arm_relocate_functions::movw_abs_nc): New function.
12367 (Arm_relocate_functions::movt_abs): New function.
12368 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12369 (Arm_relocate_functions::thm_movt_abs): New function.
12370 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12371 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12372 (Scan::global): Likewise.
12373 (Relocate::relocate): Likewise.
12374 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12375
7f5309a5
ILT
123762009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12377
12378 * arm.cc (Arm_relocate_functions::got_prel) New function.
12379 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12380 (Relocate::relocate): Likewise.
12381 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12382
364c7fa5
ILT
123832009-10-06 Ian Lance Taylor <iant@google.com>
12384
12385 * options.h (class General_options): Define
12386 split_stack_adjust_size parameter.
12387 * object.h (class Object): Add uses_split_stack_ and
12388 has_no_split_stack_ fields. Add uses_split_stack and
12389 has_no_split_stack accessor functions. Declare
12390 handle_split_stack_section.
12391 (class Reloc_symbol_changes): Define.
12392 (class Sized_relobj): Define Function_offsets. Declare
12393 split_stack_adjust, split_stack_adjust_reltype, and
12394 find_functions.
12395 * object.cc (Object::handle_split_stack_section): New function.
12396 (Sized_relobj::do_layout): Call handle_split_stack_section.
12397 * dynobj.cc (Sized_dynobj::do_layout): Call
12398 handle_split_stack_section.
12399 * reloc.cc (Sized_relobj::relocate_sections): Call
12400 split_stack_adjust for executable sections in split_stack
12401 objects. Pass reloc_map to relocate_section.
12402 (Sized_relobj::split_stack_adjust): New function.
12403 (Sized_relobj::split_stack_adjust_reltype): New function.
12404 (Sized_relobj::find_functions): New function.
12405 * target-reloc.h: Include "object.h".
12406 (relocate_section): Add reloc_symbol_changes parameter. Change
12407 all callers.
12408 * target.h (class Target): Add calls_non_split method. Declare
12409 do_calls_non_split virtual method. Declare match_view and
12410 set_view_to_nop.
12411 * target.cc: Include "elfcpp.h".
12412 (Target::do_calls_non_split): New function.
12413 (Target::match_view): New function.
12414 (Target::set_view_to_nop): New function.
12415 * gold.cc (queue_middle_tasks): Give an error if mixing
12416 split-stack and non-split-stack objects with -r.
12417 * i386.cc (Target_i386::relocate_section): Add
12418 reloc_symbol_changes parameter.
12419 (Target_i386::do_calls_non_split): New function.
12420 * x86_64.cc (Target_x86_64::relocate_section): Add
12421 reloc_symbol_changes parameter.
12422 (Target_x86_64::do_calls_non_split): New function.
12423 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12424 parameter.
12425 * powerpc.cc (Target_powerpc::relocate_section): Add
12426 reloc_symbol_changes parameter.
12427 * sparc.cc (Target_sparc::relocate_section): Add
12428 reloc_symbol_changes parameter.
12429 * configure.ac: Call AM_CONDITIONAL for the default target.
12430 * configure: Rebuild.
12431 * testsuite/Makefile.am (TEST_AS): New variable.
12432 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12433 (check_DATA): Add split_i386 and split_x86_64 files.
12434 (SPLIT_DEFSYMS): Define.
12435 (split_i386_[1234n].o): New targets.
12436 (split_i386_[124]): New targets.
12437 (split_i386_[1234r].stdout): New targets.
12438 (split_x86_64_[1234n].o): New targets.
12439 (split_x86_64_[124]): New targets.
12440 (split_x86_64_[1234r].stdout): New targets.
12441 (MOSTLYCLEANFILES): Add new executables.
12442 * testsuite/split_i386.sh: New file.
12443 * testsuite/split_x86_64.sh: New file.
12444 * testsuite/split_i386_1.s: New file.
12445 * testsuite/split_i386_2.s: New file.
12446 * testsuite/split_i386_3.s: New file.
12447 * testsuite/split_i386_4.s: New file.
12448 * testsuite/split_i386_n.s: New file.
12449 * testsuite/split_x86_64_1.s: New file.
12450 * testsuite/split_x86_64_2.s: New file.
12451 * testsuite/split_x86_64_3.s: New file.
12452 * testsuite/split_x86_64_4.s: New file.
12453 * testsuite/split_x86_64_n.s: New file.
12454 * testsuite/testfile.cc (Target_test): Update relocation_section
12455 function.
12456 * testsuite/Makefile.in: Rebuild.
12457
e8a9fcda
ILT
124582009-10-06 Ian Lance Taylor <iant@google.com>
12459
12460 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12461 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12462 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12463 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12464 the address on ldo_addrs_.
12465 (Target_i386::Relocate::fix_up_ldo): New function.
12466
e99daf92
ILT
124672009-10-06 Rafael Espindola <espindola@google.com>
12468
12469 * plugin.cc (add_input_library): New.
12470 (Plugin::load): Add add_input_library to tv.
12471 (Plugin_manager::add_input_file): Add the is_lib argument.
12472 (add_input_file): Update call to Plugin_manager::add_input_file.
12473 (add_input_library): New.
12474 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12475
966d4097
DK
124762009-09-30 Doug Kwan <dougkwan@google.com>
12477
12478 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12479 symbol and call Symbol::may_need_copy_reloc to determine if
12480 a copy reloc is needed.
12481 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12482 nocopyreloc is given in command line.
12483 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12484 given in command line.
12485 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12486 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12487 of the removed Target_i386::may_need_copy_reloc.
12488 * options.h (copyreloc): New option with default value false.
12489 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12490 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12491 instead of the removed Target_powerpc::may_need_copy_reloc.
12492 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12493 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12494 instead of the removed Target_sparc::may_need_copy_reloc.
12495 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12496 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12497 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12498 instead of the removed Target_x86_64::may_need_copy_reloc.
12499
029ba973
ILT
125002009-09-30 Ian Lance Taylor <iant@google.com>
12501
12502 * object.h (class Object): Remove target_ field, and target,
12503 sized_target, and set_target methods.
12504 (Object::sized_target): Remove.
12505 (class Sized_relobj): Update declarations. Remove sized_target.
12506 * object.cc (Sized_relobj::setup): Remove target parameter.
12507 Change all callers.
12508 (Input_objects::add_object): Don't do anything with the target.
12509 (make_elf_sized_object): Add punconfigured parameter. Change all
12510 callers. Set or test parameter target.
12511 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12512 Change all callers.
12513 * parameters.cc (Parameters::set_target): Change parameter type to
12514 be non-const.
12515 (Parameters::default_target): Remove.
12516 (set_parameters_target): Change parameter type to be non-const.
12517 (parameters_force_valid_target): New function.
12518 (parameters_clear_target): New function.
12519 * parameters.h (class Parameters): Update declarations. Remove
12520 default_target method. Add sized_target and clear_target
12521 methods. Change target_ to be non-const.
12522 (set_parameters_target): Update declaration.
12523 (parameters_force_valid_target): Declare.
12524 (parameters_clear_target): Declare.
12525 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12526 as NULL if we aren't searching.
12527 (Add_symbols::run): Don't check for compatible target.
12528 * fileread.cc (Input_file::open_binary): Call
12529 parameters_force_valid_target.
12530 * gold.cc (queue_middle_tasks): Likewise.
12531 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12532 set_target on object.
12533 * dynobj.h (class Sized_dynobj): Update declarations.
12534 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12535 make_elf_object returns NULL.
12536 (Archive::include_member): Don't check whether object target is
12537 compatible.
12538 * output.cc (Output_section::add_input_section): Get target from
12539 parameters.
12540 (Output_section::relax_input_section): Likewise.
12541 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12542 parameters.
12543 (Sized_relobj::do_scan_relocs): Likewise.
12544 (Sized_relobj::relocate_sections): Likewise.
12545 * resolve.cc (Symbol_table::resolve): Likewise.
12546 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12547 parameter. Change all callers.
12548 (Symbol_table::add_from_object): Get target from parameters.
12549 (Symbol_table::add_from_relobj): Don't check object target.
12550 (Symbol_table::add_from_dynobj): Likewise.
12551 (Symbol_table::define_special_symbol): Get target from
12552 parameters.
12553 * symtab.h (class Symbol_table): Update declaration.
12554 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12555 parameter. Change all callers. Clear parameter target.
12556 (Binary_test): Test target here.
12557 * testsuite/object_unittest.cc (gold_testsuite): Remove
12558 target_test_pointer parameter. Change all callers.
12559 (Object_test): Test target here.
12560
a6a22b83
ILT
125612009-09-26 Ian Lance Taylor <iant@google.com>
12562
12563 * testsuite/initpri1.c: Don't try to use constructor priorities if
12564 compiling with gcc before 4.3.
12565
6a8f49fe
ILT
125662009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12567
12568 * testsuite/retain_symbols_file_test.sh (check_present): Change
12569 output file name to retain_symbols_file_test.stdout.
12570 (check_absent): Likewise.
12571
8c604651
CS
125722009-09-18 Craig Silverstein <csilvers@google.com>
12573
12574 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12575 * options.cc: Include <cerrno> and <fstream>.
12576 (General_options::finalize): Parse -retain-symbols-file tag.
12577 * options.h: New flag.
12578 (General_options): New method should_retain_symbol, new
12579 variable symbols_to_retain.
12580 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12581 should_retain_symbol map.
12582 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12583 * testsuite/Makefile.in: Regenerate.
12584 * testsuite/retain_symbols_file_test.sh: New file.
12585
ca58b19f
NC
125862009-09-18 Nick Clifton <nickc@redhat.com>
12587
12588 * po/es.po: Updated Spanish translation.
12589
20e6d0d6
DK
125902009-09-17 Doug Kwan <dougkwan@google.com>
12591
12592 * debug.h (DEBUG_RELAXATION): New constant.
12593 (DEBUG_ALL): Add DEBUG_RELAXATION.
12594 (debug_string_to_enum): Add relaxation debug option.
12595 * layout.cc
12596 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12597 Layout::Relaxation_debug_check::read_sections,
12598 Layout::Relaxation_debug_check::read_sections): New method definitions.
12599 (Layout::Layout): Initialize data members
12600 record_output_section_data_from_scrips_,
12601 script_output_section_data_list_ and relaxation_debug_check_.
12602 (Layout::save_segments, Layout::restore_segments,
12603 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12604 Layout::relaxation_loop_body): New method definitions.
12605 (Layout::finalize): Support relaxation. Move section layout code to
12606 Layout::relaxation_loop_body.
12607 (Layout::set_asection_address_from_script): Move code for orphan
12608 section placement out.
12609 (Layout::place_orphan_sections_in_script): New method definition.
12610 * layout.h (Output_segment_headers, Output_file_header):
12611 New forward class declarations.
12612 (Layout::~Layout): Define.
12613 (Layout::new_output_section_data_from_script): New method definition.
12614 (Layout::place_orphan_sections_in_script): New method declaration.
12615 (Layout::Segment_states): New type declaration.
12616 (Layout::save_segments, Layout::restore_segments,
12617 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12618 Layout::relaxation_loop_body): New method declarations.
12619 (Layout::Output_section_data_list): New type declaration.
12620 (Layout::Relaxation_debug_check): New class definition.
12621 (Layout::record_output_section_data_from_script_,
12622 Layout::script_output_section_data_list_, Layout::segment_states_,
12623 Layout::relaxation_debug_check_): New data members.
12624 * output.cc: (Output_section_headers::do_size): New method definition.
12625 (Output_section_headers::Output_section_headers): Move size
12626 computation to Output_section_headers::do_size.
12627 (Output_segment_headers::do_size): New method definition.
e1df38aa 12628 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
12629 Output_file_header::do_size and call it.
12630 (Output_file_header::do_size): New method definition.
12631 (Output_data_group::Output_data_group): Adjust call to
12632 Output_section_data.
12633 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12634 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 12635 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
12636 RELAXED_INPUT_SECTION_CODE.
12637 (Output_section::Output_section): Initialize data member checkpoint_.
12638 (Output_section::~Output_section): Delete checkpoint object pointed
12639 by checkpoint_.
12640 (Output_section::add_input_section): Always add an Input_section if
12641 relaxing.
12642 (Output_section::add_merge_input_section): Add assert.
12643 (Output_section::relax_input_section): New method definition.
12644 (Output_section::set_final_data_size): Set load address to zero for
12645 an unallocated section.
12646 (Output_section::do_address_and_file_offset_have_reset_values):
12647 New method definition.
12648 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12649 Handle relaxed input section.
12650 (Output_section::sort_attached_input_sections): Checkpoint input
12651 section list lazily.
12652 (Output_section::get_input_sections): Change type of input_sections to
12653 list of Simple_input_section pointers. Checkpoint input section list
12654 lazily. Also handle relaxed input sections.
12655 (Output_section::add_input_section_for_script): Take a reference to
12656 a Simple_input_section object instead of Relobj pointer and section
12657 index as parameter. Handle relaxed input sections.
12658 (Output_section::save_states, Output_section::restore_states): New
12659 method definitions.
12660 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12661 (Output_data::is_data_size_fixed): New method definition.
12662 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12663 if it is fixed.
12664 (Output_data::address_and_file_offset_have_reset_values): New method
12665 definition.
12666 (Output_data::do_address_and_file_offset_have_reset_values): New method
12667 definition.
12668 (Output_data::set_data_size): Check that data size is not fixed.
12669 (Output_data::fix_data_size): New method definition.
12670 (Output_data::is_data_size_fixed_): New data member.
12671 (Output_section_headers::set_final_data_size): New method definition.
12672 (Output_section_headers::do_size): New method declaration.
12673 (Output_segment_headers::set_final_data_size): New method definition.
12674 (Output_segment_headers::do_size): New method declaration.
12675 (Output_file_header::set_final_data_size)::New method definition.
12676 (Output_file_header::do_size)::New method declaration.
12677 (Output_section_data::Output_section_data): Add new parameter
12678 is_data_size_fixed and use it to fix data size.
12679 (Output_data_const::Output_data_const): Adjust call to base class
12680 constructor and fix data size.
12681 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12682 base class constructor and fix data size.
12683 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12684 base class constructor and fix data size.
12685 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12686 class constructor and fix data size.
12687 (Output_data_group::set_final_data_size): New method definition.
12688 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12689 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12690 class constructor and fix data size.
12691 (Output_relaxed_input_section): New class definition.
12692 (Output_section::Simple_input_section): New class definition.
12693 (Output_section::get_input_sections): Adjust parameter list.
12694 (Output_section::add_input_section_for_script): Same.
12695 (Output_section::save_states, Output_section::restore_states,
12696 Output_section::do_address_and_file_offset_have_reset_values,
12697 (Output_section::Input_section::Input_section): Handle
12698 RELAXED_INPUT_SECTION_CODE. Add new overload for
12699 Output_relaxed_input_section.
12700 (Output_section::Input_section::is_input_section,
12701 Output_section::Input_section::set_output_section): Handle relaxed
12702 input section.
12703 (Output_section::Input_section::is_relaxed_input_section,
12704 Output_section::Input_section::output_section_data,
12705 Output_section::Input_section::relaxed_input_section): New method
12706 definitions.
12707 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12708 value.
12709 (Output_section::Input_section::u1_): Update comments.
12710 (Output_section::Input_section::u2_): Add new union member poris.
12711 (Output_section::Checkpoint_output_section): New classs definition.
12712 (Output_section::relax_input_section): New method declaration.
12713 (Output_section::checkpoint_): New data member.
12714 (Output_segment): Update comments.
12715 (Output_segment::Output_segment): Un-privatize copy constructor.
12716 (Output_segment::operator=): Un-privatize.
12717 * script-sections.cc (Output_section_element::Input_section_list):
12718 Change element type to Output_section::Simple_input_section.
12719 (Output_section_element_dot_assignment::set_section_addresses):
12720 Register output section data for relaxation clean up.
12721 (Output_data_exression::Output_data_expression): Adjust call to base
12722 constructor to fix data size.
12723 (Output_section_element_data::set_section_addresses): Register
12724 Output_data_expression object for relaxation clean up.
12725 (struct Input_section_info): Replace Relobj pointer and section index
12726 pair with Output_section::Simple_input_section and Convert struct to a
12727 class.
12728 (Input_section_sorter::operator()): Adjust access to
e1df38aa 12729 Input_section_info data member to use accessors.
20e6d0d6
DK
12730 (Output_section_element_input::set_section_addresses): Use layout
12731 parameter. Adjust code to use Output_section::Simple_input_section
12732 and Input_secction_info classes. Register filler for relaxation
12733 clean up.
12734 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12735 and section index pair with Output_section::Simple_input_section
12736 class. Adjust code accordingly.
12737 (Phdrs_element::release_segment): New method definition.
12738 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12739 segment list.
12740 (Script_sections::release_segments): New method definition.
12741 * gold/script-sections.h (Script_sections::release_segments): New
12742 method declaration.
12743 * gold/target.h (Target::may_relax, Target::relax,
12744 Target::do_may_relax, Target::do_relax): New method definitions.
12745
5e445df6
ILT
127462009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12747
12748 * arm.cc (has_signed_unsigned_overflow): New function.
12749 (Arm_relocate_functions::abs8): New function.
12750 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12751 (Target_arm::Scan::global): Likewise.
12752 (Target_arm::relocate::relocate): Likewise.
12753 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12754 Likewise.
12755
8c604651 127562009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
12757
12758 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12759 * testsuite/Makefile.in: Regenerate.
12760
1e9cc1c2
NC
127612009-09-11 Nick Clifton <nickc@redhat.com>
12762
12763 * po/gold.pot: Updated by the Translation project.
12764
6a89f575
CC
127652009-09-08 Cary Coutant <ccoutant@google.com>
12766
12767 * output.cc (Output_file::open): Add execute permission to empty file.
12768 * testsuite/Makefile.am (permission_test): New test.
12769 * testsuite/Makefile.in: Regenerate.
12770
fdcac5af
ILT
127712009-09-02 Ian Lance Taylor <iant@google.com>
12772
12773 * output.cc (Output_file::resize): Call map_no_anonymous rather
12774 than map.
12775
44453f85
ILT
127762009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12777
12778 * gold.cc: Include "incremental.h".
12779 (queue_initial_tasks): Call Incremental_checker methods.
12780 * incremental.cc: Include "output.h".
12781 (Incremental_checker::can_incrementally_link_output_file): New
12782 method.
12783 * incremental.h (Incremental_checker): New class.
12784
12785 * output.cc (Output_file::open_for_modification): New method.
12786 (Output_file::map_anonymous): Changed return type to bool. Record
12787 map in base_ field.
12788 (Output_file::map_no_anonymous): New method, broken out of map.
12789 (Output_file::map): Use map_no_anonymous and map_anonymous.
12790 * output.h (class Output_file): Update declarations.
12791
293c1386
CC
127922009-08-24 Cary Coutant <ccoutant@google.com>
12793
12794 * options.h (Command_line::Pre_options): New class.
12795 (Command_line::pre_options): New member.
12796 * options.cc (gold::options::ready_to_register): New variable.
12797 (One_option::register_option): Do nothing if not registering options.
12798 Assert if same short option registered twice.
12799 (General_options::General_options): Turn off option registration when
12800 done constructing.
12801 (Command_line::Pre_options::Pre_options): New constructor.
12802
f773f3d2
CC
128032009-08-24 Cary Coutant <ccoutant@google.com>
12804
06a73cfe
CC
12805 * options.h (General_options::no_keep_memory): Remove incorrect
12806 short option.
f773f3d2 12807
a15af8e2
RW
128082009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12809
12810 * Makefile.am (am__skiplex, am__skipyacc): New.
12811 * Makefile.in: Regenerate.
12812
c462b41b
RW
128132009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12814
14ec8efd
RW
12815 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12816 (INCLUDES): ... this.
12817 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12818 (AM_CPPFLAGS): Renamed from ...
12819 (INCLUDE): ... this.
12820 * Makefile.in, testsuite/Makefile.in: Regenerate.
12821
81ecdfbb
RW
12822 * Makefile.in: Regenerate.
12823 * aclocal.m4: Likewise.
12824 * config.in: Likewise.
12825 * configure: Likewise.
12826 * testsuite/Makefile.in: Likewise.
12827
c462b41b
RW
12828 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12829 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12830 * Makefile.in: Regenerate.
12831 * testsuite/Makefile.in: Regenerate.
12832
2da73f13
CC
128332009-08-19 Cary Coutant <ccoutant@google.com>
12834
12835 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12836 symbols in shared libraries overridden by hidden or internal symbols
12837 in the main program.
12838
2db70501
CD
128392009-08-19 Chris Demetriou <cgd@google.com>
12840
12841 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12842 checking source file names in error messages.
12843
f733487b
DK
128442009-08-18 Doug Kwan <dougkwan@google.com>
12845
12846 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12847 an elcpp::Ehdr as parameter. Adjust call to set_target.
12848 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12849 an elfcpp::Ehdr as parameter.
12850 * object.cc (Object::set_target): Remove the version that looks up
12851 a target and sets it.
12852 (Sized_relobj::setup): Take a Target object instead of
12853 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12854 (make_elf_sized_object): Find target and ask target to
12855 make an ELF object.
12856 * object.h: (Object::set_target): Remove the version that looks up
12857 a target and sets it.
12858 (Sized_relobj::setup): Take a Target object instead of
12859 an elfcpp:Ehdr as parameter.
12860 * target.cc: Include dynobj.h.
12861 (Target::do_make_elf_object_implementation): New.
2e702c99 12862 (Target::do_make_elf_object): New.
f733487b
DK
12863 * target.h (Target::make_elf_object): New template declaration.
12864 (Target::do_make_elf_object): New method declarations.
12865 (Target::do_make_elf_object_implementation): New template declaration.
12866
cc70f101
ILT
128672009-08-14 Ian Lance Taylor <iant@google.com>
12868
12869 * gold.h (FUNCTION_NAME): Define.
12870 (gold_unreachable): Use FUNCTION_NAME.
12871
ef5e0cb1
ST
128722009-08-12 Sriraman Tallam <tmsriram@google.com>
12873
12874 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12875 symbol in the --keep-unique list is not found.
12876
48c187ce
ST
128772009-08-12 Sriraman Tallam <tmsriram@google.com>
12878
12879 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12880 been maked as --keep-unique.
12881 (Icf::unfold_section): New function.
12882 * icf.h (Icf::unfold_section): New function.
12883 * options.h (General_options::keep_unique): New option.
12884 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12885 * testsuite/Makefile.in: Regenerate.
12886 * testsuite/icf_keep_unique_test.sh: New file.
12887 * testsuite/icf_keep_unique_test.cc: New file.
12888
645afe0c
CC
128892009-08-12 Cary Coutant <ccoutant@google.com>
12890
12891 PR 10471
12892 * resolve.cc (Symbol_table::resolve): Check for references from
12893 dynamic objects to hidden and internal symbols.
12894 * testsuite/Makefile.am (hidden_test.sh): New test.
12895 * testsuite/Makefile.in: Regenerate.
12896 * testsuite/hidden_test.sh: New script.
12897 * testsuite/hidden_test_1.c: New test source.
12898 * testsuite/hidden_test_main.c: New test source.
12899
11af873f
DK
129002009-08-11 Doug Kwan <dougkwan@google.com>
12901
12902 * arm.cc: Update comments.
12903 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12904 segment to locate the .ARM.exidx section if present.
12905
b9f7d72d
DK
129062009-08-09 Doug Kwan <dougkwan@google.com>
12907
12908 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12909 patch.
12910
ddd3c53c
ST
129112009-08-07 Sriraman Tallam <tmsriram@google.com>
12912 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12913 compiler warnings.
12914
27721062
ST
129152009-08-06 Sriraman Tallam <tmsriram@google.com>
12916
12917 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12918 valid tls_segment only for non-debug-section relocations.
12919 * testsuite/Makefile.am: Add gc_tls_test.
12920 * testsuite/Makefile.in: Regenerate.
12921 * testsuite/gc_tls_test.cc: New file.
12922 * testsuite/gc_tls_test.sh: New file.
12923
ef15dade 129242009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 12925
ef15dade
ST
12926 * icf.cc: New file.
12927 * icf.h: New file.
12928 * Makefile.am (CCFILES): Add icf.cc.
12929 (HFILES): Add icf.h
12930 * Makefile.in: Regenerate.
12931 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12932 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12933 section, symbol and addend information for the relocs.
12934 * gold.cc (queue_middle_tasks): Call identical code folding.
12935 * gold.h: Add defines for multimap.
12936 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12937 to the call of finalize_local_symbols.
12938 * main.cc (main): Create object of class Icf.
12939 * object.cc (Sized_relobj::do_layout): Allow this function to be
12940 called twice during icf.
12941 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12942 to sections marked as identical by icf.
12943 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12944 when available.
12945 (Sized_relobj::do_section_entsize): New function.
12946 * object.h (Object::section_entsize): New function.
12947 (Object::do_section_entsize): New pure virtual function.
12948 (Relobj::finalize_local_symbols): Add new parameter.
12949 (Relobj::do_section_entsize): New function.
12950 * options.h (General_options::icf): New option.
12951 (General_options::icf_iterations): New option.
12952 (General_options::print_icf_sections): New option.
12953 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12954 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12955 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12956 icf.
12957 * symtab.cc (Symbol_table::is_section_folded): New function.
12958 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12959 to sections marked as identical by icf.
12960 * symtab.h (Symbol_table::set_icf): New function.
12961 (Symbol_table::icf): New function.
12962 (Symbol_table::is_section_folded): New function.
12963 (Symbol_table::icf_): New data member.
12964 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12965 * testsuite/Makefile.am: Add commands to build icf_test.
12966 * testsuite/Makefile.in: Regenerate.
12967 * testsuite/icf_test.sh: New file.
12968 * testsuite/icf_test.cc: New file.
12969
c3b65ac4
CD
129702009-07-24 Chris Demetriou <cgd@google.com>
12971
12972 * layout.cc (is_compressible_debug_section): Fix incorrect
12973 comment about compressed section names.
12974
1caf2c51
ILT
129752009-07-20 Ian Lance Taylor <ian@airs.com>
12976
12977 PR 10419
12978 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12979
1ef4d87f
ILT
129802009-07-16 Ian Lance Taylor <iant@google.com>
12981
12982 PR 10400
12983 * layout.h: #include <map>.
12984 (class Kept_section): Change from struct to class. Add accessors
12985 and setters. Add section size to Comdat_group mapping. Change
12986 Comdat_group to std::map. Add is_comdat_ field. Add
12987 linkonce_size field in union.
12988 (class Layout): Update declaration of find_or_add_kept_section.
12989 Don't declare find_kept_object.
12990 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12991 parameter. Add object, shndx, is_comdat, and is_group_name
12992 parameters. Change all callers. Adjust for new Kept_section.
12993 (Layout::find_kept_object): Remove.
12994 * object.cc (Sized_relobj::include_section_group): Update use of
12995 Kept_section. Rename secnum to shndx. Only record
12996 Kept_comdat_section if sections are the same size.
12997 (Sized_relobj::include_linkonce_section): Update use of
12998 Kept_section. Only record Kept_comdat_section if sections are the
12999 same size. Set size of linkonce section.
13000 (Sized_relobj::map_to_kept_section): Update call to
13001 get_kept_comdat_section.
13002 * object.h (class Sized_relobj): Rename fields in
13003 Kept_comdat_section to drop trailing underscores; change object
13004 field to Relobj*. Change Kept_comdat_section_table to store
13005 struct rather than pointer.
13006 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13007 Add kept_object and kept_shndx parameters. Change all callers.
13008 (Sized_relobj::get_kept_comdat_section): Change return type to
13009 bool. Add kept_object and kept_shndx parameters. Change all
13010 callers.
13011 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13012 Layout::find_or_add_kept_section.
13013
37c3b7b0
ILT
130142009-07-09 Ian Lance Taylor <iant@google.com>
13015
13016 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13017 Reserve space in the hash table.
13018
98fa85cb
ILT
130192009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13020
13021 * fileread.cc (File_read::get_mtime): New method.
13022 * fileread.h (Timespec): New structure.
13023 (File_read::get_mtime): New method.
13024 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13025 Renamed from timestamp_nsec.
13026 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13027 Elf_Xword.
e1df38aa 13028 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 13029 timestamp_nsec.
e1df38aa 13030 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
13031 (Incremental_inputs::report_obejct): Save mtime; style fix.
13032 (Incremental_inputs::report_script): Save mtime; style fix.
13033 (Incremental_inputs::finalize_inputs): Style fix.
13034 (Incremental_inputs::finalize): Style fix.
13035 (Incremental_inputs::create_input_section_data): Store inputs
13036 mtime.
13037 * incremental.h (Incremental_inputs::report_script): Add mtime
13038 argument.
13039 (Incremental_inputs::Input_info::Input_info): Intialize only one
13040 union member.
13041 (Incremental_inputs::Input_info::archive): Move to nameless
13042 union.
13043 (Incremental_inputs::Input_info::obejct): Move to nameless union.
13044 (Incremental_inputs::Input_info::script): Move to nameless union.
13045 (Incremental_inputs::mtime): New field.
13046 * script.cc (read_input_script): Pass file mtime to
13047 Incremental_input.
13048 * script.h (Script_info::inputs): Style fix.
13049
c9d70757
ILT
130502009-07-01 Ian Lance Taylor <ian@airs.com>
13051
13052 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13053 instead of 32.
13054
9c547ec3
ILT
130552009-06-24 Ian Lance Taylor <iant@google.com>
13056
13057 PR 10156
13058 * layout.cc (Layout::choose_output_section): If we find an
13059 existing section, update the flags.
13060 (Layout::create_notes): New function, broken out of
13061 Layout::finalize.
13062 (Layout::finalize): Don't create note sections.
13063 (Layout::create_note): Don't crash if linker script discards
13064 section.
13065 (Layout::create_gold_note): Likewise.
13066 (Layout::create_build_id): Likewise. Don't set
13067 after_input_sections on the section.
13068 (Layout::create_executable_stack_info): Remove target parameter.
13069 Change caller.
13070 * layout.h (class Layout): Declare create_notes. Update
13071 declaration of create_executable_stack_info.
13072 * gold.cc (queue_middle_tasks): Call create_notes.
13073 * output.cc (Output_section::update_flags_for_input_section): Move
13074 here from output.h. If SHF_ALLOC flag is newly set, mark address
13075 invalid.
13076 * output.h (Output_data::mark_address_invalid): New function.
13077 (class Output_section): Only declare, not define,
13078 update_flags_for_input_section. Remove set_flags.
13079
55458500
ILT
130802009-06-24 Ian Lance Taylor <iant@google.com>
13081
13082 * script-sections.cc (Output_section_definition::
13083 set_section_addresses): Rename shadowing local load_address to
13084 laddr.
13085
1307d6cd
ILT
130862009-06-24 Ian Lance Taylor <iant@google.com>
13087
13088 PR 10244
13089 * reloc.cc (relocate_sections): Skip empty relocation sections.
13090
ec3f783e
ILT
130912009-06-23 Ian Lance Taylor <iant@google.com>
13092
13093 PR 10156
13094 * layout.cc (Layout::create_note): Use choose_output_section
13095 rather than make_output_section.
13096
459c9f1c
ILT
130972009-06-23 Ian Lance Taylor <iant@google.com>
13098
13099 PR 10237
13100 * options.cc (General_options::parse_V): Set printed_version_.
13101 (General_options::General_options): Initialize printed_version_.
13102 * options.h (class General_options): Add printed_version_ field.
13103 * gold.cc (queue_initial_tasks): If there are no input files,
13104 don't give a fatal error if we printed the version information.
13105 (queue_middle_tasks): If using -r with a shared object, give a
13106 fatal error rather than an ordinary error.
13107
1518dc8f
ILT
131082009-06-23 Ian Lance Taylor <iant@google.com>
13109
13110 PR 10219
13111 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13112 (Layout::make_output_section): Set have_stabstr_section_ if we see
13113 a .stab*str section.
13114 (Layout::finalize): Call link_stabs_sections.
13115 (Layout::link_stabs_sections): New file.
13116 * layout.h (class Layout): Add have_stabstr_section_ field.
13117 Declare link_stabs_sections.
13118
3d857b98
DK
131192009-06-23 Doug Kwan <dougkwan@google.com>
13120
13121 * Makefile.am (libgold_a_LIBADD): New.
13122 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 13123 * Makefile.in: Regenerate.
3d857b98
DK
13124 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13125 * configure: Regenerate.
13126 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13127 * fileread.cc: Include sys/state.h
13128 * gold.h: Declare memmem and strndup if found missing.
13129 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13130
0639a6f6
ILT
131312009-06-23 Ian Lance Taylor <iant@google.com>
13132
13133 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13134 * configure: Rebuild.
13135
8d63875c
ILT
131362009-06-23 Ian Lance Taylor <iant@google.com>
13137
13138 PR 10147
13139 * object.cc (Object::section_contents): Don't try to get a view if
13140 the section has length zero.
13141 (Object::handle_gnu_warning_section): If the section is empty, use
13142 the name of the section as the warning.
13143
f7c8a183
ILT
131442009-06-23 Ian Lance Taylor <iant@google.com>
13145
13146 PR 10133
13147 * stringpool.h (class Stringpool_template): Add optimize_ field.
13148 (Stringpool_template::set_optimize): New function.
13149 * stringpool.cc (Stringpool_template::Stringpool_template):
13150 Initialize optimize_ field.
13151 (Stringpool_template::set_string_offsets): Test local optimize
13152 fild rather than parameter.
13153 * layout.cc (Layout::Layout): Call set_optimize on the section
13154 name stringpool.
13155
e6a307ba
ILT
131562009-06-22 Ian Lance Taylor <iant@google.com>
13157
13158 PR 10030
13159 * yyscript.y: Parse TARGET.
13160 * script.cc (script_set_target): New function.
13161 * script-c.h (script_set_target): Declare.
13162 * options.cc (General_options::string_to_object_format): Rename
13163 from string_to_object_format in anonymous namespace. Change
13164 callers.
13165 * options.h (class General_options): Declare
13166 string_to_object_format.
13167
3ee173de
ILT
131682009-06-22 Ian Lance Taylor <iant@google.com>
13169
13170 * script-sections.cc (Script_sections::create_segments): Don't put
13171 program headers in a PT_LOAD segment if -n or -N.
13172
131732009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
13174
13175 PR 10141
13176 * options.h (class General_options): Add -z lazy and -z now. Sort
13177 -z options into alphabetical order.
13178 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13179
cd6739a1 131802009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
13181
13182 * layout.cc (Layout::make_output_section): Call
13183 Target::new_output_section.
13184 (Layout::attach_allocated_section_to_segment): Put large section
13185 sections in a separate load segment with the large segment flag
13186 set.
13187 (Layout::segment_precedes): Sort large data segments after other
13188 load segments.
13189 (align_file_offset): New static function.
13190 (Layout::set_segment_offsets): Use align_file_offset.
13191 * output.h (class Output_section): Add is_small_section_ and
13192 is_large_section_ fields.
13193 (Output_section::is_small_section): New function.
13194 (Output_section::set_is_small_section): New function.
13195 (Output_section::is_large_section): New function.
13196 (Output_section::set_is_large_section): New function.
13197 (Output_section::is_large_data_section): New function.
13198 (class Output_segment): Add is_large_data_segment_ field.
13199 (Output_segment::is_large_data_segment): New function.
13200 (Output_segment::set_is_large_data_segment): New function.
13201 * output.cc (Output_section::Output_section): Initialize new
13202 fields.
13203 (Output_segment::Output_segment): Likewise.
13204 (Output_segment::add_output_section): Add assertion that large
13205 data sections always go in large data segments. Force small data
13206 sections to the end of the list of data sections. Force small BSS
13207 sections to the start of the list of BSS sections. For large BSS
13208 sections to the end of the list of BSS sections.
13209 * symtab.h (class Symbol): Declare is_common_shndx.
13210 (Symbol::is_defined): Check Symbol::is_common_shndx.
13211 (Symbol::is_common): Likewise.
13212 (class Symbol_table): Define enum Commons_section_type. Update
13213 declarations. Add small_commons_ and large_commons_ fields.
13214 * symtab.cc (Symbol::is_common_shndx): New function.
13215 (Symbol_table::Symbol_table): Initialize new fields.
13216 (Symbol_table::add_from_object): Put small and large common
13217 symbols in the right list.
13218 (Symbol_table::sized_finalized_symbol): Check
13219 Symbol::is_common_shndx.
13220 (Symbol_table::sized_write_globals): Likewise.
13221 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13222 common symbol lists. Don't call do_allocate_commons_list if the
13223 list is empty.
13224 (Symbol_table::do_allocate_commons_list): Remove is_tls
13225 parameter. Add comons_section_type parameter. Change all
13226 callers. Handle small and large common symbols.
13227 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13228 Symbol::is_common_shndx.
13229 * resolve.cc (symbol_to_bits): Likewise.
13230 * target.h (Target::small_common_shndx): New function.
13231 (Target::small_common_section_flags): New function.
13232 (Target::large_common_shndx): New function.
13233 (Target::large_common_section_flags): New function.
13234 (Target::new_output_section): New function.
13235 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13236 small_common_section_flags, and large_common_section_flags
13237 fields.
13238 (Target::do_new_output_section): New virtual function.
13239 * arm.cc (Target_arm::arm_info): Initialize new fields.
13240 * i386.cc (Target_i386::i386_info): Likewise.
13241 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13242 Likewise.
13243 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13244 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13245 (Target_x86_64::do_new_output_section): New function.
13246 * configure.ac: Define conditional MCMODEL_MEDIUM.
13247 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13248 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13249 (large_LDFLAGS): Define.
13250 * testsuite/large.c: New file.
13251 * testsuite/testfile.cc (Target_test::test_target_info):
13252 Initialize new fields.
13253 * configure, testsuite/Makefile.in: Rebuild.
13254
bb04269c
DK
132552009-06-05 Doug Kwan <dougkwan@google.com>
13256
13257 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13258 * Makefile.in: Regenerate.
bb04269c
DK
13259 * i386.cc (class Target_i386): Define new virtual method to
13260 override do_is_local_label_name in parent.
13261 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13262 local symbols if --discard-locals or -X is given.
13263 * options.h (class General_options): Declare new options
13264 '--discard-locals' and '-X' for discarding locals.
13265 * target.h (class Target): Define new methods is_local_label_name.
13266 Declare new virtual method do_is_local_label_name.
13267 * target.cc: New file.
13268 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13269 (check_SCRIPTS): Add discard_locals_test.sh.
13270 (check_DATA): Add discard_local_tests.syms.
13271 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13272 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13273 * testsuite/Makefile.in: Regenerate.
13274 * testsuite/discard_locals_test.c: New file.
13275 * testsuite/discard_locals_test.sh: Same.
13276
805bb01c
DK
132772009-06-05 Doug Kwan <dougkwan@google.com>
13278
13279 * object.cc (Sized_relobj::Sized_relobj): Initialize
13280 discarded_eh_frame_shndx_ to -1U.
13281 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13282 section.
13283 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13284 a discarded .eh_frame section.
13285 (Sized_relobj::do_finalize_local_symbols): Ditto.
13286 * object.h (class Sized_relobj): Declare new member
13287 discarded_eh_frame_shndx_.
13288 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13289 (local_labels_test.o, local_labels_test): New rules.
13290 * testsuite/Makefile.in: Regenerate.
13291
1dcd334d
DK
132922009-06-04 Doug Kwan <dougkwan@google.com>
13293
13294 * layout.cc (Layout::section_name_mapping): Add mapping for
13295 special ARM sections.
13296
96d49306
DK
132972009-06-03 Doug Kwan <dougkwan@google.com>
13298
13299 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13300 (utils::has_overflow): Same.
13301
dff16297
ILT
133022009-06-03 Ian Lance Taylor <iant@google.com>
13303
13304 * layout.cc (Layout::section_name_mapping): New array, replacing
13305 Layout::linkonce_mapping.
13306 (Layout::section_name_mapping_count): New variable, replacing
13307 Layout::linkonce_mapping_count.
13308 (Layout::linkonce_output_name): Remove.
13309 (Layout::output_section_name): Rewrite.
13310 * layout.h (class Layout): Rename Linkonce_mapping to
13311 Section_name_mapping, linkonce_mapping to section_name_mapping,
13312 linkonce_mapping_count to section_name_mapping_count. Don't
13313 declare linkonce_output_name.
13314
c121c671
DK
133152009-06-03 Doug Kwan <dougkwan@google.com>
13316
13317 * gold/arm.cc (namespace utils): New.
13318 (Target_arm::reloc_is_non_pic): Define new method.
13319 (class Arm_relocate_functions): New.
13320 (Target_arm::Relocate::relocate): Handle relocation types used by
13321 Android.
13322
07800fab
ILT
133232009-06-03 Ian Lance Taylor <iant@google.com>
13324
13325 * arm.cc (Target_arm::scan::global): Use || instead of |.
13326
c121c671
DK
133272009-06-02 Doug Kwan <dougkwan@google.com>
13328
13329 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13330 issued_non_pic_error_.
13331 (class Target_arm::Scan): Declare new method check_non_pic.
13332 Define new method symbol_needs_plt_entry.
13333 Declare new data member issued_non_pic_error_.
13334 (class Target_arm::Relocate): Declare new method
13335 should_apply_static_reloc.
13336 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13337 (Target_arm::Scan::check_non_pic): Define new method.
13338 (Target_arm::Scan::local): Handle a small subset of reloc types used
13339 by Android.
13340 (Target_arm::Scan::local): Same.
13341 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13342
b19b0c6d
ILT
133432009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13344
13345 * incremental.cc (Incremental_inputs::report_command_line): Filter
13346 out --incremental-* options.
13347
94cdfcff
DK
133482009-05-29 Doug Kwan <dougkwan@google.com>
13349
13350 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13351 template class.
13352 (class Target_arm): Update comment.
13353 (Target_arm::Target_arm): Initialize new data members GOT_,
13354 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13355 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13356 and Target_arm::rel_dyn_section.
13357 Declare new_enum Target_arm::Got_type.
13358 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13359 and DYNBSS_.
13360 Update commments for member do_dynsym_value.
13361 (Target_arm::got_size, Target_arm::plt_section,
13362 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13363 new methods inside class defintion.
13364 (Target_arm::got_section): Define new method.
13365 (Target_arm::rel_dyn_section): Same.
13366 (Output_data_plt_arm): New template class.
13367 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13368 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13369 (Output_data_plt_arm::add_entry): Same.
13370 (Output_data_plt_arm::first_plt_entry): Define new
13371 static data member for PLT instruction template.
13372 (Output_data_plt_arm::plt_entry): Same.
13373 (Output_data_plt_arm::do_write): Define new method.
13374 (Target_arm::make_plt_entry): Same.
13375 (Target_arm::do_finalize_sections): Same.
13376 (Target_arm::do_dynsym_value): Same.
13377
4a657b0d
DK
133782009-05-28 Doug Kwan <dougkwan@google.com>
13379
13380 * Makefile.am (TARGETSOURCES): Add arm.cc.
13381 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13382 * Makefile.in: Regenerate.
13383 * arm.cc: New file.
13384 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13385
e7ae8c36
DK
133862009-05-26 Doug Kwan <dougkwan@google.com>
13387
13388 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13389 (General_options::check_excluded_libs): Strip off directories in
13390 archive name before matching like GNU ld does.
13391 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13392 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13393 (exclude_libs_test_LDFLAGS): Add linker option
13394 -Wl,--exclude-libs,libexclude_libs_test_3
13395 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13396 an explicit archive without using -l.
13397 (alt/libexclude_libs_test_3.a): New make rule.
13398 * testsuite/Makefile.in: Regenerate.
13399 * testsuite/exclude_libs_test.c : Declare lib3_default().
13400 (main): Call it.
13401 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13402 * exclude_libs_test_3.c: New file.
13403
f12e7348
NC
134042009-05-26 Nick Clifton <nickc@redhat.com>
13405
13406 * po/id.po: New Indonesian translation.
13407 * po/gold.pot: Updated template file.
13408
4daadc0d
ST
134092009-05-22 Sriraman Tallam <tmsriram@google.com>
13410
e1df38aa 13411 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13412 gc_comdat_test files. Add -Wl,--gc-sections to build
13413 gc_comdat_test.
13414 * testsuite/Makefile.in: Regenerate.
13415 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13416
531813ad
ST
134172009-05-21 Sriraman Tallam <tmsriram@google.com>
13418
13419 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13420 kept comdat section was garbage collected.
13421 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13422 * testsuite/Makefile.in: Regenerate.
13423 * testsuite/gc_comdat_test.sh: New file.
13424 * testsuite/gc_comdat_test_1.cc: New file.
13425 * testsuite/gc_comdat_test_2.cc: New file.
13426
65514900
CC
134272009-05-19 Doug Kwan <dougkwan@google.com>
13428
13429 * archive.cc (Archive::Archive): Move constructor from archive.h
13430 to here. Initialize no_export_.
13431 (Archive::get_elf_object_for_member): Set no_export flag of object.
13432 * archive.h (Archive::Archive): Move constructor body to
13433 archive.cc.
13434 (Archive::no_export): New method.
13435 (Archive::no_export_): New field.
13436 * object.h (Object::Object): Initialize no_export_ to false.
13437 (Object::no_export, Object::set_no_export): New methods.
13438 (Object::no_export_): New field.
13439 * options.cc (General_options::parse_exclude_libs): New method.
13440 (General_options::check_excluded_libs) Same.
13441 * options.h (exclude_libs): New option.
13442 (General_options::check_excluded_libs): New method declaration.
13443 (General_options::excluded_libs_): New field.
13444 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13445 default or protected visibility if an object has no-export flag set.
13446 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13447 (check_SCRIPTS): Add exclude_libs_test.sh.
13448 (check_DATA): Add exclude_libs_test.syms.
13449 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13450 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13451 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13452 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13453 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13454 libexclude_libs_test_2.a): New rules.
13455 * testsuite/Makefile.in: Regenerate.
13456 * testsuite/exclude_libs_test.c: New file.
13457 * testsuite/exclude_libs_test.sh: Ditto.
13458 * testsuite/exclude_libs_test_1.c: Ditto.
13459 * testsuite/exclude_libs_test_2.c: Ditto.
13460
1b77ea50
ILT
134612009-05-15 Ian Lance Taylor <iant@google.com>
13462
13463 * configure.ac: Check for declarations for cases where libiberty.h
13464 checks HAVE_DECL_xxx.
13465 * configure, config.in: Rebuild.
13466
072fe7ce
ILT
134672009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13468
13469 * gold.h (Incremental_argument_list): Remove (invalid) forward
13470 declaration.
13471 * incremental.cc (Incremental_inputs::report_achive): New method.
13472 (Incremental_inputs::report_object): New method.
13473 (Incremental_inputs::report_script): New method.
13474 (Incremental_inputs::finalize_inputs): New method.
13475 (Incremental_inputs::finalize): Call finalize_inputs().
13476 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13477 Create inputs entries.
13478 * incremental.h (Incremental_input_type): New enum.
13479 (Incremental_inputs::Incremental_input): Initialize new fields.
13480 (Incremental_inputs::report_inputs): New method.
13481 (Incremental_inputs::report_achive): New method.
13482 (Incremental_inputs::report_object): New method.
13483 (Incremental_inputs::report_script): New method.
13484 (Incremental_inputs::finalize_inputs): New method.
13485 (Incremental_inputs::Input_info): New struct.
13486 (Incremental_inputs::Input_info_map): New typedef.
13487 (Incremental_inputs::lock_): New field.
13488 (Incremental_inputs::Inputs_): New field.
13489 (Incremental_inputs::Inputs_map): New field.
13490 * main.cc (main): Call Incremental_input::report_inputs.
13491 * options.h (Input_argument_list): Typedef moved from
13492 Input_arguments.
13493 (Input_file_group::Files): Remove, use ::Input_argument_list.
13494 (Input_file_group::Input_argument_list): Remove, use
13495 ::Input_argument_list.
13496 * plugin.cc (Plugin_manager::add_input_file): Add error in
13497 incremental build.
13498 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13499 functions.
13500 * script.cc (read_input_script): Call
13501 Incremental_input::report_script.
13502 * script.h (Script_info): New class.
13503
b0481b0b
ILT
135042009-04-27 Ian Lance Taylor <iant@google.com>
13505
13506 * x86_64.cc (do_adjust_output_section): Set entsize to
13507 plt_entry_size.
13508
b22a5a41 135092009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13510
13511 * output.cc (Output_file::close): After short writes, continue
13512 writing from the correct offset in the buffer being written.
13513
40fde488
CD
135142009-04-23 Chris Demetriou <cgd@google.com>
13515
13516 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13517 * configure: Regenerate.
13518 * config.in: Regenerate.
13519 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13520 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13521
3ce2c28e
ILT
135222009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13523
13524 * incremental.cc (Incremental_inputs_header_data): Renamed from
13525 Incremental_input_header_data.
13526 (Incremental_inputs_header_data::data_size): New field.
13527 (Incremental_inputs_header_data::put_input_file_count): Renamed
13528 from input_file_count.
13529 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13530 from command_line_offset.
13531 (Incremental_inputs_header_data::put_reserved): Renamed from
13532 put_reserved.
13533 (Incremental_inputs_entry_data): Renamed from
13534 Incremental_input_entry_data.
13535 (Incremental_inputs_entry_data::data_size): New field.
13536 (Incremental_inputs::report_command_line): New method.
13537 (Incremental_inputs::finalize): New method.
13538 (Incremental_inputs::create_incremental_inputs_data): New method.
13539 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13540 * incremental.h: New file.
13541 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13542 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13543 incremental builds.
703d02da 13544 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13545 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13546 (Layout::create_incremental_info_sections): New method.
13547 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13548 * main.cc (main): Notify Incremental_input of the command line.
13549
e55bde5e
ILT
135502009-04-01 Ian Lance Taylor <iant@google.com>
13551 Mikolaj Zalewski <mikolajz@google.com>
13552
13553 * gold.h (reserve_unordered_map): Define, three versions, one for
13554 each version of Unordered_map.
13555 * layout.cc (Layout::Layout): Remove options parameter. Add
13556 number_of_input_files parameter. Don't initialize options_.
13557 Initialize number_of_input_files_ and resized_signatures_. Move
13558 sections_are_attached_.
13559 (Layout::layout_group): Reserve space for group_signatures_.
13560 (Layout::find_or_add_kept_section): Change name parameter to be a
13561 reference. Resize signatures_ map when it gets large enough.
13562 (Layout::layout_eh_frame): Use parameters->options() instead of
13563 this->options_.
13564 (Layout::make_output_section): Likewise.
13565 (Layout::attach_allocated_section_to_segment): Likewise.
13566 (Layout::finalize, Layout::create_executable_stack): Likewise.
13567 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13568 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13569 * layout.h (class Layout): Update declarations. Remove options_
13570 field. Add number_of_input_files_ and resized_signatures_
13571 fields. Move sections_are_attached_ field.
13572 * main.cc (main): Pass number of input files to Layout
13573 constructor. Don't pass options.
13574
154b857c
ILT
135752009-03-30 Ian Lance Taylor <iant@google.com>
13576
13577 * ffsll.c (ffsll): Correct implementation.
13578
2f35ab9b
ILT
135792009-03-27 Ian Lance Taylor <iant@google.com>
13580
fd03461a
ILT
13581 * ffsll.c: New file.
13582 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13583 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13584 * ftruncate.c (ftruncate): Declare before definition.
13585 * mremap.c (mremap): Likewise.
13586 * pread.c (pread): Likewise.
13587 * configure, Makefile.in, config.in: Rebuild.
13588
2f35ab9b
ILT
13589 * mremap.c: New file.
13590 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13591 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13592 (mremap): Declare if HAVE_MREMAP is not defined.
13593 * configure, Makefile.in, config.in: Rebuild.
13594
33aea2fd
CC
135952009-03-27 Cary Coutant <ccoutant@google.com>
13596
13597 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13598 position independent.
13599 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13600 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13601
6d479619
CC
136022009-03-24 Cary Coutant <ccoutant@google.com>
13603
13604 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13605 an executable.
13606 (needs_dynamic_reloc): Likewise.
13607
afc06bb8
ILT
136082009-03-24 Ian Lance Taylor <iant@google.com>
13609
13610 * yyscript.y (file_cmd): Recognize EXTERN.
13611 (extern_name_list, extern_name_list_body): New nonterminals.
13612 * script.cc (script_add_extern): Define.
13613 * script-c.h (script_add_extern): Declare.
13614
f6060a4d
ILT
136152009-03-24 Rafael Avila de Espindola <espindola@google.com>
13616
13617 * object.cc (is_elf_object): Define.
13618 * object.h (is_elf_object): Declare.
13619 * archive.cc (Archive::get_elf_object_for_member): Call
13620 is_elf_object.
33aea2fd 13621 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 13622
26736d8e
ILT
136232009-03-24 Elliott Hughes <enh@google.com>
13624
13625 * output.cc (Output_file::map_anonymous): Define.
13626 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13627 try an anonymous one. Report the size if the mmap fails.
13628 * output.h (class Output_file): Declare map_anonymous.
13629
22fd9730
ILT
136302009-03-24 Ian Lance Taylor <iant@google.com>
13631
13632 * target-select.cc (instantiate_target): Don't acquire the lock if
13633 the instantiated_target_ field has already been set.
13634
cb010894
ILT
136352009-03-23 Ian Lance Taylor <iant@google.com>
13636
7f055c20
ILT
13637 * gold-threads.h (class Initialize_lock): Define.
13638 * gold-threads.cc (class Initialize_lock_once): Define.
13639 (initialize_lock_control): New static variable.
13640 (initialize_lock_pointer): New static variable.
13641 (initialize_lock_once): New static function.
13642 (Initialize_lock::Initialize_lock): Define.
13643 (Initialize_lock::initialize): Define.
13644 * target-select.h: Include "gold-threads.h".
13645 (class Target_selector): Add lock_ and initialize_lock_ fields.
13646 Don't define instantiate_target, just declare it.
13647 * target-select.cc (Target_selector::Target_selector): Initialize
13648 new fields.
13649 (Target_selector::instantiate_target): Define.
13650 * descriptors.h: Include "gold-threads.h".
13651 (class Descriptors): Add initialize_lock_ field.
13652 * descriptors.cc (Descriptors::Descriptors): Initialize new
13653 field.
13654 (Descriptors::open): Use initialize_lock_ field
13655 * errors.h (class Errors): Add initialize_lock_ field.
13656 * errors.cc (Errors::Errors): Initialize new field.
13657 (Errors::initialize_lock): Use initialize_lock_ field.
13658 * powerpc.cc (class Target_selector_powerpc): Remove
13659 instantiated_target_ field. In do_recognize call
13660 instantiate_target rather than do_instantiate_target. In
13661 do_instantiate_target just allocate a new target.
13662 * sparc.cc (class Target_selector_sparc): Likewise.
13663
36959681
ILT
13664 * freebsd.h: New file.
13665 * i386.cc: Include "freebsd.h".
13666 (Target_i386): Derive from Target_freebsd rather than
13667 Sized_target.
13668 (Target_selector_i386): Derive from Target_selector_freebsd rather
13669 than Target_selector.
13670 * x86_64.cc: Include "freebsd.h".
13671 (Target_x86_64): Derive from Target_freebsd rather than
13672 Sized_target.
13673 (Target_selector_x86_64): Derive from Target_selector_freebsd
13674 rather than Target_selector.
13675 * target.h (class Target): Add adjust_elf_header and
13676 do_adjust_elf_header.
13677 * output.cc (Output_file_header:: do_sized_write): Call target
13678 adjust_elf_header routine.
13679 * configure.tgt: Set targ_osabi.
13680 * configure.ac: Define GOLD_DEFAULT_OSABI.
13681 * parameters.cc (Parameters::default_target): Pass
13682 GOLD_DEFAULT_OSABI to select_target.
13683 * target-select.h (class Target_selector): Make instantiate_target
13684 protected rather than private.
13685 * Makefile.am (HFILES): Add freebsd.h.
13686 * configure, Makefile.in, config.in: Rebuild.
13687
cb010894
ILT
13688 * merge.cc (do_add_input_section): Correct pend value. Change
13689 message about last entry not being null terminated from error to
13690 warning.
13691
0e879927
ILT
136922009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13693
13694 * incremental.cc: New file.
13695 * Makefile.am (CCFILES): Add incremental.cc.
13696 * Makefile.in: Rebuild.
13697
41105937
PP
136982009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13699
13700 * layout.cc (Layout::output_section_name): Preserve names
13701 of '.note.' sections.
e1df38aa 13702
60439920
ILT
137032009-03-19 Ian Lance Taylor <iant@google.com>
13704
13705 * descriptors.cc (Descriptors::open): Check that the options are
13706 valid before using them.
13707
0d371ad3
ILT
137082009-03-18 Ian Lance Taylor <iant@google.com>
13709
13710 * script-sections.h: Include <list>.
13711 (class Script_sections): Change Sections_elements from std::vector
13712 to std::list. Typedef public Elements_iterator. Add
13713 orphan_section_placement_, data_segment_align_start_, and
13714 saw_data_segment_align_ fields. Remove data_segment_align_index_
13715 field.
13716 * script-sections.cc (class Orphan_section_placement): New class.
13717 (class Sections_element): Add virtual functions is_relro and
13718 orphan_section_init. Remove virtual function place_orphan_here.
13719 (class Output_section_definition): Add is_relro and
13720 orphan_section_init. Remove place_orphan_here.
13721 (class Orphan_output_section): Likewise.
13722 (Script_sections::Script_sections): Update for field changes.
13723 (Script_sections::data_segment_align): Set saw_data_segment_align_
13724 and data_segment_align_start_, not data_segment_align_index.
13725 (Script_sections::data_segment_relro_end): Check
13726 saw_data_segment_align_. Use data_segment_align_start_ rather
13727 than data_segment_align_index_.
13728 (Script_sections::place_orphan): Rewrite to use
13729 Orphan_section_placement.
13730
9201d894
ILT
137312009-03-17 Ian Lance Taylor <iant@google.com>
13732
9c5b8369
ILT
13733 * archive.cc (Archive::add_symbols): Check for a version attached
13734 to the symbol name in the archive map.
13735 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13736 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13737 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13738 (ver_test_11.a): New target.
13739 * testsuite/Makefile.in: Rebuild.
13740
9201d894
ILT
13741 * configure.ac: Check for chsize and posix_fallocate. Replace
13742 ftruncate.
13743 * ftruncate.c: New file, from gnulib.
13744 * output.cc (posix_fallocate): Define dummy version if not
13745 HAVE_POSIX_FALLOCATE.
13746 (Output_file::map): Call posix_fallocate rather than lseek and
13747 write.
13748 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13749 * configure, Makefile.in, config.in: Rebuild.
13750
ef4ab7a8 137512009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 13752
ef4ab7a8
PP
13753 * layout.h (Layout::create_note): Add section_name parameter.
13754 * layout.cc (Layout::create_note): Likewise.
13755 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 13756
8c500701
ILT
137572009-03-17 Ian Lance Taylor <iant@google.com>
13758
e85b18e1
ILT
13759 * descriptors.cc: Include "options.h".
13760 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13761 (Descriptors::open): Always use O_CLOEXEC when opening a new
13762 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13763 then set FD_CLOEXEC.
13764
9efe6174
ILT
13765 * sparc.cc (class Target_sparc): Add has_got_section.
13766 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13767 make sure we have a GOT section.
13768
13769 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13770 (Target_sparc::Scan::local): Likewise.
13771 (Target_sparc::Scan::global): Likewise.
13772 (Target_sparc::Relocate::relocate): Likewise.
13773 (Target_sparc::Relocate::relocate_tls): Likewise.
13774
8c500701
ILT
13775 * symtab.cc (Symbol_table::define_default_version): New function,
13776 broken out of add_from_object.
13777 (Symbol_table::add_from_object): Call define_default_version.
13778 (Symbol_table::define_special_symbol): Add resolve_oldsym
13779 parameter. Change all callers. If the version for a symbol comes
13780 from a version script, resolve it with the symbol with the same
13781 name with no version. Also add the symbol without a version if
13782 appropriate.
13783 (do_define_in_output_data): If resolving with oldsym, don't delete
13784 sym.
13785 (do_define_in_output_segment): Likewise.
13786 (do_define_as_constant): Likewise.
13787 * symtab.h (class Symbol_table): Update declarations.
13788
f1ed28fb
ILT
137892009-03-13 Ian Lance Taylor <iant@google.com>
13790
15f8229b
ILT
13791 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13792 (Read_symbols::requeue): New function.
13793 (Read_symbols::do_read_symbols): If make_elf_object fails because
13794 the target type is not configured, and the file was searched for,
13795 issue a warning and retry with the next directory.
13796 (Add_symbols::run): If the file has an incompatible format, and
13797 it was searched for, requeue the Read_symbols task. On error,
13798 release the object.
13799 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13800 dirindex parameter to constructor. Change all callers. Declare
13801 incompatible_warning and requeue.
13802 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13803 input_argument_ and input_group_ fields. Add them to
13804 constructor. Change all callers.
13805 (class Read_script): Add dirindex_ field. Add it to constructor.
13806 Change all callers.
13807 * archive.cc (Archive::setup): Remove input_objects parameter.
13808 Change all callers.
13809 (Archive::get_file_and_offset): Likewise.
13810 (Archive::read_all_symbols): Likewise.
13811 (Archive::read_symbols): Likewise.
13812 (Archive::get_elf_object_for_member): Remove input_objects
13813 parameter. Add punconfigured parameter. Change all callers.
13814 (Archive::add_symbols): Change return type to bool. Check return
13815 value of include_member.
13816 (Archive::include_all_members): Likewise.
13817 (Archive::include_member): Change return type to bool. Return
13818 false if first included object has incompatible target. Set
13819 included_member_ field.
13820 (Add_archive_symbols::run): If add_symbols returns false, requeue
13821 Read_symbols task.
13822 * archive.h (class Archive): Add included_member_ field.
13823 Initialize it in constructor. Add input_file and searched_for
13824 methods. Update declarations.
13825 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13826 input_argument_ fields. Add them to constructor. Change all
13827 callers.
13828 * script.cc: Include "target-select.h".
13829 (class Parser_closure): Add skip_on_incompatible_target_ and
13830 found_incompatible_target_ fields. Add
13831 skip_on_incompatible_target parameter to constructor. Change all
13832 callers. Add methods skip_on_incompatible_target,
13833 clear_skip_on_incompatible_target, found_incompatible_target, and
13834 set_found_incompatible_target.
13835 (read_input_script): Add dirindex parameter. Change all callers.
13836 If parser finds an incompatible target, requeue Read_symbols
13837 task.
13838 (script_set_symbol): Clear skip_on_incompatible_target in
13839 closure.
13840 (script_add_assertion, script_parse_option): Likewise.
13841 (script_start_sections, script_add_phdr): Likewise.
13842 (script_check_output_format): New function.
13843 * script.h (read_input_script): Update declaration.
13844 * script-c.h (script_check_output_format): Declare.
13845 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13846 (ignore_cmd): Remove OUTPUT_FORMAT.
13847 * fileread.cc (Input_file::Input_file): Add explicit this.
13848 (Input_file::will_search_for): New function.
13849 (Input_file::open): Add pindex parameter. Change all callers.
13850 * fileread.h (class Input_file): Add input_file_argument method.
13851 Declare will_search_for. Update declarations.
13852 * object.cc (make_elf_object): Add punconfigured parameter.
13853 Change all callers.
13854 * object.h (class Object): Make input_file public. Add
13855 searched_for method.
13856 (make_elf_object): Update declaration.
13857 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13858 restart search.
13859 * dirsearch.h (class Dirsearch): Update declaration.
13860 * options.h (class General_options): Add --warn-search-mismatch.
13861 * parameters.cc (Parameters::is_compatible_target): New function.
13862 * parameters.h (class Parameters): Declare is_compatible_target.
13863 * workqueue.cc (Workqueue::add_blocker): New function.
13864 * workqueue.h (class Workqueue): Declare add_blocker.
13865
f1ed28fb
ILT
13866 * fileread.cc (Input_file::open): Remove options parameter.
13867 Change all callers.
13868 (Input_file::open_binary): Likewise.
13869 * script.cc (read_input_script): Likewise.
13870 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13871 options parameter from constructor. Change all callers.
13872 (class Read_script): Likewise.
13873 * fileread.h (class Input_file): Update declarations.
13874 * script.h (read_input_script): Update declaration.
13875
34dd024a
NC
138762009-03-10 Nick Clifton <nickc@redhat.com>
13877
13878 * po/es.po: New Spanish translation.
13879
6d71b17c
CC
138802009-03-06 Cary Coutant <ccoutant@google.com>
13881
13882 * options.cc (parse_short_option): Keep dash_z from registering itself.
13883
031cdbed
ILT
138842009-03-03 Ian Lance Taylor <iant@google.com>
13885
13886 PR 9918
13887 * target-reloc.h (relocate_section): Pass output_section to
13888 relocate.
13889 * i386.cc (Target_i386::should_apply_static_reloc): Add
13890 output_section parameter. Change all callers.
13891 (Target_i386::Relocate::relocate): Add output_section parameter.
13892 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13893 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13894 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13895 * testsuite/two_file_shared.sh: New script.
13896 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13897 (check_DATA): Add two_file_shared.dbg.
13898 (two_file_shared.dbg): New target.
13899 * testsuite/Makefile.in: Rebuild.
13900
15d5fa16
ILT
139012009-03-01 Ian Lance Taylor <iant@google.com>
13902
13903 * configure.ac: Check for byteswap.h.
13904 * configure: Rebuild.
13905 * config.in: Rebuild.
13906
8a4c0b0d
ILT
139072009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13908
13909 * layout.cc (Layout::find_or_add_kept_section): New function.
13910 (Layout::add_comdat): Removed.
13911 * layout.h (struct Kept_section): Move out of class Layout.
13912 Remove trailing underscores from field names. Add group_sections
13913 field. Rename group_ field to is_group. Change all uses.
13914 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13915 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13916 comdat_groups_ field.
13917 (Sized_relobj::include_section_group): Use
13918 find_or_add_kept_section and Kept_section::group_sections.
13919 (Sized_relobj::include_linkonce_section): Likewise.
13920 * object.cc (class Sized_relobj): Don't define Comdat_group or
13921 Comdat_group_table. Remove find_comdat_group and
13922 add_comdat_group. Remove comdat_groups_ field.
13923 * plugin.cc (include_comdat_group): Use
13924 Layout::find_or_add_kept_section.
13925
b4ecf66b
ILT
139262009-02-28 Ian Lance Taylor <iant@google.com>
13927
14359ca0
ILT
13928 * README: --gc-sections and map files are now supported. Document
13929 some build requirements.
13930
b4ecf66b
ILT
13931 PR 6992
13932 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13933 relocatable link set the value of the section symbol to zero.
13934 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13935 relocatable link don't include the section address in the local
13936 symbol value.
13937
0602e05a
ILT
139382009-02-27 Ian Lance Taylor <iant@google.com>
13939
fd9d194f
ILT
13940 PR 6811
13941 * options.h (class Search_directory): Add is_system_directory.
13942 (class General_options): Declare is_in_system_directory.
13943 * options.cc (get_relative_sysroot): Make static.
13944 (get_default_sysroot): Make static.
13945 (General_optoins::is_in_system_directory): New function.
13946 * fileread.cc (Input_file::is_in_system_directory): New function.
13947 * fileread.h (class Input_file): Declare is_in_system_directory.
13948 * object.h (class Object): Add is_in_system_directory.
13949 (class Input_objects): Remove system_library_directory_ field.
13950 * object.cc (Input_objects::add_object): Don't set
13951 system_library_directory_.
13952 (input_objects::found_in_system_library_directory): Remove.
13953 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13954 parameter. Change all callers.
13955 (Symbol_table::sized_write_globals): Likewise.
13956 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13957 Call Object::is_in_system_directory.
13958 * symtab.h (class Symbol_table): Update declarations.
13959
61edd21f
ILT
13960 PR 5990
13961 * descriptors.h (Open_descriptor): Add is_on_stack field.
13962 * descriptors.cc (Descriptors::open): If the descriptor is on the
13963 top of the stack, remove it. Initialize is_on_stack field.
13964 (Descriptors::release): Only add pod to stack if it is not on the
13965 stack already.
13966 (Descriptors::close_some_descriptor): Clear stack_next and
13967 is_on_stack fields.
13968
e29e076a
ILT
13969 PR 7091
13970 * output.cc (Output_section::find_starting_output_address): Rename
13971 from starting_output_address; add PADDR parameter; change return
13972 type.
13973 * output.h (class Output_section): Declare
13974 find_starting_output_address instead of starting_output_address.
13975 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13976 section symbol for which we can't find a merge section.
13977
0602e05a
ILT
13978 PR 9836
13979 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13980 hidden or internal, force the symbol to be local.
13981 * resolve.cc (Symbol::override_visibility): Define.
13982 (Symbol::override_base): Use override_visibility.
13983 (Symbol_table::resolve): Likewise.
13984 (Symbol::override_base_with_special): Likewise.
13985 (Symbol_table::override_with_special): If the visibility is hidden
13986 or internal, force the symbol to be local.
13987 * symtab.h (class Symbol): Add set_visibility and
13988 override_visibility.
13989 * testsuite/ver_test_1.sh: New file.
13990 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13991 (check_DATA): Add ver_test_1.syms.
13992 (ver_test_1.syms): New target.
13993 * testsuite/Makefile.in: Rebuild.
13994
401a9a73
CC
139952009-02-25 Cary Coutant <ccoutant@google.com>
13996
13997 * layout.cc (Layout::choose_output_section): Don't rename sections
13998 when using a linker script that has a SECTIONS clause.
13999 * Makefile.in: Regenerate.
14000
14001 * testsuite/Makefile.am (script_test_5.sh): New test case.
14002 * testsuite/Makefile.in: Regenerate.
14003 * testsuite/script_test_5.cc: New file.
14004 * testsuite/script_test_5.sh: New file.
14005 * testsuite/script_test_5.t: New file.
14006
f488e4b0
CC
140072009-02-13 Rafael Avila de Espindola <espindola@google.com>
14008
14009 * archive.cc (Archive::include_member): Update calls to add_symbols.
14010 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14011 the Layout argument.
14012 * dynobj.h (do_add_symbols): Add the Layout argument.
14013 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14014 Layout argument.
14015 * object.h (Object::add_symbols): Add the Layout argument.
14016 (Object::do_add_symbols): Add the Layout argument.
14017 (Sized_relobj::do_add_symbols): Add the Layout argument.
14018 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14019 Unify the two versions.
14020 (Add_plugin_symbols): Remove.
14021 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14022 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14023 (Add_plugin_symbols): Remove.
14024 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14025 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14026 (Add_symbols::run): Make it work with Pulginobj.
14027
89dd1680
ILT
140282009-02-06 Ian Lance Taylor <iant@google.com>
14029
14030 * object.cc (Sized_relobj::do_layout): Make info message start
14031 with lower case letter.
14032
266d0a74
ILT
140332009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14034
602b464e
ILT
14035 * binary.cc: Fix file comment.
14036
266d0a74
ILT
14037 * options.h (enum Incremental_disposition): Define.
14038 (class General_options): Add new options: --incremental,
14039 --incremental_changed, --incremental_unchanged,
14040 --incremental_unknown. Add incremental_disposition_ and
14041 implicit_incremental_ fields.
14042 (General_options::incremental_disposition): New function.
14043 (class Position_dependent_options): Add incremental_disposition
14044 option.
14045 (Position_dependent_options::copy_from_options): Set incremental
14046 dispositions.
14047 * options.cc (General_options::parse_incremental_changed): New
14048 function.
2e702c99
RM
14049 (General_options::parse_incremental_unchanged): New function.
14050 (General_options::parse_incremental_unknown): New function.
14051 (General_options::General_options): Initialize new fields
266d0a74 14052 incremental_disposition_ and implicit_incremental_.
2e702c99 14053 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
14054 without --incremental.
14055
f073bbf7
CD
140562009-02-06 Chris Demetriou <cgd@google.com>
14057
14058 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14059 pointer and to report location as the file name associated with
14060 the symbol.
14061 (gold_undefined_symbol_at_location): New function to replace the
14062 old gold_undefined_symbol functionality.
14063 * target-reloc.h (relocate_section): Update to use
14064 gold_undefined_symbol_at_location.
14065 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14066 Call gold_undefined_symbol function rather than gold_error.
14067 * errors.h (Errors::undefined_symbol): Take location as a
14068 string, rather than calculating it from a relocation.
14069 * errors.cc (Errors::fatal): Print "fatal error:" before the
14070 formatted message.
14071 (Errors::error, Errors::error_at_location): Print "error: "
14072 before the formatted message.
14073 (Errors::undefined_symbol): Take location as a string, rather
14074 than calculating it from a relocation.
14075 (gold_undefined_symbol_at_location): New function akin to
14076 old gold_undefined_symbol, calculates location from relocation.
14077 (gold_undefined_symbol): Change to take only a Symbol pointer
14078 and to report location as the file name associated with the symbol.
14079 * testsuite/debug_msg.sh: Update for changed error messages.
14080 * testsuite/undef_symbol.sh: Likewise.
14081
8e94a90c
ILT
140822009-02-04 Duncan Sands <baldrick@free.fr>
14083
14084 PR 9812
14085 * reduced_debug_output.h
14086 (Output_reduced_debug_abbrev_section::failed): Use format for
14087 gold_warning.
14088 (Output_reduced_debug_info_section::faild): Likewise.
14089
88a0e15b
ILT
140902009-01-31 Mikolaj Zalewski <mikolajz@google.com>
14091
14092 * script.cc (Lazy_demangler): New class.
2e702c99 14093 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
14094 symbol only once.
14095
5efc7cd2
CC
140962009-01-29 Cary Coutant <ccoutant@google.com>
14097
14098 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
14099 to __tls_get_addr.
14100 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14101
e0ebcf42
ILT
141022009-01-28 Ian Lance Taylor <iant@google.com>
14103
5efc7cd2 14104 * version.cc (version_string): Bump to 1.9.
75fe7426 14105
e0ebcf42
ILT
14106 * gold.h: Include <cstring> and <stdint.h>.
14107 * version.cc: Include <cstdio>.
14108 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
14109 warning.
14110 * reduced_debug_output.cc (insert_into_vector): Rename from
14111 Insert_into_vector; change all callers. Use Swap_unaligned to
14112 avoid aliasing issue; remove union since it is unnecessary.
14113
8e2813be 141142009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
14115
14116 * Makefile.am (CCFILES): Add gc.cc.
14117 (HFILES): Add gc.h.
14118 * Makefile.in: Regenerate.
14119 * gold.cc (Gc_runner): New class.
14120 (queue_initial_tasks): Call garbage collection related tasks
14121 when corresponding options are invoked.
14122 (queue_middle_gc_tasks): New function.
14123 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14124 processed early before laying out sections during garbage collection.
14125 * gold.h (queue_middle_gc_tasks): New function.
14126 (is_prefix_of): Move from "layout.cc".
14127 * i386.cc (Target_i386::gc_process_relocs): New function.
14128 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14129 * main.cc (main): Create object of class "Garbage_collection".
14130 * object.cc (Relobj::copy_symbols_data): New function.
14131 (Relobj::is_section_name_included): New function.
e1df38aa
NC
14132 (Sized_relobj::do_layout): Allow this function to be called twice
14133 during garbage collection and defer layout of section during the
6d03d481
ST
14134 first call.
14135 * object.h (Relobj::get_symbols_data): New function.
14136 (Relobj::is_section_name_included): New function.
14137 (Relobj::copy_symbols_data): New function.
14138 (Relobj::set_symbols_data): New function.
14139 (Relobj::get_relocs_data): New function.
14140 (Relobj::set_relocs_data): New function.
14141 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14142 (Relobj::gc_process_relocs): New function.
14143 (Relobj::do_gc_process_relocs): New pure virtual function.
14144 (Relobj::sd_): New data member.
14145 (Sized_relobj::is_output_section_offset_invalid): New function.
14146 (Sized_relobj::do_gc_process_relocs): New function.
14147 * options.h (General_options::gc_sections): Modify to not be a no-op.
14148 (General_options::print_gc_sections): New option.
14149 * plugin.cc (Plugin_finish::run): Remove function call to
14150 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14151 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14152 * reloc.cc (Read_relocs::run): Add task to process relocs and
14153 determine unreferenced sections when doing garbage collection.
14154 (Gc_process_relocs): New class.
14155 (Sized_relobj::do_gc_process_relocs): New function.
14156 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14157 sections that are garbage collected.
14158 * reloc.h (Gc_process_relocs): New class.
14159 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14160 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14161 symbols whose corresponding sections are garbage collected.
14162 (Symbol_table::Symbol_table): Add new parameter for the garbage
14163 collection object.
14164 (Symbol_table::gc_mark_undef_symbols): New function.
14165 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14166 (Symbol_table::gc_mark_dyn_syms): New function.
14167 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14168 as garbage.
14169 (Symbol_table::add_from_object): Likewise.
14170 (Symbol_table::add_from_relobj): When building shared objects, do not
14171 treat externally visible symbols as garbage.
14172 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14173 table information for static and relocatable links.
14174 * symtab.h (Symbol_table::set_gc): New function.
14175 (Symbol_table::gc): New function.
14176 (Symbol_table::gc_mark_undef_symbols): New function.
14177 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14178 (Symbol_table::gc_mark_dyn_syms): New function.
14179 (Symbol_table::gc_): New data member.
e1df38aa 14180 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
14181 function.
14182 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14183 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14184
3b293544
CF
141852009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14186
14187 * options.h (General_options::gc_sections): Define as a no-op for now.
14188 (General_options::no_keep_memory): Ditto.
14189 (General_options::Bshareable): Define.
14190 * options.cc (General_options::finalize): Honor -Bshareable.
14191
83d22aa8
AS
141922009-01-20 Andreas Schwab <schwab@suse.de>
14193
14194 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14195 read the value in the contents, since we don't use it. Use the
14196 template endianness when writing.
14197 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14198
cd536b21
AS
141992009-01-19 Andreas Schwab <schwab@suse.de>
14200
14201 * configure.tgt (powerpc64-*): Fix targ_obj.
14202
99e9a495
ILT
142032009-01-15 Ian Lance Taylor <iant@google.com>
14204
14205 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14206 local symbols when stripping all symbols.
14207
bbbfea06
CC
142082009-01-14 Cary Coutant <ccoutant@google.com>
14209
99e9a495 14210 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 14211
0f7c0701
CC
142122009-01-14 Cary Coutant <ccoutant@google.com>
14213
14214 * archive.cc (Archive::get_elf_object_for_member): Remove call
14215 to File_read::claim_for_plugin.
14216 * descriptors.cc (Descriptors::open): Remove reference to
14217 is_claimed.
14218 (Descriptors::claim_for_plugin): Remove.
14219 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14220 (Descriptors::is_claimed): Remove.
14221 (claim_descriptor_for_plugin): Remove.
14222 * fileread.cc (File_read::claim_for_plugin): Remove.
14223 * fileread.h (File_read::claim_for_plugin): Remove.
14224 (File_read::descriptor): Reopen descriptor if necessary.
14225 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14226 (Plugin_manager::all_symbols_read): Add task parameter. Change
14227 all callers.
14228 (Plugin_manager::get_input_file): New function.
14229 (Plugin_manager::release_input_file): New function.
14230 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14231 corresponding data member.
14232 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14233 and pass to base constructor. Change all callers.
14234 (get_input_file, release_input_file): New functions.
14235 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14236 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14237 (Plugin_manager::all_symbols_read): Add task parameter.
14238 (Plugin_manager::get_input_file): New function.
14239 (Plugin_manager::release_input_file): New function.
14240 (Plugin_manager::task_): New data member.
14241 (Pluginobj::Pluginobj): Add filesize parameter.
14242 (Pluginobj::filename): New function.
14243 (Pluginobj::descriptor): New function.
14244 (Pluginobj::filesize): New function.
14245 (Pluginobj::filesize_): New data member.
14246 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14247 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14248 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14249
14250 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14251 with archive libraries.
14252 * testsuite/Makefile.in: Regenerate.
14253 * testsuite/plugin_test.c (struct sym_info): New type.
14254 (get_input_file, release_input_file): New static variables.
14255 (onload): Capture new transfer vector entries.
14256 (claim_file_hook): Stop reading at end of file according to filesize.
14257 Factor out parsing of readelf output into separate function.
14258 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14259 APIs and get the source file name from the symbol table. Convert
14260 source file name to corresponding object file name. Print info
14261 message when adding new input files.
14262 (parse_readelf_line): New function.
14263 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14264 * testsuite/plugin_test_2.sh: Likewise.
14265 * testsuite/plugin_test_3.sh: Likewise.
14266 * testsuite/plugin_test_4.sh: New test case.
14267
62a6d109
ILT
142682009-01-07 Ian Lance Taylor <iant@google.com>
14269
14270 * version.cc (version_string): Bump to 1.8.
14271
483620e8
CC
142722008-12-23 Cary Coutant <ccoutant@google.com>
14273
14274 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14275 * plugin.cc (Plugin_manager::finish): Rename as
14276 layout_deferred_objects. Move cleanup to separate function.
14277 (Plugin_manager::cleanup): New function.
14278 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14279 separately.
14280 * plugin.h (Plugin_manager::finish): Rename as
14281 layout_deferred_objects.
14282 (Plugin_manager::cleanup): New function.
14283 (Plugin_manager::cleanup_done): New field.
14284
d66a9eb3
CC
142852008-12-23 Cary Coutant <ccoutant@google.com>
14286
14287 * plugin.cc (is_visible_from_outside): New function.
14288 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14289 so we don't return "IR only" status for exported symbols or -r links.
14290
14291 * testsuite/Makefile.am (plugin_test_3): New test case.
14292 * testsuite/Makefile.in: Regenerate.
14293 * testsuite/plugin_test_3.sh: New file.
14294
5995b570
CC
142952008-12-22 Cary Coutant <ccoutant@google.com>
14296
14297 * object.cc (Sized_relobj::layout_section): New function.
14298 (Sized_relobj::do_layout): Defer layout of input sections until after
14299 plugin has provided replacement files.
14300 (Sized_relobj::do_layout_deferred_sections): New function.
14301 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14302 (Relobj::layout_deferred_sections): New function.
14303 (Relobj::do_layout_deferred_sections): New function.
14304 (Sized_relobj::do_layout_deferred_sections): New function.
14305 (Sized_relobj::layout_section): New function.
14306 (Sized_relobj::Deferred_layout): New structure.
14307 (Sized_relobj::deferred_layout_): New field.
14308 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14309 Change all callers. Layout deferred sections.
14310 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14311 references.
14312 (Plugin_hook::run): Move code from do_plugin_hook inline.
14313 (Plugin_hook::do_plugin_hook): Remove.
14314 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14315 (Plugin_manager::finish): Renamed, was cleanup.
14316 (Plugin_manager::should_defer_layout): New function.
14317 (Plugin_manager::add_deferred_layout_object): New function.
14318 (Plugin_manager::Deferred_layout_list): New type.
14319 (Plugin_manager::deferred_layout_objects_): New field.
14320 (Plugin_hook::do_plugin_hook): Remove.
14321
ee769c88
ILT
143222008-12-17 Ian Lance Taylor <iant@google.com>
14323
14324 * options.h (class General_options): Add --no case for
14325 --export-dynamic.
14326
abc8dcba
CC
143272008-12-16 Cary Coutant <ccoutant@google.com>
14328
14329 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14330 vector.
14331 (Plugin_manager::claim_file): Create plugin object even if
14332 plugin did not call the add_symbols callback.
14333 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14334 asking for more symbols than were added.
14335 * testsuite/Makefile.am (plugin_test_1): Add test case with
14336 no global symbols.
14337 (empty.syms): New target.
14338 * testsuite/Makefile.in: Regenerate.
14339 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14340 message. Don't call add_symbols if no globals.
14341 (all_symbols_read_hook): Don't provide replacement for empty
14342 claimed file.
14343
b0074644
ILT
143442008-12-12 Ian Lance Taylor <iant@google.com>
14345
68943102
ILT
14346 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14347 r_type == 0 for a local symbol with r_sym == 0.
14348 (scan_relocatable_relocs): Pass r_sym to
14349 local_non_section_strategy.
14350 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14351 r_sym parameter.
14352
b0074644
ILT
14353 * configure.ac: Update test for TLS descriptors: they are
14354 supported as of glibc 2.9.
14355 * configure: Rebuild.
14356
c2508178
ILT
143572008-12-11 Ian Lance Taylor <iant@google.com>
14358
14359 PR 7091
14360 * target-reloc.h (Default_scan_relocatable_relocs): For each
14361 function, map r_type == 0 to RELOC_DISCARD.
14362
2756a258
CC
143632008-12-10 Cary Coutant <ccoutant@google.com>
14364
14365 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14366 object to override a kept COMDAT group from a plugin object.
14367
bb6f53d3
ILT
143682008-12-09 Ian Lance Taylor <iant@google.com>
14369
fbc558e1
ILT
14370 PR 7088
14371 * yyscript.y (file_cmd): Handle INPUT.
14372
bb6f53d3
ILT
14373 * testsuite/initpri1.c: Change all declarations to be full
14374 prototypes by adding void, to avoid compiler warnings.
14375
4674ecfc
CC
143762008-12-05 Rafael Avila de Espindola <espindola@google.com>
14377
14378 * options.cc (General_options::parse_plugin_opt): New.
14379 (General_options::add_plugin): The argument now is just the filename.
14380 (General_options::add_plugin_option): New.
14381 * options.h (plugin_opt): New.
14382 (add_plugin): Change argument name.
14383 (add_plugin_option): New.
14384 * plugin.cc (Plugin::load): Don't parse the plugin option.
14385 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14386 (Plugin::add_option): New.
14387 (Plugin::args_): Change type.
14388 (Plugin::filename_): New.
14389 (Plugin_manager::add_plugin_option): New.
14390 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14391 * testsuite/Makefile.in: Regenerate.
14392
fd06b4aa
CC
143932008-12-05 Cary Coutant <ccoutant@google.com>
14394
14395 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14396 Handle --strip-lto-sections option.
14397 * options.h (strip_lto_sections): New option.
14398
6c52134c
CC
143992008-12-01 Cary Coutant <ccoutant@google.com>
14400
14401 * plugin.cc (ld_plugin_message): Change format parameter to const.
14402 Fix mismatch between new[] and delete.
14403
a45248e0
CC
144042008-11-14 Cary Coutant <ccoutant@google.com>
14405
14406 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14407 instead of -1U.
14408
c82fbeee
CS
144092008-11-05 Craig Silverstein <csilvers@google.com>
14410
14411 * options.cc (General_options::parse_dynamic_list): New function.
14412 * options.h (General_options): New flags dynamic_list,
14413 dynamic_list_data, dynamic_list_cpp_new, and
14414 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14415 (General_options::in_dynamic_list): New function.
14416 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14417 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14418 (Lex::can_continue_name): Likewise.
14419 (yylex): Likewise.
14420 (read_script_file): New parameter script_options.
14421 (read_dynamic_list): New function.
14422 (Script_options::define_dynamic_list): New function.
14423 (dynamic_list_keyword_parsecodes): New variable.
14424 (dynamic_list_keywords): New variable.
14425 * script.h (Script_options::define_dynamic_list): New function
14426 prototype.
14427 (read_dynamic_list): New function prototype.
14428 * symtab.cc (strprefix): New macro.
14429 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14430 dynamic_list_data, dynamic_list_cpp_new, and
14431 dynamic_list_cpp_typeinfo.
14432 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14433 (dynamic_list_expr): New rule.
14434 (dynamic_list_nodes): Likewise.
14435 (dynamic_list_node): Likewise.
14436 * testsuite/Makefile.am (dynamic_list): New test.
14437 * testsuite/Makefile.in: Regenerated.
14438 * testsuite/dynamic_list.t: New file.
14439 * testsuite/dynamic_list.sh: New file.
14440
e0bb29a5
CS
144412008-11-05 Craig Silverstein <csilvers@google.com>
14442
14443 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14444 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14445 (t11_last): Likewise.
14446 * testsuite/ver_test_6.c (main): Likewise.
14447
4e1e25e0
CC
144482008-10-07 Cary Coutant <ccoutant@google.com>
14449
14450 * options.c (General_options::finalize): Add check for -static and
14451 -shared.
14452 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14453 is not empty.
14454
92f03fcb
CC
144552008-10-02 Cary Coutant <ccoutant@google.com>
14456
14457 * plugin.cc (make_sized_plugin_object): Fix conditional
14458 compilation to work when not all targets are enabled.
14459
fbd8a257
CC
144602008-09-29 Cary Coutant <ccoutant@google.com>
14461
14462 * archive.cc (Archive::get_file_and_offset): Use filename instead
14463 of name to get library path.
14464 (Archive::include_member): Unlock external member of a thin archive.
14465
14466 * testsuite/Makefile.am (TEST_AR): New variable.
14467 (thin_archive_test_1): New test.
14468 (thin_archive_test_2): New test.
81636b3f
CC
14469 * testsuite/Makefile.in: Regenerate.
14470 * testsuite/thin_archive_main.cc: New file.
14471 * testsuite/thin_archive_test_1.cc: New file.
14472 * testsuite/thin_archive_test_2.cc: New file.
14473 * testsuite/thin_archive_test_3.cc: New file.
14474 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14475
eff45813
CC
144762008-09-29 Cary Coutant <ccoutant@google.com>
14477
14478 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14479 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14480 instead of -1U.
14481 (Sized_relobj::do_finalize_local_symbols): Likewise.
14482 (Sized_relobj::map_to_kept_section): Likewise.
14483 * object.h (Sized_relobj::invalid_address): New constant.
14484 (Sized_relobj::do_output_section_offset): Check for invalid_address
14485 and return -1ULL.
14486 * output.cc (Output_reloc::local_section_offset): Use constant
14487 invalid_address instead of -1U.
14488 (Output_reloc::get_address): Likewise.
14489 (Output_section::output_address): Change -1U to -1ULL.
14490 * output.h (Output_reloc::invalid_address): New constant.
14491 * reloc.cc (Sized_relobj::write_sections): Use constant
14492 invalid_address instead of -1U.
14493 (Sized_relobj::relocate_sections): Likewise.
14494 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14495 values for merge sections.
14496 * target-reloc.h (relocate_for_relocatable): Use constant
14497 invalid_address instead of -1U.
14498
89fc3421
CC
144992008-09-19 Cary Coutant <ccoutant@google.com>
14500
14501 Add plugin functionality for link-time optimization (LTO).
14502 * configure.ac (plugins): Add --enable-plugins option.
14503 * configure: Regenerate.
14504 * config.in: Regenerate.
14505 * Makefile.am (LIBDL): New variable.
14506 (CCFILES): Add plugin.cc.
14507 (HFILES): Add plugin.h.
14508 (ldadd_var): Add LIBDL.
14509 * Makefile.in: Regenerate.
14510
14511 * archive.cc: Include "plugin.h".
14512 (Archive::setup): Don't preread archive symbols when using a plugin.
14513 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14514 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14515 files.
14516 (Archive::include_member): Add symbols from plugin objects.
14517 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14518 * descriptors.cc (Descriptors::open): Check for file descriptors
14519 abandoned by plugins.
14520 (Descriptors::claim_for_plugin): New function.
14521 * descriptors.h (Descriptors::claim_for_plugin): New function.
14522 (Open_descriptor::is_claimed): New field.
14523 (claim_descriptor_for_plugin): New function.
14524 * fileread.cc (File_read::claim_for_plugin): New function.
14525 * fileread.h (File_read::claim_for_plugin): New function.
14526 (File_read::descriptor): New function.
14527 * gold.cc: Include "plugin.h".
14528 (queue_initial_tasks): Add task to call plugin hooks for generating
14529 new object files.
14530 * main.cc: Include "plugin.h".
14531 (main): Load plugin libraries.
14532 * object.h (Pluginobj): Declare.
14533 (Object::pluginobj): New function.
14534 (Object::do_pluginobj): New function.
14535 (Object::set_target): New function.
14536 * options.cc: Include "plugin.h".
14537 (General_options::parse_plugin): New function.
14538 (General_options::General_options): Initialize plugins_ field.
14539 (General_options::add_plugin): New function.
14540 * options.h (Plugin_manager): Declare.
14541 (General_options): Add --plugin option.
14542 (General_options::has_plugins): New function.
14543 (General_options::plugins): New function.
14544 (General_options::add_plugin): New function.
14545 (General_options::plugins_): New field.
14546 * plugin.cc: New file.
14547 * plugin.h: New file.
14548 * readsyms.cc: Include "plugin.h".
14549 (Read_symbols::do_read_symbols): Check for archive before checking
14550 for ELF file. Call plugin hooks to claim files.
14551 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14552 from a real object file; force override when processing replacement
14553 files.
14554 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14555 (Symbol::init_base_object): Likewise.
14556 (Symbol::init_base_output_data): Likewise.
14557 (Symbol::init_base_output_segment): Likewise.
14558 (Symbol::init_base_constant): Likewise.
14559 (Symbol::init_base_undefined): Likewise.
14560 (Symbol::output_section): Assert that object is not a plugin.
14561 (Symbol_table::add_from_pluginobj): New function.
14562 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14563 undefined.
14564 (Symbol_table::sized_write_globals): Likewise.
14565 (Symbol_table::add_from_pluginobj): Instantiate template.
14566 * symtab.h (Sized_pluginobj): Declare.
14567 (Symbol::in_real_elf): New function.
14568 (Symbol::set_in_real_elf): New function.
14569 (Symbol::in_real_elf_): New field.
14570 (Symbol_table::add_from_pluginobj): New function.
14571
14572 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14573 (LIBDL): New variable.
14574 (LDADD): Add LIBDL.
14575 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14576 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14577 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14578 (MOSTLYCLEANFILES): Likewise.
14579 * testsuite/Makefile.in: Regenerate.
14580 * testsuite/plugin_test.c: New file.
14581 * testsuite/plugin_test_1.sh: New file.
14582 * testsuite/plugin_test_2.sh: New file.
14583
de31bda5
ILT
145842008-09-16 Ian Lance Taylor <iant@google.com>
14585
9c2d0ef9
ILT
14586 * target-reloc.h (relocate_section): Check whether a symbol is
14587 defined by the ABI before reporting an undefined symbol error.
14588 * target.h (Target::is_defined_by_abi): Make parameter const.
14589 (Target::do_is_defined_by_abi): Likewise.
14590 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14591 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14592 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14593 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14594 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14595 * testsuite/Makefile.in: Rebuild.
14596
de31bda5
ILT
14597 * fileread.cc (make_view): Add casts to avoid warning.
14598
9fa33bee
AO
145992008-09-16 Alexandre Oliva <aoliva@redhat.com>
14600
14601 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14602 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14603
183fd0e3
AO
146042008-09-16 Alexandre Oliva <aoliva@redhat.com>
14605
14606 * options.h (General_options::output_is_executable): New.
14607 (General_options::output_is_pie): New.
14608 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14609 for shared libraries.
14610 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14611
7be8330a
CD
146122008-09-11 Chris Demetriou <cgd@google.com>
14613
14614 * options.h (origin): New -z option.
14615 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14616 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14617 in DT_FLAGS_1.
14618
a9caad02
CC
146192008-09-05 Cary Coutant <ccoutant@google.com>
14620
14621 * fileread.cc (File_read::make_view): Add check for attempt to map
14622 beyond end of file.
14623
ae6dce4d
CC
146242008-09-05 Cary Coutant <ccoutant@google.com>
14625
14626 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14627 explicit instantiations.
14628
d7ab2a47
KVH
146292008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14630
14631 PR gold/6858
14632 * options.cc (General_options::finalize): Allow undefined symbols
14633 in shlibs if linking -shared.
14634
14635 PR gold/6859
14636 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14637 symbols as not needing a dynsym entry.
14638
1e52a9c1
CS
146392008-08-20 Craig Silverstein <csilvers@google.com>
14640
14641 * fileread.cc (File_read::open): Do not lock the file unless it
14642 was successfully opened.
14643
d85c80a3
CC
146442008-08-14 Cary Coutant <ccoutant@google.com>
14645
14646 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14647 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14648 * testsuite/tls_test.cc (struct int128): 128-bit struct
14649 for testing TLS relocs with non-zero addend.
14650 (v12): New TLS variable.
14651 (t12): New test.
14652 (t_last): Add check for v12.
14653 * testsuite/tls_test.h (t12): New function.
14654 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14655
2d924fd9
ILT
146562008-08-13 Ian Lance Taylor <iant@google.com>
14657
14658 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14659 set tls_segment_ or relro_segment_.
14660 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14661 when appropriate.
14662 * output.h (Output_section::clear_is_relro): New function.
14663 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14664 sections specially even when output_data_ is empty.
14665 (Output_segment::maximum_alignment): When first section is relro,
14666 only force alignment for PT_LOAD segments.
14667 * script.cc (script_data_segment_align): New function.
14668 (script_data_segment_relro_end): New function.
14669 * script-c.h (script_data_segment_align): Declare.
14670 (script_data_segment_relro_end): Declare.
14671 * script-sections.h (class Script_sections): Declare
14672 data_segment_align and data_segment_relro_end. Add fields
14673 segment_align_index_ and saw_relro_end_.
14674 * script-sections.cc (class Sections_element): Add set_is_relro
14675 virtual function. Add new bool* parameter to place_orphan_here.
14676 Add get_output_section virtual function.
14677 (class Output_section_definition): Add set_is_relro. Add new
14678 bool* parameter to place_orphan_here. Add get_output_section.
14679 Add is_relro_ field.
14680 (Output_section_definition::Output_section_definition): Initialize
14681 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14682 and is_relro_ fields.
14683 (Output_section_definition::place_orphan_here): Add is_relro
14684 parameter.
14685 (Output_section_definition::set_section_addresses): Set relro for
14686 output section.
14687 (Output_section_definition::alternate_constraint): Likewise.
14688 (class Orphan_output_section): Add new bool* parameter to
14689 place_orphan_here. Add get_output_section.
14690 (Orphan_output_section::place_orphan_here): Add is_relro
14691 parameter.
14692 (Script_sections::Script_sections): Initialize
14693 data_segment_align_index_ and saw_relro_end_.
14694 (Script_sections::data_segment_align): New function.
14695 (Script_sections::data_segment_relro_end): New function.
14696 (Script_sections::place_orphan): Set or clear is_relro.
14697 (Script_sections::set_section_addresses): Force alignment of first
14698 TLS section.
14699 * yyscript.y (exp): Call script_data_segment_align and
14700 script_data_segment_relro_end.
14701 * testsuite/relro_script_test.t: New file.
14702 * testsuite/relro_test.cc (using_script): Declare.
14703 (t1, t2): Test using_script.
14704 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14705 (relro_script_test_SOURCES): Define.
14706 (relro_script_test_DEPENDENCIES): Define.
14707 (relro_script_test_LDFLAGS): Define.
14708 (relro_script_test_LDADD): Define.
14709 (relro_script_test.so): New target.
14710 * testsuite/Makefile.in: Rebuild.
14711
f827c9a9
CC
147122008-08-06 Cary Coutant <ccoutant@google.com>
14713
14714 * archive.cc (Archive::total_archives, Archive::total_members)
14715 (Archive::total_members_loaded): New variables.
14716 (Archive::setup): Add parameter. Add option to preread
14717 archive symbols.
14718 (Archive::read_armap): Add counter.
14719 (Archive::get_file_and_offset): New function.
14720 (Archive::get_elf_object_for_member): New function.
14721 (Archive::read_all_symbols): New function.
14722 (Archive::read_symbols): New function.
14723 (Archive::add_symbols): Add counters.
14724 (Archive::include_all_members): Use armap to find members if it's
14725 already built.
14726 (Archive::include_member): Skip reading symbols if already read.
14727 Factored code into Archive::get_file_and_offset and
14728 Archive::get_elf_object_for_member. Changed call to
14729 Mapfile::report_include_archive_member.
14730 (Archive::print_stats): New function.
14731 * archive.h: Declare Object and Read_symbols_data classes.
14732 (Archive::Archive): Add initializers for new members.
14733 (Archive::setup): Add parameter.
14734 (Archive::print_stats): New function.
14735 (Archive::total_archives, Archive::total_members)
14736 (Archive::total_members_loaded): New variables.
14737 (Archive::get_file_and_offset): New function.
14738 (Archive::get_elf_object_for_member): New function.
14739 (Archive::read_all_symbols): New function.
14740 (Archive::read_symbols): New function.
14741 (Archive::Archive_member): New class.
14742 (Archive::members_): New member.
14743 (Archive::num_members_): New member.
14744 * main.cc: Include archive.h.
14745 (main): Call Archive::print_stats.
14746 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14747 archive parameter; member_name is now the fully-decorated name.
14748 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14749 * options.h: (General_options): Add --preread-archive-symbols option.
14750 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14751 Archive::setup.
14752
de4c45bd
ILT
147532008-08-04 Ian Lance Taylor <iant@google.com>
14754
14755 * symtab.h (Symbol::use_plt_offset): New function.
14756 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14757 * powerpc.cc (Relocate::relocate): Likewise.
14758 * sparc.cc (Relocate::relocate): Likewise.
14759 * x86_64.cc (Relocate::relocate): Likewise.
14760 * testsuite/weak_plt.sh: New test.
14761 * testsuite/weak_plt_main.cc: New test.
14762 * testsuite/weak_plt_shared.cc: New test.
14763 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14764 (check_PROGRAMS): Add weak_plt.
14765 (check_DATA): Add weak_plt_shared.so.
14766 (weak_plt_main_pic.o, weak_plt): New targets.
14767 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14768 * testsuite/Makefile.in: Rebuild.
14769
14770 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14771 gcctestdir/ld.
14772 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14773 * testsuite/Makefile.in: Rebuild.
14774
323ee3f4
AM
147752008-08-04 Alan Modra <amodra@bigpond.net.au>
14776
14777 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14778 * Makefile.in: Regenerate.
14779 * po/POTFILES.in: Regenerate.
14780
7c07ecec
ILT
147812008-07-29 Ian Lance Taylor <iant@google.com>
14782
14783 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14784 symbols before other symbols.
14785 * testsuite/script_test_2.cc (test_addr): Declare.
14786 (test_addr_alias): Declare.
14787 (main): Check that test_addr and test_addr_alias have the right
cd536b21 14788 values.
7c07ecec
ILT
14789 * testsuite/script_test_2.t: Define test_addr_alias and
14790 test_addr.
14791
5778530e
ILT
147922008-07-24 Ian Lance Taylor <iant@google.com>
14793
2a00e4fb
ILT
14794 PR 5990
14795 * descriptors.cc: New file.
14796 * descriptors.h: New file.
14797 * gold-threads.h (class Hold_optional_lock): New class.
14798 * fileread.cc: Include "descriptors.h".
14799 (File_read::~File_read): Release descriptor rather than closing
14800 it.
14801 (File_read::open) [file]: Call open_descriptor rather than open.
14802 Set is_descriptor_opened_.
14803 (File_read::open) [memory]: Assert that descriptor is not open.
14804 (File_read::reopen_descriptor): New function.
14805 (File_read::release): Release descriptor.
14806 (File_read::do_read): Make non-const. Reopen descriptor.
14807 (File_read::read): Make non-const.
14808 (File_read::make_view): Reopen descriptor.
14809 (File_read::do_readv): Likewise.
14810 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14811 Update declarations.
14812 * layout.cc: Include "descriptors.h".
14813 (Layout::create_build_id): Use open_descriptor rather than open.
14814 * output.cc: Include "descriptors.h".
14815 (Output_file::open): Use open_descriptor rather than open.
14816 * archive.cc (Archive::const_iterator): Change Archive to be
14817 non-const.
14818 (Archive::begin, Archive::end): Make non-const.
14819 (Archive::count_members): Likewise.
14820 * archive.h (class Archive): Update declarations.
14821 * object.h (Object::read): Make non-const.
14822 * Makefile.am (CCFILES): Add descriptors.cc.
14823 (HFILES): Add descriptors.h.
14824 * Makefile.in: Rebuild.
14825
801647d1
ILT
14826 PR 6716
14827 * gold.h: Always include <clocale>. Add Solaris workarounds
14828 following code in binutils/sysdep.h.
14829
5edd166e
ILT
14830 PR 6048
14831 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14832 this->eh_frame_hdr_ is NULL before using it.
14833
c89ad728
ILT
14834 * dynobj.cc (Versions::Versions): Update comment.
14835
aa86f06b
ILT
14836 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14837 the base version name.
14838
5778530e
ILT
14839 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14840 array size plus one.
14841 (Stringpool_template::set_string_offsets): Subtract one from key
14842 before using it as an array index.
14843 (Stringpool_template::get_offset_with_length): Likewise.
14844 (Stringpool_template::write_to_buffer): Likewise.
14845 * stringpool.h (Stringpool_template::get_offset_from_key):
14846 Likewise.
14847
057ead22
ILT
148482008-07-23 Ian Lance Taylor <iant@google.com>
14849
7f649c59
ILT
14850 PR 6658
14851 * object.h (Merged_symbol_value::value): Do our best to handle a
14852 negative addend.
14853
057ead22
ILT
14854 PR 6647
14855 * script.cc (Version_script_info::get_versions): Don't add empty
14856 version tag to return value.
14857 (Version_script_info::get_symbol_version_helper): Change return
14858 type to bool. Add pversion parameter. Change all callers.
14859 (script_register_vers_node): Don't require a non-NULL tag.
14860 * script.h (class Version_script_info): Update declarations.
14861 (Version_script_info::get_symbol_version): Change return type to
14862 bool. Add version parameter. Change all callers.
14863 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14864 handling. Handle an empty version from a version script.
14865 (Symbol_table::define_special_symbol): Likewise.
14866 * testsuite/ver_test_10.script: New file.
14867 * testsuite/ver_test_10.sh: New file.
14868 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14869 (check_DATA): Add ver_test_10.syms.
14870 (ver_test_10.syms, ver_test_10.so): New target.
14871 * testsuite/Makefile.in: Rebuild.
14872
58e54ac2
CD
148732008-07-23 Simon Baldwin <simonb@google.com>
14874
14875 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14876 to zero for undefined symbols from dynamic libraries.
14877
95d14cd3
ILT
148782008-07-23 Ian Lance Taylor <iant@google.com>
14879
14880 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14881 Change all callers.
14882 * symtab.h (class Symbol_table): Update declaration.
14883 * testsuite/ver_test_9.cc: New file.
14884 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14885 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14886 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14887 (ver_test_9.so, ver_test_9.o): New targets.
14888 * testsuite/Makefile.in: Rebuild.
14889
92de84a6
ILT
148902008-07-22 Ian Lance Taylor <iant@google.com>
14891
34810851
ILT
14892 * options.h (class General_options): Define --check-sections.
14893 * layout.cc (Layout::set_segment_offsets): Handle
14894 --check-sections.
14895
af6156ef
ILT
14896 * options.h (class General_options): Define -n/--nmagic and
14897 -N/--omagic.
14898 * options.cc (General_options::finalize): For -n/--nmagic or
14899 -N/--omagic, set -static.
14900 * layout.cc (Layout::attach_allocated_section_to_segment): If
14901 -N/--omagic, don't put read-only and read-write sections in
14902 different segments.
14903 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14904 finding a read-only segment.
14905 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14906 don't set the minimum segment alignment to the common page size,
14907 and don't set the file offset to the address modulo the page size.
14908 * script-sections.cc (Script_sections::create_segments): If
14909 -n/--omagic, don't put read-only and read-write sections in
14910 different segments.
14911
92de84a6
ILT
14912 * cref.cc: New file.
14913 * cref.h: New file.
14914 * options.h (class General_options): Add --print-symbol-counts.
14915 * main.cc (main): Issue defined symbol report if requested.
14916 * archive.cc (Archive::interpret_header): Make into a const member
14917 function.
14918 (Archive::add_symbols): Call Input_objects::archive_start and
14919 archive_stop.
14920 (Archive::const_iterator): Define new class.
14921 (Archive::begin, Archive::end): New functions.
14922 (Archive::include_all_members): Rewrite to use iterator.
14923 (Archive::count_members): New function.
14924 * archive.h (class Archive): Update declarations.
14925 (Archive::filename): New function.
14926 * object.cc: Include "cref.h".
14927 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14928 (Sized_relobj::do_get_global_symbol_counts): New function.
14929 (Input_objects::add_object): Add object to cross-referencer.
14930 (Input_objects::archive_start): New function.
14931 (Input_objects::archive_stop): New function.
14932 (Input_objects::print_symbol_counts): New function.
14933 * object.h: Declare Cref and Archive.
14934 (Object::get_global_symbol_counts): New function.
14935 (Object::do_get_global_symbol_counts): New pure virtual function.
14936 (class Sized_relobj): Add defined_count_ field. Update
14937 declarations.
14938 (class Input_objects): Add cref_ field. Update constructor.
14939 Update declarations.
14940 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14941 defined_count_.
14942 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14943 symbol counts.
14944 (Sized_dynobj::do_get_global_symbol_counts): New function.
14945 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14946 defined_count_. Update declarations. Define Symbols typedef.
14947 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14948 parameter. Change all callers.
14949 (Symbol_table::add_from_dynobj): Add sympointers and defined
14950 parameters. Change all callers.
14951 * symtab.h (class Symbol_table): Update declarations.
14952 * Makefile.am (CCFILES): Add cref.cc.
14953 (HFILES): Add cref.h.
14954 * Makefile.in: Rebuild.
14955
3f7c5e1d
CD
149562008-07-22 Simon Baldwin <simonb@google.com>
14957
14958 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14959 to zero when writing undefined symbols.
14960
e0b64032
ILT
149612008-07-22 Ian Lance Taylor <iant@google.com>
14962
14963 * output.cc (Output_section::add_input_section): Don't try to
14964 merge empty merge sections.
14965
096b02cf
CS
149662008-07-21 Craig Silverstein <csilvers@google.com>
14967
14968 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14969 Include symbol version in error message.
cd536b21 14970
1d1f116d
CD
149712008-07-20 Chris Demetriou <cgd@google.com>
14972
cd536b21 14973 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
14974 (RANDOM_SEED_CFLAGS): New substituted variable.
14975 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14976 * configure: Rebuild.
14977 * Makefile.in: Likewise.
14978 * testsuite/Makefile.in: Likewise.
14979
a18f591e
ILT
149802008-07-18 Ian Lance Taylor <iant@google.com>
14981
14982 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14983 where we see NAME/NULL and NAME/VERSION as separate symbols.
14984 * testsuite/ver_test_main.cc (main): Call t4.
14985 (t4, t4_2a): Define.
14986 * testsuite/ver_test_2.cc (t4_2): Define.
14987 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14988 * testsuite/ver_test_4.cc (t4_2a): Define.
14989 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14990 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14991
c6e3f6ed
ILT
149922008-07-17 Ian Lance Taylor <iant@google.com>
14993
14994 * dynobj.cc (Versions::add_def): If we give an error about a
14995 missing version, go ahead and create the version anyhow.
14996
ef9beddf
ILT
149972008-07-10 Ian Lance Taylor <iant@google.com>
14998
14999 Handle output sections with more than 0x7fffffff bytes.
15000 * object.h (class Relobj): Change map_to_output_ to
15001 output_sections_, and just keep a section pointer. Change all
15002 uses. Move comdat group support to Sized_relobj.
15003 (Relobj::is_section_specially_mapped): Remove.
15004 (Relobj::output_section): Remove poff parameter. Change all
15005 callers.
15006 (Relobj::output_section_offset): New function.
15007 (Relobj::set_section_offset): Rewrite.
15008 (Relobj::map_to_output): Remove.
15009 (Relobj::output_sections): New function.
15010 (Relobj::do_output_section_offset): New pure virtual function.
15011 (Relobj::do_set_section_offset): Likewise.
15012 (class Sized_relobj): Add section_offsets_ field. Add comdat
15013 group support from Relobj. Update declarations.
15014 (Sized_relobj::get_output_section_offset): New function.
15015 (Sized_relobj::do_output_section_offset): New function.
15016 (Sized_relobj::do_set_section_offset): New function.
15017 * object.cc (Relobj::output_section_address): Remove.
15018 (Sized_relobj::Sized_relobj): Initialize new fields.
15019 (Sized_relobj::include_section_group): Cast find_kept_object to
15020 Sized_relobj.
15021 (Sized_relobj::include_linkonce_section): Likewise.
15022 (Sized_relobj::do_layout): Use separate arrays for output section
15023 and output offset.
15024 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15025 output_sections.
15026 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15027 output_sections and section_offsets.
15028 (Sized_relobj::write_local_symbols): Likewise.
15029 (map_to_kept_section): Compute output address directly.
15030 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15031 output_sections and section_offsets.
15032 (Sized_relobj::write_sections): Likewise.
15033 (Sized_relobj::relocate_sections): Likewise.
15034 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15035 * output.h (class Output_reloc): Update declarations. Change
15036 u2_.relobj to Sized_relobj*.
15037 (class Output_data_reloc): Change add functions to use
15038 Sized_relobj*.
15039 * output.cc (Output_reloc::Output_reloc): Change relobj to
15040 Sized_relobj*.
15041 (Output_reloc::local_section_offset): Change return type to
15042 Elf_Addr. Use get_output_section_offset.
15043 (Output_reloc::get_address): Likewise.
15044 (Output_section::is_input_address_mapped): Don't call
15045 is_section_specially_mapped.
15046 (Output_section::output_offset): Likewise.
15047 (Output_section::output_address): Likewise.
15048 (Output_section::starting_output_address): Likewise.
15049 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15050 parameter to Sized_relobj*.
15051 (Copy_relocs::need_copy_reloc): Likewise.
15052 (Copy_relocs::save): Likewise.
15053 * copy-relocs.h (class Copy_relocs): Update declarations.
15054 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15055 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15056 * target-reloc.h (relocate_for_relocatable): Change
15057 offset_in_output_section type to Elf_Addr. Change code that uses
15058 it as well.
15059 * layout.cc (Layout::layout): Always set *off.
15060 * mapfile.cc (Mapfile::print_input_section): Use
15061 output_section_offset.
15062 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15063 Sized_relobj*.
15064 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15065 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15066 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15067
5cb66f97
ILT
150682008-07-03 Ian Lance Taylor <iant@google.com>
15069
15070 * layout.cc (Layout::include_section): Do not discard unrecognized
15071 SHT_STRTAB sections.
15072
afe47622
CS
150732008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15074
15075 * script.cc (Lex::can_continue_name): Make '?' allowable in
15076 version-script names.
15077 * testsuite/version_script.map: Change glob pattern to use '?'
15078
5adf9721
ILT
150792008-06-30 Manish Singh <yosh@gimp.org>
15080
15081 PR 6585
15082 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
15083 Correct typo.
15084
e6fde208
ILT
150852008-06-30 Ian Lance Taylor <iant@google.com>
15086
15087 PR 6660
15088 PR 6682
15089 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
15090 versions]: Don't try to read the value in the contents, since we
15091 don't use it. Use the template endianness when writing.
15092
3f2e6a2d
CC
150932008-06-25 Cary Coutant <ccoutant@google.com>
15094
15095 * fileread.cc (File_read::make_view): Assert on zero-length view.
15096 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
15097 symbol table when there are no symbols to read.
15098
c43d3a48
CS
150992008-06-23 Craig Silverstein <csilvers@google.com>
15100
15101 * version.cc (version_string): Bump to 1.7
15102
5f494ea0
CS
151032008-06-18 Craig Silverstein <csilvers@google.com>
15104
15105 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
15106 constant 0xFFFF to type Valtype.
15107 (Powerpc_relocate_functions::rel16_ha): Likewise.
15108
c42e122e
ILT
151092008-06-17 Ian Lance Taylor <iant@google.com>
15110
f34787f8
ILT
15111 * output.h (Output_section::Input_section): Initialize p2align_ to
15112 zero for Output_section_data constructors.
15113 (Output_section::Input_section::addralign): If not an input
15114 section, return the alignment of the Output_section_data.
15115 * testsuite/copy_test.cc: New file.
15116 * testsuite/copy_test_1.cc: New file.
15117 * testsuite/copy_test_2.cc: New file.
15118 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15119 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15120 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15121 (copy_test_1_pic.o, copy_test_1.so): New targets.
15122 (copy_test_2_pic.o, copy_test_2.so): New targets.
15123 * testsuite/Makefile.in: Rebuild.
15124
c42e122e
ILT
15125 * script-sections.cc (Script_sections::place_orphan): Initialize
15126 local variable exact.
15127
ce3ac18a
DE
151282008-06-13 David Edelsohn <edelsohn@gnu.org>
15129
15130 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15131
42cacb20
DE
151322008-06-12 David Edelsohn <edelsohn@gnu.org>
15133 David S. Miller <davem@davemloft.net>
15134
15135 * powerpc.cc: New file.
15136 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15137 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15138 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15139 * Makefile.in: Rebuild.
15140
7b308235
ILT
151412008-06-09 Ian Lance Taylor <iant@google.com>
15142
15143 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15144 <exception>.
15145 (throwing, orig_terminate): New static variables.
15146 (terminate_handler): New static function.
15147 (t2): Set terminate handler.
15148
f0b886e3
ILT
151492008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15150
15151 PR 6584
cd536b21 15152 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
15153 alignment.
15154
3e90f135
CC
151552008-05-30 Cary Coutant <ccoutant@google.com>
15156
15157 * archive.cc (Archive::include_all_members) Correct to step
15158 over symbol table and extended name table in thin archives.
15159
e09ad04a
ILT
151602008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15161
15162 PR 6407
15163 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15164 calculation.
15165
62b01cb5
ILT
151662008-05-28 Caleb Howe <cshowe@google.com>
15167
15168 * reduced_debug_output.cc: New file.
15169 * reduced_debug_output.h: New file.
92de84a6 15170 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
15171 * options.cc (General_options::finalize): Add strip_debug_non_line
15172 to the strip heirarchy.
15173 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15174 fields.
15175 * layout.cc: Include "reduced_debug_output.h".
15176 (Layout::Layout): Initialize new fields.
15177 (line_only_debug_sections): New static array.
15178 (is_lines_only_debug_sections): New static inline function.
15179 (Layout::include_section): Handle --strip-debug-non-line.
15180 (Layout::make_output_section): If --strip-debug-non-line, build
15181 new output sections for .debug_abbrev and .debug_info.
15182 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15183 gold. Warn about possible overflow.
15184 (read_signed_LEB_128): Likewise.
15185 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15186 (read_signed_LEB_128): Declare.
15187 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15188 (HFILES): Add reduced_debug_output.h.
15189 * Makefile.in: Rebuild.
15190
7d9e3d98
ILT
151912008-05-21 Ian Lance Taylor <iant@google.com>
15192
15193 * mapfile.cc: New file.
15194 * mapfile.h: New file.
15195 * options.h (class General_options): Add -M/--print-map and -Map.
15196 * options.cc (General_options::finalize): Make -M equivalent to
15197 -Map -.
15198 * main.cc: Include <cstdio> and "mapfile.h".
15199 (main): Open mapfile if requested.
15200 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15201 constructor. Change caller.
15202 (queue_initial_tasks): Add mapfile parameter. Change caller.
15203 (queue_middle_tasks): Likewise.
15204 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15205 declarations.
15206 * archive.cc: Include "mapfile.h".
15207 (Archive::add_symbols): Add mapfile parameter. Change all
15208 callers. Pass mapfile, symbol, and reason to include_member.
15209 (Archive::include_all_members): Add mapfile parameter. Change all
15210 callers.
15211 (Archive::include_member): Add mapfile, sym, and why parameters.
15212 Change all callers. Report inclusion to map file.
15213 * archive.h: Include "fileread.h".
15214 (class Archive): Update declarations.
15215 (Archive::file): New const method.
15216 (class Add_archive_symbols): Add mapfile_ field. Update
15217 constructor. Change all callers.
15218 * readsyms.h (class Read_symbols): Likewise.
15219 (class Finish_group): Likewise.
15220 (class Read_script): Likewise.
15221 * common.cc: Include "mapfile.h".
15222 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15223 all callers.
15224 (Symbol_table::do_allocate_commons): Likewise.
15225 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15226 symbol allocation to mapfile.
15227 * common.h (class Allocate_commons_task): Add mapfile_ field.
15228 Update constructor. Change all callers.
15229 * symtab.h (class Symbol_table): Update declarations.
15230 * layout.cc: Include "mapfile.h".
15231 (Layout_task_runner::run): Print information to mapfile.
15232 (Layout::create_gold_note): Change Output_data_fixed_space to
15233 Output_data_zero_fill.
15234 (Layout::create_build_id): Likewise.
15235 (Layout::print_to_mapfile): New function.
15236 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15237 constructor. Change caller.
15238 (class Layout): Declare print_to_mapfile.
15239 * output.cc (Output_section::Input_section::print_to_mapfile): New
15240 function.
15241 (Output_section::add_input_section): If producing a map, always
15242 add to input_sections_ list.
15243 (Output_section::do_print_to_mapfile): New function.
15244 (Output_segment::print_sections_to_mapfile): New function.
15245 (Output_segment::print_section_list_to_mapfile): New function.
15246 * output.h: Include "mapfile.h".
15247 (Output_data::print_to_mapfile): New function.
15248 (Output_data::do_print_to_mapfile): New virtual function.
15249 (Output_segment_headers::do_print_to_mapfile): New function.
15250 (Output_file_header::do_print_to_mapfile): New function.
15251 (Output_data_const::do_print_to_mapfile): New function.
15252 (class Output_data_const_buffer): Add map_name_ field. Update
15253 constructor. Change all callers. Add do_print_to_mapfile
15254 function.
15255 (class Output_data_fixed_space): Likewise.
15256 (class Output_data_space): Likewise.
15257 (class Output_data_zero_fill): New class.
15258 (Output_data_strtab::do_print_to_mapfile): New function.
15259 (Output_data_reloc_base::do_print_to_mapfile): New function.
15260 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15261 (Output_data_group::do_print_to_mapfile): New function.
15262 (Output_data_got::do_print_to_mapfile): New function.
15263 (Output_data_dynamic::do_print_to_mapfile): New function.
15264 (Output_symtab_xindex::do_print_to_mapfile): New function.
15265 (class Output_section): Declare do_print_to_mapflie. Declare
15266 print_to_mapfile in Input_section.
15267 (class Output_segment): Declare new functions.
15268 * object.h (Sized_relobj::symbol_count): New function.
15269 * script-sections.cc
15270 (Output_section_element_dot_assignment::set_section_addresses):
15271 Change Output_data_fixed_space to Output_data_zero_fill.
15272 (Output_data_expression::do_print_to_mapfile): New function.
15273 * script.cc (read_input_script): Add mapfile parameter. Change
15274 all callers.
15275 * script.h (read_input_script): Update declaration.
15276 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15277 (Eh_frame::do_print_to_mapfile): New function.
15278 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15279 (Output_merge_string::do_print_to_mapfile): New function.
15280 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15281 function.
15282 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15283 function.
15284 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15285 function.
15286 * Makefile.am (CCFILES): Add mapfile.cc.
15287 (HFILES): Add mapfile.h.
15288 * Makefile.in: Rebuild.
15289
9f1d377b
ILT
152902008-05-19 Ian Lance Taylor <iant@google.com>
15291
15292 * options.h (class General_options): Add -z relro.
15293 * layout.cc (Layout::Layout): Initialize relro_segment_.
15294 (Layout::add_output_section_data): Return the output section.
15295 (Layout::make_output_section): Rcognize relro sections and mark
15296 them appropriately.
15297 (Layout::attach_allocated_section_to_segment): Put relro sections
15298 in a PT_GNU_RELRO segment.
15299 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15300 section as relro.
15301 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15302 PT_TLS segments.
15303 (Layout::linkonce_mapping): Map d.rel.ro.local to
15304 .data.rel.ro.local.
15305 (Layout::output_section_name): Us .data.rel.ro.local for any
15306 section which begins with that.
15307 * layout.h (class Layout): Update add_output_section_data
15308 declaration. Add relro_segment_ field.
15309 * output.cc (Output_section::Output_section): Initialize is_relro_
15310 and is_relro_local_ fields.
15311 (Output_segment::add_output_section): Group relro sections.
15312 (Output_segment::is_first_section_relro): New function.
15313 (Output_segment::maximum_alignment): If there is a relro section,
15314 align the segment to the common page size.
15315 (Output_segment::set_section_addresses): Track whether we are
15316 looking at relro sections. If the last section is a relro
15317 section, align to the common page size.
15318 (Output_segment::set_section_list_addresses): Add in_relro
15319 parameter. Change all callers. Align to the page size when
15320 moving from relro to non-relro section.
15321 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15322 segment.
15323 * output.h (class Output_section): Add is_relro_ and
15324 is_relro_local_ fields.
15325 (Output_section::is_relro): New function.
15326 (Output_section::set_is_relro): New function.
15327 (Output_section::is_relro_local): New function.
15328 (Output_section::set_is_relro_local): New function.
15329 (class Output_segment): Update declarations.
15330 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15331 * sparc.cc (Target_sparc::got_section): Likewise.
15332 * x86_64.cc (Target_x86_64::got_section): Likewise.
15333 * testsuite/relro_test_main.cc: New file.
15334 * testsuite/relro_test.cc: New file.
15335 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15336 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15337 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15338 (relro_test.so, relro_test_pic.o): New targets.
15339 * testsuite/Makefile.in: Rebuild.
15340
a984ee1d
ILT
153412008-05-16 Ian Lance Taylor <iant@google.com>
15342
01676dcd
ILT
15343 * output.cc (Output_segment::add_output_section): Remove front
15344 parameter.
15345 * output.h (class Output_segment): Remove
15346 add_initial_output_section and overloaded add_output_section.
15347 Update declaration of remaining add_output_section.
15348 * layout.cc (Layout::create_interp): Call add_output_section
15349 rather than add_initial_output_section.
15350 (Layout::finish_dynamic_section): Likewise.
15351
497897f9
ILT
15352 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15353 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15354 know the dynamic type.
15355 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15356 field. Initialize it in constructor.
15357 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15358 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15359 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15360 reloc.
15361
a984ee1d
ILT
15362 * output.cc (Output_reloc::get_address): Change return type to
15363 Elf_Addr.
15364 * output.h (class Output_reloc): Update get_address declaration.
15365 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15366 for section addresses.
15367
55ba0940
ILT
153682008-05-09 Ian Lance Taylor <iant@google.com>
15369
15370 PR 6493
15371 * gold.cc (gold_nomem): Use return value of write.
15372
75517b77
ILT
153732008-05-08 Ian Lance Taylor <iant@google.com>
15374
15375 * symtab.c (Symbol::init_base_output_data): Add version
15376 parameter. Change all callers.
15377 (Symbol::init_base_output_segment): Likewise.
15378 (Symbol::init_base_constant): Likewise.
15379 (Symbol::init_base_undefined): Likewise.
15380 (Sized_symbol::init_output_data): Likewise.
15381 (Sized_symbol::init_output_segment): Likewise.
15382 (Sized_symbol::init_constant): Likewise.
15383 (Sized_symbol::init_undefined): Likewise.
15384 (Symbol_table::do_define_in_output_data): If the new symbol has a
15385 version, mark it as the default.
15386 (Symbol_table::do_define_in_output_segment): Likewise.
15387 (Symbol_table::do_define_as_constant): Likewise.
15388 * symtab.h (class Symbol): Update declarations.
15389 (class Sized_symbol): Likewise.
15390 * resolve.cc (Symbol::override_version): New function.
c42e122e 15391 (Symbol::override_base): Call override_version.
75517b77
ILT
15392 (Symbol::override_base_with_special): Likewise.
15393 * testsuite/ver_script_8.script: New file.
15394 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15395 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15396 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15397 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15398
f1f70eae
ILT
153992008-05-06 Ian Lance Taylor <iant@google.com>
15400
f3e9c5c5
ILT
15401 PR 6049
15402 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15403 functions.
15404 (class General_options): Remove existing --undefined, and add
15405 --no-undefined instead. Add new --undefined as synonym for -u.
15406 * archive.cc (Archive::add_symbols): Check whether symbol was
15407 named with -u.
15408 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15409 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15410 all uses. Add IS_UNDEFINED. Update declarations to split
15411 different versions of init_base. Declare init_base_undefined.
15412 (Symbol::is_defined): Handle IS_UNDEFINED.
15413 (Symbol::is_undefined): Likewise.
15414 (Symbol::is_weak_undefined): Call is_undefined.
15415 (Symbol::is_absolute): Handle IS_CONSTANT.
15416 (class Sized_symbol): Update declarations to split different
15417 versions of init. Declare init_undefined.
15418 (class Symbol_table): Declare new functions.
15419 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15420 Change all callers.
15421 (Symbol::init_base_output_data): Likewise.
15422 (Symbol::init_base_output_segment): Likewise.
15423 (Symbol::init_base_constant): Likewise.
15424 (Symbol::init_base_undefined): New function.
15425 (Sized_symbol::init_object): Rename from init. Change all
15426 callers.
15427 (Sized_symbol::init_output_data): Likewise.
15428 (Sized_symbol::init_output_segment): Likewise.
15429 (Sized_symbol::init_constant): Likewise.
15430 (Sized_symbol::init_undefined): New function.
15431 (Symbol_table::add_undefined_symbols_from_command_line): New
15432 function.
15433 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15434 function.
15435 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15436 (Symbol::output_section): Likewise.
15437 (Symbol::set_output_section): Likewise.
15438 (Symbol_table::sized_finalize_symbol): Likewise.
15439 (Symbol_table::sized_write_globals): Likewise.
15440 * resolve.cc (Symbol_table::should_override): Likewise.
15441 (Symbol::override_base_with_special): Likewise.
15442
8bdcdf2c
ILT
15443 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15444 symbol, change it to have default visibility.
15445 * testsuite/protected_1.cc: New file.
15446 * testsuite/protected_2.cc: New file.
15447 * testsuite/protected_3.cc: New file.
15448 * testsuite/protected_main_1.cc: New file.
15449 * testsuite/protected_main_2.cc: New file.
15450 * testsuite/protected_main_3.cc: New file.
15451 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15452 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15453 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15454 (protected_1.so): New target.
15455 (protected_1_pic.o, protected_2_pic.o): New targets.
15456 (protected_3_pic.o): New target.
15457 (check_PROGRAMS): Add protected_2.
15458 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15459 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15460 * testsuite/Makefile.in: Rebuild.
15461
2b706932
ILT
15462 * options.h (DEFINE_var): Add set_user_set_##varname__.
15463 (DEFINE_bool_alias): New macro.
15464 (class General_options): Define -Bstatic using DEFINE_bool_alias
15465 rather than DEFINE_special. Add --undefined as an alias for -z
15466 defs.
15467 * options.cc (General_options::parse_Bstatic): Remove.
15468
d82a5bcc
ILT
15469 * options.h (class General_options): Add --fatal-warnings.
15470 * main.cc (main): Implement --fatal-warnings.
15471 * errors.h (Errors::warning_count): New function.
15472
f1f70eae
ILT
15473 * options.h (class General_options): Add -Bsymbolic-functions.
15474 * symtab.h (Symbol::is_preemptible): Check for
15475 -Bsymbolic-functions.
15476
8825ac63
ILT
154772008-05-05 Ian Lance Taylor <iant@google.com>
15478
d98bc257
ILT
15479 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15480 as noVARNAME rather than no-VARNAME.
15481 (class General_options): Add option -z combreloc.
15482 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15483 get_address.
15484 (Output_reloc::sort_before) [SHT_REL]: New function.
15485 (Output_reloc::sort_before) [SHT_RELA]: New function.
15486 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15487 Sort_relocs_comparison.
15488 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15489 parameter. Change all callers.
15490 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15491 sort_relocs parameter. Change all callers.
15492 * output.cc (Output_reloc::get_address): New function, broken out
15493 of write_rel.
15494 (Output_reloc::write_rel): Call it.
15495 (Output_reloc::compare): New function.
15496 (Output_data_reloc_base::do_write): Optionally sort relocs.
15497
60b2b4e7
ILT
15498 * configure.ac: If targ_extra_obj is set, link it in.
15499 * configure.tgt: Initialize all variables.
15500 (x86_64*): Set targ_extra_obj and targ_extra_size.
15501 * configure: Rebuild.
15502
8825ac63
ILT
15503 * object.cc (Sized_relobj::include_section_group): Adjust section
15504 indexes read from group data. Build vector to pass to
15505 layout_group.
15506 * layout.cc (Layout::layout_group): Add flags and shndxes
15507 parameters. Remove contents parameter. Change caller. Update
15508 explicit instantiations.
15509 * layout.h (class Layout): Update layout_group declaration.
15510 * output.cc (Output_data_group::Output_data_group): Add flags and
15511 input_shndxes parameters. Remove contents parameter. Change
15512 caller.
15513 (Output_data_group::do_write): Change input_sections_ to
15514 input_shndxes_.
15515 * output.h (class Output_data_group): Update constructor
15516 declaration. Rename input_sections_ to input_shndxes_.
15517 * testsuite/many_sections_test.cc: Add template.
15518
e94cf127
CC
155192008-04-30 Cary Coutant <ccoutant@google.com>
15520
4418b2d5
CC
15521 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15522
e94cf127
CC
15523 * layout.cc (Layout::include_section): Refactored check for debug
15524 info section.
15525 (Layout::add_comdat): Add new parameters. Change type
15526 of signature parameter. Add object and shndx to signatures table.
15527 (Layout::find_kept_object): New function.
15528 * layout.h: Include <cstring>.
15529 (Layout::is_debug_info_section): New function.
15530 (Layout::add_comdat): Add new parameters.
15531 (Layout::find_kept_object): New function.
15532 (Layout::Kept_section): New struct.
15533 (Layout::Signatures): Change type of map range.
15534 * object.cc (Relobj::output_section_address): New function.
15535 (Sized_relobj::include_section_group): Add new parameters. Change
15536 calls to Layout::add_comdat. Change to build table of kept comdat
15537 groups and table mapping discarded sections to kept sections.
15538 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15539 (Sized_relobj::do_layout): Change calls to include_section_group and
15540 include_linkonce_section.
15541 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15542 value to zero when section is discarded.
15543 (Sized_relobj::map_to_kept_section): New function.
15544 * object.h (Relobj::output_section_address): New function.
15545 (Relobj::Comdat_group): New type.
15546 (Relobj::find_comdat_group): New function.
15547 (Relobj::Comdat_group_table): New type.
15548 (Relobj::Kept_comdat_section): New type.
15549 (Relobj::Kept_comdat_section_table): New type.
15550 (Relobj::add_comdat_group): New function.
15551 (Relobj::set_kept_comdat_section): New function.
15552 (Relobj::get_kept_comdat_section): New function.
15553 (Relobj::comdat_groups_): New field.
15554 (Relobj::kept_comdat_sections_): New field.
15555 (Symbol_value::input_value): Update comment.
15556 (Sized_relobj::map_to_kept_section) New function.
15557 (Sized_relobj::include_linkonce_section): Add new parameter.
15558 * target-reloc.h (Comdat_behavior): New type.
15559 (get_comdat_behavior): New function.
15560 (relocate_section): Add code to map a discarded section to the
15561 corresponding kept section when applying a relocation.
15562
e4e5049b
CS
155632008-04-30 Craig Silverstein <csilvers@google.com>
15564
15565 * dwarf_reader.cc (next_generation_count): New static var.
15566 (Addr2line_cache_entry): New struct.
15567 (addr2line_cache): New static var.
15568 (Dwarf_line_info::one_addr2line): Added caching.
15569 (Dwarf_line_info::clear_addr2line_cache): New function.
15570 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15571 cache-size parameter.
15572 (Dwarf_line_info::one_addr2line_cache): New function.
15573 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15574 new cache-size argument to one_addr2line(), and clear cache.
15575
d09e9154
CC
155762008-04-28 Cary Coutant <ccoutant@google.com>
15577
15578 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15579 R_386_PC8 relocations.
15580
7ef73768
ILT
155812008-04-23 Ian Lance Taylor <iant@google.com>
15582
55438702
ILT
15583 * object.cc (Sized_relobj::include_section_group): Check for
15584 invalid section group.
15585
c165fb93
ILT
15586 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15587 header size.
15588
7ef73768
ILT
15589 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15590 than read for file header.
15591 * archive.cc (Archive::include_member): Likewise.
15592
6194aaab
L
155932008-04-23 Paolo Bonzini <bonzini@gnu.org>
15594
15595 * aclocal.m4: Regenerate.
15596 * configure: Regenerate.
15597
d491d34e
ILT
155982008-04-19 Ian Lance Taylor <iant@google.com>
15599
5ea2bac6
ILT
15600 * version.cc (version_string): Bump to 1.6.
15601
7bc3e21a
ILT
15602 * testsuite/Makefile.am (many_sections_r_test): New target.
15603 (many_sections_r_test_SOURCES): Remove.
15604 (many_sections_r_test_DEPENDENCIES): Remove.
15605 (many_sections_r_test_LDFLAGS): Remove.
15606 (many_sections_r_test_LDADD): Remove.
15607
7fcd3aa9
ILT
15608 * object.cc (Sized_relobj::do_add_symbols): Always pass
15609 local_symbol_count_ to add_from_relobj.
15610
4c94d6ae
ILT
15611 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15612 every thousand variables.
15613 * testsuite/Makefile.in: Rebuild.
15614
d491d34e
ILT
15615 * object.cc (Xindex::initialize_symtab_xindex): New function.
15616 (Xindex::read_symtab_xindex): New function.
15617 (Xindex::sym_xindex_to_shndx): New function.
15618 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15619 available.
15620 (Sized_relobj::do_initialize_xindex): New function.
15621 (Sized_relobj::do_read_symbols): Adjust section links.
15622 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15623 parameter. Change all callers.
15624 (Sized_relobj::include_section_group): Adjust section links and
15625 symbol section indexes.
15626 (Sized_relobj::do_layout): Adjust section links.
15627 (Sized_relobj::do_count_local_symbols): Adjust section links and
15628 symbol section indexes.
15629 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15630 ordinary and special symbols.
15631 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15632 dynsym_xindex parameters. Change all callers. Adjust section
15633 links. Use SHN_XINDEX when needed.
15634 (Sized_relobj::get_symbol_location_info): Adjust section links.
15635 Don't get fooled by special symbols.
15636 * object.h (class Xindex): Define.
15637 (class Object): Add xindex_ parameter. Declare virtual functoin
15638 do_initialize_xindex.
15639 (Object::adjust_sym_shndx): New function.
15640 (Object::set_xindex): New protected function.
15641 (class Symbol_value): Add is_ordinary_shndx_ field.
15642 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15643 (Symbol_value::value): Assert ordinary section.
15644 (Symbol_value::initialize_input_to_output_map): Likewise.
15645 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15646 Change all callers.
15647 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15648 all callers.
15649 (class Sized_relobj): Update declarations.
15650 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15651 parameter. Change all callers.
15652 (Sized_relobj::adjust_shndx): New function.
15653 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15654 field.
15655 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15656 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15657 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15658 (Sized_dynobj::read_dynsym_section): Adjust section links.
15659 (Sized_dynobj::read_dynamic): Likewise.
15660 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15661 section links.
15662 (Sized_dynobj::do_initialize_xindex): New function.
15663 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15664 do_initialize_xindex.
15665 (Sized_dynobj::adjust_shndx): New function.
15666 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15667 dynsym_xindex_ fields.
15668 (Layout::finalize): Add a call to set_section_indexes before
15669 creating the symtab sections.
15670 (Layout::set_section_indexes): Don't do anything if the section
15671 already has a section index.
15672 (Layout::create_symtab_sections): Add shnum parameter. Change
15673 caller. Create .symtab_shndx section if needed.
15674 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15675 caller.
15676 (Layout::allocated_output_section_count): New function.
15677 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15678 needed.
15679 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15680 fields. Update declarations.
15681 (Layout::symtab_xindex): New function.
15682 (Layout::dynsym_xindex): New function.
15683 (class Write_symbols_task): Add layout_ field.
15684 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15685 Change caller.
15686 * output.cc (Output_section_headers::Output_section_headers): Add
15687 shstrtab_section parameter. Change all callers.
15688 (Output_section_headers::do_sized_write): Store overflow values
15689 for section count and section string table section index in
15690 section header zero.
15691 (Output_file_header::do_sized_write): Check for overflow of
15692 section count and section string table section index.
15693 (Output_symtab_xindex::do_write): New function.
15694 (Output_symtab_xindex::endian_do_write): New function.
15695 * output.h (class Output_section_headers): Add shstrtab_section_.
15696 Update declarations.
15697 (class Output_symtab_xindex): Define.
15698 (Output_section::has_out_shndx): New function.
15699 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15700 field.
15701 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15702 Change all callers.
15703 (Sized_symbol::init): Likewise.
15704 (Symbol::output_section): Check for ordinary symbol.
15705 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15706 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15707 callers.
15708 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15709 Change all callers. Simplify handling of symbols from sections
15710 not included in the link.
15711 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15712 distinction.
15713 (Weak_alias_sorter::operator()): Assert that symbols are
15714 ordinary.
15715 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15716 distinction.
15717 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15718 parameters. Change all callers.
15719 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15720 symbol distinction. Use SHN_XINDEX when needed.
15721 (Symbol_table::write_section_symbol): Add symtab_xindex
15722 parameter. Change all callers.
15723 (Symbol_table::sized_write_section_symbol): Likewise. Use
15724 SHN_XINDEX when needed.
15725 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15726 declarations.
15727 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15728 (Symbol::is_defined): Check is_ordinary.
15729 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15730 (Symbol::is_absolute, Symbol::is_common): Likewise.
15731 (class Sized_symbol): Update declarations.
15732 (class Symbol_table): Update declarations.
15733 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15734 parameters. Change all callers.
15735 (Sized_symbol::override): Likewise.
15736 (Symbol_table::override): Likewise.
15737 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15738 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15739 is_ordinary, and orig_st_shndx parameters. Change all callers.
15740 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15741 to be in an ordinary section.
15742 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15743 object and is_ordinary parameters. Change all callers.
15744 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15745 Change all callers. Don't add undefined or non-ordinary symbols
15746 to reloc_map_.
15747 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15748 Change all callers.
15749 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15750 declarations.
15751 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15752 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15753 (Sized_relobj::relocate_sections): Likewise.
15754 * target-reloc.h (scan_relocs): Adjust section symbol index.
15755 (scan_relocatable_relocs): Likewise.
15756 * i386.cc (Scan::local): Check for ordinary symbols.
15757 * sparc.cc (Scan::local): Likewise.
15758 * x86_64.cc (Scan::local): Likewise.
15759 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15760 to symbol_section_and_value.
15761 * testsuite/many_sections_test.cc: New file.
15762 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15763 (check_PROGRAMS): Add many_sections_test.
15764 (many_sections_test_SOURCES): Define.
15765 (many_sections_test_DEPENDENCIES): Define.
15766 (many_sections_test_LDFLAGS): Define.
15767 (BUILT_SOURCES): Add many_sections_define.h.
15768 (many_sections_define.h): New target.
15769 (BUILT_SOURCES): Add many_sections_check.h.
15770 (many_sections_check.h): New target.
15771 (check_PROGRAMS): Add many_sections_r_test.
15772 (many_sections_r_test_SOURCES): Define.
15773 (many_sections_r_test_DEPENDENCIES): Define.
15774 (many_sections_r_test_LDFLAGS): Define.
15775 (many_sections_r_test_LDADD): Define.
15776 (many_sections_r_test.o): New target.
15777 * testsuite/Makefile.in: Rebuild.
15778
c5818ff1
CC
157792008-04-17 Cary Coutant <ccoutant@google.com>
15780
15781 * errors.cc (Errors::info): New function.
15782 (gold_info): New function.
15783 * errors.h (Errors::info): New function.
15784 * gold.h (gold_info): New function.
15785 * object.cc (Input_objects::add_object): Print trace output.
15786 * options.cc (options::parse_set): New function.
15787 (General_options::parse_wrap): Deleted.
15788 (General_options::General_options): Deleted initializer.
15789 * options.h (options::String_set): New typedef.
15790 (options::parse_set): New function.
15791 (DEFINE_set): New macro.
15792 (General_options::wrap): Changed to use DEFINE_set. Changed
15793 callers of any_wrap_symbols and is_wrap_symbol.
15794 (General_options::trace, General_options::trace_symbol):
15795 New options.
15796 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15797 (General_options::wrap_symbols_): Deleted.
15798 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15799
b5be4a7c
DM
158002008-04-17 David S. Miller <davem@davemloft.net>
15801
15802 * options.cc (General_options::parse_V): New function.
15803 * options.h: Add entries for -V and -Qy.
15804
155a0dd7
ILT
158052008-04-17 Ian Lance Taylor <iant@google.com>
15806
15807 * common.cc (Symbol_table::allocate_commons): Remove options
15808 parameter. Change caller.
15809 (Symbol_table::do_allocate_commons): Remove options parameter.
15810 Change caller. Just call do_allocate_commons_list twice.
15811 (Symbol_table::do_allocate_commons_list): New function, broken out
15812 of do_allocate_commons.
15813 * common.h (class Allocate_commons_task): Remove options_ field.
15814 Update constructor.
15815 * symtab.cc (Symbol_table::Symbol_table): Initialize
15816 tls_commons_.
15817 (Symbol_table::add_from_object): Put TLS common symbols on
15818 tls_commons_ list.
15819 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15820 which are IN_OUTPUT_DATA.
15821 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15822 allocate_commons and do_allocate_commons declarations. Declare
15823 do_allocate_commons_list.
15824 * gold.cc (queue_middle_tasks): Update creation of
15825 Allocate_commons_task to not pass options.
15826 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15827 (TLS_TEST_C_FLAGS): New variable.
15828 (tls_test_c_pic.o): New target.
15829 (tls_test_shared.so): Link in tls_test_c_pic.o.
15830 (tls_test_c_pic_ie.o): New target.
15831 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15832 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15833 (tls_test_c.o): New target.
15834 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15835 (tls_pic_test_LDADD): Likewise.
15836 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15837 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15838 (tls_test_c_gnu2.o): New target.
15839 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15840 tls_test_c_gnu2.o.
15841 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15842 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15843 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15844 * testsuite/tls_test.cc: Include "config.h".
15845 (t_last): Call t11_last.
15846 * testsuite/tls_test.h (t11, t11_last): Declare.
15847 * testsuite/tls_test_c.c: New file.
15848 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15849 * configure.ac: Check for OpenMP support.
15850 * configure, config.in, Makefile.in: Rebuild.
15851 * testsuite/Makefile.in: Rebuild.
15852
edfbb029
CC
158532008-04-16 Cary Coutant <ccoutant@google.com>
15854
15855 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15856 (Target_i386::tls_base_symbol_defined_): New field.
15857 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15858 (Target_i386::Scan::global): Likewise.
15859 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15860 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15861 (Target_x86_64::tls_base_symbol_defined_): New field.
15862 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15863 (Target_x86_64::Scan::global): Likewise.
15864
f3c69fca
CC
158652008-04-16 Cary Coutant <ccoutant@google.com>
15866
15867 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15868 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15869 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15870 building shared libraries.
15871 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15872 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15873 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15874 * testsuite/Makefile.in: Rebuild.
15875 * testsuite/weak_undef.h: New file.
15876 * testsuite/weak_undef_file1.cc: Add extra test cases.
15877 * testsuite/weak_undef_file2.cc: Likewise.
15878 * testsuite/weak_undef_test.cc: Likewise.
15879
7c414435
DM
158802008-04-16 David S. Miller <davem@davemloft.net>
15881
32b769e1
DM
15882 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15883 Add issued_non_pic_error_ field. Declare check_non_pic.
15884 (Target_sparc::Scan::check_non_pic): New function.
15885 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15886 (Target_sparc::Scan::global): Likewise.
15887
11936fb1
DM
15888 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15889 * configure: Rebuild.
15890
7c414435
DM
15891 * options.h (DEFINE_enable): New macro.
15892 (new_dtags): New enable option.
15893 (initfirst, interpose, loadfltr, nodefaultlib,
15894 nodelete, nodlopen, nodump): New -z options.
15895 * layout.cc (Layout:finish_dynamic_section): If new
15896 dtags enabled, emit DT_RUNPATH. Also, emit a
15897 DT_FLAGS_1 containing any specified -z flags.
15898
85c7bf8b
ILT
158992008-04-16 Ian Lance Taylor <iant@google.com>
15900
12c0daef
ILT
15901 * copy-relocs.cc: New file.
15902 * copy-relocs.h: New file.
15903 * reloc.cc: Remove Copy_relocs code.
15904 * reloc.h: Likewise.
15905 * reloc-types.h (struct Reloc_types) [both versions]: Add
15906 get_reloc_addend_noerror.
15907 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15908 variants of add_global which take an addend which must be zero.
15909 * i386.cc: Include "copy-relocs.h".
15910 (class Target_i386): Change type of copy_relocs_ to variable,
15911 update initializer.
15912 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15913 Change all callers.
15914 (Target_i386::do_finalize_sections): Change handling of
15915 copy_relocs_.
15916 * sparc.cc: Include "copy-relocs.h".
15917 (class Target_sparc): Change type of copy_relocs_ to variable,
15918 update initializer.
15919 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15920 Change all callers.
15921 (Target_sparc::do_finalize_sections): Change handling of
15922 copy_relocs_.
15923 * x86_64.cc: Include "copy-relocs.h".
15924 (class Target_x86_64): Change type of copy_relocs_ to variable,
15925 update initializer.
15926 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15927 class. Change all callers.
15928 (Target_x86_64::do_finalize_sections): Change handling of
15929 copy_relocs_.
15930 * Makefile.am (CCFILES): Add copy-relocs.cc.
15931 (HFILES): Add copy-relocs.h.
15932
4f4995b6
ILT
15933 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15934
85c7bf8b
ILT
15935 * testsuite/script_test_4.sh: Permit leading zeroes.
15936
4f2a9edd
ILT
159372008-04-15 Ian Lance Taylor <iant@google.com>
15938
e6188289
ILT
15939 * script-sections.cc (Script_sections::create_segments): Use
15940 header_size_adjustment even when there is enough room for the
15941 headers.
15942 * testsuite/script_test_4.sh: New file.
15943 * testsuite/script_test_4.t: New file.
15944 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15945 (check_DATA): Add script_test_4.stdout.
15946 (MOSTLYCLEANFILES): Likewise.
15947 (script_test_4): New target.
15948 (script_test_4.stdout): New target.
15949 * testsuite/Makefile.in: Rebuild.
15950
4f2a9edd
ILT
15951 * sparc.cc: Add definitions for Output_data_plt_sparc class
15952 constants.
15953
f5314dd5
DM
159542008-04-14 David S. Miller <davem@davemloft.net>
15955
15956 * sparc.cc: New file.
15957 * Makefile.am (TARGETSOURCES): Add sparc.cc
15958 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15959 * configure.tgt: Document targ_extra_size and
15960 targ_extra_big_endian. Add entries for sparc-* and
15961 sparc64-*.
15962 * configure.ac: Handle targ_extra_size and
15963 targ_extra_big_endian.
15964 * Makefile.in: Rebuild.
15965 * configure: Likewise.
15966 * po/POTFILES.in: Likewise.
15967 * po/gold.pot: Likewise.
15968
154e0e9a
ILT
159692008-04-14 Ian Lance Taylor <iant@google.com>
15970
15971 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15972 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15973 in the name/type/flags to section mapping. Don't call
15974 allocate_output_section.
15975 (Layout::choose_output_section): Change parameter from adjust_name
15976 to is_input_section. Don't permit input sections after sections
15977 are attached to segments. Don't call allocate_output_section.
15978 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15979 not write_enable_output_section.
15980 (Layout::make_output_section): Don't push to
15981 unattached_section_list_ nor call attach_to_segment. Call
15982 attach_section_to_segment if sections are attached.
15983 (Layout::attach_sections_to_segments): New function.
15984 (Layout::attach_section_to_segment): New function.
15985 (Layout::attach_allocated_section_to_segment): Rename from
15986 attach_to_segment. Remove flags parameter.
15987 (Layout::allocate_output_section): Remove function.
15988 (Layout::write_enable_output_section): Remove function.
15989 * layout.h (class Layout): Update for above changes. Add new
15990 field sections_are_attached_.
15991 * output.h (Output_section::update_flags_for_input_section): New
15992 function.
15993 * output.cc (Output_section::add_input_section): Call
15994 update_flags_for_input_section.
15995 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15996
009a67a2
CC
159972008-04-11 Cary Coutant <ccoutant@google.com>
15998
15999 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16000 thought unnecessary.
16001 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16002
759b1a24
ILT
160032008-04-11 Ian Lance Taylor <iant@google.com>
16004
16005 * output.h (class Output_section_data): Remove inline definition
16006 of set_addralign.
16007 * output.cc (Output_section_data::set_addralign): New function.
16008
c2b45e22
CC
160092008-04-11 Cary Coutant <ccoutant@google.com>
16010
16011 Add support for TLS descriptors for i386 and x86_64.
16012 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16013 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16014 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16015 GOT_TYPE_TLS_DESC.
16016 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16017 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16018 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16019 relocations.
16020 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16021 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16022 Fix problem with initial-exec relocations.
16023 (Target_i386::Relocate::relocate_tls): Likewise.
16024 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16025 relaxation.
16026 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16027 support for section-plus-offset dynamic table entries.
16028 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16029 (Output_data_dynamic::Dynamic_entry): Add support for
16030 section-plus-offset dynamic table entries.
16031 (Output_data_dynamic::Classification): Likewise.
16032 (Output_data_dynamic::classification_): Renamed offset_.
16033 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16034 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16035 (Target_x86_64::make_plt_section): New function.
16036 (Target_x86_64::reserve_tlsdesc_entries): New function.
16037 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
16038 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
16039 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
16040 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
16041 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
16042 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
16043 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
16044 add extra PLT entry for TLS descriptors.
16045 (Output_data_plt_x86_64::got_): New field.
16046 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16047 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16048 fields.
16049 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16050 descriptors.
16051 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16052 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16053 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16054 R_386_TLS_DESC_CALL relocations.
16055 (Target_x86_64::Scan::global): Likewise.
16056 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16057 for TLS descriptors.
16058 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16059 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16060 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16061 GD-to-IE relaxation.
16062 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16063 and TLS_DESCRIPTORS.
16064 * Makefile.in: Rebuild.
16065 * configure: Rebuild.
16066 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16067 (tls_test_shared2.so): New target.
16068 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16069 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16070 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16071 (tls_shared_gd_to_ie_test_LDADD): New variable.
16072 (tls_shared_gnu2_gd_to_ie_test): New target.
16073 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16074 New targets.
16075 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16076 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16077 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16078 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16079 (tls_shared_gnu2_test): New target.
16080 (tls_test_gnu2_shared.so): New target.
16081 (tls_shared_gnu2_test_SOURCES): New variable.
16082 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
16083 (tls_shared_gnu2_test_LDFLAGS): New variable.
16084 (tls_shared_gnu2_test_LDADD): New variable.
16085 * testsuite/Makefile.in: Rebuild.
16086 * testsuite/Makefile.
16087
83bfb6b7
ILT
160882008-04-11 Ian Lance Taylor <iant@google.com>
16089
16090 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
16091 justsyms.t.
16092 * testsuite/Makefile.in: Rebuild.
16093
16094 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
16095 long.
16096 * testsuite/script_test_2.cc (main): Adjust test.
16097
706e1f5e
ILT
160982008-04-11 David S. Miller <davem@davemloft.net>
16099 Ian Lance Taylor <iant@google.com>
16100
16101 * options.h (General_options): Add entries for '-Y' and
16102 '-relax'.
16103 * options.cc (General_options:finalize): If -Y was used, add those
16104 entries to the library path instead of the default "/lib" and
16105 "/usr/lib".
16106
7c98e6bb
DM
161072008-04-11 David S. Miller <davem@davemloft.net>
16108
16109 * testsuite/justsyms.t: Start at 0x100.
16110 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
16111 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16112 long.
16113 * testsuite/script_test_2.cc: Adjust string and section length
16114 checks.
7c98e6bb 16115
99a37bfd
ILT
161162008-04-09 Ian Lance Taylor <iant@google.com>
16117
2cefc357
ILT
16118 PR gold/5996
16119 * script-sections.cc (Sections_element::allocate_to_segment): Add
16120 orphan parameter.
16121 (Output_section_definition::allocate_to_segment): Likewise.
16122 (Orphan_output_section::allocate_to_segment): Likewise.
16123 (Script_sections::attach_sections_using_phdrs_clause): Don't
16124 propagate non-PT_LOAD segments to orphan sections.
16125 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16126 readelf rather than objdump.
16127 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16128 .interp section and PT_INTERP segment are the same size.
16129 * testsuite/Makefile.in: Rebuild.
16130
99a37bfd
ILT
16131 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16132 aliases for symbols defined in the same object.
16133 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16134 (weak_alias_test_SOURCES): New variable.
16135 (weak_alias_test_DEPENDENCIES): New variable.
16136 (weak_alias_test_LDFLAGS): New variable.
16137 (weak_alias_test_LDADD): New variable.
16138 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16139 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16140 (weak_alias_test_3.o): New target.
16141 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16142 * testsuite/weak_alias_test_main.cc: New file.
16143 * testsuite/weak_alias_test_1.cc: New file.
16144 * testsuite/weak_alias_test_2.cc: New file.
16145 * testsuite/weak_alias_test_3.cc: New file.
16146
780e49c5
ILT
161472008-04-08 Ian Lance Taylor <iant@google.com>
16148
cdb0b8f5
ILT
16149 * options.h (class General_options): Add --noinhibit-exec option.
16150 * main.cc (main): Check --noinhibit-exec.
16151
0864d551
ILT
16152 * options.h (class General_options): Define --wrap as a special
16153 option. Add wrap_symbols_ field.
16154 (General_options::any_wrap_symbols): New function.
16155 (General_options::is_wrap_symbol): New function.
16156 * options.cc (General_options::parse_wrap): New function.
16157 (General_options::General_options): Initialize wrap_symbols_.
16158 * symtab.cc (Symbol_table::wrap_symbol): New function.
16159 (Symbol_table::add_from_object): Handle --wrap.
16160 * symtab.h (class Symbol_table): Declare wrap_symbol.
16161 * target.h (Target::wrap_char): New function.
16162 (Target::Target_info): Add wrap_char field.
16163 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16164 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16165 * testsuite/testfile.cc (Target_test::test_target_info):
16166 Likewise.
16167
789aa6de
ILT
16168 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16169 there is one.
16170
2c38906f
ILT
16171 * layout.h (class Layout): Add added_eh_frame_data_ field.
16172 * layout.cc (Layout::Layout): Initialize new field.
16173 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16174 output section until we find a section we merged successfully.
16175 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16176 that the size be non-zero.
16177
780e49c5
ILT
16178 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16179 qualifier.
16180
7fcd0256
ILT
161812008-04-08 Craig Silverstein <csilvers@google.com>
16182
16183 * configure.ac: Export new conditional variable HAVE_ZLIB.
16184 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16185 on HAVE_ZLIB.
16186 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16187 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16188
6835af53
ILT
161892008-04-07 Ian Lance Taylor <iant@google.com>
16190
e24f324c
ILT
16191 * version.cc (version_string): Set to "1.5".
16192
a036edd8
ILT
16193 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16194 Add issued_non_pic_error_ field. Declare check_non_pic.
16195 (Target_x86_64::Scan::check_non_pic): New function.
16196 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16197 (Target_x86_64::Scan::global): Likewise.
16198
624f8810
ILT
16199 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16200 addend parameter. Change caller. Handle merge sections.
16201 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16202 Address to Addend. Don't add in the result of
16203 local_section_offset, pass down the addend and use the returned
16204 value.
16205 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16206 Update declarations of local_section_offset and symbol_value.
16207 * testsuite/two_file_test_1.cc (t18): New function.
16208 * testsuite/two_file_test_2.cc (f18): New function.
16209 * testsuite/two_file_test_main.cc (main): Call t18.
16210 * testsuite/two_file_test.h (t18, f18): Declare.
16211
6835af53
ILT
16212 * configure.ac: Don't test for objdump, c++filt, or readelf.
16213 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16214 conditionals.
16215 (TEST_READELF): New variable.
16216 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16217 (check_PROGRAMS): Add two_file_strip_test.
16218 (two_file_strip_test): New target.
16219 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16220 (two_file_same_shared_strip_test_SOURCES): New variable.
16221 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16222 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16223 (two_file_same_shared_strip_test_LDADD): New variable.
16224 (two_file_shared_strip.so): New target.
16225 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16226 (ver_test_5.syms, ver_test_7.syms): Likewise.
16227 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16228 (strip_test_3.stdout): Use TEST_OBJDUMP.
16229 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16230
86925eef
CC
162312008-04-04 Cary Coutant <ccoutant@google.com>
16232
16233 * symtab.h (Symbol::is_weak_undefined): New function.
16234 (Symbol::is_strong_undefined): New function.
16235 (Symbol::is_absolute): New function.
16236 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16237 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16238 absolute symbols.
16239 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16240 (weak_undef_test): New target.
16241 * testsuite/Makefile.in: Rebuild.
16242 * testsuite/weak_undef_file1.cc: New file.
16243 * testsuite/weak_undef_file2.cc: New file.
16244 * testsuite/weak_undef_test.cc: New file.
16245
126f3ece
ILT
162462008-04-03 Craig Silverstein <csilvers@google.com>
16247
16248 * compressed_output.h (class Output_compressed_section): Use
16249 unsigned buffer.
16250 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16251 add zlib header.
16252 (zlib_compressed_suffix): Removed.
16253 (Output_compressed_section::set_final_data_size): Use unsigned
16254 buffers.
16255 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16256 Fix linker invocation.
16257 (flagstest_o_specialfile_and_compress_debug_sections):
16258 Likewise.
16259 * testsuite/Makefile.in: Regenerated.
16260
deae2a14
DM
162612008-04-02 David S. Miller <davem@davemloft.net>
16262
16263 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16264 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16265
70752818
ILT
162662008-04-02 Craig Silverstein <csilvers@google.com>
16267
16268 * TODO: New file.
16269
39d0cb0e
ILT
162702008-04-02 Ian Lance Taylor <iant@google.com>
16271
16272 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16273 parameters. Update for new key type to views_. Change all
16274 callers.
16275 (File_read::read): Adjust for byteshift in returned view.
16276 (File_read::add_view): New function, broken out of
16277 find_and_make_view.
16278 (File_read::make_view): New function, broken out of
16279 find_and_make_view.
16280 (File_read::find_or_make_view): Add offset and aligned
16281 parameters. Rewrite accordingly. Change all callers.
16282 (File_read::get_view): Add offset and aligned parameters. Adjust
16283 for byteshift in return value.
16284 (File_read::get_lasting_view): Likewise.
16285 * fileread.h (class File_read): Update declarations.
16286 (class File_read::View): Add byteshift_ field. Add byteshift to
16287 constructor. Add byteshift method.
16288 * archive.h (Archive::clear_uncached_views): New function.
16289 (Archive::get_view): Add aligned parameter. Change all callers.
16290 * object.h (Object::get_view): Add aligned parameter. Change all
16291 callers.
16292 (Object::get_lasting_view): Likewise.
16293
16294 * fileread.cc (File_read::release): Don't call clear_views if
16295 there are multiple objects.
16296 * fileread.h (File_read::clear_uncached_views): New function.
16297 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16298 on the archive.
16299
a1207466
CC
163002008-03-31 Cary Coutant <ccoutant@google.com>
16301
16302 Add thin archive support.
16303 * archive.cc (Archive::armagt): New const.
16304 (Archive::setup): Remove task parameter and calls to unlock.
16305 (Archive::unlock_nested_archives): New function.
16306 (Archive::read_header): Add nested_off parameter. Change
16307 all callers.
16308 (Archive::interpret_header): Likewise.
16309 (Archive::include_all_members): Change to handle thin
16310 archives.
16311 (Archive::include_member): Likewise.
16312 * archive.h (Archive::Archive): Add new parameters and
16313 initializers.
16314 (Archive::armagt): New const.
16315 (Archive::setup): Remove task parameter.
16316 (Archive::unlock_nested_archives): New function.
16317 (Archive::read_header): Add nested_off parameter.
16318 (Archive::interpret_header): Likewise.
16319 (Archive::Nested_archive_table): New typedef.
16320 (Archive::is_thin_archive_): New field.
16321 (Archive::nested_archives_): New field.
16322 (Archive::options_): New field.
16323 (Archive::dirpath_): New field.
16324 (Archive::task_): New field.
16325 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16326 for thin archives. Pass additional parameters to
16327 Archive::Archive. Unlock the archive file after calling
16328 Archive::setup.
cd536b21 16329
479f6503
ILT
163302008-03-29 Ian Lance Taylor <iant@google.com>
16331
686c8caf
ILT
16332 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16333 version symbol to be local.
16334 * testsuite/ver_test_4.sh: New file.
16335 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16336 (check_DATA): Add ver_test_4.syms.
16337 (ver_test_4.syms): New target.
16338 * testsuite/Makefile.in: Rebuild.
16339
ab794b6b
ILT
16340 * output.cc
16341 (Output_section::Input_section_sort_entry::has_priority): New
16342 function.
16343 (Output_section::Input_section_sort_entry::match_file_name): New
16344 function.
16345 (Output_section::Input_section_sort_entry::match_section_name):
16346 Remove.
16347 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16348 Remove.
16349 (Output_section::Input_section_sort_entry::match_section_file):
16350 Remove.
16351 (Output_section::Input_section_sort_compare::operator()): Rewrite
16352 using new Input_section_sort_entry functions. Sort crtbegin and
16353 crtend first. Sort sections with no priority before sections with
16354 a priority.
16355 * testsuite/initpri1.c (d3): Check j != 4.
16356 (cd5): New constructor/destructor function.
16357 (main): Check j != 2.
16358
479f6503
ILT
16359 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16360 new symbol when resolving, don't call set_is_default.
16361 * testsuite/ver_test_7.cc: New file.
16362 * testsuite/ver_test_7.sh: New file.
16363 * testsuite/Makefile.am (ver_test_7.so): New target.
16364 (ver_test_7.o): New target.
16365 (check_SCRIPTS): Add ver_test_7.sh.
16366 (check_DATA): Add ver_test_7.syms.
16367 (ver_test_7.syms): New target.
16368
2fd32231
ILT
163692008-03-28 Ian Lance Taylor <iant@google.com>
16370
16371 * layout.cc (Layout::layout): If we see an input section with a
16372 name that needs sorting, set the must_sort flag for the output
16373 section.
16374 (Layout::make_output_section): If the name of the output section
16375 indicates that it might require sorting, set the may_sort flag.
16376 * output.h (Output_section::may_sort_attached_input_sections): New
16377 function.
16378 (Output_section::set_may_sort_attached_input_sections): New
16379 function.
16380 (Output_section::must_sort_attached_input_sections): New
16381 function.
16382 (Output_section::set_must_sort_attached_input_sections): New
16383 function.
16384 (class Output_section): Declare Input_section_sort_entry. Define
16385 Input_section_sort_compare. Declare
16386 sort_attached_input_sections. Add new fields:
16387 may_sort_attached_input_sections_,
16388 must_sort_attached_input_sections_,
16389 attached_input_sections_are_sorted_.
16390 * output.cc (Output_section::Output_section): Initialize new
16391 fields.
16392 (Output_section::add_input_section): Add an entry to
16393 input_sections_ if may_sort or must_sort are true.
16394 (Output_section::set_final_data_size): Call
16395 sort_attached_input_sections if necessary.
16396 (Output_section::Input_section_sort_entry): Define new class.
16397 (Output_section::Input_section_sort_compare::operator()): New
16398 function.
16399 (Output_section::sort_attached_input_sections): New function.
16400 * configure.ac: Check whether the compiler supports constructor
16401 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16402 * testsuite/initpri1.c: New file.
16403 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16404 CONSTRUCTOR_PRIORITY.
16405 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16406 (initpri1_LDFLAGS): New variable.
16407 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16408
18e6b24e
ILT
164092008-03-27 Ian Lance Taylor <iant@google.com>
16410
49bdd526
ILT
16411 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16412 * testsuite/common_test_1.c: New file.
16413 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16414 (common_test_1_SOURCES): New variable.
16415 (common_test_1_DEPENDENCIES): New variable.
16416 (common_test_1_LDFLAGS): New variable.
16417
18e6b24e
ILT
16418 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16419 and commons_ correctly when NAME/VERSION does not override
16420 NAME/NULL.
16421 * testsuite/ver_test_6.c: New file.
16422 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16423 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16424 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16425
04bf7072
ILT
164262008-03-26 Ian Lance Taylor <iant@google.com>
16427
5871526f
ILT
16428 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16429 of an undefined symbol from a version script.
16430 * testsuite/Makefile.am (ver_test_5.so): New target.
16431 (ver_test_5.o): New target.
16432 (check_SCRIPTS): Add ver_test_5.sh.
16433 (check_DATA): Add ver_test_5.syms.
16434 (ver_test_5.syms): New target.
16435 * testsuite/ver_test_5.cc: New file.
16436 * testsuite/ver_test_5.script: New file.
16437 * testsuite/ver_test_5.sh: New file.
16438 * Makefile.in, testsuite/Makefile.in: Rebuild.
16439
04bf7072
ILT
16440 PR gold/5986
16441 Fix problems building gold with gcc 4.3.0.
16442 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16443 (gold_error_at_location, gold_warning_at_location): Use it.
16444 * configure.ac: Check whether we can compile and use a template
16445 function with a printf attribute.
16446 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16447 when jumping over bytes.
16448 * object.cc: Instantiate Object::read_section_data.
16449 * debug.h: Include <cstring>
16450 * dwarf_reader.cc: Include <algorithm>
16451 * main.cc: Include <cstring>.
16452 * options.cc: Include <cstring>.
16453 * output.cc: Include <cstring>.
16454 * script.cc: Include <cstring>.
16455 * script.h: Include <string>.
16456 * symtab.cc: Include <cstring> and <algorithm>.
16457 * target-select.cc: Include <cstring>.
16458 * version.cc: Include <string>.
16459 * testsuite/testmain.cc: Include <cstdlib>.
16460 * configure, config.in: Rebuild.
16461
874c5b28
ILT
164622008-03-25 Ian Lance Taylor <iant@google.com>
16463
819d6c3a
ILT
16464 * options.cc: Include "../bfd/bfdver.h".
16465 (options::help): Print bug reporting address.
16466
f4b2c6f5
ILT
16467 * version.cc (print_version): Adjust output for current value of
16468 BFD_VERSION_STRING.
16469
16470 * NEWS: New file.
16471
e96caa79
ILT
16472 * options.cc (options::help): Print list of supported targets.
16473 * target-select.h: Include <vector>.
16474 (class Target_selector): Make machine_, size_, and is_big_endian_
16475 fields const. Add bfd_name_ and instantiated_target_ fields.
16476 (Target_selector::Target_selector): Add bfd_name parameter.
16477 (Target_selector::recognize): Make non-virtual, call
16478 do_recognize.
16479 (Target_selector::recognize_by_name): Make non-virtual, call
16480 do_recognize_by_name.
16481 (Target_selector::supported_names): New function.
16482 (Target_selector::bfd_name): New function.
16483 (Target_selector::do_instantiate_target): New pure virtual
16484 function.
16485 (Target_selector::do_recognize): New virtual function.
16486 (Target_selector::do_recognize_by_name): New virtual function.
16487 (Target_selector::instantiate_target): New private function.
16488 (supported_target_names): Declare.
16489 * target-select.cc (Target_selector::Target_selector): Update for
16490 new parameter and fields.
16491 (select_target_by_name): Check that the name matches before
16492 calling recognize_by_name.
16493 (supported_target_names): New function.
16494 * i386.cc (class Target_selector_i386): Update Target_selector
16495 constructor call. Remove recognize and recognize_by_name. Add
16496 do_instantiate_target.
16497 * x86_64.cc (class Target_selector_x86_64): Likewise.
16498 * testsuite/testfile.cc (class Target_selector_test): Update for
16499 changes to Target_selector.
16500
874c5b28
ILT
16501 * README: Rewrite, with some notes on unsupported features.
16502
0a65a3a7
CC
165032008-03-24 Cary Coutant <ccoutant@google.com>
16504
16505 * i386.cc (Target_i386::Got_type): New enum declaration.
16506 (Target_i386::Scan::local): Updated callers of Output_data_got
16507 member functions.
16508 (Target_i386::Scan::global): Likewise.
16509 (Target_i386::Relocate::relocate): Likewise.
16510 (Target_i386::Relocate::relocate_tls): Likewise.
16511 * object.h (Got_offset_list): New class.
16512 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16513 (Sized_relobj::local_got_offset): Likewise.
16514 (Sized_relobj::set_local_got_offset): Likewise.
16515 (Sized_relobj::local_has_tls_got_offset): Removed.
16516 (Sized_relobj::local_tls_got_offset): Removed.
16517 (Sized_relobj::set_local_tls_got_offset): Removed.
16518 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16519 * output.cc (Output_data_got::add_global): Added got_type parameter.
16520 (Output_data_got::add_global_with_rel): Likewise.
16521 (Output_data_got::add_global_with_rela): Likewise.
16522 (Output_data_got::add_global_pair_with_rel): New function.
16523 (Output_data_got::add_global_pair_with_rela): New function.
16524 (Output_data_got::add_local): Added got_type parameter.
16525 (Output_data_got::add_local_with_rel): Likewise.
16526 (Output_data_got::add_local_with_rela): Likewise.
16527 (Output_data_got::add_local_pair_with_rel): New function.
16528 (Output_data_got::add_local_pair_with_rela): New function.
16529 (Output_data_got::add_global_tls): Removed.
16530 (Output_data_got::add_global_tls_with_rel): Removed.
16531 (Output_data_got::add_global_tls_with_rela): Removed.
16532 (Output_data_got::add_local_tls): Removed.
16533 (Output_data_got::add_local_tls_with_rel): Removed.
16534 (Output_data_got::add_local_tls_with_rela): Removed.
16535 * output.h (Output_data_got::add_global): Added got_type parameter.
16536 (Output_data_got::add_global_with_rel): Likewise.
16537 (Output_data_got::add_global_with_rela): Likewise.
16538 (Output_data_got::add_global_pair_with_rel): New function.
16539 (Output_data_got::add_global_pair_with_rela): New function.
16540 (Output_data_got::add_local): Added got_type parameter.
16541 (Output_data_got::add_local_with_rel): Likewise.
16542 (Output_data_got::add_local_with_rela): Likewise.
16543 (Output_data_got::add_local_pair_with_rel): New function.
16544 (Output_data_got::add_local_pair_with_rela): New function.
16545 (Output_data_got::add_global_tls): Removed.
16546 (Output_data_got::add_global_tls_with_rel): Removed.
16547 (Output_data_got::add_global_tls_with_rela): Removed.
16548 (Output_data_got::add_local_tls): Removed.
16549 (Output_data_got::add_local_tls_with_rel): Removed.
16550 (Output_data_got::add_local_tls_with_rela): Removed.
16551 * resolve.cc (Symbol::override_base_with_special): Removed
16552 reference to has_got_offset_ field.
16553 * symtab.cc (Symbol::init_fields): Replaced initialization
16554 of got_offset_ with got_offsets_. Removed initialization
16555 of has_got_offset_
53fcba31 16556 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16557 (Symbol::got_offset): Likewise.
16558 (Symbol::set_got_offset): Likewise.
16559 (Symbol::has_tls_got_offset): Removed.
16560 (Symbol::tls_got_offset): Removed.
16561 (Symbol::set_tls_got_offset): Removed.
16562 (Symbol::got_offset_): Removed.
16563 (Symbol::tls_mod_got_offset_): Removed.
16564 (Symbol::tls_pair_got_offset_): Removed.
16565 (Symbol::got_offsets_): New field.
16566 (Symbol::has_got_offset): Removed.
16567 (Symbol::has_tls_mod_got_offset): Removed.
16568 (Symbol::has_tls_pair_got_offset): Removed.
16569 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16570 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16571 member functions.
16572 (Target_x86_64::Scan::global): Likewise.
16573 (Target_x86_64::Relocate::relocate): Likewise.
16574 (Target_x86_64::Relocate::relocate_tls): Likewise.
16575
bd52eafb
BE
165762008-03-25 Ben Elliston <bje@au.ibm.com>
16577
16578 * yyscript.y: Fix spelling error in comment.
16579
8b105e34
ILT
165802008-03-24 Ian Lance Taylor <iant@google.com>
16581
8ed814a9
ILT
16582 * options.h (class General_options): Define build_id option.
16583 * layout.h (class Layout): Declare write_build_id, create_note,
16584 create_build_id. Add build_id_note_ member.
16585 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16586 "libiberty.h", "md5.h", "sha1.h".
16587 (Layout::Layout): Initialize eh_frame_data_,
16588 eh_frame_hdr_section_, and build_id_note_.
16589 (Layout::finalize): Call create_build_id.
16590 (Layout::create_note): New function, broken out of
16591 Layout::create_gold_note.
16592 (Layout::create_gold_note): Call create_note.
16593 (Layout::create_build_id): New function.
16594 (Layout::write_build_id): New function.
16595 (Close_task_runner::run): Call write_build_id.
16596
8b105e34
ILT
16597 * x86_64.cc: Correct license to GPLv3.
16598
086a1841
ILT
165992008-03-23 Ian Lance Taylor <iant@google.com>
16600
16601 * options.cc: Include "demangle.h".
16602 (parse_optional_string): New function.
16603 (parse_long_option): Handle takes_optional_argument.
16604 (parse_short_option): Update dash_z initializer. Handle
16605 takes_optional_argument.
16606 (General_options::General_options): Initialize do_demangle_.
16607 (General_options::finalize): Set do_demangle_. Handle demangling
16608 style.
16609 * options.h (parse_optional_string): Declare.
16610 (struct One_option): Add optional_arg field. Update constructor.
16611 Update call constructor calls. Add takes_optional_argument
16612 function.
16613 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16614 (DEFINE_optional_string): Define.
16615 (General_options::demangle): Change from DEFINE_bool to
16616 DEFINE_optional_string.
16617 (General_options::no_demangle): New function.
16618 (General_options::do_demangle): New function.
16619 (General_options::set_do_demangle): New function.
16620 (General_options::execstack_status_): Move definition to end of
16621 class definition.
16622 (General_options::static_): Likewise.
16623 (General_options::do_demangle_): New field.
16624 * object.cc (big_endian>::get_symbol_location_info): Call
16625 Options::do_demangle, not Options::demangle.
16626 * symtab.cc (demangle): Likewise.
16627
cbb93e63
ILT
166282008-03-22 Ian Lance Taylor <iant@google.com>
16629
16630 * gold.h: Include <cstddef> and <sys/types.h>
16631 * options.h: Include <cstring>.
16632
ec531623
ILT
166332008-03-21 Ian Lance Taylor <iant@google.com>
16634
16635 * Added source code to GNU binutils.
752937aa 16636\f
b90efa5b 16637Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
16638
16639Copying and distribution of this file, with or without modification,
16640are permitted in any medium without royalty provided the copyright
16641notice and this notice are preserved.
16642
16643Local Variables:
16644mode: change-log
16645left-margin: 8
16646fill-column: 74
16647version-control: never
16648End:
This page took 1.137312 seconds and 4 git commands to generate.