Automatic date update in version.in
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
b39b8b9d
RÁE
12015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
2
3 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
4 body.
5
b66d1c52
CC
62015-02-04 Peter Collingbourne <pcc@google.com>
7
8 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
9 forwarding symbols when computing symbol resolution info for plugins.
10 * plugin.h (Plugin_manager::symtab): New method.
11 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
12
23081de0
CC
132015-02-03 Cary Coutant <ccoutant@google.com>
14 Peter Collingbourne <pcc@google.com>
15
16 PR gold/15660
17 * archive.cc (Thin_archive_object_unlocker): New class.
18 (Archive::include_member): Unlock external members of thin archives.
19 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
20 (plugin_test_2): Likewise.
21 (plugin_test_3): Likewise.
22 (plugin_test_4): Likewise.
23 (plugin_test_5): Likewise.
24 (plugin_test_6): Likewise.
25 (plugin_test_7): Likewise.
26 (plugin_test_8): Likewise.
27 (plugin_test_9): Likewise.
28 (plugin_test_10): Likewise.
29 (plugin_test_11): New test case.
30 * testsuite/Makefile.in: Regenerate.
31 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
32 file to decide whether to claim file.
33 (all_symbols_read_hook): Likewise.
34 * testsuite/plugin_test_1.sh: Adjust expected output.
35 * testsuite/plugin_test_2.sh: Likewise.
36 * testsuite/plugin_test_3.sh: Likewise.
37 * testsuite/plugin_test_6.sh: Likewise.
38 * testsuite/plugin_test_tls.sh: Likewise.
39 * testsuite/plugin_test_11.sh: New testcase.
40
412015-02-03 Cary Coutant <ccoutant@google.com>
42
43 * descriptors.cc (Descriptors::open): Set artificially-low limit for
44 file descriptors when debugging enabled. Add debug output.
45 (Descriptors::release): Add debug output.
46 (Descriptors::close_some_descriptor): Likewise.
47 (Descriptors::close_all): Likewise.
48 * fileread.cc (File_read::lock): Likewise.
49 (File_read::unlock): Likewise.
50
24dd5808
CC
512015-02-02 Cary Coutant <ccoutant@google.com>
52
53 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
54 executable output file.
55
fa89cc82
HS
562015-01-22 Han Shen <shenhan@google.com>
57
58 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
59 (Target_arm::do_plt_address_for_global): New method.
60 (Target_arm::do_plt_address_for_local): New method.
61 (Target_arm::rel_irelative_section): New method.
62 (Target_arm::make_data_plt): Add more parameters for plt ctor.
63 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
64 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
65 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
66 (Target_arm::Scan::check_non_pic): Add ifunc support.
67 (Target_arm::Scan::local): Add ifunc support.
68 (Target_arm::Scan::global): Add ifunc support.
69 (Target_arm::make_plt_section): New method.
70 (Target_arm::make_plt_entry): Change to call to make_plt_section.
71 (Target_arm::make_local_ifunc_plt_entry): New method.
72 (Target_arm::got_irelative_): New member.
73 (Target_arm::rel_irelative_): New member.
74 (Target_arm::got_section): Add creation for got_irelative_.
75 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
76 (Target_arm::Relocate::relocate): Properly set local ifunc address.
77 (Target_arm::do_dynsym_value): Properly set global ifunc address.
78 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
79 (Output_data_plt_arm::IRelative_data): New type.
80 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
81 (Output_data_plt_arm::add_entry): Add more parameters.
82 (Output_data_plt_arm::add_relocation): New method.
83 (Output_data_plt_arm::add_local_ifunc_entry): New method.
84 (Output_data_plt_arm::rel_irelative): New method.
85 (Output_data_plt_arm::entry_count): Modified.
86 (Output_data_plt_arm::address_for_global): New method.
87 (Output_data_plt_arm::address_for_local): New method.
23081de0 88gold/
fa89cc82
HS
89 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
90 (Output_data_plt_arm::insert_irelative_data): New method.
91 (Output_data_plt_arm::irelative_rel_): New member.
92 (Output_data_plt_arm::got_): New member.
93 (Output_data_plt_arm::got_irelative_): New member.
94 (Output_data_plt_arm::irelative_count_): New member.
95 (Output_data_plt_arm::IRelative_data_vec): New typedef.
96 (Output_data_plt_arm::irelative_data_vec_): New member.
97 (Output_data_plt_arm::do_write): Write out irelative entries.
98 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
99 more parameters to ctor.
100 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
101 more parameters to ctor.
102 * output.h (Output_data_reloc::add_local_relative): New method.
103 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
104
0f81d3f0
AM
1052015-01-29 Alan Modra <amodra@gmail.com>
106
107 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
108 and GOT_TLSGD to LE optimization.
109
65d92137
CC
1102015-01-28 Cary Coutant <ccoutant@google.com>
111
112 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
113 for undef TLS symbols.
114 (Target_x86_64::Relocate::relocate_tls): Likewise.
115 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
116
5485698a
CC
1172015-01-25 Cary Coutant <ccoutant@google.com>
118
119 * output.cc (Output_segment::set_section_addresses): Fix calculation
120 of size of relro segment.
121
b01a4b04
AM
1222015-01-22 Alan Modra <amodra@gmail.com>
123
124 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
125 condition for need of ifunc plt entry.
126 (Target_powerpc::Scan::global <got relocs>): Likewise.
127
3d0064a9
CC
1282015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
129
130 * mips.cc (reloc_high): Add r_sym.
131 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
132 reloc_high constructor.
133 (Mips_relocate_functions::relgot16_local): Likewise.
134 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
135 r_type to decide whether LO16 matches HI16.
136 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
137 rello16 and relgot16_local.
138
a5cd8f05
CC
1392015-01-09 Cary Coutant <ccoutant@google.com>
140
141 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
142 unless alignment is larger than page size.
143
4fc1b9d4
L
1442015-01-06 H.J. Lu <hongjiu.lu@intel.com>
145 Cary Coutant <ccoutant@google.com>
146
147 PR gold/17729
148 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
149 (DEFAULT_TARGET_X32): Set for x32.
150 * x86_64.cc (cmp_insn_32): New.
151 (lea_r10_insn_32): Likewise.
152 (lea_r11_insn_32): Likewise.
153 (cmp_insn_64): Likewise.
154 (lea_r10_insn_64): Likewise.
155 (lea_r11_insn_64): Likewise.
156 (Target_x86_64<size>::do_calls_non_split): Handle x32.
157 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
158 (check_DATA): Add split_x32 files.
159 (split_x32_[1234n].o): New targets.
160 (split_x32_[124]): New targets.
161 (split_x32_[1234r].stdout): New targets.
162 * testsuite/split_x32.sh: New file.
163 * testsuite/split_x32_1.s: Likewise.
164 * testsuite/split_x32_2.s: Likewise.
165 * testsuite/split_x32_3.s: Likewise.
166 * testsuite/split_x32_4.s: Likewise.
167 * testsuite/split_x32_n.s: Likewise.
168 * configure: Regenerated.
169 * testsuite/Makefile.in: Likewise.
170
e749cab8
L
1712015-01-06 H.J. Lu <hongjiu.lu@intel.com>
172
173 PR gold/17809
174 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
175 x32.
176
af759df0
AM
1772015-01-02 Alan Modra <amodra@gmail.com>
178
179 * version.cc (print_version): Just print current year.
180 * dwp.cc (print_version): Likewise.
181
b90efa5b
AM
1822015-01-01 Alan Modra <amodra@gmail.com>
183
184 Update year range in copyright notice of all files.
185
f12d1e8a
AM
1862014-12-25 Alan Modra <amodra@gmail.com>
187
188 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
189 new enums.
190 (Target_arm::merge_object_attributes, ): Likewise.
191
5c294fee
TG
1922014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
193
194 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
195 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
196 AEABI_VFP_args_vfp to check that.
197 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
198 value and replace hardcoded values by enum values.
199
e30880c2
CC
2002014-12-22 Cary Coutant <ccoutant@google.com>
201
202 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
203
bd040da1
L
2042014-12-20 H.J. Lu <hongjiu.lu@intel.com>
205
206 PR gold/14608
207 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
208 to "return i * i * 3;".
209
e02a4046
CC
2102014-12-16 Cary Coutant <ccoutant@google.com>
211
212 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
213 (Mapfile::print_output_data): Use current_data_size() to avoid
214 assert for sections requiring postprocessing; if address is not valid,
215 print 0.
216 (Mapfile::print_output_section): Use current_data_size(); print note
217 that addresses and sizes are before compression.
218
add6016b
L
2192014-12-14 H.J. Lu <hongjiu.lu@intel.com>
220
221 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
222 Cast current_group_size to unsigned long when reporting error.
223
0bf32ea9
JY
2242014-12-10 Jing Yu <jingyu@google.com>
225
226 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
227 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
228 Update error message.
229 (Target_aarch64::do_relax): Use absolute value of option
230 stub_group_size. Replace local variable with class member
231 stub_group_size_.
232
cbcb23fa
AM
2332014-12-04 Alan Modra <amodra@gmail.com>
234
235 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
236 addend of PLTREL24 reloc when not generating a plt stub. Make
237 max_branch_offset an "Address".
fbad6518 238 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
239 (Target_powerpc::Relocate::relocate): Likewise.
240
1611bc4a
AM
2412014-12-04 Alan Modra <amodra@gmail.com>
242
243 PR 17670
244 * symtab.cc (Symbol::set_undefined): Remove assertion.
245 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
246 on symbols defined in discarded sections, instead return false.
247 Rearrange params, update all callers.
248 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
249 branches to syms in discarded sections.
250 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
251 undefined and flag as discarded.
252 (Target_powerpc::Relocate::relocate): Localize variable.
253
4759c34e
L
2542014-12-03 H.J. Lu <hongjiu.lu@intel.com>
255
256 PR gold/17675
257 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
258 * testsuite/Makefile.in: Regenerated.
259
1f98a074
AM
2602014-12-03 Alan Modra <amodra@gmail.com>
261
262 PR 17566
263 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
264 when adding dynamic relocations against section symbols.
265
fb257835
DI
2662014-12-01 Dimitry Ivanov <dimitry@google.com>
267
268 * layout.cc (Layout::finish_dynamic_section): When '-z global'
269 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
270 * options.h (General_options): New -z option (global).
271
d8e60314
CC
2722014-12-01 Cary Coutant <ccoutant@google.com>
273
274 PR gold/17578
275 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
276 is given.
277 (Layout::create_executable_stack_info): Warn when -z noexecstack is
278 given but some inputs require executable stack.
279
982bbd97
CC
2802014-11-26 Cary Coutant <ccoutant@google.com>
281
282 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
283 .debug_str_offsets; strip .debug_gnu_pubnames and
284 .debug_gnu_pubtypes.
285 (lines_only_debug_sections): Strip all four new sections.
286
bb779192
HS
2872014-11-26 Jing Yu <jingyu@google.com>
288
289 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
290 register to be x0 when to relax TLSDESC_LD64_LO12.
291
a3e60ddb
AM
2922014-11-26 Alan Modra <amodra@gmail.com>
293
294 * powerpc.cc (struct Stub_table_owner): New.
295 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
296 unsigned int vector. Update all references.
297 (powerpc_relobj::set_stub_table): Take an unsigned int param
298 rather than a Stub_table. Update callers.
299 (Powerpc_relobj::clear_stub_table): New function.
300 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
301 stub_group_size_ vars.
302 (Target_powerpc::new_stub_table): Delete.
303 (max_branch_delta): New function, extracted from..
304 (Target_powerpc::Relocate::relocate): ..here..
305 (Target_powerpc::Branch_info::make_stub): ..and here. Return
306 status on whether stub created successfully.
307 (Stub_control::Stub_control): Add "no_size_errors" param. Move
308 default sizing to..
309 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
310 reduce on relax failure.
311 (Target_powerpc::group_sections): Add "no_size_errors" param.
312 Use stub_group_size_. Set up group info in a temp vector,
313 before building Stub_table vector. Account for input sections
314 possibly already converted to relaxed sections.
315 (Stub_table::init): Delete. Merge into..
316 (Stub_table::Stub_table): ..here.
317 (Stub_table::can_reach_stub): New function.
318 (Stub_table::add_plt_call_entry): Add "from" parameter and
319 return true iff stub could be reached.
320 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
321 param too.
322 (Stub_table::clear_stubs): Add "all" param.
323
a20605cf
AM
3242014-11-26 Alan Modra <amodra@gmail.com>
325
326 * powerpc.cc (Stub_control::set_output_and_owner): New function.
327 (Target_powerpc::group_sections): Use it.
328
43b64deb
CC
3292014-11-25 Cary Coutant <ccoutant@google.com>
330
331 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
332 (Binary_to_elf::write_symbol): Add st_size parameter.
333 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
334
c924eb67
CC
3352014-11-25 Cary Coutant <ccoutant@google.com>
336
337 PR gold/17639
338 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
339 (Sized_relobj_file::do_layout): Handle deferred sections properly
340 during GC pass 1. Don't add reloc sections to deferred list twice.
341 * object.h (Sized_relobj_file::is_deferred_layout): New function.
342 (Sized_relobj_file::is_deferred_layout_): New data member.
343
9d585188
L
3442014-11-21 H.J. Lu <hongjiu.lu@intel.com>
345
346 PR gold/17619
347 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
348 Check PC-relative offset overflow in PLT entry.
349
3ffaac20
AM
3502014-11-21 Alan Modra <amodra@gmail.com>
351
352 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
353 for undefined weaks.
354
0cfb0717
AM
3552014-11-20 Alan Modra <amodra@gmail.com>
356
357 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
358 from --stub-group-size parameter divided by 1024.
359 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
360 template parameter. Update all uses.
361 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
362 has_stub_value. Set for long branches. Don't report overflow for
363 branch to undefined weak symbols. Print info message on
364 overflowing branch to stub.
365
f9dffbf0
AM
3662014-11-20 Alan Modra <amodra@gmail.com>
367
368 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
369
e88ba8d5
L
3702014-11-13 H.J. Lu <hongjiu.lu@intel.com>
371
372 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
373 entry for R_X86_64_GOTPLT64.
374 (Target_x86_64<size>::Relocate::relocate): Update comments for
375 R_X86_64_GOTPLT64.
376
d37ffe25
ED
3772014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
378
379 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
380 * plugin.h: add lock definition
381
9726c3c1
HS
3822014-10-29 Han Shen <shenhan@google.com>
383 Jing Yu <jingyu@google.com>
384
385 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
386 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
387 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
388 Symbol::TLS_REF.
389 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
390 method.
391 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
392 (Target_aarch64::tls_ld_to_le): New method.
393 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
394 for 64bit targets.
395 (Output_data_plt_aarch64::irelative_rel_): New data member.
396 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
397 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
398 (Output_data_plt_aarch64::add_relocation): New method.
399 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
400 offset. Add got_irelative size to got size.
401 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
402 type string with the new typename.
403 (AArch64_relocate_functions::update_adr): Replace parameter x with
404 immed.
405 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
406 (AArch64_relocate_functions::reloc_common): New method.
407 (AArch64_relocate_funcsions::rela_general): Extract common part out
408 into reloc_common method.
409 (AArch64_relocate_functions::rela_general): Likewise.
410 (AArch64_relocate_functions::pcrela_general): Likewise.
411 (AArch64_relocate_functions::adr): New method.
412 (AArch64_relocate_functions::adrp): Calculate immed before calling
413 update_adr.
414 (AArch64_relocate_functions::adrp): Likewise.
415 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
416 comparing x to 0. Calculate immed from ~x when x < 0.
417 (Target_aarch64::optimize_tls_reloc): Add new cases for
418 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
419 TLSLD_MOVW_DTPREL_G0_NC.
420 (Target_aarch64::possible_function_pointer_reloc): Implement this
421 method.
422 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
423 comment.
424 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
425 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
426 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
427 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
428 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
429 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
430 (Target_aarch64::make_plt_entry): Call add_entry with two more
431 parameters.
432 (Target_aarch64::make_local_ifunc_plt_entry): New method.
433 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
434 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
435 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
436 (Target_aarch64::Relocate::relocate_tls): Add cases for
437 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
438 TLSLD_MOVW_DTPREL_G0_NC.
439 * testsuite/icf_safe_so_test.cc: Correct test comment.
440 * testsuite/icf_safe_test.sh: Add AArch64 arch.
441
80272b8c
AM
4422014-10-22 Alan Modra <amodra@gmail.com>
443
444 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
445 thread_starter.
446
998a69f4
AS
4472014-10-18 Andreas Schwab <schwab@linux-m68k.org>
448
449 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
450
aed56ec5
CC
4512014-10-17 Cary Coutant <ccoutant@google.com>
452
453 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
454 Add "typename" keyword.
455
bb779192 4562014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
457 Jing Yu <jingyu@google.com>
458
459 Patch for gold aarch64 backend to support relaxation.
460 * aarch64-reloc.def: Change format.
461 * aarch64.cc (class Reloc_stub): New class.
462 (class Stub_table): New class.
463 (class AArch64_relobj): New class.
464 (class AArch64_input_section): New class.
465 (class AArch64_output_section): New class.
466 (Target_aarch64::new_stub_table): New method.
467 (Target_aarch64::new_aarch64_input_section): New method.
468 (Target_aarch64::find_aarch64_input_section): New method.
469 (Target_aarch64::scan_section_for_stubs): New method.
470 (Target_aarch64::scan_reloc_section_for_stubs): New method.
471 (Target_aarch64::relocate_stub): New method.
472 (Target_aarch64::current_target): New method.
473 (Target_aarch64::do_make_elf_object): New method.
474 (Target_aarch64::do_may_relax): New method.
475 (Target_aarch64::do_relax): New method.
476 (Target_aarch64::group_sections): New method.
477 (Target_aarch64::scan_reloc_for_stub): New method.
478 (Target_aarch64::do_make_output_section): New method.
479 (Target_aarch64::stub_tables_): New data member.
480 (Target_aarch64::aarch64_input_section_map_): New data member.
481 (AArch64_relocate_functions::maybe_apply_stub): New method.
482
db4c9594
CC
4832014-09-30 Cary Coutant <ccoutant@google.com>
484
485 PR gold/17432
486 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
487
cd6da036
KC
4882014-09-30 Kito Cheng <kito@0xlab.org>
489
490 PR gold/13597
491 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
492 hash table before sysv-style hash table.
493
5f772412
ST
4942014-09-29 Sriraman Tallam <tmsriram@google.com>
495
496 * options.h (--pic-executable): Add negative to alias to -no-pie.
497
5efeedf6
CC
4982014-09-26 Cary Coutant <ccoutant@google.com>
499
500 PR gold/16773
501 * object.cc (Sized_relobj_file): Compute value of section symbols
502 for TLS sections the same as TLS symbols.
503
1707f183
CC
5042014-09-25 Cary Coutant <ccoutant@google.com>
505
506 PR gold/17432
507 * resolve.cc (Symbol_table::resolve): Override common placeholder
508 symbols, but adjust sizes.
509 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
510 symbols to common lists.
511
00cac886
AM
5122014-09-24 Alan Modra <amodra@gmail.com>
513
514 * po/POTFILES.in: Regenerate.
515
635aa30e
CC
5162014-09-23 Taiju Tsuiki <tzik@google.com>
517 Cary Coutant <ccoutant@google.com>
518
71b9b91b 519 PR gold/14860
635aa30e
CC
520 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
521 on input_sections_blocker.
522 * layout.cc (Write_sections_task::locks): Unblock
523 input_sections_blocker_.
524 * layout.h (Write_sections_task::Write_sections_task): Add
525 input_sections_blocker.
526 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
527 to DEPENDENCIES.
528 * testsuite/Makefile.in: Regenerate.
529
c0c71592
RÁE
5302014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
531
532 * testsuite/Makefile.am (plugin_test_10): New test.
533 * testsuite/Makefile.in: Regenerate
534 * testsuite/plugin_common_test_2.c (c1): Align to 8.
535 * testsuite/plugin_test_10.sh: New file.
536
6168c2a1
RÁE
5372014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
538
539 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
540 * resolve.cc (Symbol_table::resolve): Don't override common symbols
541 during the replacement phase.
542
3a531937
JY
5432014-09-17 Han Shen <shenhan@google.com>
544 Jing Yu <jingyu@google.com>
545
546 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
547 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
548 * aarch64.cc (Target_aarch64): Add data members
549 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
550 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
551 constructor.
552 (Target_aarch64::do_reloc_symbol_index): New method.
553 (Target_aarch64::do_reloc_addend): New method.
554 (Target_aarch64::add_tlsdesc_info): New method.
555 (Target_aarch64::do_dynsym_value): New method.
556 (Target_aarch64::do_make_data_plt): Add new parameters: got,
557 got_irelative. Pass them to Output_data_plt_aarch64_standard.
558 (Target_aarch64::make_data_plt): Add new parameters: got,
559 got_irelative. Pass them to do_make_data_plt.
560 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
561 (Target_aarch64::Relocate:tls_gd_to_le): New method.
562 (Target_aarch64::Relocate:tls_ie_to_le): New method.
563 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
564 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
565 (Target_aarch64::got_tlsdesc_section): New method.
566 (Target_aarch64::make_local_ifunc_plt_entry): New method.
567 (Target_aarch64::define_tls_base_symbol): New method.
568 (Target_aarch64::reserve_tlsdesc_entries): New method.
569 (Target_aarch64::got_mod_index_entry): New method.
570 (Target_aarch64::rela_tlsdesc_section): New method.
571 (Target_aarch64::rela_irelative_section): New method.
572 (Target_aarch64::Tlsdesc_info): New struct.
573 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
574 relocations and tlsdesc relocations.
575 (Target_aarch64::optimize_tls_reloc): Implement method.
576 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
577 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
578 in constructor.
579 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
580 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
581 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
582 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
583 (Output_data_plt_aarch64::rela_tlsdesc): New method.
584 (Output_data_plt_aarch64::rela_irelative): New method.
585 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
586 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
587 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
588 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
589 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
590 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
591 (Output_data_plt_aarch64_standard): New member variables:
592 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
593 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
594 New parameter: got, got_irelative.
595 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
596 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
597 (Output_data_plt_aarch64::do_write): Replace got_address with
598 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
599 (AArch64_relocate_functions::update_movnz): New method.
600 (AArch64_relocate_functions): Correct format.
601 (AArch64_relocate_functions::movnz): New method.
602 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
603 before the switch. Add new cases to switch.
00cac886 604 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
605 tlsgd tlsdesc cases.
606 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
607 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
608 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
609 Call reloc_name_in_error_message to print unsupported reloc.
610 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
611 make_data_plt.
612 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
613 relocs. Fill in some more dynamic tags.
614 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
615 Skip call tls_get_addr when tlsgd is relaxed.
616 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
617 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
618 tlsdesc->ie relaxation.
619
62661c93
SS
6202014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
621
622 * mips.cc (Target_mips_nacl): New class.
623 (Target_selector_mips_nacl): New class.
624 (target_selector_mips32): Rename from target_selector_mips32be and use
625 Target_selector_mips_nacl instead of Target_selector_mips.
626 (target_selector_mips32el): Rename from target_selector_mips32 and use
627 Target_selector_mips_nacl instead of Target_selector_mips.
628 (target_selector_mips64): Rename from target_selector_mips64be and use
629 Target_selector_mips_nacl instead of Target_selector_mips.
630 (target_selector_mips64el): Rename from target_selector_mips64 and use
631 Target_selector_mips_nacl instead of Target_selector_mips.
632 (Target_mips::mips_info): Add const attribute.
633
54674d38
CC
6342014-09-02 Cary Coutant <ccoutant@google.com>
635
636 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
637 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
638 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
639 (Sized_incr_dynobj::do_section_name): Likewise.
640 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
641 (Sized_incr_dynobj::do_section_name): Likewise.
642 * object.h (Object::section_name): Likewise.
643 (Object::do_section_name): Likewise.
644 (Sized_relobj_file::do_section_name): Likewise.
645 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
646 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
647
9860cbcf
CC
6482014-09-02 Cary Coutant <ccoutant@google.com>
649
650 PR gold/17005
651 * ehframe.cc (Fde::write): Add output_offset parameter.
652 (Cie::write): Likewise.
653 (Eh_frame::set_final_data_size): Account for offset within output
654 section.
655 (Eh_frame::do_sized_write): Likewise.
656 * ehframe.h (Fde::write): Add output_offset parameter.
657 (Cie::write): Likewise.
658 * output.cc (Output_section::Input_section_sort_entry): Remove
659 section_has_name_; add output_section_name parameter. Use
660 output section name for non-input sections.
661 (Output_section::Input_section_sort_entry::section_has_name): Remove.
662 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
663 (Output_section::Input_section_sort_compare): Remove logic for
664 sections without names.
665 (Output_section::Input_section_sort_init_fini_compare): Likewise.
666 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
667 Likewise.
668 (Output_section::Input_section_sort_section_name_compare): Likewise.
669
8e33481e
HS
6702014-08-29 Han Shen <shenhan@google.com>
671 Jing Yu <jingyu@google.com>
672
673 * aarch64-reloc-property.cc
674 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
675 reference reloc property in the table.
676 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
677 3 other entries.
678 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
679 2 new overloaded methods.
680 (Output_data_got_aarch64::do_write): Add code to write out
681 static relocs.
682 (class Output_data_got_aarch64::Static_reloc): New class to wrap
683 static relocs.
684 (Output_data_got_aarch64::static_relocs): New vector to
685 hold static relocs.
686 (Target_aarch64::TCB_SIZE): New const static memeber.
687 (Target_aarch64::tcb_size): New method.
688 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
689 (Target_aarch64::Relocate::relocate_tls): New method.
690 (Target_aarch64::Scan::local): Add code handling new reloc types.
691 (Target_aarch64::Scan::global): Add code handling new reloc types.
692
81233653
ST
6932014-08-13 Sriraman Tallam <tmsriram@google.com>
694
695 * options.h (-no-pie): Add option.
696
9363c7c3
JY
6972014-08-08 Jing Yu <jingyu@google.com>
698 Han Shen <shenhan@google.com>
699
700 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
701 (DEFFILES): add aarch64-reloc.def.
702 (TARGETSOURCES): Add aarch64-reloc-property.cc.
703 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
704 * Makefile.in: Regenerate.
705 * aarch64-reloc-property.cc: New file.
706 * aarch64-reloc-property.h: New file.
707 * aarch64-reloc.def: New file.
708 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
709 with tab to make the format consistent.
710 (Output_data_got_aarch64::symbol_table_): New method.
711 (Target_aarch64::do_plt_address_for_global): New method.
712 (Target_aarch64::do_plt_address_for_local): New method.
713 (Target_aarch64::do_select_as_default_target): New method.
714 (Target_aarch64::do_make_data_plt): New method.
715 (Target_aarch64::make_data_plt): New method.
716 (Output_data_plt_aarch64::has_irelative_section): New method.
717 (Output_data_plt_aarch64::address_for_global): New method.
718 (Output_data_plt_aarch64::address_for_local): New method.
719 (Output_data_plt_aarch64::irelative_rel_): New parameter.
720 (Output_data_plt_aarch64::add_entry): Implement contents.
721 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
722 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
723 the got_pov entry to plt0.
724 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
725 Implement contents.
726 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
727 (AArch64_howto): New struct.
728 (aarch64_howto[]): New static const array.
729 (AArch64_relocate_functions): New class.
730 (Target_aarch64::Scan::get_reference_flags): Remove method.
731 (Target_aarch64::Scan::local): Implement to support a few relocations.
732 (Target_aarch64::Scan::global): Implement to support a few relocations.
733 (Target_aarch64::make_plt_section): Implement contents.
734 (Target_aarch64::make_plt_entry): Implement contents.
735 (Target_aarch64::do_finalize_sections): Implement contents.
736 (Target_aarch64::Relocate::relocate): Implement a few relocations.
737 (Target_aarch64::relocate_section): Implement contents.
738
ad9fe6c1
AM
7392014-08-06 Alan Modra <amodra@gmail.com>
740
741 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
742
7cd4e5b7
AM
7432014-08-06 Alan Modra <amodra@gmail.com>
744
745 PR 13227
746 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
747
5ad9b0a7
ST
7482014-07-21 Sriraman Tallam <tmsriram@google.com>
749
750 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 751 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 752
e051745c
CC
7532014-07-08 Cary Coutant <ccoutant@google.com>
754
755 * expression.cc (struct Expression::Expression_eval_info): Add
756 new fields type_pointer, vis_pointer, and nonvis_pointer.
757 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
758 nonvis_pointer parameters. Adjust all calls.
759 (Symbol_expression::value): Update type, visibility, and nonvis bits
760 in caller.
761 * script.cc (Symbol_assignment::sized_finalize): Update type,
762 visibility, and remaining st_other bits for new symbol.
763 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
764 vis_pointer, and nonvis_pointer parameters.
765 * symtab.h (Symbol::set_type): New method.
766
767 * testsuite/Makefile.am (defsym_test): New test.
768 * testsuite/Makefile.in: Regenerate.
769 * testsuite/defsym_test.c: New file.
770 * testsuite/defsym_test.sh: New file.
771
f35c4853
CC
7722014-07-08 Cary Coutant <ccoutant@google.com>
773
774 PR gold/15639
775 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
776 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
777 (Sized_dynobj::base_read_symbols): ...new method.
778 * object.h (Sized_relobj_file::base_read_symbols): New method.
779 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
780 (Sized_relobj_file::base_read_symbols): ...new method.
781 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
782 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
783 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
784
2900af2d
AM
7852014-07-04 Alan Modra <amodra@gmail.com>
786
787 * po/POTFILES.in: Regenerate.
788
053a4d68
JY
7892014-07-02 Jing Yu <jingyu@google.com>
790
791 * aarch64.cc: New file
792 * Makefile.am (TARGETSOURCES): Add aarch64.cc
793 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
794 * Makefile.in: Regenerate.
795 * configure.tgt: Add entries for aarch64*.
796 * configure.ac: Likewise.
797 * configure: Likewise.
798
7b549045
AM
7992014-06-27 Alan Modra <amodra@gmail.com>
800
801 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
802
cb818dbf
CC
8032014-06-24 Cary Coutant <ccoutant@google.com>
804
805 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
806 sections.
807 (Dwo_file::sized_read_unit_index): Likewise.
808
9810d34d
SS
8092014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
810
811 * mips.cc: New file.
812 * Makefile.am (TARGETSOURCES): Add mips.cc
813 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
814 * configure.tgt: Add entries for mips*.
815 * configure.ac: Likewise.
816 * Makefile.in: Regenerate.
817 * configure: Likewise.
818
9baa787b
CC
8192014-06-09 Cary Coutant <ccoutant@google.com>
820
821 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
822 unit_length is within section bounds.
823
8f89af0a
CC
8242014-06-09 Cary Coutant <ccoutant@google.com>
825
826 PR gold/16980
827 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
828 map.
829
a47622ac
AM
8302014-06-07 Alan Modra <amodra@gmail.com>
831
832 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
833
4320c691
CC
8342014-06-06 Cary Coutant <ccoutant@google.com>
835
836 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
837 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
838 (Dwarf_pubnames_table::read_header): Likewise.
839 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
840 .debug_gnu_pubtypes.
841
270c9937
JB
8422014-06-05 Joel Brobecker <brobecker@adacore.com>
843
844 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
845 * Makefile.in, configure: Regenerate.
846
397998fc
AM
8472014-06-03 Alan Modra <amodra@gmail.com>
848
849 * powerpc.cc (addis_12_2): Define.
850 (Stub_table::do_write): Support fusion on ELFv2 stubs.
851
61f5c66f
AM
8522014-06-03 Alan Modra <amodra@gmail.com>
853
854 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
855 st_other output.
856
f6971787
AM
8572014-06-02 Alan Modra <amodra@gmail.com>
858
859 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
860 Only ignore relocs on ELFv1.
861 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
862
f6fb8322
CC
8632014-05-30 Cary Coutant <ccoutant@google.com>
864
865 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
866 * testsuite/Makefile.in: Regenerate.
867 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
868
c23dd342
L
8692014-05-27 H.J. Lu <hongjiu.lu@intel.com>
870
871 PR gold/16945
872 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
873 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
874
5fe7ffdc
AM
8752014-05-15 Alan Modra <amodra@gmail.com>
876
877 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
878 Compare FDE contents with DW_CFA_nop rather than 0.
879
a82bef93
ST
8802014-05-13 Sriraman Tallam <tmsriram@google.com>
881
882 * symtab.h (may_need_copy_reloc): Remove check for position independent
883 code.
884 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
885 position independence before pc absolute may_need_copy_reloc call.
886 Add check for executable output befor pc relative may_need_copy_reloc
887 call.
888 * i386.cc: Ditto.
889 * arm.cc: Ditto.
890 * sparc.cc: Ditto.
891 * tilegx.cc: Ditto.
892 * powerpc.cc: Add check for no position independence before
893 may_need_copy_reloc calls.
894 * testsuite/pie_copyrelocs_test.cc: New file.
895 * testsuite/pie_copyrelocs_shared_test.cc: New file.
896 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 897 * Makefile.in: Regenerate.
a82bef93 898
53c66605
ML
8992014-05-08 Martin Liška <mliska@suse.cz>
900
901 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
902
57b2284c
CC
9032014-05-06 Cary Coutant <ccoutant@google.com>
904
905 PR gold/16900
906 * i386.cc (Output_data_got_plt_i386): New class.
907 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
908 parameter. Change all callers.
909 (Output_data_plt_i386::layout_): Remove.
910 (Output_data_plt_i386::got_plt_): Change type.
911 (Target_i386::got_plt_): Change type. Change all references.
912 (Target_i386::got_section): Create instance of new class.
913 (Output_data_got_plt_i386::do_write): New function.
914 * x86_64.cc (Output_data_got_plt_x86_64): New class.
915 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
916 parameter. Change all callers.
917 (Output_data_plt_x86_64::layout_): Remove.
918 (Output_data_plt_x86_64::got_plt_): Change type.
919 (Target_x86_64::got_plt_): Change type. Change all references.
920 (Target_x86_64::got_section): Create instance of new class.
921 (Output_data_got_plt_x86_64::do_write): New function.
922 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
923 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
924 class.
925
6b97515d 9262014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 927
6b97515d
CC
928 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
929 if we have pubnames/pubtypes.
930
d1bddd3c
CC
9312014-05-02 Cary Coutant <ccoutant@google.com>
932
5fe7ffdc
AM
933 * defstd.cc (in_segment): Define __ehdr_start here...
934 * layout.cc (Layout::finalize): ...Instead of here. Set the
935 output segment when known.
936 * resolve.cc (Symbol::override_base_with_special): Remember
937 the original binding.
938 * symtab.cc (Symbol::set_output_segment): New function.
939 (Symbol::set_undefined): New function.
940 * symtab.h (Symbol::is_weak_undefined): Check original undef
941 binding.
942 (Symbol::is_strong_undefined): New function.
943 (Symbol::set_output_segment): New function.
944 (Symbol::set_undefined): New function.
945 * target-reloc.h (is_strong_undefined): Remove.
946 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
947 Check for hidden undefs.
948 (relocate_section): Call Symbol::is_strong_undefined.
949
950 * testsuite/Makefile.am (ehdr_start_test_1)
951 (ehdr_start_test_2, ehdr_start_test_3)
952 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
953 * testsuite/Makefile.in: Regenerate.
954 * testsuite/ehdr_start_def.cc: New source file.
955 * testsuite/ehdr_start_test.cc: New source file.
956 * testsuite/ehdr_start_test.t: New linker script.
957 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 958
7849f6d8
CC
9592014-04-23 Cary Coutant <ccoutant@google.com>
960
bf2cc635 961 PR gold/16870
7849f6d8
CC
962 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
963
99fd8cff
CC
9642014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
965
966 * layout.cc (Layout::include_section): Allow a target to decide
967 whether to include a section.
968 * target.h (Target::should_include_section): New function.
969 (Target::do_should_include_section): New function.
970
91f43acd
CC
9712014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
972
973 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
974 inline into ...
975 (Copy_relocs::emit): ... here.
976 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
977 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
978 (Copy_reloc_entry::entries_): Change from private to protected.
979
c4eb27e1
ST
9802014-04-02 Sriraman Tallam <tmsriram@google.com>
981
982 * icf.cc (get_section_contents): Replace copies of reloc
983 vectors with const references.
984
ae447ddd
CC
9852014-04-02 Cary Coutant <ccoutant@google.com>
986
987 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
988 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
989 * configure: Regenerate.
990 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
991 -fno-use-linker-plugin.
992 (LINK1, CXXLINK1): Add it to the link command.
993 * testsuite/Makefile.in: Regenerate.
994
fa47fa92
AM
9952014-03-12 Alan Modra <amodra@gmail.com>
996
997 * Makefile.in: Regenerate.
998
9b12c500
CC
9992014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1000
1001 * symtab.h (Symbol::set_nonvis): New function.
1002
beacaa96
CC
10032014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1004
1005 * symtab.cc (Sized_symbol<32>::init_output_data):
1006 Instantiate the template.
1007 (Sized_symbol<64>::init_output_data): Likewise.
1008
800d9823
CC
10092014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1010
1011 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1012 adjust dynamic symbol value.
1013 * target.h (Target::adjust_dyn_symbol): New function.
1014 (Target::do_adjust_dyn_symbol): New function.
1015
918fc1f8 10162014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 1017
918fc1f8
CC
1018 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1019 Get the value of DYNAMIC_CUSTOM dynamic entry.
1020 * output.h (Output_data_dynamic::add_custom): New function.
1021 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1022 dynamic entry.
1023 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1024 * target.h (Target::dynamic_tag_custom_value): New function.
1025 (Target::do_dynamic_tag_custom_value): New function.
1026
98ff9231
CC
10272014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1028
1029 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1030 dynsym indexes.
1031 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1032 (Target::do_has_custom_set_dynsym_indexes): New function.
1033 (Target::set_dynsym_indexes): New function.
1034 (Target::do_set_dynsym_indexes): New function.
1035
b80eed39
AM
10362014-03-07 Alan Modra <amodra@gmail.com>
1037
1038 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1039 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1040 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1041 (Powerpc_relocate_functions::has_overflow_bitfield,
1042 overflowed): Use the above.
1043 (Target_powerpc::Relocate::relocate): Correct overflow checking
1044 for a number of relocations. Modify overflow test for 16-bit
1045 fields in instructions to signed/unsigned according to whether
1046 the field takes a signed or unsigned value.
1047
4b95cf5c
AM
10482014-03-05 Alan Modra <amodra@gmail.com>
1049
1050 Update copyright years.
1051
45965137
AM
10522014-03-05 Alan Modra <amodra@gmail.com>
1053
1054 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1055 R_PPC64_ADDR64_LOCAL.
1056 (Target_powerpc::Relocate::relocate): Likewise.
1057
2c80b753
AM
10582014-03-03 Alan Modra <amodra@gmail.com>
1059
1060 * dwp.cc (print_version): Update copyright year to current.
1061
c1c69e83
AM
10622014-02-10 Alan Modra <amodra@gmail.com>
1063
1064 * po/gold.pot: Regenerate.
1065
dd0c4e70
CC
10662014-02-06 Cary Coutant <ccoutant@google.com>
1067
1068 Fix problem where -u is ignored when a weak undef is seen.
1069
1070 * archive.cc (Library_base::should_include_member): Reorder
1071 code to check for -u option if a weak undef has already been seen.
1072 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1073 * testsuite/Makefile.in: Regenerate.
1074 * testsuite/weak_undef_file3.cc: New file.
1075 * testsuite/weak_undef_file4.cc: New file.
1076 * testsuite/weak_undef_test_2.cc: New file.
1077
1a221d3d
CC
10782014-02-05 Cary Coutant <ccoutant@google.com>
1079
1080 Fix issues with gold undefined symbol diagnostics.
1081
1082 PR binutils/15435
1083 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1084 check to here.
1085 * target-reloc.h (is_strong_undefined): New function.
1086 (relocate_section): Move undef vtable symbol check from here.
1087 Check for is_strong_undefined.
1088
e889f0a4 10892014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1090
e889f0a4
CC
1091 Fix problems with the --dynamic-list option.
1092
1093 PR gold/13577
1094 * options.cc (General_options::parse_dynamic_list):
1095 Set have_dynamic_list_.
1096 (General_options::General_options): Initialize have_dynamic_list_.
1097 (General_options::finalize): Turn off -Bsymbolic and
1098 -Bsymbolic-functions if --dynamic-list provided.
1099 * options.h (General_options::have_dynamic_list): New function.
1100 (General_options::have_dynamic_list_): New data member.
1101 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
1102 correctly.
5fe7ffdc 1103
e889f0a4
CC
1104 PR gold/16530
1105 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
1106 in --dynamic-list, mark it.
5fe7ffdc 1107
e889f0a4
CC
1108 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
1109 (dynamic_list_2): New test case.
1110 * testsuite/Makefile.in: Regenerate.
1111 * testsuite/dynamic_list_2.cc: New file.
1112 * testsuite/dynamic_list_2.t: New file.
1113 * testsuite/dynamic_list_lib1.cc: New file.
1114 * testsuite/dynamic_list_lib2.cc: New file.
1115 * testsuite/gc_dynamic_list_test.c: New file.
1116 * testsuite/gc_dynamic_list_test.sh: New file.
1117 * testsuite/gc_dynamic_list_test.t: New file.
1118
ec673e64
CC
11192014-01-28 Cary Coutant <ccoutant@google.com>
1120
1121 Add .gdb_index version 7 support.
1122
1123 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1124 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1125 debug sections.
1126 (Dwarf_ranges_table::read_ranges_table): Likewise.
1127 (Dwarf_pubnames_table::read_section): Check for GNU-style
1128 sections, and for compressed debug sections.
1129 (Dwarf_pubnames_table::read_header): Compute end address of table.
1130 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1131 for end of list by offset, not by offset == 0.
1132 (Dwarf_info_reader::do_read_string_table): Check for compressed
1133 debug sections.
1134 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1135 Initialize new data members.
1136 (Dwarf_pubnames_table::next_name): return flag_byte.
1137 (Dwarf_pubnames_table::end_of_table_): New data member.
1138 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1139 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1140 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1141 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1142 read skeleton type unit DIEs.
1143 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1144 (Gdb_index::do_write): Write flag_byte.
1145 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1146 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1147 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1148 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1149
221fd5d5
L
11502014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1151
1152 * version.cc (print_version): Update copyright year to 2014.
1153
6c09fb0b
ILT
11542013-12-19 Dimitry Andric <dimitry@andric.com>
1155
1156 * stringpool.cc (Stringpool_template::reserve): Add
1157 HAVE_UNORDERED_MAP case.
1158 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1159
8356f2d0
CC
11602013-12-18 Cary Coutant <ccoutant@google.com>
1161
1162 * configure.ac: Check for <unordered_set> and <unordered_map>.
1163 * config.in: Regenerate.
1164 * configure: Regenerate.
1165 * system.h: Use <unordered_set> and <unordered_map> if available.
1166
f2c7d7ee
RM
11672013-12-10 Roland McGrath <mcgrathr@google.com>
1168
1169 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1170 with $(INSTALL_PROGRAM_ENV).
1171 * Makefile.in: Regenerate.
1172
6632e8cc
CC
11732013-11-22 Cary Coutant <ccoutant@google.com>
1174
1175 * configure.ac: Add check for which library is needed for
1176 dlopen.
1177 * configure: Regenerate.
1178
0c075858
CC
11792013-11-22 Cary Coutant <ccoutant@google.com>
1180
1181 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1182 assembler.
1183 * testsuite/Makefile.in: Regenerate.
1184
f49fe902
L
11852013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1186
1187 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1188 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1189 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1190 (Target_x86_64<size>::Scan::local): Likewise.
1191 (Target_x86_64<size>::Scan::global): Likewise.
1192 (Target_x86_64<size>::Relocate::relocate): Likewise.
1193 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1194 Likewise.
1195 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1196 R_X86_64_PC32_BND.
1197
1198 * testsuite/Makefile.am (check_PROGRAMS): Add
1199 exception_x86_64_bnd_test.
1200 (exception_x86_64_bnd_test_SOURCES): New macro.
1201 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1202 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1203 (exception_x86_64_bnd_test_LDADD): Likewise.
1204 (exception_x86_64_bnd_1.o): New rule.
1205 (exception_x86_64_bnd_2.o): Likewise.
1206 * testsuite/Makefile.in: Regenerated.
1207
9055360d
AM
12082013-11-15 Alan Modra <amodra@gmail.com>
1209
1210 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1211 accessor.
1212 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1213 Only call ppc64_local_entry_offset for 64-bit. Restrict
1214 symval_for_branch lookup to ELFv1.
1215 (Stub_table::add_plt_call_entry): Use unsigned int off.
1216 (Output_data_glink::Address, invalid_address): New.
1217 (Output_data_glink::add_eh_frame): Move out of line. Add
1218 support for ELFv2.
1219 (Output_data_glink::add_global_entry, find_global_entry,
1220 global_entry_address): New functions.
1221 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1222 ge_size): New variables.
1223 (Output_data_glink::set_final_data_size): Add global entry
1224 stub sizing.
1225 (Output_data_glink::do_write): Write global entry stubs.
1226 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1227 parameter. Return true for ELFv2. Adjust callers.
1228 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1229 ELFv1. Similarly for ifunc and dynamic relocation processing
1230 specific to ELFv1. Recognize that symbols are defined on
1231 their plt entries for ELFv2.
1232 (Target_powerpc::symval_for_branch): Assert if called for
1233 ELFv2 or ppc32.
1234 (Target_powerpc::Relocate::relocate): Use global entry plt
1235 stub for symbol value if such exists on ELFv2.
1236 (Target_powerpc::Relocate::relocate): Don't call
1237 symval_for_branch when ELFv2. Do adjust for local entry
1238 offset when ELFv2.
1239 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1240 plt stub for ELFv2.
1241 (Target_powerpc::do_plt_address_for_global): Similarly.
1242
cafdd569
CC
12432013-11-14 Cary Coutant <ccoutant@google.com>
1244
1245 Revert patch -- this did not fix the problem, and there is
1246 no race there.
1247
1248 2013-11-14 Cary Coutant <ccoutant@google.com>
1249
1250 PR gold/14860
1251 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1252 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1253 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1254 updating fde_offsets_.
1255 (Eh_frame_hdr::lock_): New data member.
1256
94e49e16
CC
12572013-11-14 Cary Coutant <ccoutant@google.com>
1258
1259 * dwp.cc (Dwo_file_entry): New type.
1260 (File_list): Use Dwo_file_entry.
1261 (Dwo_file::verify): New function.
1262 (Dwo_file::verify_dwo_list): New function.
1263 (Dwo_file::sized_verify_dwo_list): New function.
1264 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1265 list.
1266 (Dwp_options): New enum type.
1267 (dwp_options): Add --verify-only.
1268 (usage): Likewise.
1269 (main): Likewise.
1270 * dwp.h (gold_info): Add declaration.
1271
7cdd7d57
CC
12722013-11-14 Cary Coutant <ccoutant@google.com>
1273
1274 PR gold/14860
1275 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1276 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1277 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1278 updating fde_offsets_.
1279 (Eh_frame_hdr::lock_): New data member.
1280
1d946cb3
CC
12812013-11-06 Cary Coutant <ccoutant@google.com>
1282
1283 PR gold/15758
1284 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1285 before reloc sections.
1286
4f65b40e
AM
12872013-11-04 Alan Modra <amodra@gmail.com>
1288
1289 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1290 (Symbol::needs_dynamic_reloc): Test new flag.
1291 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1292 (Target_powerpc::Scan::get_reference_flags): Add target param.
1293 Return FUNC_DESC_ABI for 64-bit ELFv1.
1294 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1295 call.
1296 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1297 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1298
908794a9
CC
12992013-10-31 Cary Coutant <ccoutant@google.com>
1300
1301 Restore support for dwp v2 DWARF package file format.
1302
1303 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1304 tu_length parameter. Adjust all callers.
1305 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1306 * dwp.cc: Include dwarf.h.
1307 (Section_bounds): New struct type.
1308 (Unit_set): New struct type.
1309 (Dwo_file::Dwo_file): Initialize new data member.
1310 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1311 Combine and rename to...
1312 (Dwo_file::read_unit_index): ...this.
1313 (Dwo_file::sized_read_compunit_index)
1314 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1315 (Dwo_file::sized_read_unit_index): ...this.
1316 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1317 parameters; add section_id parameter.
1318 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1319 (Dwo_file::add_unit_set): ...this.
1320 (Dwo_file::shndx_map_): Remove.
1321 (Dwo_file::sect_offsets_): New data member.
1322 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1323 (Dwp_output_file::add_section): Rename to...
1324 (Dwp_output_file::add_contribution): ...this.
1325 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1326 (Dwp_output_file::add_tu_set): Likewise.
1327 (Dwp_output_file::Contribution): New type.
1328 (Dwp_output_file::Section::contributions): New data member.
1329 (Dwp_output_file::Cu_or_tu_set): Remove.
1330 (Dwp_output_file::Section::Section): New ctor.
1331 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1332 (Dwp_output_file::Dwp_index::Section_table): New type.
1333 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1334 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1335 parameter.
1336 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1337 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1338 (Dwp_output_file::Dwp_index::section_table): New member function.
1339 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1340 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1341 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1342 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1343 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1344 (Dwp_output_file::Dwp_index::section_table_): New data member.
1345 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1346 (Dwp_output_file::add_output_section): New member function.
1347 (Dwp_output_file::write_new_section): New member function.
1348 (Dwp_output_file::write_contributions): New member function.
1349 (Dwp_output_file::section_id_map_): New data member.
1350 (class Dwo_id_info_reader): Remove.
1351 (class Unit_reader): New class.
1352 (get_dwarf_section_name): New function.
1353 (Dwo_file::read_executable): Adjust initializations of class data.
1354 (Dwo_file::read): Add support for v2 package file format.
1355 (Dwo_file::read_unit_index): Likewise.
1356 (Dwo_file::sized_read_unit_index): Likewise.
1357 (Dwo_file::copy_section): Likewise.
1358 (Dwo_file::add_unit_set): Likewise.
1359 (Dwp_output_file::add_output_section): Likewise.
1360 (Dwp_output_file::add_contribution): Likewise.
1361 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1362 for empty slot.
1363 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1364 file format.
1365 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1366 slot.
1367 (Dwp_output_file::initialize): Remove unused function.
1368 (Dwp_output_file::finalize): Add support for v2 package file format.
1369 (Dwp_output_file::write_index): Likewise.
1370 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1371 function prototype.
1372
2500c017
CC
13732013-10-31 Cary Coutant <ccoutant@google.com>
1374
1375 * configure.ac: Fix check for -fmerge-constants.
1376 * configure.ac: Regenerate.
1377
dd0845d7
RM
13782013-10-30 Roland McGrath <mcgrathr@google.com>
1379
1380 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1381 Correct 9-byte nop sequence to match what the assembler generates.
1382
b4f7960d
AM
13832013-10-30 Alan Modra <amodra@gmail.com>
1384
1385 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1386 ppc64_local_entry_offset, ppc64_local_entry_offset,
1387 do_read_symbols): New functions.
1388 (Powerpc_relobj::e_flags_, st_other_): New vars.
1389 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1390 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1391 (Powerpc_relobj::e_flags_): New var.
1392 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1393 and adjust for ELFv2.
1394 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1395 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1396 (Powerpc_dynobj::do_find_special_sections): Likewise.
1397 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1398 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1399 to ELFv2 local entry.
1400 (Target_powerpc::do_relax): No thread safe barriers needed for
1401 ELFv2.
1402 (Output_data_plt_powerpc::initial_plt_entry_size_,
1403 plt_entry_size): Delete. Replace all uses with
1404 first_plt_entry_offset() and plt_entry_size().
1405 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1406 reserved_size parm. Update callers.
1407 (Output_data_plt_powerpc::entry_count): Update.
1408 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1409 and use Target_powerpc::first_plt_entry_offset().
1410 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1411 rename to plt_entry_size.
1412 (Output_data_plt_powerpc::add_ifunc_entry,
1413 add_local_ifunc_entry): Adjust reloc for ELFv2.
1414 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1415 (glink_eh_frame_fde_64v2): New.
1416 (Stub_table::plt_call_size): Support ELFv2 sizing.
1417 (Output_data_glink::add_eh_frame): Use the new FDE.
1418 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1419 (Stub_table::do_write): Write ELFv2 stubs and glink.
1420 (Target_powerpc::Relocate::relocate): Replaces nop after call
1421 with ld 2,24(1) and adjust local offset destination for ELFv2.
1422
f9c6b907
AM
14232013-10-30 Alan Modra <amodra@gmail.com>
1424
1425 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1426 (Target_powerpc::Scan::global, local): Likewise.
1427 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1428 on all ppc64 @h and @ha relocs.
1429
e84fe78f
AM
14302013-10-14 Alan Modra <amodra@gmail.com>
1431
1432 * output.h (Output_data_got::add_constant): Tidy.
1433 (Output_data_got::add_constant_pair): New function.
1434 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1435 methods used so as to first call reserve_ent().
1436
679e4abf
RM
14372013-10-11 Roland McGrath <mcgrathr@google.com>
1438
44dcb735
RM
1439 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1440 add_got_entry and add_got_entry_pair.
1441
13323c49
RM
1442 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1443 (HAVE_PUBNAMES): Likewise.
1444 * configure: Regenerate.
1445
1496b446
RM
1446 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1447 * testsuite/Makefile.in: Regenerate.
1448
cc84c10b
RM
1449 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1450 Remove const from declaration.
1451 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1452 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1453 * output.h (Output_file_header): Remove const from member target_
1454 and corresponding constructor argument.
1455 * output.cc (Output_file_header::Output_file_header): Update prototype.
1456 (Output_file_header::do_sized_write): Use this->target_ in place
1457 of parameters()->target().
1458
52f66a2c
RM
1459 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1460
2b64b551
RM
1461 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1462 * configure: Regenerate.
1463 * Makefile.in: Regenerate.
1464 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1465 * testsuite/merge_string_literals_2.c: Likewise.
1466 * testsuite/Makefile.am
1467 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1468 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1469 literal -fmerge-constants.
1470 * testsuite/Makefile.in: Regenerate.
1471
43819297
RM
1472 * i386.cc (Target_i386): Remove unused member dynbss_.
1473 * arm.cc (Target_arm): Likewise.
1474 * powerpc.cc (Target_powerpc): Likewise.
1475 * sparc.cc (Target_sparc): Likewise.
1476 * tilegx.cc (Target_tilegx): Likewise.
1477 * x86_64.cc (Target_x86_64): Likewise.
1478 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1479 type_signature_, type_offset_.
1480 * plugin.h (Plugin_hook): Remove unused member layout_.
1481 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1482 mapfile_.
1483 (Read_member): Remove unused members input_objects_, symtab_,
1484 mapfile_, layout_.
1485 (Check_library): Remove unused member symtab_.
1486 * archive.h (Lib_group): Remove unused member lib_.
1487 * archive.cc (Lib_group::Lib_group): Update initializer.
1488 * incremental.h (Incremental_binary): Remove unused member target_.
1489 (Incremental_script_entry): Removed unused member script_.
1490 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1491 * icf.h (Icf): Remove unused member num_tracked_relocs.
1492
39d9ead7
RM
1493 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1494 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1495 its only use.
1496 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1497
679e4abf
RM
1498 * archive.h: Use struct rather than class for forward declaration
1499 of Read_symbols_data.
1500
54de2ea6
CC
15012013-10-07 Cary Coutant <ccoutant@google.com>
1502
1503 PR gold/16010
1504 * testsuite/Makefile.am (icf_test): Fix dependencies.
1505 (icf_safe_test): Likewise.
1506 (icf_safe_so_test): Likewise.
1507 (large_symbol_alignment): Add empty _LDADD rule.
1508 * testsuite/Makefile.in: Regenerate.
1509
b14016f0
L
15102013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1511
1512 PR gold/15927
1513 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1514 relocation for R_X86_64_32 on x32.
1515
eb426534
RM
15162013-08-27 Roland McGrath <mcgrathr@google.com>
1517
1518 * output.cc (Output_segment::set_section_addresses): Take new
1519 Target* argument. If target->isolate_execinstr() and the segment
1520 is executable and starts at a target->abi_pagesize() boundary,
1521 pad its end out to a target->abi_pagesize() boundary with code fill.
1522 * output.h (Output_segment::set_section_addresses): Update decl.
1523 * layout.h (Layout::check_output_data_for_reset_values): Take new
1524 argument RELAX_OUTPUTS.
1525 (Layout): New member relax_output_list_.
1526 (Layout::add_relax_output): New method.
1527 * layout.cc (Layout::Layout): Update constructor.
1528 (Layout::reset_relax_output): New method.
1529 (Layout::clean_up_after_relaxation): Call it.
1530 (Layout::prepare_for_relaxation): Update caller.
1531 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1532 Call reset_relax_output before re-processing segments for
1533 isolate_execinstr case.
1534 (Layout::write_data): Handle relax_output_list_.
1535 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1536 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1537
9aff4b7a
NC
15382013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1539
1540 PR binutils/15834
1541 * object.h: Fix typos.
1542
93f8221c
RM
15432013-08-16 Roland McGrath <mcgrathr@google.com>
1544
1545 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1546 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1547
e44c3715
CC
15482013-08-07 Cary Coutant <ccoutant@google.com>
1549
1550 Revert support for v2 DWP files:
1551
1552 2013-03-01 Cary Coutant <ccoutant@google.com>
1553
1554 Add dwp support for v2 DWARF package file format.
1555 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1556 tu_length parameter. Adjust all callers.
1557 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1558 * dwp.cc: Include dwarf.h.
1559 (Section_bounds): New struct type.
1560 (Unit_set): New struct type.
1561 (Dwo_file::Dwo_file): Initialize new data member.
1562 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1563 Combine and rename to...
1564 (Dwo_file::read_unit_index): ...this.
1565 (Dwo_file::sized_read_compunit_index)
1566 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1567 (Dwo_file::sized_read_unit_index): ...this.
1568 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1569 parameters; add section_id parameter.
1570 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1571 (Dwo_file::add_unit_set): ...this.
1572 (Dwo_file::shndx_map_): Remove.
1573 (Dwo_file::sect_offsets_): New data member.
1574 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1575 (Dwp_output_file::add_section): Rename to...
1576 (Dwp_output_file::add_contribution): ...this.
1577 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1578 (Dwp_output_file::add_tu_set): Likewise.
1579 (Dwp_output_file::Contribution): New type.
1580 (Dwp_output_file::Section::contributions): New data member.
1581 (Dwp_output_file::Cu_or_tu_set): Remove.
1582 (Dwp_output_file::Section::Section): New ctor.
1583 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1584 (Dwp_output_file::Dwp_index::Section_table): New type.
1585 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1586 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1587 parameter.
1588 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1589 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1590 (Dwp_output_file::Dwp_index::section_table): New member function.
1591 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1592 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1593 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1594 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1595 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1596 (Dwp_output_file::Dwp_index::section_table_): New data member.
1597 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1598 (Dwp_output_file::add_output_section): New member function.
1599 (Dwp_output_file::write_new_section): New member function.
1600 (Dwp_output_file::write_contributions): New member function.
1601 (Dwp_output_file::section_id_map_): New data member.
1602 (class Dwo_id_info_reader): Remove.
1603 (class Unit_reader): New class.
1604 (get_dwarf_section_name): New function.
1605 (Dwo_file::read_executable): Adjust initializations of class data.
1606 (Dwo_file::read): Add support for v2 package file format.
1607 (Dwo_file::read_unit_index): Likewise.
1608 (Dwo_file::sized_read_unit_index): Likewise.
1609 (Dwo_file::copy_section): Likewise.
1610 (Dwo_file::add_unit_set): Likewise.
1611 (Dwp_output_file::add_output_section): Likewise.
1612 (Dwp_output_file::add_contribution): Likewise.
1613 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1614 for empty slot.
1615 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1616 file format.
1617 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1618 slot.
1619 (Dwp_output_file::initialize): Remove unused function.
1620 (Dwp_output_file::finalize): Add support for v2 package file format.
1621 (Dwp_output_file::write_index): Likewise.
1622 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1623 function prototype.
1624
c6905c28
CC
16252013-07-31 Cary Coutant <ccoutant@google.com>
1626
1627 * object.cc (Sized_relobj::do_output_section_address): New function.
1628 (Sized_relobj): Instantiate explicitly.
1629 * object.h (Object::output_section_address): New function.
1630 (Object::do_output_section_address): New function.
1631 (Sized_relobj::do_output_section_address): New function.
1632 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1633
16342013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 1635 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
1636
1637 * parameters.cc (Parameters::entry): Return target-specific entry
1638 symbol name.
1639 * target.h (Target::entry_symbol_name): New function.
1640 (Target_info::entry_symbol_name): New data member.
1641
1642 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1643 * i386.cc (Target_i386::i386_info): Likewise.
1644 (Target_i386_nacl::i386_nacl_info): Likewise.
1645 * sparc.cc (Target_sparc::sparc_info): Likewise.
1646 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1647 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1648 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1649 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1650
234d4ab8
SA
16512013-07-22 Sterling Augustine <saugustine@google.com>
1652
1653 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1654 Convert parameter shndx to local variable. Add parameters symtab
1655 and symtab_size. Scan over section names. Find relocation
1656 section corresponding to current section. Create and initialize
1657 reloc_mapper_ and reloc_type_.
1658 (Dwarf_pubnames_table::read_header): Add assertion. Change
1659 unit_length to off_t. Initialize member unit_length_. Fill in field
1660 cu_offset_.
1661 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1662 Initialize new fields unit_length_ and cu_offset_.
1663 (Dwarf_pubnames_table::read_section): Update prototype.
1664 (Dwarf_pubnames_table::cu_offset): New member function.
1665 (Dwarf_pubnames_table::subsection_size): Likewise.
1666 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1667 New fields.
1668 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1669 member functions public.
1670 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1671 Update comment. Rework logic. Move repeated parts to...
1672 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1673 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1674 pubtypes_table_, and stmt_list_offset.
1675 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1676 Gdb_index::find_pubtype_offset,
1677 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1678 (Gdb_index::pubnames_read): Update prototype and rework logic.
1679 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1680 Forward declare.
1681 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1682 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1683 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1684 Gdb_index::map_pubtable_to_dies):
1685 Declare functions.
1686 (Gdb_index::pubnames_read): Update declaration.
1687 (Gdb_index::Pubname_offset_map): New type.
1688 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1689 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1690 Gdb_index::stmt_list_offset): Declare.
1691 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1692 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1693 Gdb_index::pubtypes_offset_): Remove.
1694
a3ed37d8
RM
16952013-07-19 Roland McGrath <mcgrathr@google.com>
1696
1697 * options.h (General_options): Add -Trodata-segment option.
1698 * parameters.cc (Parameters::check_rodata_segment): New function.
1699 (Parameters::set_target_once): Call it.
1700 * parameters.h (Parameters): Declare it (private member function).
1701 * layout.cc (load_seg_unusable_for_headers): New function, broken
1702 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1703 then validate rodata segment rather than text segment.
1704 (relaxation_loop_body): Call that.
1705 (is_text_segment): New function. Don't admit a non-executable
1706 segment if TARGET->isolate_execinstr().
1707 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1708
eb5b4ded
CC
17092013-07-15 Shawn Landden <shawnlandden@gmail.com>
1710
1711 PR gold/15070
1712 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1713 * nacl.h (Sniff_file::View::View): Request aligned view.
1714
4d5effb9
CC
17152013-07-11 Cary Coutant <ccoutant@google.com>
1716
1717 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1718 correct BRLT entry size.
1719
ba8ca3e7
AM
17202013-07-03 Alan Modra <amodra@gmail.com>
1721
1722 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1723 comment.
1724
267257d2
CC
17252013-07-01 Cary Coutant <ccoutant@google.com>
1726
1727 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1728 reloc_type_.
1729 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1730 (Dwarf_ranges_table::lookup_reloc): New function.
1731 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1732 reloc_type_.
1733 (Dwarf_ranges_table::lookup_reloc): New function.
1734 (Dwarf_ranges_table::reloc_type_): New data member.
1735
06f30c9d
CC
17362013-06-27 Jing Yu <jingyu@google.com>
1737
1738 PR gold/15662
1739 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1740 function.
1741 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1742 (Target_powerpc::do_relax): Call the above.
1743
a2d7bf59
AM
17442013-06-27 Cary Coutant <ccoutant@google.com>
1745
1746 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1747 on garbage collected .opd section.
1748
17492013-06-27 Alan Modra <amodra@gmail.com>
1750
1751 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1752 is non-zero.
1753 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1754 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1755
32364e50
CC
17562013-06-14 Cary Coutant <ccoutant@google.com>
1757
1758 * resolve.cc (Symbol::override_base): Don't override st_type
1759 from plugin placeholder symbols.
1760 (Symbol_table::resolve): Likewise.
1761 (Symbol_table::should_override): Don't complain about TLS mismatch
1762 if the TO symbol is a plugin placeholder.
1763 * testsuite/Makefile.am (plugin_test_tls): New test.
1764 * testsuite/Makefile.in: Regenerate.
1765 * testsuite/plugin_test_tls.sh: New test script.
1766 * testsuite/two_file_test_2_tls.cc: New test source.
1767 * testsuite/two_file_test_tls.cc: New test source.
1768
7fb47cc9
CC
17692013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1770
1771 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1772 the maximum segment alignment is larger than the page size.
1773 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1774 correctly aligns the symbols with large alignemnt.
1775 * testsuite/Makefile.in: Regenerate.
1776 * testsuite/large_symbol_alignment.cc: New file.
1777
6934001a
CC
17782013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1779 Sriraman Tallam <tmsriram@google.com>
1780
1781 * options.h (sort_section): New option.
1782 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1783 Rename from Input_section_sort_section_name_special_ordering_compare.
1784 (Input_section_sort_section_name_compare): New struct.
1785 * output.cc (Output_section::Input_section_sort_section_name_compare::
1786 operator()): New function.
1787 (Output_section::sort_attached_input_sections): Use new sort function
1788 for .text if --sort-section=name is specified.
1789 * layout.cc (Layout::make_output_section):
1790 Add sorting by name when --sort-section=name is specified.
1791 * testsuite/Makefile.am (text_section_grouping): Test option
1792 --sort-section=name.
1793 * testsuite/Makefile.in: Regenerate.
1794 * testsuite/section_sorting_name.cc: New file.
1795 * testsuite/section_sorting_name.sh: New file.
1796
93acabad
CC
17972013-05-21 Cary Coutant <ccoutant@google.com>
1798
1799 * symtab.h (Symbol::is_cxx_vtable): New function.
1800 * target-reloc.h (relocate_section): Check for vtable symbol.
1801 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1802 * testsuite/Makefile.in: Regenerate.
1803 * testsuite/missing_key_func.cc: New test source.
1804 * testsuite/missing_key_func.sh: New test script.
1805
60e8b3fc
CC
18062013-05-21 Cary Coutant <ccoutant@google.com>
1807
2b64b551
RM
1808 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1809 type of enclosing symbol.
1810 (Relocate_info::location): Check symbol type when describing symbol.
1811 * object.h (Symbol_location_info): Remove unused line_number;
1812 add enclosing_symbol_type.
1813 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 1814
9df9de2c
CC
18152013-05-13 Cary Coutant <ccoutant@google.com>
1816
2b64b551
RM
1817 * configure.ac: Export DEFAULT_TARGET.
1818 * configure: Regenerate.
1819 * Makefile.in: Regenerate.
1820 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1821 * testsuite/Makefile.in: Regenerate.
1822 * testsuite/debug_msg.sh: Delete duplicate tests.
1823 Don't check undef_int error message match for powerpc where the
1824 source file and line number aren't available.
9df9de2c 1825
bbc5ae17
RM
18262013-05-10 Roland McGrath <mcgrathr@google.com>
1827
1828 * options.h (General_options): Add --rosegment-gap option.
1829 * options.cc (finalize): --rosegment-gap implies --rosegment.
1830 * layout.cc (set_segment_offsets): Let user option override
1831 target->rosegment_gap().
1832
0c6e6c39
RM
18332013-05-10 Roland McGrath <mcgrathr@google.com>
1834
1835 * options.h (General_options): Remove leading space from help
1836 messages for -nostdlib and --rosegment.
1837
cde7cb01
MR
18382013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1839
1840 PR ld/15365
1841 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1842
f31ae5b8
AM
18432013-05-03 Alan Modra <amodra@gmail.com>
1844
1845 * merge.cc (Output_merge_string::do_add_input_section): Correct
1846 scan for number of strings. Rename vars to avoid shadowing.
1847 Include missing terminator in input_size_.
1848
d3a7cd45
L
18492013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1850
1851 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1852 Restore empty string handling.
1853
6ad3daba
CC
18542013-05-01 Cary Coutant <ccoutant@google.com>
1855
1856 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1857 uninitialized warning.
1858
e31908b6
CC
18592013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1860
1861 * output.cc (Output_section::add_merge_input_section): Allow
1862 to merge sections if the alignment is more than character size.
1863 * merge.h (Output_merge_string::Output_merge_string): Remove
1864 assert.
1865 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1866 only not-null strings. Check the alignment of strings.
1867 * stringpool.h
1868 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1869 alignment as the argument.
1870 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1871 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1872 Align non-zero length strings according to the addralign_.
1873 (Stringpool_template<Stringpool_char>::set_string_offsets):
1874 Updating offsets according to the given alignment.
1875 * testsuite/Makefile.am (text_section_grouping): Test if string
1876 literals are getting merged.
1877 * testsuite/Makefile.in: Regenerate.
1878 * testsuite/merge_string_literals_1.c: New file.
1879 * testsuite/merge_string_literals_2.c: Ditto.
1880 * testsuite/merge_string_literals.sh: Ditto.
1881
0e804863
ILT
18822013-04-26 Ian Lance Taylor <iant@google.com>
1883
1884 * target-reloc.h (relocate_section): If the reloc offset is out of
1885 range, pass VIEW as NULL to relocate.relocate.
1886 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1887 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1888 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1889 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1890 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1891 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1892
e7c5ea40
CC
18932013-04-26 Geoff Pike <gpike@chromium.org>
1894
1895 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1896 * layout.cc (Hash_task): New class.
1897 (Layout::queue_build_id_tasks): New function.
1898 (Layout::write_build_id): Handle single-thread portion of build ID
1899 computation. (In some cases, all of it is single-threaded.) Replace
1900 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1901 functionality in fewer lines of code.
1902 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1903 * options.h (General_options): make "--build-id" default to tree
1904 rather than sha1. Add two new options related to --build-id=tree:
1905 --build-id-chunk-size-for-treehash and
1906 --build-id-min-file-size-for-treehash.
1907 * Makefile.am: add testing of --build-id=tree and related new options
1908 (these tests will be invoked by "make check").
1909 * Makefile.in: Regenerate.
1910
49926cd0
AM
19112013-04-25 Alan Modra <amodra@gmail.com>
1912
1913 * configure.tgt: Add powerpcle and powerpc64le.
1914
a4034750
AM
19152013-04-22 Alan Modra <amodra@gmail.com>
1916
1917 PR gold/15355
1918 * layout.cc (Layout::segment_precedes): Allow more than one
1919 segment with the same type and flags.
1920
e79c84aa
CC
19212013-04-15 Cary Coutant <ccoutant@google.com>
1922
1923 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1924 allocate space in file for BSS sections.
1925
2199fbe7
CC
19262013-04-15 Cary Coutant <ccoutant@google.com>
1927
1928 * script-sections.cc (Orphan_output_section): Reset address
1929 to zero after each orphaned section for relocatable links.
1930
502e8a84
CC
19312013-04-15 Cary Coutant <ccoutant@google.com>
1932
a4034750
AM
1933 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1934 section starting address for relocatable link.
1935 * testsuite/Makefile.am (script_test_11): New test.
1936 * testsuite/Makefile.in: Regenerate.
1937 * testsuite/script_test_11.c: New source file.
1938 * testsuite/script_test_11.t: New linker script.
502e8a84 1939
0cfdc767
AM
19402013-04-13 Alan Modra <amodra@gmail.com>
1941
1942 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1943 owner when sections are not adjacent and exceed group size.
1944 (Target_powerpc::group_sections): Handle corner case.
1945 (Target_powerpc::Branch_info::make_stub): Handle case where
1946 stub table doesn't exist due to branches in non-exec sections.
1947 (Target_powerpc::Relocate::relocate): Likewise.
1948
6830ee24
AM
19492013-04-11 Alan Modra <amodra@gmail.com>
1950
1951 PR gold/15354
1952 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1953 .branch_lt to match bfd ld. Adjust comments throughout file.
1954
54a3d865
ILT
19552013-04-04 Ian Lance Taylor <iant@google.com>
1956
1957 GCC PR c++/56840
1958 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1959 sections before checking whether they are included in the link.
1960
9993ba11
ST
19612013-03-29 Sriraman Tallam <tmsriram@google.com>
1962
1963 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1964 object before calling the plugin claim_file handler. Pass the elf
1965 object of the archive to the plugin. Delete the elf object if the
1966 plugin claims the file.
1967
ebacd51e
AM
19682013-03-21 Alan Modra <amodra@gmail.com>
1969
1970 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1971 segment when omagic.
1972
117be58f
AM
19732013-03-21 Alan Modra <amodra@gmail.com>
1974
1975 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1976 comparison warning.
1977 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1978 uninitialized" warning.
1979
32e2b61d
AM
19802013-03-20 Alan Modra <amodra@gmail.com>
1981
1982 * symtab.h (Symbol::clear_version): New function.
1983 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1984 is_needed by weak references. Clear version for symbols defined
1985 in as-needed objects that are not needed.
1986
b3ccdeb5
AM
19872013-03-15 Alan Modra <amodra@gmail.com>
1988
1989 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1990 static and public. Add report_err param. Return false for data refs.
1991 (Target_powerpc::rela_dyn_section): New overloaded function.
1992 (Target_powerpc::plt_, iplt_): Elucidate.
1993 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1994 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1995 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1996 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1997 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1998 push_branch and make_plt_entry for ifunc syms when
1999 reloc_needs_plt_for_ifunc.
2000 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2001 for ifunc unless reloc_needs_plt_for_ifunc.
2002
ad3d8a2f
AM
20032013-03-15 Alan Modra <amodra@gmail.com>
2004
2005 * gc.h (gc_process_relocs): Don't look through function descriptors.
2006 * icf.cc (get_section_contents): Do so here instead.
2007
4d9aa155
AM
20082013-03-13 Alan Modra <amodra@gmail.com>
2009
2010 * powerpc.cc (is_branch_reloc): Forward declare.
2011 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2012 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2013 false for 64-bit, true for 32-bit non-branch relocs.
2014 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2015 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2016 nm output.
2017 (icf_safe_test): Generate linker map file as well as nm output.
2018 (icf_safe_so_test): Likewise.
2019 * testsuite/Makefile.in: Regenerate.
2020 * testsuite/icf_test.sh: Parse linker map file to determine
2021 section folding.
2022 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2023 * testsuite/icf_safe_so_test.sh: Likewise.
2024 (X86_32_or_ARM_specific_safe_fold): Merge into..
2025 (arch_specific_safe_fold): ..this.
2026 (X86_64_specific_safe_fold): Delete unused function.
2027
57420c20
AM
20282013-03-12 Alan Modra <amodra@gmail.com>
2029
2030 * gc.h (gc_process_relocs): Look through function descriptors
2031 to determine shndx, symvalue and addend used by ICF. Tidy
2032 variable duplication.
2033
dc3714f3
AM
20342013-03-11 Alan Modra <amodra@gmail.com>
2035
2036 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2037 * layout.cc (Layout_task_runner::run): ..to here.
2038 * symtab.h (struct Symbol_location): Extract from..
2039 (class Symbol_table): ..here.
2040 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2041 * target.h (class Target): Add function_location and
2042 do_function_location functions.
2043 (class Sized_target): Add do_function_location.
2044 * object.h (class Sized_relobj_file): Move find_shdr..
2045 (class Object): ..to here.
2046 * object.cc: Likewise. Update to suit. Instantiate.
2047 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
2048 * powerpc.cc (class Powerpc_dynobj): New.
2049 (Target_powerpc::do_function_location): New function.
2050 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2051 (Powerpc_dynobj::do_read_symbols): New function.
2052 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2053
956b03bb
ILT
20542013-03-08 Ian Lance Taylor <iant@google.com>
2055
2056 * options.cc (General_options::string_to_object_format): Accept
2057 "default".
2058
4bead2d5
AM
20592013-03-08 Alan Modra <amodra@gmail.com>
2060
2061 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2062 pointer to Post_fde.
2063 (struct Post_fde): Move definition to here..
2064 * ehframe.cc (struct Post_fde): ..from here.
2065 (Cie::write): Don't alloc Post_fde.
2066 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2067
02e60bf7
AM
20682013-03-07 Alan Modra <amodra@gmail.com>
2069
2070 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2071 relocation referencing .LC0.
2072 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2073
8343f03a
AM
20742013-03-07 Alan Modra <amodra@gmail.com>
2075
2076 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2077 always_inline. Add assembly for powerpc to avoid GOT.
2078
3366d57c
AM
20792013-03-07 Alan Modra <amodra@gmail.com>
2080
2081 * testsuite/script_test_10.sh: Don't test .bss section
2082 header number.
2083
6c77229c
AM
20842013-03-06 Alan Modra <amodra@gmail.com>
2085
2086 * powerpc.cc (class Powerpc_relobj): Move some member functions.
2087 (Target_powerpc::symval_for_branch): Add symtab param. Update
2088 all callers. Handle folded sections.
2089 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
2090 to Powerpc_relobj.
2091 (Global_symbol_visitor_opd::operator()): Likewise.
2092
a39e4af6
AM
20932013-03-04 Alan Modra <amodra@gmail.com>
2094
2095 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
2096 * testsuite/Makefile.in: Regenerate.
2097
d5834edb
CC
20982013-03-01 Cary Coutant <ccoutant@google.com>
2099
2100 Add dwp support for v2 DWARF package file format.
2101 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2102 tu_length parameter. Adjust all callers.
2103 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2104 * dwp.cc: Include dwarf.h.
2105 (Section_bounds): New struct type.
2106 (Unit_set): New struct type.
2107 (Dwo_file::Dwo_file): Initialize new data member.
2108 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2109 Combine and rename to...
2110 (Dwo_file::read_unit_index): ...this.
2111 (Dwo_file::sized_read_compunit_index)
2112 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2113 (Dwo_file::sized_read_unit_index): ...this.
2114 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2115 parameters; add section_id parameter.
2116 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2117 (Dwo_file::add_unit_set): ...this.
2118 (Dwo_file::shndx_map_): Remove.
2119 (Dwo_file::sect_offsets_): New data member.
2120 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2121 (Dwp_output_file::add_section): Rename to...
2122 (Dwp_output_file::add_contribution): ...this.
2123 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2124 (Dwp_output_file::add_tu_set): Likewise.
2125 (Dwp_output_file::Contribution): New type.
2126 (Dwp_output_file::Section::contributions): New data member.
2127 (Dwp_output_file::Cu_or_tu_set): Remove.
2128 (Dwp_output_file::Section::Section): New ctor.
2129 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2130 (Dwp_output_file::Dwp_index::Section_table): New type.
2131 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2132 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2133 parameter.
2134 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2135 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2136 (Dwp_output_file::Dwp_index::section_table): New member function.
2137 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2138 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2139 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2140 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2141 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2142 (Dwp_output_file::Dwp_index::section_table_): New data member.
2143 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2144 (Dwp_output_file::add_output_section): New member function.
2145 (Dwp_output_file::write_new_section): New member function.
2146 (Dwp_output_file::write_contributions): New member function.
2147 (Dwp_output_file::section_id_map_): New data member.
2148 (class Dwo_id_info_reader): Remove.
2149 (class Unit_reader): New class.
2150 (get_dwarf_section_name): New function.
2151 (Dwo_file::read_executable): Adjust initializations of class data.
2152 (Dwo_file::read): Add support for v2 package file format.
2153 (Dwo_file::read_unit_index): Likewise.
2154 (Dwo_file::sized_read_unit_index): Likewise.
2155 (Dwo_file::copy_section): Likewise.
2156 (Dwo_file::add_unit_set): Likewise.
2157 (Dwp_output_file::add_output_section): Likewise.
2158 (Dwp_output_file::add_contribution): Likewise.
2159 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2160 for empty slot.
2161 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2162 file format.
2163 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2164 slot.
2165 (Dwp_output_file::initialize): Remove unused function.
2166 (Dwp_output_file::finalize): Add support for v2 package file format.
2167 (Dwp_output_file::write_index): Likewise.
2168 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2169 function prototype.
2170
a68a081d
CC
21712013-03-01 Cary Coutant <ccoutant@google.com>
2172
2173 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2174 function into class definition in header file.
2175 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2176 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2177 New function.
2178 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2179
9d5781f8
AM
21802013-02-28 Alan Modra <amodra@gmail.com>
2181
2182 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2183 * target.cc (Target::do_plt_fde_location): New function.
2184 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2185 accessor function, and constructor param.
2186 (struct Post_fde, Post_fdes): Declare.
2187 (Cie::write): Add post_fdes param.
2188 * ehframe.cc (Fde::write): Use plt_fde_location.
2189 (struct Post_fde): Define.
2190 (Cie::write): Stash FDEs added post merge mapping.
2191 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2192 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2193 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2194 other FDEs.
2195 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2196 (Target_powerpc::has_glink): New function.
2197 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2198 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2199 glink_eh_frame_fde_32, default_fde): New data.
2200 (Stub_table::eh_frame_added_): New var.
2201 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2202 Make const.
2203 (Stub_table::add_eh_frame): New function.
2204 (Output_data_glink::add_eh_frame): New function.
2205 (Target_powerpc::make_glink_section): Call add_eh_frame.
2206
214383dd
ILT
22072013-02-15 Ian Lance Taylor <iant@google.com>
2208
2209 * options.h (DEFINE_uint64_alias): Define.
2210 (class General_options): Add -Ttext-segment as an alias for
2211 -Ttext.
2212
91c2b899
AM
22132013-02-15 Alan Modra <amodra@gmail.com>
2214
2215 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2216 (Stub_table::do_write): ..here, two places.
2217 (Stub_table::plt_call_size): Use it here too.
2218
20e2a8aa
ILT
22192013-02-11 Ian Lance Taylor <iant@google.com>
2220
2221 * descriptors.cc (Descriptors::close_all): New function.
2222 * descriptors.h (class Descriptors): Declare close_all.
2223 (close_all_descriptors): New inline function.
2224 * plugin.cc: Include "descriptors.h".
2225 (Plugin_manager::cleanup): Call close_all_descriptors.
2226
8952bc69
AM
22272013-02-06 Alan Modra <amodra@gmail.com>
2228
2229 * README: Update coding style link.
2230
29bd8b6b
CC
22312013-01-28 Cary Coutant <ccoutant@google.com>
2232
a4034750
AM
2233 * dwp.cc (File_list): New typedef.
2234 (Dwo_name_info_reader): New class.
2235 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2236 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2237 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2238 (Dwo_file::read_executable): New function.
2239 (Dwo_file::read): Move common setup code to ...
2240 (Dwo_file::make_object): ... here.
2241 (dwp_options): Add --exec/-e.
2242 (usage): Likewise.
2243 (main): Likewise.
29bd8b6b 2244
c6ac678d
ST
22452013-01-24 Sriraman Tallam <tmsriram@google.com>
2246
2247 * layout.cc (Layout::layout): Check for option text_reorder.
2248 (Layout::make_output_section): Ditto.
2249 * options.h (text_reorder): New option.
2250 * output.cc (Input_section_sort_compare): Remove special ordering
2251 of section names.
2252 (Output_section::
2253 Input_section_sort_section_name_special_ordering_compare::
2254 operator()): New function.
2255 (Output_section::sort_attached_input_sections): Use new sort function
2256 for .text.
2257 * output.h (Input_section_sort_section_name_special_ordering_compare):
2258 New struct.
2259 * testsuite/Makefile.am (text_section_grouping): Test option
2260 --no-text-reorder
2261 * testsuite/Makefile.in: Regenerate.
2262 * testsuite/text_section_grouping.sh: Check order of functions without
2263 default text reordering.
2264
50701cc1
MF
22652013-01-18 Mike Frysinger <vapier@gentoo.org>
2266
2267 * options.h (General_options): Change default to true for new_dtags.
2268
b1b00fcc
MF
22692013-01-18 Mike Frysinger <vapier@gentoo.org>
2270
2271 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2272 when enable_new_dtags is false. Only add DT_RUNPATH when
2273 enable_new_dtags is true.
2274
ec5b8187
AM
22752013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2276
2277 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2278 used in declaration and definition consistent.
2279 (Target_powerpc::symval_for_branch): Ditto.
2280
a880d4c4
ST
22812013-01-16 Sriraman Tallam <tmsriram@google.com>
2282
2283 * testsuite/plugin_final_layout.cc: Fix comment.
2284
7c381248
ST
22852013-01-16 Sriraman Tallam <tmsriram@google.com>
2286
2287 * layout.cc (Layout::layout): Do not do default sorting for
2288 text sections when section ordering is specified.
2289 (make_output_section): Ditto.
2290 * testsuite/plugin_final_layout.cc: Name the function sections
2291 to catch reordering issues.
2292
e2458743
AM
22932013-01-15 Alan Modra <amodra@gmail.com>
2294
2295 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2296 plt-thread-safe.
2297
431ed302
AM
22982013-01-15 Alan Modra <amodra@gmail.com>
2299
2300 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2301 * testsuite/Makefile.in: Regenerate.
2302
0ec6429b
AM
23032013-01-14 Alan Modra <amodra@gmail.com>
2304
2305 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2306 * testsuite/Makefile.in: Regenerate.
2307
0bf402d5
ILT
23082013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2309
36af3926 2310 PR bfd/14430
0bf402d5
ILT
2311 Fix mingw gold build with plugins enabled
2312 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2313 * configure.ac: Export DLOPEN_LIBS and add headers check.
2314 * plugin.cc: Handle non-dlfcn case.
2315 * Makefile.in: Regenerate.
2316 * config.in: Regenerate.
2317 * configure: Regenerate.
2318 * testsuite/Makefile.in: Regenerate.
2319
9e9143bc
ST
23202013-01-09 Sriraman Tallam <tmsriram@google.com>
2321
2322 * output.h (sort_attached_input_sections): Change to be public.
2323 * script-sections.cc
2324 (Output_section_definition::set_section_addresses): Sort
2325 attached input sections according to section order before linker
2326 script assigns section addresses.
2327 (Orphan_output_section::set_section_addresses): Sort
2328 attached input sections according to section order before linker
2329 script assigns section addresses.
2330 * Makefile.am (final_layout.sh): Use a simple linker script to
2331 check if section ordering still works.
2332 * Makefile.in: Regenerate.
2333
679af368
ILT
23342013-01-09 Ben Cheng <bccheng@google.com>
2335
2336 * arm.cc (Target_arm::attributes_accept_div): New function.
2337 (Target_arm::attributes_forbid_div): New function.
2338 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2339 attribute using the same new functions as what bfd/elf32_arm.c
2340 does.
2341
3136a00e
CC
23422013-01-07 Cary Coutant <ccoutant@google.com>
2343
2344 PR gold/14993
2345 * output.cc (Output_section::add_input_section): For incremental
2346 updates, don't track input sections that are allocated from patch
2347 space.
2348
f2a6224b
L
23492013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2350 Ian Lance Taylor <iant@google.com>
2351
2352 PR gold/14897
2353 * configure.ac (--enable-ld): Removed.
2354 (install_as_default): Set to yes only for --enable-gold=default
2355 or --disable-ld.
2356 * configure: Regenerated.
2357
4f46f626
L
23582013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2359
2360 * options.h (General_options): Add -fuse-ld= for GCC linker
2361 option compatibility.
2362
26e4ef59
CC
23632013-01-04 Cary Coutant <ccoutant@google.com>
2364
2365 * configure.ac: Fix typo restoring CXXFLAGS.
2366 * configure: Regenerate.
2367
3d587466
CC
23682013-01-04 Cary Coutant <ccoutant@google.com>
2369
4f46f626
L
2370 * testsuite/Makefile.am (CXXLINK_S): New macro.
2371 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2372 * testsuite/Makefile.in: Regenerate.
3d587466 2373
44db6695
L
23742013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2375
2376 * version.cc (print_version): Update copyright year to 2013.
2377
edcac0c1
ILT
23782012-12-20 Ian Lance Taylor <iant@google.com>
2379
2380 * layout.cc (Layout::special_ordering_of_input_section): New
2381 function.
2382 (Layout::layout): If input section requires special ordering, must
2383 sort input sections.
2384 (Layout::make_output_section): May sort .text input sections.
2385 (Layout::is_section_name_prefix_grouped): Remove.
2386 * layout.h (class Layout): Declare
2387 special_ordering_of_input_section. Don't declare
2388 is_section_name_prefix_grouped.
2389 * output.cc (Output_section::add_input_section): Revert last
2390 change.
2391 (Output_section::Input_section_sort::match_file_name): Don't crash
2392 if called on output section data.
2393 (Output_section::Input_section_sort_compare): Sort based on
2394 special ordering.
2395 (Output_section::Input_section_sort_section_order_index_compare):
2396 Revert last patch.
2397 (Output_section::sort_attached_input_sections): Likewise.
2398
28f2a4ac
ST
23992012-12-18 Sriraman Tallam <tmsriram@google.com>
2400
edcac0c1 2401 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2402 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2403 * output.cc (Output_section::add_input_section): Check if section
2404 name contains special prefix. Keep input sections to sort such
2405 sections.
2406 (Output_section::Input_section_sort_section_order_index_compare
2407 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2408 (Output_section::sort_attached_input_sections): Add condition to
2409 Input_section_entry constructor call.
28f2a4ac
ST
2410 * testsuite/Makefile.am (text_section_grouping): New test.
2411 * testsuite/Makefile.in: Regenerate.
2412 * testsuite/text_section_grouping.cc: New file.
2413 * testsuite/text_section_grouping.sh: New file.
2414
5bf135a7
NC
24152012-12-17 Nick Clifton <nickc@redhat.com>
2416
2417 * Makefile.am: Add copyright notice.
2418 * NEWS: Likewise.
2419 * README: Likewise.
2420 * configure.ac: Likewise.
2421 * ftruncate.c: Likewise.
2422 * Makefile.in: Regenerate.
2423
59965708
CC
24242012-12-14 Cary Coutant <ccoutant@google.com>
2425
a4034750
AM
2426 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2427 --no-as-needed flag.
2428 (exception_separate_shared_12_test): Likewise.
2429 (incremental_copy_test): Likewise.
2430 * testsuite/Makefile.in: Regenerate.
59965708 2431
2a77e2ab
CC
24322012-12-14 Cary Coutant <ccoutant@google.com>
2433
2434 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2435 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2436
e3deeb9c
AM
24372012-12-12 Alan Modra <amodra@gmail.com>
2438
2439 * powerpc.cc (class Track_tls): New.
2440 (class Relocate, class Scan): Inherit Track_tls.
2441 (Target_powerpc::Scan::local, global): Track tls optimization
2442 and avoid creating plt entry for __tls_get_addr if all uses
2443 are optimized away.
2444 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2445
d8f5a274
AM
24462012-12-12 Alan Modra <amodra@gmail.com>
2447
2448 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2449 Replace no_toc_optimize with toc_optimize.
2450 * output.h (Output_section::input_sections): Provide non-const variant.
2451 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2452 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2453 accessors.
2454 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2455 (class Sort_toc_sections): New.
2456 (Target_powerpc::do_finalize_sections): Sort toc sections.
2457 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2458
4c8a1de1
RM
24592012-12-10 Roland McGrath <mcgrathr@google.com>
2460
2461 * testsuite/binary_unittest.cc (read_all): New function.
2462 (Sized_binary_test): Use it instead of ::read.
2463 * fileread.cc (do_read): Don't assume pread always reads the whole
2464 amount in a single call.
2465
edc27beb
AM
24662012-12-10 Alan Modra <amodra@gmail.com>
2467
2468 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2469 Set EM_PPC64 or EM_PPC here.
2470 (Target_selector_powerpc::do_recognize): Delete.
2471
906b9150
AM
24722012-12-10 Alan Modra <amodra@gmail.com>
2473
2474 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2475 stub_table_.
2476 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2477
418c15ae
RM
24782012-12-07 Roland McGrath <mcgrathr@google.com>
2479
2480 * testsuite/binary_unittest.cc (Sized_binary_test):
2481 Use open_descriptor rather than ::open.
2482
decdd3bc
AM
24832012-12-07 Alan Modra <amodra@gmail.com>
2484
2485 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2486 typedef and invalid_address constant.
2487 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2488 instantiate constants.
2489
db399005
ILT
24902012-12-06 Roland McGrath <mcgrathr@google.com>
2491
2492 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2493 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2494 * aclocal.m4: Regenerate.
2495 * configure: Regenerate.
2496 * Makefile.in: Regenerate.
2497 * testsuite/Makefile.in: Regenerate.
2498
aba6bc71
AM
24992012-12-07 Alan Modra <amodra@gmail.com>
2500
2501 * options.h (General_options): Add no_toc_optimize.
2502 * powerpc.cc (ok_lo_toc_insn): New function.
2503 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2504
9e69ed50
AM
25052012-12-06 Alan Modra <amodra@gmail.com>
2506
2507 * options.h (General_options): Add plt_align, plt_static_chain,
2508 plt_thread_safe. Update stub_group_size help text.
2509 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2510 for new plt_thread_safe_ var.
2511 (use_plt_offset): Correct comments.
2512 (Target_powerpc::do_relax): Look for thread creation symbols to
2513 determine default plt_thread_safe value. Clear plt call stubs
2514 as well as branch stubs each iteration.
2515 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2516 insn constants.
2517 (l, hi, ha, write_insn): Move earlier.
2518 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2519 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2520 plt stubs too.
2521 (Stub_table::update_size): Adjust.
2522 (Stub_table::prev_size, set_prev_size): Delete.
2523 (Stub_table::stub_align): Let --plt-align affect result.
2524 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2525 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2526 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2527 (Stub_table::do_write): Support more stub variants.
2528
f43ba157
AM
25292012-12-04 Alan Modra <amodra@gmail.com>
2530
2531 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2532 (Target_powerpc::do_define_standard_symbols): New function.
2533
34171bc5
AM
25342012-12-03 Alan Modra <amodra@gmail.com>
2535
2536 * output.h: Formatting, whitespace.
2537
dc9589e9 25382012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2539
2540 * layout.h (Layout::get_executable_sections): Declare.
2541 * layout.cc (Layout::get_executable_sections): New function.
2542 * arm.cc (Target_arm::group_sections): Use it.
2543 (Arm_output_section::group_sections): Delete now redundant test.
2544 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2545 param to handle relative relocs.
2546 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2547 (Output_data_reloc::add_absolute): Adjust.
2548 (Output_data_reloc::add_relative): New function.
2549 (Output_data::reset_data_size): New function.
2550 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2551 (Output_section::set_addralign): New function.
2552 (Output_section::checkpoint_set_addralign): New function.
2553 (Output_section::clear_section_offsets_need_adjustment): New function.
2554 (Output_section::input_sections): Make public.
2555 * powerpc.cc (class Output_data_brlt_powerpc): New.
2556 (class Stub_table, class Stub_control): New.
2557 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2558 stub_table_, set_stub_table, stub_table): New vectors and accessor
2559 functions.
2560 (Target_powerpc::do_may_relax, do_relax, push_branch,
2561 new_stub_table, stub_tables, brlt_section, group_sections,
2562 add_branch_lookup_table, find_branch_lookup_table,
2563 write_branch_lookup_table, make_brlt_section): New functions.
2564 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2565 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2566 branch_info_): New vars.
2567 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2568 make call stubs here.
2569 (Output_data_glink): Remove all call stub handling from this class.
2570 (Target_powerpc::Scan::local, global): Save interesting branch
2571 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2572 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2573 functions on final link.
2574 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2575 Handle long branch destinations too.
2576 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2577 do_plt_address_for_local): Adjust lookup of plt call stubs.
2578
627b30b7
AM
25792012-11-30 Alan Modra <amodra@gmail.com>
2580
2581 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2582 relocs against protected symbols when building 32-bit shared libs.
2583
40b469d7
AM
25842012-11-30 Alan Modra <amodra@gmail.com>
2585
2586 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2587 param. Call got_section() to make .got. Update all callers
2588 and their callers and so on.
2589
bb66a627
AM
25902012-11-30 Alan Modra <amodra@gmail.com>
2591
2592 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2593 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2594 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2595 value if it already exists.
2596
d2cf1c6c
L
25972012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2598
2599 PR gold/14858
2600 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2601
edccdf7c
RM
26022012-11-14 Roland McGrath <mcgrathr@google.com>
2603
2604 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2605 than bfc instruction for data sandboxing.
2606
6febeb74
AM
26072012-11-08 Alan Modra <amodra@gmail.com>
2608
2609 * po/POTFILES.in: Regenerate.
2610
0a6f1bf2
AM
26112012-11-05 Alan Modra <amodra@gmail.com>
2612
2613 * configure.ac: Apply 2012-09-10 change to config.in here.
2614 * configure: Regenerate.
2615
26a4e9cb
AM
26162012-11-05 Alan Modra <amodra@gmail.com>
2617
2618 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2619 (struct Opd_ent): Use "Address" rather than "Offset".
2620 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2621 (Target_powerpc::got_section): Make public.
2622 (Target_powerpc::scan_relocs): Move code setting symbols..
2623 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2624 Create _SDA_BASE_ only when referenced.
2625
cc928013
RM
26262012-11-02 Roland McGrath <mcgrathr@google.com>
2627
2628 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2629 from last change.
2630
50ed5eb1
RM
26312012-11-01 Roland McGrath <mcgrathr@google.com>
2632
62fe925a
RM
2633 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2634 for offset_in_output_section parameter.
2635 (Sized_target::relocate_special_relocatable): Likewise.
2636 * arm.cc (Target_arm::relocate_relocs): Likewise.
2637 (Target_arm::relocate_special_relocatable): Likewise.
2638 * i386.cc (Target_i386::relocate_relocs): Likewise.
2639 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2640 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2641 * target-reloc.h (relocate_relocs): Likewise.
2642 * testsuite/testfile.cc (Target_test): Likewise.
2643 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2644 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2645
2646 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2647 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2648
2649 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2650 parameter, which is unused in the [!F_SETFD] case.
2651
50ed5eb1
RM
2652 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2653 SYMNDX to off_t before comparing it to this->data_size().
2654 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2655 * incremental.cc (Output_section_incremental_inputs::do_write):
2656 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2657
2cadc0bf
RM
2658 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2659
3bfcb652
NC
26602012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2661
2662 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2663 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2664 in EABI_VER5.
2665
c1a8d56e
CC
26662012-10-29 Cary Coutant <ccoutant@google.com>
2667
2668 * dwp.cc (usage): Add file and exit status parameters;
2669 add --help and --version options.
2670 (print_version): New function.
2671 (main): Add --help and --version options.
2672
b2490a7b
L
26732012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2674
2675 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2676 final_layout_sequence.txt.
2677 * testsuite/Makefile.in: Regenerated.
2678
aa543512
L
26792012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2680
2681 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2682 COMPILE generated by automake.
2683 (LINK1): Likewise.
2684 (CXXCOMPILE1): Likewise.
2685 (CXXLINK1): Likewise.
2686 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2687 (LINK): Likewise.
2688 (CXXCOMPILE): Likewise.
2689 (CXXLINK): Likewise.
2690 * testsuite/Makefile.in: Regenerated.
2691
d361fafb
L
26922012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2693
2694 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2695 on bad fwrite return.
2696
598c7410
L
26972012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2698
2699 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2700 on val.
2701
35c813e2
CC
27022012-10-23 Cary Coutant <ccoutant@google.com>
2703
2704 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2705 * testsuite/Makefile.in: Regenerate.
2706 * testsuite/dwp_test.h: New source file.
2707 * testsuite/dwp_test_1.cc: New source file.
2708 * testsuite/dwp_test_1.s: New source file.
2709 * testsuite/dwp_test_1.sh: New source file.
2710 * testsuite/dwp_test_1b.cc: New source file.
2711 * testsuite/dwp_test_1b.s: New source file.
2712 * testsuite/dwp_test_2.cc: New source file.
2713 * testsuite/dwp_test_2.s: New source file.
2714 * testsuite/dwp_test_2.sh: New source file.
2715 * testsuite/dwp_test_main.cc: New source file.
2716 * testsuite/dwp_test_main.s: New source file.
2717
77429909
CC
27182012-10-23 Cary Coutant <ccoutant@google.com>
2719
2720 * dwp.h: New header file.
2721 * dwp.cc: New source file.
2722 * gold.h: Move shared declarations to system.h.
2723 * system.h: New header file.
2724 * Makefile.am: Add dwp.
2725 * Makefile.in: Regenerate.
2726
ed5d6712
CC
27272012-10-23 Cary Coutant <ccoutant@google.com>
2728
2729 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2730 Dwarf_info_reader::read_from_pointer.
2731 (Dwarf_pubnames_table::read_header): Likewise.
2732 (Dwarf_pubnames_table::next_name): Likewise.
2733 (Dwarf_die::read_attributes): Likewise.
2734 (Dwarf_die::skip_attributes): Likewise.
2735 (Dwarf_info_reader::read_from_pointer): New function template.
2736 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2737 (Dwarf_pubnames_table): Likewise.
2738 (Dwarf_info_reader::read_from_pointer): New function template.
2739 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2740 Dwarf_pubnames_table ctor.
2741
8787852d
CC
27422012-10-23 Cary Coutant <ccoutant@google.com>
2743
2744 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2745 abbrev_shndx.
2746 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2747 abbrev_shndx_.
2748 (Dwarf_info_reader::set_abbrev_shndx): New method.
2749 (Dwarf_info_reader::abbrev_shndx_): New data member.
2750
9fc236f3
CC
27512012-10-23 Cary Coutant <ccoutant@google.com>
2752
2753 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2754 from object, not parameters.
2755 (Dwarf_info_reader::parse): Likewise.
2756 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2757 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2758 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2759 methods.
2760
effe8365
CC
27612012-10-23 Cary Coutant <ccoutant@google.com>
2762
2763 * fileread.cc (Input_file::Input_file): New constructor.
2764 * fileread.h (class Input_file): Add new constructor.
2765
1698990d
AM
27662012-10-18 Alan Modra <amodra@gmail.com>
2767
2768 PR gold/14727
2769 * object.cc (Relobj::is_section_name_included): Also match
2770 .sdata personality section.
2771
168a4726
AM
27722012-10-18 Alan Modra <amodra@gmail.com>
2773
2774 * target-reloc.h (class Default_comdat_behavior): New, package up..
2775 (get_comdat_behaviour): ..this.
2776 (relocate_section): Add Relocate_comdat_behavior template arg,
2777 adjust code to suit.
2778 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2779 (Target_arm::scan_reloc_section): Likewise.
2780 * i386.cc (Target_i386::relocate_section): Likewise.
2781 * sparc.cc (Target_sparc::relocate_section): Likewise.
2782 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2783 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2784 * powerpc.cc (class Relocate_comdat_behavior): New.
2785 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2786 gold::relocate_section with new template arg.
2787
acc276d8
AM
27882012-10-18 Alan Modra <amodra@gmail.com>
2789
2790 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2791 dynamic relocs for GOT_TPREL got entries, without symbol if
2792 resolving locally.
2793 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2794 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2795 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2796
e10f9870
AM
27972012-10-17 Alan Modra <amodra@gmail.com>
2798
2799 PR gold/14726
2800 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2801
ae034989
ST
28022012-10-16 Sriraman Tallam <tmsriram@google.com>
2803
2804 * layout.cc (Layout::include_section): Keep sections marked
2805 SHF_EXCLUDE when doing relocatable links.
2806
f3a0ed29
AM
28072012-10-16 Alan Modra <amodra@gmail.com>
2808
2809 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2810 (Target_powerpc::do_finalize_sections): Call it.
2811 (Output_data_save_res): New class and supporting functions.
2812 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2813 normal symbols defined in object files.
2814
c6de8ed4
AM
28152012-10-12 Alan Modra <amodra@gmail.com>
2816
2817 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2818 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2819 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2820 section if scan_opd_relocs not yet called.
2821 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2822
03e25981
AM
28232012-10-12 Alan Modra <amodra@gmail.com>
2824
2825 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2826 add_local_ifunc_entry): Revert last change.
2827 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2828
c9824451
AM
28292012-10-05 Alan Modra <amodra@gmail.com>
2830
2831 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2832 do_plt_address_for_global): New functions.
2833 (Output_data_got_powerpc::do_write): Don't segfault when linking
2834 statically.
2835 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2836 add_local_ifunc_entry): Return true on adding entry..
2837 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2838 glink->add_entry call. Remove unused symtab param. Adjust calls.
2839 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2840 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2841 set up symbols here.
2842 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2843 syms here. Do so even when no .iplt. Don't segfault when linking
2844 statically.
2845 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2846 new variants without reloc param.
2847 (Glink_sym_ent::Glink_sym_ent): Likewise.
2848 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2849 reloc when refs will resolve to plt call stub.
2850 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2851 R_PPC_PLTREL24 to resolve locally.
2852 (Target_powerpc::Scan::global): Correct ifunc handling.
2853 (Target_powerpc::Relocate::relocate): Correct local sym glink
2854 lookup. Don't destroy "value" when we have a plt call stub,
2855 and when checking plt call validity.
2856 (Target_powerpc::do_dynsym_value): Simplify.
2857
19fec8c1
AM
28582012-10-05 Alan Modra <amodra@gmail.com>
2859
2860 * i386.cc (Output_data_plt_i386::address_for_global,
2861 address_for_local): Add plt offset to returned value. Adjust uses.
2862 * sparc.cc (Output_data_plt_sparc::address_for_global,
2863 address_for_local): Likewise.
2864 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2865 address_for_local): Likewise.
2866 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2867 address_for_local): Likewise.
2868 * target.h (Target::plt_address_for_global, plt_address_for_local):
2869 Update comment.
2870 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2871 (Output_data_got::Got_entry::write): Nor here.
2872 * output.h: Comment fix.
2873
e867b647
WL
28742012-10-02 Jiong Wang <jiwang@tilera.com>
2875
2876 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2877 global_offset_table_ value for larget got.
2878 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2879
e5d5f5ed
AM
28802012-09-29 Alan Modra <amodra@gmail.com>
2881
2882 * powerpc.cc (Target_powerpc::iplt_): New output section.
2883 (Target_powerpc::iplt_section, make_iplt_section,
2884 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2885 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2886 Target_powerpc::plt_entry_count): Count iplt entries too.
2887 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2888 reloc section in constructor. New params.
2889 (Target_powerpc::make_plt_section): Create reloc section here instead.
2890 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2891 functions.
2892 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2893 (Output_data_glink::add_entry, find_entry): New functions to
2894 deal with local syms.
2895 (Glink_sym_ent): Add support for local syms.
2896 (Output_data_glink::do_write): Handle ifunc plt entries.
2897 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2898 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2899 (Target_powerpc::Relocate::relocate): Likewise.
2900 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2901
ec4dbad3
AM
29022012-09-25 Alan Modra <amodra@gmail.com>
2903
2904 * object.h (Sized_relobj_file::adjust_local_symbol,
2905 do_adjust_local_symbol): New functions.
2906 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2907 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2908 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2909 and irregular opd entry spacing.
2910 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2911 (Global_symbol_visitor_opd): New functor.
2912 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2913 on deleted opd entries.
2914
5c0b3823
WL
29152012-09-15 Jiong Wang <jiwang@tilera.com>
2916
2917 * tilegx.cc: New file.
2918 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2919 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2920 * configure.tgt: Add entries for tilegx*.
2921 * configure.ac: Likewise.
2922 * Makefile.in: Rebuild.
2923 * configure: Likewise.
2924 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2925 tilegx.
2926
bfdfa4cd
AM
29272012-09-13 Alan Modra <amodra@gmail.com>
2928
2929 * target-reloc.h (scan_relocs): Call scan.local for relocs
2930 against symbols in discarded sections. Pass is_discarded
2931 param.
2932 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2933 Add is_discarded param.
2934 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2935 is_discarded to flag opd entry as discarded. Don't emit dyn
2936 relocs on such entries.
2937 (Target_powerpc::Scan::global): Similarly detect and handle
2938 such opd entries.
2939 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2940 opd_ent_. Update all uses.
2941 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2942 (Target_powerpc::relocate_section): Zero out discarded opd
2943 entry relocs.
2944
d77a0555
ILT
29452012-09-12 Ian Lance Taylor <iant@google.com>
2946
2947 PR gold/14570
2948 * output.cc: Rename Output_data_got template parameter from size
2949 to got_size for all functions. Compile all variants of
2950 Output_data_got.
2951 (Output_data_got::Got_entry::write): Correct use of size for
2952 symbol value. Use local_is_tls rather than casting to
2953 Sized_relobj_file.
2954 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2955 (class Sized_relobj_file): Add do_local_is_tls.
2956 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2957
815a1205
AM
29582012-09-11 Alan Modra <amodra@gmail.com>
2959
2960 PR gold/14566
2961 * layout.cc (Layout::set_segment_offsets): When using
2962 common-page-size alignment, ensure we are on a new max-page-size
2963 page.
2964 * output.cc (Output_segment::set_section_addresses): Use
2965 abi_pagesize, not common_pagesize for relro boundary.
2966 (Output_segment::set_offset): Likewise.
2967
bd73a62d
AM
29682012-09-11 Alan Modra <amodra@gmail.com>
2969
2970 * output.h (Output_data_got::add_global_tls, add_local_tls,
2971 add_local_tls_pair): New functions.
2972 (Output_data_got::add_local_pair_with_rel): Remove second
2973 reloc param. Expand comment.
2974 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2975 use_plt_or_tls_offset_, similarly for constructor param.
2976 (Output_data_got::Got_entry::write): Add got_index param.
2977 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2978 add_local_tls_pair): New functions.
2979 (Output_data_got::Got_entry::write): Handle tls symbols
2980 with use_plt_or_tls_offset_ set specially.
2981 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2982 (Output_data_got::do_write): Replace iterator with index, pass
2983 index to entry write function.
2984 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2985 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2986 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2987 call.
2988 * i386.cc (Target_i386::Scan::local): Likewise.
2989 * sparc.cc (Target_sparc::Scan::local): Likewise.
2990 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2991 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2992 do_tls_offset_for_global): New functions.
2993 (Target_powerpc::Scan::local): Correct TLS relocations and got
2994 entry values.
2995 (Target_powerpc::Scan::global): Don't emit unnecessary
2996 dynamic relocations on TLS GOT entries.
2997
00716ab1
AM
29982012-09-10 Matthias Klose <doko@ubuntu.com>
2999
3000 * config.in: Disable sanity check for kfreebsd.
3001
c891b3f9
SA
30022012-09-10 Sterling Augustine <saugustine@google.com>
3003
3004 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3005 (Gdb_index::pubtypes_read): New parameter.
3006 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3007 to calls.
3008 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3009 pubtypes_object_.
3010
e81fea4d
AM
30112012-09-09 Alan Modra <amodra@gmail.com>
3012
3013 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3014 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3015 * gc.h (gc_process_relocs): Call target gc_add_reference.
3016 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3017 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3018 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3019 unnecessary cast.
3020 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3021 to cater for when we don't need code offset. Update use.
3022 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3023 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3024 set_opd_valid): New functions.
3025 (Target_powerpc::do_gc_add_reference): New function.
3026 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3027 stashed refs.
3028 (Target_powerpc::do_gc_mark_symbol): New function.
3029
d2d60eef
CC
30302012-09-06 Cary Coutant <ccoutant@google.com>
3031
3032 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3033 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3034 (Dwarf_die::skip_attributes): Likewise.
3035 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3036 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3037 (main): Call it.
3038 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3039
32ed4573
L
30402012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3041
3042 * testsuite/script_test_3.t: Add .got.plt output section
3043 statement.
3044 * testsuite/script_test_4.t: Likewise.
3045
f4baf0d4
AM
30462012-09-05 Alan Modra <amodra@gmail.com>
3047
3048 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
3049 update all uses and lose "enum" when using type.
3050
864a1b56
AM
30512012-09-05 Alan Modra <amodra@gmail.com>
3052
3053 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3054 * configure: Regenerate.
3055 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3056 (plugin_final_layout.stdout): Likewise.
3057 (memory_test): Set page sizes to 0x1000.
3058 * testsuite/Makefile.in: Regenerate.
3059 * testsuite/discard_locals_test.sh: Add FIXME comment.
3060 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3061 * testsuite/pr14265.t: Add .got output section statement.
3062 * testsuite/script_test_2.t: Likewise.
3063 * testsuite/script_test_3.t: Likewise.
3064 * testsuite/script_test_4.t: Likewise.
3065 * testsuite/script_test_5.t: Likewise.
3066 * testsuite/script_test_6.t: Likewise.
3067 * testsuite/script_test_7.t: Likewise.
3068 * testsuite/script_test_9.t: Likewise.
3069
3ea0a085
AM
30702012-09-05 Alan Modra <amodra@gmail.com>
3071
3072 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3073 (Powerpc_relocate_functions::Status): New typedef.
3074 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3075 (Target_powerpc::Scan::local): Handle REL64.
3076 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3077 for REL32 and REL64.
3078 (Target_powerpc::symval_for_branch): New function, extracted from..
3079 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3080 checks. Report overflow errors.
3081
7404fe1b
AM
30822012-09-05 Alan Modra <amodra@gmail.com>
3083
3084 * object.h (Sized_relobj_file::emit_relocs): Delete.
3085 (Sized_relobj_file::emit_relocs_reltype): Delete.
3086 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
3087 relocate_relocs for --emit-relocs.
3088 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
3089 * output.h: Update comment.
3090 (Output_segment::first_section): New function.
3091 (Output_segment::first_section_load_address): Use first_section.
3092 * output.cc (Output_segment::first_section): New function extracted..
3093 (Output_segment::first_section_load_address): ..from here. Delete.
3094 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
3095 * target.h (Sized_target::relocate_for_relocatable): Likewise.
3096 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
3097 adjust call to target.h function.
3098 * i386.cc (Target_i386): Likewise.
3099 * sparc.cc (Target_sparc): Likewise.
3100 * x86_64.cc (Target_x86_64): Likewise.
3101 * powerpc.cc (Target_powerpc): Likewise.
3102 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
3103 first tls section has section symbol for optimised local dynamic
3104 output relocs.
3105 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
3106 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
3107 optimised tls code.
3108 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
3109 Rename to relocate_relocs. Update error message.
3110
957564c9
AS
31112012-09-04 Andreas Schwab <schwab@linux-m68k.org>
3112
3113 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
3114 --just-symbols.
3115
dd93cd0a
AM
31162012-08-31 Alan Modra <amodra@gmail.com>
3117
3118 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3119 (Powerpc_relobj::toc_base_offset): New stub function.
3120 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3121 got_mod_index_offset to tlsld_got_offset. Update all refs.
3122 (Target_powerpc::Relocate::enum skip_tls): New.
3123 (Target_powerpc::call_tls_get_addr_): New var.
3124 (Target_powerpc::is_branch_reloc): Move to file scope.
3125 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3126 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3127 New functions.
3128 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3129 (powerpc_info): Correct common_pagesize for ppc64.
3130 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3131 (Powerpc_relocate_functions): Add overflow check enums and functions.
3132 Add non-shift version of rela, rela_ua. Delete all rel public
3133 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3134 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3135 addr16_ha3, addr14 functions.
3136 (Output_data_got_powerpc::add_constant_pair): New function.
3137 (Output_data_got_powerpc::got_base_offset): Likewise.
3138 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3139 (instruction constants): Sort, add some more.
3140 (Output_data_glink::do_write): Add and use Address typedef. Use
3141 object->toc_base_offset() stub for 64-bit.
3142 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3143 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3144 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3145 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3146 Always treat .opd relocs as against locally defined symbol.
3147 Correct condition for RELATIVE relocs.
3148 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3149 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3150 for 32-bit syms with a plt entry. Correct ppc64 toc base
3151 calculations. Handle TLS relocs, and more. Add overflow
3152 checking and adjust for Powerpc_relocate_functions changes.
3153 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3154 Reinstate --emit-relocs code with FIXME.
3155
a1373b60
AM
31562012-08-30 Alan Modra <amodra@gmail.com>
3157
3158 * layout.cc (Layout::set_segment_offsets): Set p_align to
3159 abi_pagesize, not common_pagesize.
3160 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3161 to determine whether file header can go in segment.
3162
703d02da
AM
31632012-08-30 Alan Modra <amodra@gmail.com>
3164
3165 * output.h (Output_reloc::Output_reloc <output section>): Add
3166 is_relative param. Adjust calls.
3167 (Output_reloc::add_output_section_relative): New functions.
3168 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3169 is_relative.
3170 (Output_reloc::symbol_value): Handle SECTION_CODE.
3171
16164a6b
ST
31722012-08-24 Sriraman Tallam <tmsriram@google.com>
3173
3174 * gold.cc (queue_middle_tasks): Call layout again when unique
3175 segments for sections is desired.
3176 * layout.cc (Layout::Layout): Initialize new members.
3177 (Layout::get_output_section_flags): New function.
3178 (Layout::choose_output_section): Call get_output_section_flags.
3179 (Layout::layout): Make output section for mapping to a unique segment.
3180 (Layout::insert_section_segment_map): New function.
3181 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 3182 output sections marked so.
16164a6b
ST
3183 (Layout::segment_precedes): Check for unique segments when sorting.
3184 * layout.h (Layout::Unique_segment_info): New struct.
3185 (Layout::Section_segment_map): New typedef.
3186 (Layout::insert_section_segment_map): New function.
3187 (Layout::get_output_section_flags): New function.
3188 (Layout::is_unique_segment_for_sections_specified): New function.
3189 (Layout::set_unique_segment_for_sections_specified): New function.
3190 (Layout::unique_segment_for_sections_specified_): New member.
3191 (Layout::section_segment_map_): New member.
3192 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3193 Rename is_gc_pass_one to is_pass_one.
3194 Rename is_gc_pass_two to is_pass_two.
3195 Rename is_gc_or_icf to is_two_pass.
3196 Check for which pass based on whether symbols data is present.
3197 Make it two pass when unique segments for sections is desired.
3198 * output.cc (Output_section::Output_section): Initialize new
3199 members.
3200 * output.h (Output_section::is_unique_segment): New function.
3201 (Output_section::set_is_unique_segment): New function.
3202 (Output_section::is_unique_segment_): New member.
3203 (Output_section::extra_segment_flags): New function.
3204 (Output_section::set_extra_segment_flags): New function.
3205 (Output_section::extra_segment_flags_): New member.
3206 (Output_section::segment_alignment): New function.
3207 (Output_section::set_segment_alignment): New function.
3208 (Output_section::segment_alignment_): New member.
3209 (Output_segment::Output_segment): Initialize is_unique_segment_.
3210 (Output_segment::is_unique_segment): New function.
3211 (Output_segment::set_is_unique_segment): New function.
3212 (Output_segment::is_unique_segment_): New member.
3213 * plugin.cc (allow_unique_segment_for_sections): New function.
3214 (unique_segment_for_sections): New function.
3215 (Plugin::load): Add new functions to transfer vector.
3216 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3217 * Makefile.in: Regenerate.
3218 * testsuite/plugin_final_layout.sh: Check if unique segment
3219 functionality works.
3220 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3221 are available.
3222 (allow_unique_segment_for_sections): New global.
3223 (unique_segment_for_sections): New global.
3224 (claim_file_hook): Call allow_unique_segment_for_sections.
3225 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 3226
1e2bee4f
CC
32272012-08-22 Cary Coutant <ccoutant@google.com>
3228
3229 * layout.cc (Layout::include_section): Don't assert on GROUP
3230 sections with --emit-relocs.
3231
1d5dfe78
CC
32322012-08-21 Cary Coutant <ccoutant@google.com>
3233
3234 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3235 if --export-dynamic-symbol names an undef symbol.
3236
c9269dff
AM
32372012-08-18 Alan Modra <amodra@gmail.com>
3238
3239 * powerpc.cc: Formatting and white space.
3240 (Powerpc_relobj): Rename got2_section_ to special_.
3241 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3242 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3243 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3244 (Target_powerpc): Add Address typedef and invalid_address. Use
3245 throughout.
3246 (Target_powerpc::is_branch_reloc): New function.
3247 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3248 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3249 for dst_mask, value and addend.
3250 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3251 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3252 (Output_data_glink::do_write): Correct toc base. Don't try to use
3253 uint16_t for 24-bit offset. Use get_output_section_offset and
3254 check return.
3255 (Target_powerpc::Scan::local): Handle more relocs.
3256 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3257 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3258 Plug in toc restoring insn after plt calls. Translate branches
3259 to function descriptor symbols to corresponding entry point.
3260 (Target_powerpc::relocate_for_relocatable): Check return from
3261 get_output_section_offset.
3262 * symtab.h: Comment typo.
3263
b1759dce
ILT
32642012-08-14 Ian Lance Taylor <iant@google.com>
3265
3266 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3267 unsupported_relocal_local to call unsupported_reloc_global.
3268
b9b2ae8b
NC
32692012-08-14 Nick Clifton <nickc@redhat.com>
3270
3271 PR ld/14265
3272 * script-sections.cc (Sections_element::output_section_name): Add
3273 keep return parameter.
3274 (Output_section_element::match_name): Add keep return parameter.
3275 Return the value of the keep_ member.
3276 * script-sections.h (class Output_section): Update
3277 output_section_name prototype.
3278 * layout.cc (Layout::keep_input_section): New public member
3279 function.
3280 (Layout::choose_output_section): Pass keep parameter to
3281 output_section_name.
3282 * layout.h (class Layout): Add keep_input_section.
3283 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3284 sections.
3285 * testsuite/Makefile.am: Add a test.
3286 * testsuite/Makefile.in: Regenerate.
3287 * testsuite/pr14265.c: Source file for the test.
3288 * testsuite/pr14265.t: Linker script for the test.
3289 * testsuite/pr14265.sh: Shell script for the test.
3290
921b5322
AM
32912012-08-14 Alan Modra <amodra@gmail.com>
3292
3293 * target.h (Target::output_section_name): New function.
3294 (Target::do_output_section_name): New function.
3295 * layout.cc (Layout::choose_output_section): Call the above.
3296 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3297
6ce78956
AM
32982012-08-14 Alan Modra <amodra@gmail.com>
3299
3300 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3301 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3302 for replace_constant call.
3303 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3304 (Output_data_glink::do_print_to_mapfile): New function.
3305 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3306 (Target_powerpc::Relocate::relocate): Likewise.
3307
d1a8cabd
AM
33082012-08-14 Alan Modra <amodra@gmail.com>
3309
3310 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3311 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3312 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3313 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3314 all references to shndx_. Handle special case for R_PPC_PLTREL24
3315 here.
3316 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3317 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3318 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3319 here.
3320 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3321 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3322
d83ce4e3
AM
33232012-08-12 Alan Modra <amodra@gmail.com>
3324
3325 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3326 (glink insn constants): Use uint32_t.
3327 (Output_data_glink::add_entry): Use insert, not [] operator.
3328
cf43a2fe
AM
33292012-08-11 Alan Modra <amodra@gmail.com>
3330
3331 * object.h (Sized_relobj_file::find_shdr): New function.
3332 (Sized_relobj_file::find_special_sections): New function.
3333 * object.cc (Sized_relobj_file::find_shdr): New function.
3334 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3335 (Sized_relobj_file::find_special_sections): New function, split out..
3336 (Sized_relobj_file::do_read_symbols): ..from here.
3337 * output.h (Output_data_got::replace_constant): New function.
3338 (Output_data_got::num_entries): New function.
3339 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3340 (Output_data_got::got_offset): Protected rather than private.
3341 (Output_data_got::replace_got_entry): New function.
3342 * output.cc (Output_data_got::replace_got_entry): New function.
3343 * powerpc.cc (class Powerpc_relobj): New.
3344 (class Powerpc_relocate_functions): Delete all psymval variants or
3345 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3346 Implement _ha functions using corresponding _hi function.
3347 (Powerpc_relobj::find_special_sections): New function.
3348 (Target_powerpc::do_make_elf_object): New function.
3349 (class Output_data_got_powerpc): New.
3350 (class Output_data_glink): New.
3351 (class Powerpc_scan_relocatable_reloc): New.
3352 Many more changes througout file.
3353
3c892704
NC
33542012-08-09 Nick Clifton <nickc@redhat.com>
3355
3356 * po/vi.po: Updated Vietnamese translation.
3357
82435b3b
ILT
33582012-08-07 Ian Lance Taylor <iant@google.com>
3359
3360 * layout.cc (Layout::add_target_dynamic_tags): If
3361 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3362 plt_rel.
3363
a6dc81d2
NC
33642012-07-30 Nick Clifton <nickc@redhat.com>
3365
3366 * po/gold.pot: Updated template.
3367 * po/es.po: Updated Spanish translation.
3368
f1415016
CC
33692012-07-18 Cary Coutant <ccoutant@google.com>
3370
3371 PR gold/14344
3372 * configure.ac: Add check for -gpubnames support.
3373 * configure: Regenerate.
3374 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3375 support; force -gno-pubnames.
3376 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3377 support.
3378 (gdb_index_test_4): New test.
3379 * testsuite/Makefile.in: Regenerate.
3380 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3381 * testsuite/gdb_index_test_2.sh: Likewise.
3382 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3383 * testsuite/gdb_index_test_4.sh: New script.
3384 * testsuite/gdb_index_test_comm.sh: New script with common code;
3385 don't look for space after colon.
3386
b7fd7c37
ST
33872012-07-16 Sriraman Tallam <tmsriram@google.com>
3388
3389 * gold.cc (queue_middle_tasks): Update function order only after
3390 deferred objects due to plugins are processed.
3391
1f3212db
ILT
33922012-07-11 Ian Lance Taylor <iant@google.com>
3393
3394 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3395 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3396 (Target_arm::scan_reloc_for_stub): Likewise.
3397 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3398 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3399 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3400 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3401 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3402
81c82a68
ILT
34032012-07-10 Dodji Seketeli <dodji@redhat.com>
3404 Ian Lance Taylor <iant@google.com>
3405
3406 PR gold/14309
3407 * configure.ac: Test whether std::tr1::hash<off_t> works.
3408 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3409 needed.
3410 * output.h (class Output_fill): Add virtual destructor.
3411 * configure, config.in: Rebuild.
3412
eabc84f4
RM
34132012-06-22 Roland McGrath <mcgrathr@google.com>
3414
3415 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3416
370e30b6
RÁE
34172012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3418
3419 * plugin.cc (Plugin::load): Handle position independent executables.
3420
fb1b895d
CC
34212012-06-06 Cary Coutant <ccoutant@google.com>
3422
3423 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3424 add .debug_macro.
3425 (lines_only_debug_sections): Likewise.
3426 (gdb_fast_lookup_sections): New static array.
3427 (is_gdb_debug_section): Rename formal parameter.
3428 (is_lines_only_debug_section): Likewise.
3429 (is_gdb_fast_lookup_section): New function.
3430 (Layout::include_section): Check for ".zdebug_" prefix; pass
3431 section name suffix to is_gdb_debug_section, et al.; check for
3432 fast-lookup sections when building .gdb_index.
3433 * options.h (--strip-debug-gdb): Update GDB version number.
3434
7c0640fa
CC
34352012-06-06 Cary Coutant <ccoutant@google.com>
3436
3437 * configure.ac: Add check for fallocate.
3438 * configure: Regenerate.
3439 * config.in: Regenerate.
3440
3441 * options.h (class General_options): Add --mmap-output-file and
3442 --posix-fallocate options.
3443 * output.cc: (posix_fallocate): Remove; replace with...
3444 (gold_fallocate): New function.
3445 (Output_file::map_no_anonymous): Call gold_fallocate.
3446 (Output_file::map): Check --mmap-output-file option.
3447
2a49eb69
DK
34482012-06-05 Jing Yu <jingyu@google.com>
3449
3450 * gold.h (textdomain): Add do {} to empty while(0).
3451 (bindtextdomain): Likewise.
3452
fad072ac
CC
34532012-06-04 Cary Coutant <ccoutant@google.com>
3454
3455 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3456 has_dynsym_index.
3457
8cc69fb6
ST
34582012-05-25 Sriraman Tallam <tmsriram@google.com>
3459
3460 * symtab.cc (Symbol_table::define_special_symbol):
3461 Initialize *poldsym to prevent uninitialized variable errors.
3462
1be75daa
CC
34632012-05-23 Cary Coutant <ccoutant@google.com>
3464
3465 * layout.cc (Layout::section_name_mapping): Add rules to handle
3466 exact match on .data.rel.ro.local or .data.rel.ro.
3467 (Layout::output_section_name): Check for exact matches.
3468
9b689de0
CC
34692012-05-23 Cary Coutant <ccoutant@google.com>
3470
3471 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3472 more carefully.
3473
b24fdbf5
CC
34742012-05-22 Cary Coutant <ccoutant@google.com>
3475
3476 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3477 object before exporting symbol.
3478
e550e1a2
L
34792012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3480
3481 * testsuite/tls_test.cc: Include "config.h" first.
3482 * testsuite/tls_test_c.c: Likewise.
3483
df7b86aa
NC
34842012-05-17 Daniel Richard G. <skunk@iskunk.org>
3485 Nick Clifton <nickc@redhat.com>
3486
3487 PR 14072
3488 * configure.in: Add check that sysdep.h has been included before
3489 any system header files.
3490 * configure: Regenerate.
3491 * config.in: Regenerate.
3492
1007b503
CC
34932012-05-14 Cary Coutant <ccoutant@google.com>
3494
3495 * layout.cc (Layout::make_output_section): Mark .tdata section
3496 as RELRO.
3497 * testsuite/relro_test.cc: Add a TLS variable.
3498
fd885f3a
L
34992012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3500
3501 PR gold/14091
3502 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3503 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3504 R_X86_64_64.
3505
80f5885c
CC
35062012-05-08 Cary Coutant <ccoutant@google.com>
3507
3508 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3509 (lines_only_debug_sections): Likewise.
3510
2e702c99
RM
35112012-05-02 Roland McGrath <mcgrathr@google.com>
3512
3513 * nacl.cc: New file.
3514 * nacl.h: New file.
3515 * Makefile.am (CCFILES, HFILES): Add them.
3516 * Makefile.in: Regenerate.
3517 * i386.cc (Output_data_plt_i386_nacl): New class.
3518 (Output_data_plt_i386_nacl_exec): New class.
3519 (Output_data_plt_i386_nacl_dyn): New class.
3520 (Target_i386_nacl): New class.
3521 (Target_selector_i386_nacl): New class.
3522 (target_selector_i386): Use it instead of Target_selector_i386.
3523 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3524 (Target_x86_64_nacl): New class.
3525 (Target_selector_x86_64_nacl): New class.
3526 (target_selector_x86_64, target_selector_x32): Use it instead of
3527 Target_selector_x86_64.
3528 * arm.cc (Output_data_plt_arm_nacl): New class.
3529 (Target_arm_nacl): New class.
3530 (Target_selector_arm_nacl): New class.
3531 (target_selector_arm, target_selector_armbe): Use it instead of
3532 Target_selector_arm.
3533
3534 * target-select.cc (select_target): Take new Input_file* and off_t
3535 arguments, pass them on to recognize method of selector.
3536 * object.cc (make_elf_sized_object): Update caller.
3537 * parameters.cc (parameters_force_valid_target): Likewise.
3538 * incremental.cc (make_sized_incremental_binary): Likewise.
3539 * target-select.h: Update decl.
3540 (Target_selector::recognize): Take new Input_file* argument,
3541 pass it on to do_recognize.
3542 (Target_selector::do_recognize): Take new Input_file* argument.
3543 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3544 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3545 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3546 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3547
3548 * target.h (Target::Target_info): New members isolate_execinstr
3549 and rosegment_gap.
3550 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3551 * arm.cc (Target_arm::arm_info): Update initializer.
3552 * i386.cc (Target_i386::i386_info): Likewise.
3553 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3554 * sparc.cc (Target_sparc::sparc_info): Likewise.
3555 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3556 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3557 * layout.cc (Layout::attach_allocated_section_to_segment):
3558 Take new const Target* argument. If target->isolate_execinstr(), act
3559 like --rosegment.
3560 (Layout::find_first_load_seg): Take new const Target* argument;
3561 if target->isolate_execinstr(), reject PF_X segments.
3562 (Layout::relaxation_loop_body): Update caller.
3563 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3564 reset file offset to zero when we hit LOAD_SEG, and then do a second
3565 loop over the segments before LOAD_SEG to reassign offsets after
3566 addresses have been determined. Handle target->rosegment_gap().
3567 (Layout::attach_section_to_segment): Take new const Target* argument;
3568 pass it to attach_allocated_section_to_segment.
3569 (Layout::make_output_section): Update caller.
3570 (Layout::attach_sections_to_segments): Take new const Target* argument;
3571 pass it to attach_section_to_segment.
3572 * gold.cc (queue_middle_tasks): Update caller.
3573 * layout.h (Layout): Update method decls with new arguments.
3574
3575 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3576 Target_info pointer to use.
3577 (Target_arm::do_make_data_plt): New virtual method.
3578 (Target_arm::make_data_plt): New method that calls it.
3579 (Target_arm::make_plt_entry): Use it.
3580 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3581 for the section alignment.
3582 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3583 method.
3584 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3585 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3586 method.
3587 (Output_data_plt_arm::get_plt_entry_size): Call it.
3588 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3589 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3590 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3591 method.
3592 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3593 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3594 method instead of sizeof(plt_entry).
3595 (Output_data_plt_arm::add_entry): Likewise.
3596 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3597 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3598 than static method.
3599 (Target_arm::plt_entry_size): Likewise.
3600 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3601 Move to ...
3602 (Output_data_plt_arm_standard): ... here, new class.
3603 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3604 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3605 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3606
3607 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3608 Take additional argument for the PLT entry size.
3609 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3610 Use get_plt_entry_size method rather than plt_entry_size variable.
3611 (Output_data_plt_x86_64::reserve_slot): Likewise.
3612 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3613 (Output_data_plt_x86_64::add_entry): Likewise.
3614 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3615 (Output_data_plt_x86_64::address_for_global): Likewise.
3616 (Output_data_plt_x86_64::address_for_local): Likewise.
3617 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3618 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3619 Make method non-static.
3620 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3621 method.
3622 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3623 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3624 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3625 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3626 virtual method.
3627 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3628 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3629 virtual method.
3630 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3631 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3632 virtual method.
3633 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3634 (Output_data_plt_x86_64::plt_entry_size)
3635 (Output_data_plt_x86_64::first_plt_entry)
3636 (Output_data_plt_x86_64::plt_entry)
3637 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3638 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3639 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3640 (Output_data_plt_x86_64_standard): ... here, new class.
3641 (Target_x86_64::Target_x86_64): Take optional argument for the
3642 Target_info pointer to use.
3643 (Target_x86_64::do_make_data_plt): New virtual method.
3644 (Target_x86_64::make_data_plt): New method to call it.
3645 (Target_x86_64::init_got_plt_for_update): Use that.
3646 Call this->plt_->add_eh_frame method here.
3647 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3648 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3649 rather than static method.
3650 (Target_x86_64::plt_entry_size): Likewise.
3651 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3652 rather than plt_entry_size variable. Move guts of PLT filling to...
3653 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3654 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3655 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3656
3657 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3658 additional argument for the section alignment.
3659 Don't do add_eh_frame_for_plt here.
3660 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3661 non-static. Use get_plt_entry_size method rather than plt_entry_size
3662 variable.
3663 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3664 method.
3665 (Output_data_plt_i386::get_plt_entry_size): Call it.
3666 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3667 (Output_data_plt_i386::add_eh_frame): New method to call it.
3668 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3669 method.
3670 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3671 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3672 method.
3673 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3674 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3675 method instead of plt_entry_size.
3676 (Output_data_plt_i386::plt_entry_size)
3677 (Output_data_plt_i386::plt_eh_frame_fde_size)
3678 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3679 (Output_data_plt_i386_standard): ... here, new class.
3680 (Output_data_plt_i386_exec): New class.
3681 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3682 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3683 (Output_data_plt_i386::exec_plt_entry): Move to ...
3684 (Output_data_plt_i386_exec::plt_entry): ... here.
3685 (Output_data_plt_i386_dyn): New class.
3686 (Output_data_plt_i386::first_plt_entry): Move to ...
3687 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3688 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3689 (Output_data_plt_i386_dyn::plt_entry): ... here.
3690 (Target_i386::Target_i386): Take optional argument for the Target_info
3691 pointer to use.
3692 (Target_i386::do_make_data_plt): New virtual method.
3693 (Target_i386::make_data_plt): New method to call it.
3694 (Target_i386::make_plt_section): Use that.
3695 Call this->plt_->add_eh_frame method here.
3696 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3697 rather than plt_entry_size variable.
3698 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3699 (Output_data_plt_i386::address_for_local): Likewise.
3700 (Output_data_plt_i386::do_write): Likewise.
3701 Move guts of PLT filling to...
3702 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3703 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3704 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3705 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3706
b9b9f2ee
CC
37072012-05-01 Cary Coutant <ccoutant@google.com>
3708
3709 * dwarf_reader.cc (Dwarf_die::read_attributes)
3710 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3711 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3712 * reduced_debug_output.cc
3713 (Output_reduced_debug_info_section::get_die_end): Remove
3714 DW_FORM_GNU_ref_index. Add default case.
3715
57923f48
MW
37162012-04-26 Mark Wielaard <mjw@redhat.com>
3717
3718 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3719 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3720 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3721 DW_AT_high_pc as offset from DW_AT_low_pc.
3722
3723 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3724 * testsuite/Makefile.in: Regenerate.
3725 * testsuite/gdb_index_test_3.c: New test source file.
3726 * testsuite/gdb_index_test_3.sh: New test source file.
3727
2c54b4f4
ILT
37282012-04-25 Ian Lance Taylor <iant@google.com>
3729
3730 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3731 pointer.
3732 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3733 as a class, not a struct.
3734 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3735 (Target_arm::apply_cortex_a8_workaround): Likewise.
3736 * gc.h: Declare Reloc_types as a struct, not a class.
3737 * object.h: Declare Symbols_data as a struct.
3738 * reloc.h: Declare Read_relocs_data as a struct.
3739 * target.h: Declare Relocate_info as a struct.
3740
a5a5f7a3
DM
37412012-04-24 David S. Miller <davem@davemloft.net>
3742
3743 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3744 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3745 and R_SPARC_WPLT30.
3746
f038d496
CC
37472012-04-24 Cary Coutant <ccoutant@google.com>
3748
3749 * incremental-dump.cc (find_input_containing_global): Replace
3750 magic number with symbolic constant.
3751 (dump_incremental_inputs): Update version number.
3752 * incremental.cc (Output_section_incremental_inputs): Update version
3753 number; import symbolic constants from Incremental_inputs_reader.
3754 (Incremental_inputs::create_data_sections): Align relocations
3755 section correctly for 64-bit targets.
3756 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3757 constants; add padding.
3758 (Output_section_incremental_inputs::write_header): Add assert for
3759 header_size.
3760 (Output_section_incremental_inputs::write_input_files): Add assert
3761 for input_entry_size.
3762 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3763 add assert for object_info_size, input_section_entry_size,
3764 global_sym_entry_size.
3765 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3766 for data structure sizes; use them.
3767 (Incremental_input_entry_reader): Import symbolic constants from
3768 Incremental_inputs_reader; use them.
3769
a4d85145
DM
37702012-04-23 David S. Miller <davem@davemloft.net>
3771
3772 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3773 and elf_flags_set_.
3774 (Target_sparc::Target_sparc): Initialize new fields.
3775 (Target_sparc::do_make_elf_object): New function.
3776 (Target_sparc::do_adjust_elf_header): New function.
3777
1d509098
CC
37782012-04-23 Cary Coutant <ccoutant@google.com>
3779
3780 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3781 CU range table of gdb index.
3782
7ebeff7f
DM
37832012-04-20 David S. Miller <davem@davemloft.net>
3784
3785 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3786 instead of false.
3787
13cf9988
DM
37882012-04-16 David S. Miller <davem@davemloft.net>
3789
2a1079e8
DM
3790 * sparc.cc (Target_sparc::got_address): New function.
3791 (Sparc_relocate_functions::gdop_hix22): New function.
3792 (Sparc_relocate_functions::gdop_lox10): New function.
3793 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3794 relocs.
3795 (Target_sparc::Scan::local): Likewise if the global symbol is not
3796 preemptible and is not IFUNC.
3797 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3798 transformations for local and non-preemptible non-IFUNC global
3799 symbols.
3800
0bc964fc
DM
3801 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3802 writing out 64-bit part of ranges.
3803
661d7a80
DM
3804 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3805 -fpic and -fpie respectively.
3806 * Makefile.in: Regenerate.
3807
8c2bf391
DM
3808 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3809 (Target_sparc::Target_sparc): Initialize new field.
3810 (Target_sparc::do_plt_section_for_global): New function.
3811 (Target_sparc::do_plt_section_for_local): New function.
3812 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3813 (Target_sparc::make_plt_section): New function, broken out of
3814 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3815 (Target_sparc::make_plt_entry): Call make_plt_section.
3816 (Target_sparc::make_local_ifunc_plt_entry): New function.
3817 (Target_sparc::rela_ifunc_section): New function.
3818 (Target_sparc::plt_section): Remove const.
3819 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3820 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3821 and ifunc_count_ fields.
3822 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3823 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3824 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3825 (Output_data_plt_sparc::rela_ifunc): New function.
3826 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3827 (Output_data_plt_sparc::has_ifunc_section): New function.
3828 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3829 (Output_data_plt_sparc::address_for_global): New function.
3830 (Output_data_plt_sparc::address_for_local): New function.
3831 (Output_data_plt_sparc::plt_index_to_offset): New function.
3832 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3833 and entry_count.
3834 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3835 entry_count.
3836 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3837 R_SPARC_JMP_IREL to switch.
3838 (Target_sparc::Scan::check_non_pic): Likewise.
3839 (Target_sparc::Scan::local): Handle IFUNC symbols.
3840 (Target_sparc::Scan::local): Likewise.
3841 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3842 and plt_address_for_local.
3843 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3844 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3845
13cf9988
DM
3846 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3847 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3848 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3849 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3850 global relocs too.
3851 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3852 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3853 calls.
3854 * sparc.cc (Target_sparc::Scan::global): Likewise.
3855 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3856
31821be0
CC
38572012-04-16 Cary Coutant <ccoutant@google.com>
3858
3859 * archive.cc (Library_base::should_include_member): Check for
3860 --export-dynamic-symbol.
3861 * options.h (class General_options): Add --export-dynamic-symbol.
3862 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3863 --export-dynamic-symbol.
3864 (Symbol_table::gc_mark_undef_symbols): Likewise.
3865 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3866
2615994e
DM
38672012-04-12 David S. Miller <davem@davemloft.net>
3868
3869 * sparc.cc (Reloc::wdisp10): New relocation method.
3870 (Reloc::h34): Likewise.
3871 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3872 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3873 R_SPARC_WDISP10.
3874 (Target_sparc::Scan::local): Likewise.
3875 (Target_sparc::Scan::global): Likewise.
3876 (Target_sparc::Relocate::relocate): Likewise.
3877
6782735d
CC
38782012-04-09 Cary Coutant <ccoutant@google.com>
3879
3880 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3881 low_pc == 0.
3882
8c7a0b00
ILT
38832012-04-06 Ian Lance Taylor <iant@google.com>
3884
3885 * timer.cc: #include <unistd.h>.
3886
58797674
RM
38872012-04-06 Roland McGrath <mcgrathr@google.com>
3888
3889 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3890 * config.in: Regenerate.
3891 * configure: Regenerate.
3892
44350750
NC
38932012-04-05 Nick Clifton <nickc@redhat.com>
3894
3895 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3896 (AM_LC_MESSAGES): Add.
3897 * aclocal.m4: Regenerate.
3898 * config.in: Regenerate.
3899 * configure: Regenerate.
3900
c1027032
CC
39012012-03-21 Cary Coutant <ccoutant@google.com>
3902
3903 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3904 * Makefile.in: Regenerate.
3905 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3906 (Sized_elf_reloc_mapper::symbol_section): New function.
3907 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3908 (make_elf_reloc_mapper): New function.
3909 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3910 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3911 (Dwarf_abbrev_table::do_get_abbrev): New function.
3912 (Dwarf_ranges_table::read_ranges_table): New function.
3913 (Dwarf_ranges_table::read_range_list): New function.
3914 (Dwarf_pubnames_table::read_section): New function.
3915 (Dwarf_pubnames_table::read_header): New function.
3916 (Dwarf_pubnames_table::next_name): New function.
3917 (Dwarf_die::Dwarf_die): New function.
3918 (Dwarf_die::read_attributes): New function.
3919 (Dwarf_die::skip_attributes): New function.
3920 (Dwarf_die::set_name): New function.
3921 (Dwarf_die::set_linkage_name): New function.
3922 (Dwarf_die::attribute): New function.
3923 (Dwarf_die::string_attribute): New function.
3924 (Dwarf_die::int_attribute): New function.
3925 (Dwarf_die::uint_attribute): New function.
3926 (Dwarf_die::ref_attribute): New function.
3927 (Dwarf_die::child_offset): New function.
3928 (Dwarf_die::sibling_offset): New function.
3929 (Dwarf_info_reader::check_buffer): New function.
3930 (Dwarf_info_reader::parse): New function.
3931 (Dwarf_info_reader::do_parse): New function.
3932 (Dwarf_info_reader::do_read_string_table): New function.
3933 (Dwarf_info_reader::lookup_reloc): New function.
3934 (Dwarf_info_reader::get_string): New function.
3935 (Dwarf_info_reader::visit_compilation_unit): New function.
3936 (Dwarf_info_reader::visit_type_unit): New function.
3937 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3938 Sized_elf_reloc_mapper.
3939 (Sized_dwarf_line_info::symbol_section): Remove function.
3940 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3941 (Sized_dwarf_line_info::read_line_mappings): Remove object
3942 parameter, adjust callers.
3943 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3944 * dwarf_reader.h: Include <sys/types.h>.
3945 (class Track_relocs): Remove forward declaration.
3946 (class Elf_reloc_mapper): New class.
3947 (class Sized_elf_reloc_mapper): New class.
3948 (class Dwarf_abbrev_table): New class.
3949 (class Dwarf_range_list): New class.
3950 (class Dwarf_ranges_table): New class.
3951 (class Dwarf_pubnames_table): New class.
3952 (class Dwarf_die): New class.
3953 (class Dwarf_info_reader): New class.
3954 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3955 (Sized_dwarf_line_info::symbol_section): Remove member function.
3956 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3957 base class.
3958 * gdb-index.cc: New source file.
3959 * gdb-index.h: New source file.
3960 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3961 and .debug_types sections, call Layout::add_to_gdb_index.
3962 (Sized_relobj_incr::do_section_name): Implement.
3963 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3964 return type; Implement.
3965 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3966 return type.
3967 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3968 parameter list and return type.
3969 (Sized_incr_dynobj::do_section_contents): Likewise.
3970 * layout.cc: Include gdb-index.h.
3971 (Layout::Layout): Initialize gdb_index_data_.
3972 (Layout::init_fixed_output_section): Check for .gdb_index section.
3973 (Layout::add_to_gdb_index): New function. Instantiate.
3974 * layout.h: Add forward declaration for class Gdb_index.
3975 (Layout::add_to_gdb_index): New member function.
3976 (Layout::gdb_index_data_): New data member.
3977 * main.cc: Include gdb-index.h.
3978 (main): Print statistics for gdb index.
3979 * object.cc (Object::section_contents): Move code into
3980 do_section_contents.
3981 (need_decompressed_section): Check for sections needed when building
3982 gdb index.
3983 (build_compressed_section_map): Likewise.
3984 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3985 gdb index.
3986 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3987 sections; call Layout::add_to_gdb_index.
3988 (Sized_relobj_file::do_decompressed_section_contents): Call
3989 do_section_contents directly.
3990 * object.h (Object::do_section_contents): Adjust parameter list and
3991 return type.
3992 (Object::do_decompressed_section_contents): Call do_section_contents
3993 directly.
3994 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3995 return type.
3996 * options.h (class General_options): Add --gdb-index option.
3997 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3998 list and return type.
3999 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4000 * reloc.h (Track_relocs::checkpoint): New function.
4001 (Track_relocs::reset): New function.
4002
4003 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4004 New test cases.
4005 * testsuite/Makefile.in: Regenerate.
4006 * testsuite/gdb_index_test.cc: New test source file.
4007 * testsuite/gdb_index_test_1.sh: New test source file.
4008 * testsuite/gdb_index_test_2.sh: New test source file.
4009
647f1574
DK
40102012-03-19 Doug Kwan <dougkwan@google.com>
4011
4012 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 4013 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
4014 __exidx_start and __exidx_end. Make symbol table parameter
4015 anonymous as it is not used.
4016 * gold.cc (queue_middle_tasks): Call target hook to define any
4017 target-specific symbols.
4018 * target.h (Target::define_standard_symbols): New method.
4019 (Target::do_define_standard_symbols): Same.
4020 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4021 * testsuite/Makefile.in: Regenerate.
4022 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4023 and __exidx_end.
4024 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4025 relocations are generated for __exidx_start and __exidx_end.
4026
7c6109da
DK
40272012-03-16 Doug Kwan <dougkwan@google.com>
4028
4029 * testsuite/Makefile.am: Disable test initpri3b.
4030 * testsuite/Makefile.in: Regenerate.
4031
7b8957f8
DK
40322012-03-15 Doug Kwan <dougkwan@google.com>
4033
4034 * arm.cc (Target_arm::got_section): Make .got section read-only
4035 if -z now is given.
4036
14dc9ef7
ILT
40372012-03-15 Ian Lance Taylor <iant@google.com>
4038
4039 PR gold/13850
4040 * layout.cc (Layout::make_output_section): Correctly mark
4041 SHT_INIT_ARRAY, et. al., as relro.
4042
fa40b62a
DK
40432012-03-14 Doug Kwan <dougkwan@google.com>
4044
4045 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
4046 dynamic relocations for protected symbols in shared objects.
4047
fd325007
ILT
40482012-03-13 Ian Lance Taylor <iant@google.com>
4049
4050 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4051 keep the larger alignment.
4052
e8dd54e1
CC
40532012-03-12 Cary Coutant <ccoutant@google.com>
4054
4055 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4056 handling of DW_LNE_define_file.
4057
feb5f3b0
CC
40582012-03-12 Cary Coutant <ccoutant@google.com>
4059
4060 * reduced_debug_output.cc
4061 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4062 codes to switch.
4063
a1fb4256
CC
40642012-02-29 Cary Coutant <ccoutant@google.com>
4065
4066 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4067
5dd8762a
CC
40682012-02-29 Cary Coutant <ccoutant@google.com>
4069
4070 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4071 Call Object::decompressed_section_contents.
4072 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4073 New dtor.
4074 (Sized_dwarf_line_info::buffer_start_): New data member.
4075 * merge.cc (Output_merge_data::do_add_input_section): Call
4076 Object::decompressed_section_contents.
4077 (Output_merge_string::do_add_input_section): Likewise.
4078 * object.cc (need_decompressed_section): New function.
4079 (build_compressed_section_map): Decompress sections needed later.
4080 (Sized_relobj_file::do_decompressed_section_contents): New function.
4081 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4082 * object.h (Object::decompressed_section_contents): New function.
4083 (Object::discard_decompressed_sections): New function.
4084 (Object::do_decompressed_section_contents): New function.
4085 (Object::do_discard_decompressed_sections): New function.
4086 (Compressed_section_info): New type.
4087 (Compressed_section_map): Include decompressed section contents.
4088 (Sized_relobj_file::do_decompressed_section_contents): New function.
4089 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4090
7b5de7ee
CC
40912012-02-16 Cary Coutant <ccoutant@google.com>
4092
4093 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
4094 * testsuite/Makefile.in: Regenerate.
4095
f9fa4a63
CC
40962012-02-14 Cary Coutant <ccoutant@google.com>
4097
4098 * options.cc (General_options::finalize): Disallow -pie and -static.
4099
2c175ebc
DK
41002012-02-03 Doug Kwan <dougkwan@google.com>
4101
4102 * arm.cc (Arm_relocate_functions::abs8,
4103 Arm_relocate_functions::abs16): Use
4104 Bits::has_signed_unsigned_overflow32.
4105 (Arm_relocate_functions::thm_abs8): Correct range of
4106 overflow check.
4107 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
4108 in assertions.
4109
90cff06f
DK
41102012-02-02 Doug Kwan <dougkwan@google.com>
4111
4112 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
4113 position independent outputs, not just shared objects.
4114
63887f3d
L
41152012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4116
4117 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4118 * configure: Regenerated.
4119
bef2b434
ILT
41202012-01-27 Ian Lance Taylor <iant@google.com>
4121
4122 * reloc.h (Bits): New class with static functions, copied from
4123 namespace utils in arm.cc.
4124 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4125 instead.
4126
c335b55d
L
41272012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4128
4129 * incremental.cc (write_info_blocks): Correct relocation offset.
4130
41194d9f
L
41312012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4132
4133 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4134 (Relocate::tls_gd_to_le): Likewise.
4135
1bae613c
L
41362012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4137
4138 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4139
24482ca0
L
41402012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4141
4142 * configure.ac: Check if -mcmodel=medium works.
4143 * configure: Regenerated.
4144
c2c7840a
CC
41452012-01-24 Cary Coutant <ccoutant@google.com>
4146
4147 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4148 definition and ...
4149 (read_unsigned_LEB_128_x): ... this new function.
4150 (read_signed_LEB_128): Replaced with inline definition and ...
4151 (read_signed_LEB_128_x): ... this new function.
4152 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4153 (read_unsigned_LEB_128): Add inline definition.
4154 (read_signed_LEB_128_x): New function.
4155 (read_signed_LEB_128): Add inline definition.
4156 * testsuite/Makefile.am (leb128_unittest): New unit test.
4157 * testsuite/Makefile.in: Regenerate.
4158 * testsuite/leb128_unittest.cc: New unit test.
4159
833de760 41602012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
4161
4162 PR gold/13617
4163 * i386.cc (Target_i386::do_code_fill): When using a jmp
4164 instruction, pad with nop instructions.
4165 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4166
618d6666
L
41672012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4168
4169 * x86_64.cc (gc_process_relocs): Add typename on types used in
4170 template.
4171 (scan_relocs): Likewise.
4172 (relocate_section): Likewise.
4173 (apply_relocation): Likewise.
4174
3660ff06
L
41752012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4176
4177 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4178 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4179 under x32.
4180
fc51264f
L
41812012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4182
4183 * x86_64.cc: Initial support for x32.
4184
dd74ae06
CC
41852012-01-03 Cary Coutant <ccoutant@google.com>
4186
4187 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4188 Use abstract base class for GOT.
4189 * gold/output.h (class Output_data_got_base): New abstract base class.
4190 (class Output_data_got): Derive from new base class, adjust ctors.
4191 (Output_data_got::reserve_slot): Make virtual; rename to
4192 do_reserve_slot; Adjust callers.
4193 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4194 pointer to abstract base class.
4195 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4196
83896202
ILT
41972011-12-18 Ian Lance Taylor <iant@google.com>
4198
4199 * object.h (Relobj::local_symbol_value): New function.
4200 (Relobj::local_plt_offset): New function.
4201 (Relobj::local_has_got_offset): New function.
4202 (Relobj::local_got_offset): New function.
4203 (Relobj::set_local_got_offset): New function.
4204 (Relobj::do_local_symbol_value): New pure virtual function.
4205 (Relobj::do_local_plt_offset): Likewise.
4206 (Relobj::do_local_has_got_offset): Likewise.
4207 (Relobj::do_local_got_offset): Likewise.
4208 (Relobj::do_set_local_got_offset): Likewise.
4209 (Sized_relobj::do_local_has_got_offset): Rename from
4210 local_has_got_offset.
4211 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4212 (Sized_relobj::do_set_local_got_offset): Rename from
4213 set_local_got_offset.
4214 (Sized_relobj_file::do_local_plt_offset): Rename from
4215 local_plt_offset.
4216 (Sized_relobj_file::do_local_symbol_value): New function.
4217 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4218 local_plt_offset.
4219 * output.cc (Output_data_got::Got_entry::write): Change object to
4220 Relobj. Use local_symbol_value.
4221 (Output_data_got::add_global_with_rel): Change rel_dyn to
4222 Output_data_reloc_generic*. Use add_global_generic.
4223 (Output_data_got::add_global_with_rela): Remove. Change all
4224 callers to use add_global_with_rel.
4225 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4226 Output_data_reloc_generic*. Use add_global_generic.
4227 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4228 callers to use add_global_pair_with_rel.
4229 (Output_data_got::add_local): Change object to Relobj*.
4230 (Output_data_got::add_local_plt): Likewise.
4231 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4232 change rel_dyn to Output_data_reloc_generic*. Use
4233 add_local_generic.
4234 (Output_data_got::add_local_with_rela): Remove. Change all
4235 callers to use all_local_with_rel.
4236 (Output_data_got::add_local_pair_with_rel): Change object to
4237 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4238 add_output_section_generic.
4239 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4240 callers to use add_local_pair_with_rel.
4241 (Output_data_got::reserve_local): Change object to Relobj*.
4242 * output.h: (class Output_data_reloc_generic): Add pure virtual
4243 declarations for add_global_generic, add_local_generic,
4244 add_output_section_generic.
4245 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4246 functions for Output_data_reloc_generic. Update declarations for
4247 changes listed in output.cc.
4248 (class Output_data_got): Change template parameter to got_size.
4249 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4250 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4251 function.
4252 (Sized_relobj_incr::do_local_plt_offset): New function.
4253 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4254 add_global_generic.
4255
76677ad0
CC
42562011-12-17 Cary Coutant <ccoutant@google.com>
4257
4258 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4259 * resolve.cc (Symbol_table::resolve): Likewise.
4260 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4261 arrays.
4262 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4263
8b8dd8d5
ILT
42642011-12-16 Ian Lance Taylor <iant@google.com>
4265
4266 * output.h (Output_data_reloc_generic::add): Only call
4267 add_dynamic_reloc if this is a dynamic reloc section.
4268
d55525b9
L
42692011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4270
4271 PR gold/13505
4272 * target-reloc.h (apply_relocation): Replace <64, false> with
4273 <size, big_endian>.
4274
ff81c7c1
NC
42752011-11-25 Nick Clifton <nickc@redhat.com>
4276
4277 * po/it.po: New Italian translation.
4278
628f39be
SA
42792011-11-17 Sterling Augustine <saugustine@google.com>
4280
4281 * script.cc (script_include_directive): Implement.
4282 (read_script_file): New local variables name and search_path. Update
4283 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4284 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4285 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4286
98ef3ea4
SA
42872011-11-11 Sterling Augustine <saugustine@google.com>
4288
4289 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4290 (file_or_sections_cmd): Likewise.
4291
f4a8b6d7
DK
42922011-11-11 Doug Kwan <dougkwan@google.com>
4293
4294 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4295 if --just-symbols is given.
4296
29ab395d
DK
42972011-11-10 Doug Kwan <dougkwan@google.com>
4298
4299 PR gold/13362
4300 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4301 when processing data relocs.
4302 * reloc.h (Relocate_functions::rel_unaligned): New method.
4303 (Relocate_functions::pcrel_unaligned): Ditto.
4304 (Relocate_functions::rel32_unaligned): Ditto.
4305 (Relocate_functions::pcrel32_unaligned): Ditto.
4306
2c339f71
DK
43072011-11-09 Doug Kwan <dougkwan@google.com>
4308
4309 PR gold/13362
4310 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4311 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4312 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4313 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4314 (Relocate_functions::rel_unaligned): New.
4315 (Relocate_functions::rel32_unaligned): New.
4316 * target-reloc.h (relocate_for_relocatable): Add code to handle
4317 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4318 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4319 arm_unaligned_reloc_r): New targets.
4320 * testsuite/Makefile.in: Regenerate.
4321 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4322 linking.
4323
3f3cddf1
ILT
43242011-11-02 Ian Lance Taylor <iant@google.com>
4325
4326 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4327 NATIVE_LINKER.
4328 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4329 * options.cc (General_options::finalize): Use library search path
4330 from configure script if specified. If not native and no sysroot,
4331 only search TOOLLIBDIR.
4332 * options.h (Search_directory::Search_directory): Change name to
4333 const std::string&.
4334 (General_options::add_to_library_path_with_sysroot): Change arg to
4335 const std::string&.
4336 * configure, Makefile.in, config.in: Rebuild.
4337
a8e2273b
ILT
43382011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4339
4340 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4341 we are working around the ARM1176 Erratum.
4342 * options.h (General_options::fix_arm1176): Add option.
4343 * testsuite/Makefile.am: Add testcases, and keep current ones
4344 working.
4345 * testsuite/Makefile.in: Regenerate.
4346 * testsuite/arm_fix_1176.s: New file.
4347 * testsuite/arm_fix_1176.sh: Likewise.
4348
cd6eab1c
ILT
43492011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4350
4351 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4352 may_use_blx_.
4353 (Target_arm::may_use_blx): Remove method.
4354 (Target_arm::set_may_use_blx): Likewise.
4355 (Target_arm::may_use_v4t_interworking): New method.
4356 (Target_arm::may_use_v5t_interworking): Likewise.
4357 (Target_arm::may_use_blx_): Remove member variable.
4358 (Arm_relocate_functions::arm_branch_common): Check for v5T
4359 interworking.
4360 (Arm_relocate_functions::thumb_branch_common): Likewise.
4361 (Reloc_stub::stub_type_for_reloc): Likewise.
4362 (Target_arm::do_finalize_sections): Correct interworking checks.
4363 * testsuite/Makefile.am: Add new tests.
4364 * testsuite/Makefile.in: Regenerate.
4365 * testsuite/arm_farcall_arm_arm.s: New test.
4366 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4367 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4368 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4369 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4370 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4371 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4372 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4373
286adcf4
CC
43742011-10-31 Cary Coutant <ccoutant@google.com>
4375
4376 PR gold/13023
4377 * expression.cc (Expression::eval_with_dot): Add
4378 is_section_dot_assignment parameter.
4379 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4380 absolute and assigning to dot within a section.
4381 * script-sections.cc
4382 (Output_section_element_assignment::set_section_addresses): Pass
4383 dot_section to set_if_absolute.
4384 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4385 as is_section_dot_assignment flag to eval_with_dot.
4386 (Output_section_element_dot_assignment::set_section_addresses):
4387 Likewise.
4388 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4389 parameter. Also set value if relative to dot_section; set the
4390 symbol's output_section.
4391 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4392 parameter. Adjust all callers.
4393 (Expression::eval_maybe_dot): Likewise.
4394 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4395 Adjust all callers.
4396 * testsuite/script_test_2.t: Test assignment of an absolute value
4397 to dot within an output section element.
4398
9634ed06
CC
43992011-10-31 Cary Coutant <ccoutant@google.com>
4400
4401 * options.h (class General_options): Add --[no-]gnu-unique options.
4402 * symtab.cc (Symbol_table::sized_write_globals): Convert
4403 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4404
de4101c7
CC
44052011-10-31 Cary Coutant <ccoutant@google.com>
4406
4407 PR gold/13359
4408 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4409 unnecessary assertion.
4410 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4411
7257cc92
ST
44122011-10-31 Sriraman Tallam <tmsriram@google.com>
4413
4414 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4415 gc_mark_symbol.
4416 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4417 gc_mark_symbol.
4418 Change to just keep the section associated with symbol.
4419 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4420 they are externally visible and --export-dynamic is turned on.
4421 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4422
bfc34b3f
ILT
44232011-10-19 Ian Lance Taylor <iant@google.com>
4424
4425 PR gold/13163
4426 * script-sections.cc
4427 (Output_section_element_dot_assignment::needs_output_section): New
4428 function.
4429
ea0d8c47
ILT
44302011-10-19 Ian Lance Taylor <iant@google.com>
4431
4432 PR gold/13204
4433 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4434 --section-start option was seen.
4435 * options.h (General_options::any_section_start): New function.
4436
abd242a9
DM
44372011-10-18 David S. Miller <davem@davemloft.net>
4438
4439 PR binutils/13301
4440 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4441 member to track relocation locations that have moved during TLS
4442 reloc optimizations.
4443 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4444 (Target_sparc::Relocate::relocate): Adjust view down by 4
4445 bytes if it matches reloc_adjust_addr_.
4446 (Target_sparc::Relocate::relocate_tls): Always move the
4447 __tls_get_addr call delay slot instruction forward 4 bytes when
4448 performing relaxation.
4449
bab9090f
CC
44502011-10-18 Cary Coutant <ccoutant@google.com>
4451
4452 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4453 (Output_file::map_no_anonymous): Check for non-zero
4454 return code from posix_fallocate.
4455
f7c5b166
CC
44562011-10-17 Cary Coutant <ccoutant@google.com>
4457
4458 PR gold/13245
4459 * plugin.cc (is_visible_from_outside): Check for symbols
4460 referenced from dynamic objects.
4461 * resolve.cc (Symbol_table::resolve): Don't count references
4462 from dynamic objects as references from real ELF files.
4463 * testsuite/plugin_test_2.sh: Adjust expected result.
4464
b490c0bb
CC
44652011-10-17 Cary Coutant <ccoutant@google.com>
4466
4467 * gold.cc: Include timer.h.
4468 (queue_middle_tasks): Stamp time.
4469 (queue_final_tasks): Likewise.
4470 * main.cc (main): Store timer in parameters. Print timers
4471 for each pass.
4472 * parameters.cc (Parameters::Parameters): Initialize timer_.
4473 (Parameters::set_timer): New function.
4474 (set_parameters_timer): New function.
4475 * parameters.h (Parameters::set_timer): New function.
4476 (Parameters::timer): New function.
4477 (Parameters::timer_): New data member.
4478 (set_parameters_timer): New function.
4479 * timer.cc (Timer::stamp): New function.
4480 (Timer::get_pass_time): New function.
4481 * timer.h (Timer::stamp): New function.
4482 (Timer::get_pass_time): New function.
4483 (Timer::pass_times_): New data member.
4484
f475cf7b
CC
44852011-10-17 Cary Coutant <ccoutant@google.com>
4486
4487 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4488 task for members of lib groups.
4489
cdd7e244
CC
44902011-10-17 Cary Coutant <ccoutant@google.com>
4491
4492 PR gold/13288
4f95c8b4 4493 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
4494 (File_read::make_view): Move bounds check (replace with assert)...
4495 (File_read::find_or_make_view): ... to here.
4496
dfb45471
CC
44972011-10-12 Cary Coutant <ccoutant@google.com>
4498
4f95c8b4 4499 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
4500 ::read returns less than requested size.
4501
53bbcc1b
CC
45022011-10-10 Cary Coutant <ccoutant@google.com>
4503
4f95c8b4 4504 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
4505 Initialize defined_count_.
4506 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4507 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4508 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4509 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4510 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4511 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4512 member.
4513 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4514 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4515 Return zeroes instead of internal error.
4516
397b129b
CC
45172011-10-10 Cary Coutant <ccoutant@google.com>
4518
4519 PR gold/13249
4f95c8b4 4520 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4521 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4522 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4523 (Output_reloc::type_): Adjust size of bit field.
4524 (Output_reloc::use_plt_offset_): New bit field.
4525 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4526 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4527 flag. Adjust all callers.
4f95c8b4 4528 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4529 creating RELATIVE relocations.
4530
d5698657
NC
45312011-10-10 Nick Clifton <nickc@redhat.com>
4532
4533 * po/es.po: Updated Spanish translation.
4534 * po/fi.po: Updated Finnish translation.
4535
6a59a5c2
DN
45362011-10-03 Diego Novillo <dnovillo@google.com>
4537
4538 * options.cc (parse_uint): Fix dereference of RETVAL.
4539
f0558624
ST
45402011-09-29 Sriraman Tallam <tmsriram@google.com>
4541
4542 * layout.h (section_order_map_): New member.
4543 (get_section_order_map): New member function.
4544 * output.cc (Output_section::add_input_section): Check for patterns
4545 only when --section-ordering-file is specified.
4546 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4547 output_sections have been formed.
4548 * layout.cc (Layout_Layout): Initialize section_order_map_.
4549 * plugin.cc (update_section_order): Store order in order_map. Do not
4550 update the order.
4551 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4552 * testsuite/Makefile.in: Regenerate.
4553 * testsuite/plugin_section_order.c: New file.
4554 * testsuite/plugin_final_layout.cc: New file.
4555 * testsuite/plugin_final_layout.sh: New file.
4556
a7dac153
CC
45572011-09-29 Cary Coutant <ccoutant@google.com>
4558
4f95c8b4 4559 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4560 Check for NULL.
4f95c8b4 4561 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4562 symbols during incremental update.
4563 (Symbol_table::add_from_dynobj): Likewise.
4564
eebd87a5
ILT
45652011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4566 Ian Lance Taylor <iant@google.com>
4567
4568 * symtab.cc (Symbol_table::define_special_symbol): Always
4569 canonicalize version string.
4570
403a3331
CC
45712011-09-26 Cary Coutant <ccoutant@google.com>
4572
4f95c8b4
CC
4573 * gold.cc (queue_initial_tasks): Move option checks ...
4574 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
4575 some options; make others fatal.
4576
235061c2
CC
45772011-09-26 Cary Coutant <ccoutant@google.com>
4578
4579 gcc PR lto/47247
4580 * plugin.cc (get_symbols_v2): New function.
4581 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4582 (is_referenced_from_outside): New function.
4583 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4584 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4585 (get_symbols): Pass version parameter.
4586 (get_symbols_v2): New function.
4587 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4588 parameter.
4589 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4590 (onload): Add LDPT_GET_SYMBOLS_V2.
4591 (all_symbols_read_hook): Use get_symbols_v2; check for
4592 LDPR_PREVAILING_DEF_IRONLY_EXP.
4593 * testsuite/plugin_test_3.sh: Update expected results.
4594
dc87f620
ILT
45952011-09-23 Simon Baldwin <simonb@google.com>
4596
4597 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4598 configuration options.
4599 * configure: Regenerate.
4600 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4601 * Makefile.in: Regenerate.
4602 * testsuite/Makefile.in: Regenerate.
4603
a8279f82
ST
46042011-09-19 Sriraman Tallam <tmsriram@google.com>
4605
4606 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4607
0c9350c8
CC
46082011-09-19 Cary Coutant <ccoutant@google.com>
4609
4610 * incremental.cc (can_incremental_update): Fix typo in comment.
4611 * incremental.h (can_incremental_update): Likewise.
4612
aa06ae28
CC
46132011-09-18 Cary Coutant <ccoutant@google.com>
4614
4615 * incremental.cc (can_incremental_update): New function.
4616 * incremental.h (can_incremental_update): New function.
4617 * layout.cc (Layout::init_fixed_output_section): Call it.
4618 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4619 * object.cc (Sized_relobj_file::do_layout): Call
4620 can_incremental_update.
4621
ebb300b2
CC
46222011-09-13 Cary Coutant <ccoutant@google.com>
4623
4624 * configure.ac: Check for glibc support for gnu_indirect_function
4625 support with static linking, setting automake conditional
4626 IFUNC_STATIC.
4627 * Makefile.in: Regenerate.
4628 * configure: Regenerate.
4629
4630 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4631 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4632 for IFUNC_STATIC.
4633 * testsuite/Makefile.in: Regenerate.
4634
1206d0d5
CC
46352011-09-13 Cary Coutant <ccoutant@google.com>
4636
4637 * incremental.cc (Sized_relobj_incr::do_layout): Call
4638 report_comdat_group for kept comdat sections.
4639 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4640 * testsuite/Makefile.in: Regenerate.
4641 * testsuite/incr_comdat_test_1.cc: New source file.
4642 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4643 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4644 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4645
40b29874
ILT
46462011-09-13 Ian Lance Taylor <iant@google.com>
4647
4648 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4649 variable external_symbols_offset.
4650
1b045aac
ILT
46512011-09-12 Ian Lance Taylor <iant@google.com>
4652
4653 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4654 triggered if object has no symbols.
4655
24c6c55a
DM
46562011-09-09 David S. Miller <davem@davemloft.net>
4657
4658 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4659 (Output_fill_debug_line::do_write): Likewise.
4660
66570254
CC
46612011-08-29 Cary Coutant <ccoutant@google.com>
4662
4663 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4664 casts to match formatting specs.
4665 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4666
8ea8cd50
CC
46672011-08-26 Cary Coutant <ccoutant@google.com>
4668
4669 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4670 remaining hole size when allocating.
4671 (Layout::make_output_section): Set fill methods for debug sections.
4672 * layout.h (Free_list::Free_list_node): Move from private to
4673 public.
4674 (Free_list::set_min_hole_size): New function.
4675 (Free_list::begin, Free_list::end): New functions.
4676 (Free_list::min_hole_): New data member.
4677 * output.cc: Include dwarf.h.
4678 (Output_fill_debug_info::do_minimum_hole_size): New function.
4679 (Output_fill_debug_info::do_write): New function.
4680 (Output_fill_debug_line::do_minimum_hole_size): New function.
4681 (Output_fill_debug_line::do_write): New function.
4682 (Output_section::Output_section): Initialize new data member.
4683 (Output_section::set_final_data_size): Ensure patch space is larger
4684 than minimum hole size.
4685 (Output_section::do_write): Fill holes in debug sections.
4686 * output.h (Output_fill): New class.
4687 (Output_fill_debug_info): New class.
4688 (Output_fill_debug_line): New class.
4689 (Output_section::set_free_space_fill): New function.
4690 (Output_section::free_space_fill_): New data member.
4691 * testsuite/Makefile.am (incremental_test_3): Add
4692 --incremental-patch option.
4693 (incremental_test_4): Likewise.
4694 (incremental_test_5): Likewise.
4695 (incremental_test_6): Likewise.
4696 (incremental_copy_test): Likewise.
4697 (incremental_common_test_1): Likewise.
4698 * testsuite/Makefile.in: Regenerate.
4699
7cf80422
NC
47002011-08-26 Nick Clifton <nickc@redhat.com>
4701
4702 * po/es.po: Updated Spanish translation.
4703
c3f7b0e5
CC
47042011-08-01 Cary Coutant <ccoutant@google.com>
4705
4706 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4707 * gold/testsuite/Makefile.in: Regenerate.
4708 * gold/testsuite/justsyms_exec.c: New source file.
4709 * gold/testsuite/justsyms_lib.c: New source file.
4710
9590bf25
CC
47112011-08-01 Cary Coutant <ccoutant@google.com>
4712
4713 * layout.cc (Layout::set_segment_offsets): Don't realign text
4714 segment if -Ttext was specified.
4715 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4716 file type.
4717 * object.h (Sized_relobj_file::e_type): New function.
4718 (Sized_relobj_file::e_type_): New data member.
4719 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4720 base address for ET_EXEC files.
4721 * target.cc (Target::do_make_elf_object_implementation): Allow
4722 ET_EXEC files with --just-symbols option.
4723
dcd8d12e
CC
47242011-07-28 Cary Coutant <ccoutant@google.com>
4725
4726 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4727 Add thread_number parameter.
4728 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4729 * workqueue-threads.cc
4730 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4731 current thread if its thread number is greater than desired thread
4732 count.
4733 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4734 Add thread_number parameter.
4735 (Workqueue::should_cancel_thread): Likewise.
4736 (Workqueue::find_runnable_or_wait): Pass thread_number to
4737 should_cancel_thread.
4738 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4739 parameter.
4740
804eb480
ST
47412011-07-22 Sriraman Tallam <tmsriram@google.com>
4742
4743 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4744 only after checking if it cannot be forced local.
4745 * symtab.h (is_externally_visible): Check if the symbol is not forced
4746 local.
4747
f1ddb600
ILT
47482011-07-15 Ian Lance Taylor <iant@google.com>
4749
4750 * options.h (class General_options): Add --print-output-format.
4751 Move -EL next to -EB, for better --help output.
4752 * target-select.cc: Include <cstdio>, "options.h", and
4753 "parameters.h".
4754 (Target_selector::do_target_bfd_name): New function.
4755 (print_output_format): New function.
4756 * target-select.h (class Target_selector): Update declarations.
4757 (Target_selector::target_bfd_name): New function.
4758 (print_output_format): Declare.
4759 * main.cc: Include "target-select.h".
4760 (main): Handle --print-output-format.
4761 * gold.cc: Include "target-select.h".
4762 (queue_initial_tasks): Handle --print-output-format when there are
4763 no input files.
4764 * parameters.cc (parameters_force_valid_target): Give a better
4765 error message if -EB/-EL does not match target.
4766 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4767 function.
4768
7d172687
ILT
47692011-07-15 Ian Lance Taylor <iant@google.com>
4770
4771 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4772 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4773 (Output_data_plt_i386::do_write): Write address of .dynamic
4774 section to first entry in .got.plt section.
4775 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4776 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4777 Initialize layout_.
4778 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4779 section to first entry in .got.plt section.
4780 * layout.h (Layout::dynamic_section): New function.
4781
e9552f7e
ST
47822011-07-13 Sriraman Tallam <tmsriram@google.com>
4783
4784 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4785 to claim_file call.
4786 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4787 input_section_position_, and input_section_glob_.
4788 (read_layout_from_file): Call function section_ordering_specified.
4789 * layout.h (is_section_ordering_specified): New function.
4790 (section_ordering_specified): New function.
4791 (section_ordering_specified_): New boolean member.
4792 * main.cc(main): Call load_plugins after layout object is defined.
4793 * output.cc (Output_section::add_input_section): Use
4794 function section_ordering_specified to check if section ordering is
4795 needed.
4796 * output.cc (Output_section::add_relaxed_input_section): Use
4797 function section_ordering_specified to check if section ordering is
4798 needed.
4799 (Output_section::update_section_layout): New function.
4800 (Output_section::sort_attached_input_sections): Check if input section
4801 must be reordered.
4802 * output.h (Output_section::update_section_layout): New function.
4803 * plugin.cc (get_section_count): New function.
4804 (get_section_type): New function.
4805 (get_section_name): New function.
4806 (get_section_contents): New function.
4807 (update_section_order): New function.
58797674 4808 (allow_section_ordering): New function.
e9552f7e
ST
4809 (Plugin::load): Add the new interfaces to the transfer vector.
4810 (Plugin_manager::load_plugins): New parameter.
4811 (Plugin_manager::all_symbols_read): New parameter.
4812 (Plugin_manager::claim_file): New parameter. Save the elf object for
4813 unclaimed objects.
4814 (Plugin_manager::get_elf_object): New function.
4815 (Plugin_manager::get_view): Change to directly use the bool to check
4816 if get_view is called from claim_file_hook.
4817 * plugin.h (input_objects): New function
4818 (Plugin__manager::load_plugins): New parameter.
4819 (Plugin_manager::claim_file): New parameter.
4820 (Plugin_manager::get_elf_object): New function.
4821 (Plugin_manager::in_claim_file_handler): New function.
4822 (Plugin_manager::in_claim_file_handler_): New member.
4823 (layout): New function.
4824 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4825 handler with an extra parameter. Make the elf object before calling
4826 claim_file handler.
4827 * testsuite/plugin_test.c (get_section_count): New function pointer.
4828 (get_section_type): New function pointer.
4829 (get_section_name): New function pointer.
4830 (get_section_contents): New function pointer.
4831 (update_section_order): New function pointer.
4832 (allow_section_ordering): New function pointer.
4833 (onload): Check if the new interfaces exist.
4834
9446efde
ILT
48352011-07-13 Ian Lance Taylor <iant@google.com>
4836
4837 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4838 relro section.
4839 * x86_64.cc (Target_x86_64::got_section): Likewise.
4840 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4841 (relro_now_test_SOURCES): New variable.
4842 (relro_now_test_DEPENDENCIES): New variable.
4843 (relro_now_test_LDFLAGS): New variable.
4844 (relro_now_test_LDADD): New variable.
4845 (relro_now_test.so): New target.
4846 * testsuite/Makefile.in: Rebuild.
4847
07aa62f2
ILT
48482011-07-12 Ian Lance Taylor <iant@google.com>
4849
4850 PR gold/12980
4851 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4852 GLOB_DAT relocation rather than a RELATIVE relocation for a
4853 protected symbol when creating a shared library.
4854 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4855 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4856 * testsuite/protected_main_1.cc (main): Test that protected
4857 function has same address.
4858
e2153196
ILT
48592011-07-11 Ian Lance Taylor <iant@google.com>
4860
4861 PR gold/12979
4862 * options.h (class General_options): Add -Bgroup.
4863 * options.cc (General_options::finalize): If -Bgroup is set,
4864 default to --unresolved-symbols=report-all.
4865 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4866 * target-reloc.h (issue_undefined_symbol_error): Handle
4867 --unresolved-symbols=report-all.
4868
6daf5215
ILT
48692011-07-08 Ian Lance Taylor <iant@google.com>
4870
4871 PR gold/11985
4872 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4873 if linker script discards key sections.
4874 (Layout::create_dynamic_symtab): Likewise.
4875 (Layout::assign_local_dynsym_offsets): Likewise.
4876 (Layout::sized_create_version_sections): Likewise.
4877 (Layout::create_interp): Likewise.
4878 (Layout::finish_dynamic_section): Likewise.
4879 (Layout::set_dynamic_symbol_size): Likewise.
4880
beabb2c6
ILT
48812011-07-08 Ian Lance Taylor <iant@google.com>
4882
4883 PR gold/12386
4884 * options.h (class General_options): Add --unresolved-symbols.
4885 * target-reloc.h (issue_undefined_symbol_error): Check
4886 --unresolved-symbols. Add comments.
4887
9c16daf1
ILT
48882011-07-08 Ian Lance Taylor <iant@google.com>
4889
4890 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4891 expression more complex.
4892
191f1a2d
ILT
48932011-07-08 Ian Lance Taylor <iant@google.com>
4894
4895 PR gold/11317
4896 * target-reloc.h (issue_undefined_symbol_error): New inline
4897 function, broken out of relocate_section.
4898 (relocate_section): Call issue_undefined_symbol_error.
4899 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4900 there is no TLS segment if we are about to issue an undefined
4901 symbol error.
4902 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4903
62855347
ILT
49042011-07-08 Ian Lance Taylor <iant@google.com>
4905
4906 PR gold/12279
4907 * resolve.cc (Symbol_table::should_override): Add fromtype
4908 parameter. Change all callers. Give error when linking together
4909 TLS and non-TLS symbol.
4910 (Symbol_table::should_override_with_special): Add fromtype
4911 parameter. Change all callers.
4912 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4913 there is no TLS segment if we have reported some errors.
4914 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4915
67181c72
ILT
49162011-07-08 Ian Lance Taylor <iant@google.com>
4917
4918 PR gold/12372
4919 * target.h (Target::plt_address_for_global): New function.
4920 (Target::plt_address_for_local): New function.
4921 (Target::plt_section_for_global): Remove.
4922 (Target::plt_section_for_local): Remove.
4923 (Target::do_plt_address_for_global): New virtual function.
4924 (Target::do_plt_address_for_local): New virtual function.
4925 (Target::do_plt_section_for_global): Remove.
4926 (Target::do_plt_section_for_local): Remove.
4927 (Target::register_global_plt_entry): Add Symbol_table and Layout
4928 parameters.
4929 * output.cc (Output_data_got::Got_entry::write): Use
4930 plt_address_for_global and plt_address_for_local.
4931 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4932 address of output section.
4933 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4934 got_irelative_, and irelative_count_ fields. Update
4935 declarations.
4936 (Output_data_plt_i386::has_irelative_section): New function.
4937 (Output_data_plt_i386::entry_count): Add irelative_count_.
4938 (Output_data_plt_i386::set_final_data_size): Likewise.
4939 (class Target_i386): Add got_irelative_ and rel_irelative_
4940 fields. Update declarations.
4941 (Target_i386::Target_i386): Initialize new fields.
4942 (Target_i386::do_plt_address_for_global): New function replacing
4943 do_plt_section_for_global.
4944 (Target_i386::do_plt_address_for_local): New function replacing
4945 do_plt_section_for_local.
4946 (Target_i386::got_section): Create got_irelative_.
4947 (Target_i386::rel_irelative_section): New function.
4948 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4949 fields. Don't define __rel_iplt_{start,end}.
4950 (Output_data_plt_i386::add_entry): Add symtab and layout
4951 parameters. Change all callers. Use different PLT and GOT for
4952 IFUNC symbols.
4953 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4954 layout parameters. Change all callers. Use different PLT and
4955 GOT.
4956 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4957 (Output_data_plt_i386::rel_irelative): New function.
4958 (Output_data_plt_i386::address_for_global): New function.
4959 (Output_data_plt_i386::address_for_local): New function.
4960 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4961 IRELATIVE GOT when changing IFUNC GOT entries.
4962 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4963 reloc.
4964 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4965 if we didn't create an IRELATIVE GOT.
4966 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4967 plt_address_for_local.
4968 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4969 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4970 got_irelative_, and irelative_count_ fields. Update
4971 declarations.
4972 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4973 Initialize new fields. Remove symtab parameter. Change all
4974 callers.
4975 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4976 irelative_count_.
4977 (Output_data_plt_x86_64::has_irelative_section): New function.
4978 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4979 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4980 fields. Update declarations.
4981 (Target_x86_64::Target_x86_64): Initialize new fields.
4982 (Target_x86_64::do_plt_address_for_global): New function replacing
4983 do_plt_section_for_global.
4984 (Target_x86_64::do_plt_address_for_local): New function replacing
4985 do_plt_section_for_local.
4986 (Target_x86_64::got_section): Create got_irelative_.
4987 (Target_x86_64::rela_irelative_section): New function.
4988 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4989 all callers. Don't create __rel_iplt_{start,end}.
4990 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4991 parameters. Change all callers. Use different PLT and GOT for
4992 IFUNC symbols.
4993 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4994 layout parameters. Change all callers. Use different PLT and
4995 GOT.
4996 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4997 parameters. Change all callers. Use different PLT and GOT for
4998 IFUNC symbols.
4999 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5000 (Output_data_plt_x86_64::rela_irelative): New function.
5001 (Output_data_plt_x86_64::address_for_global): New function.
5002 (Output_data_plt_x86_64::address_for_local): New function.
5003 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5004 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5005 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5006 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5007 parameters.
5008 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5009 reloc.
5010 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5011 symbols if we didn't create an IRELATIVE GOT.
5012 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5013 plt_address_for_local.
5014 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5015 * testsuite/ifuncvar1.c: New test file.
5016 * testsuite/ifuncvar2.c: New test file.
5017 * testsuite/ifuncvar3.c: New test file.
5018 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5019 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5020 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5021 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5022 * testsuite/Makefile.in: Rebuild.
5023
33c15b45
CC
50242011-07-07 Cary Coutant <ccoutant@google.com>
5025
5026 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5027 (two_file_test_1_ndebug.o): Likewise.
5028 (two_file_test_1b_ndebug.o): Likewise.
5029 (two_file_test_2_ndebug.o): Likewise.
5030 (two_file_test_main_ndebug.o): Likewise.
5031 (incremental_test_2): Link with no-debug versions.
5032
f48b5fb7
CC
50332011-07-06 Cary Coutant <ccoutant@google.com>
5034
5035 * gold/incremental.cc
5036 (Output_section_incremental_inputs::write_info_blocks): Check for
5037 hidden and internal symbols.
5038
221597a5
CC
50392011-07-06 Cary Coutant <ccoutant@google.com>
5040
5041 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5042 Check disposition for startup file.
5043 (Incremental_inputs::report_command_line): Ignore
5044 --incremental-startup-unchanged option.
5045 * options.cc (General_options::parse_incremental_startup_unchanged):
5046 New function.
5047 (General_options::General_options): Initialize new data member.
5048 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
5049 (General_options): Add --incremental-startup-unchanged option.
5050 (General_options::incremental_startup_disposition): New function.
5051 (General_options::incremental_startup_disposition_): New data member.
5052
e24719f6
CC
50532011-07-06 Cary Coutant <ccoutant@google.com>
5054
5055 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5056 input file index to Script_info ctor.
5057 (Sized_incremental_binary::do_file_has_changed): Find the
5058 command-line argument for files named in scripts.
5059 * incremental.h (Script_info::Script_info): New ctor
5060 with input file index.
5061 (Script_info::input_file_index): New function.
5062 (Script_info::input_file_index_): New data member.
5063 (Incremental_binary::get_library): Add const.
5064 (Incremental_binary::get_script_info): Add const.
5065 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5066 * testsuite/Makefile.am (incremental_test_5): New test case.
5067 (incremental_test_6): New test case.
5068 * testsuite/Makefile.in: Regenerate.
5069
8f7c81e8
CC
50702011-07-06 Cary Coutant <ccoutant@google.com>
5071
5072 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5073 debug output when command lines differ.
5074
9fbd3822
CC
50752011-07-06 Cary Coutant <ccoutant@google.com>
5076
5077 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5078 --incremental-patch option.
5079 * layout.cc (Free_list::allocate): Extend allocation beyond original
5080 end if enabled.
5081 (Layout::make_output_section): Mark sections that should get
5082 patch space.
5083 * options.cc (parse_percent): New function.
5084 * options.h (parse_percent): New function.
5085 (DEFINE_percent): New macro.
5086 (General_options): Add --incremental-patch option.
5087 * output.cc (Output_section::Output_section): Initialize new data
5088 members.
5089 (Output_section::add_input_section): Print section name when out
5090 of patch space.
5091 (Output_section::add_output_section_data): Likewise.
5092 (Output_section::set_final_data_size): Add patch space when
5093 doing --incremental-full.
5094 (Output_section::do_reset_address_and_file_offset): Remove patch
5095 space.
5096 (Output_segment::set_section_list_addresses): Print debug output
5097 only if --incremental-update.
5098 * output.h (Output_section::set_is_patch_space_allowed): New function.
5099 (Output_section::is_patch_space_allowed_): New data member.
5100 (Output_section::patch_space_): New data member.
5101 * parameters.cc (Parameters::incremental_full): New function.
5102 * parameters.h (Parameters::incremental_full): New function
5103 * testsuite/Makefile.am (incremental_test_2): Add test for
5104 --incremental-patch option.
5105 * testsuite/Makefile.in: Regenerate.
5106 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
5107 (t18): Remove function body.
5108
f6cccc2c
DK
51092011-07-05 Doug Kwan <dougkwan@google.com>
5110
5111 PR gold/12771
5112 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
5113 Arm_Address type for relocation result.
5114 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
5115 overflow check.
5116 (Arm_relocate_functions::abs32): Use unaligned access.
5117 (Arm_relocate_functions::rel32): Ditto.
5118 (Arm_relocate_functions::prel31): Ditto.
5119 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5120 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5121 static data relocations.
5122 * testsuite/Makefile.in: Regnerate.
5123 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5124
28a13fec
ILT
51252011-07-05 Ian Lance Taylor <iant@google.com>
5126
5127 PR gold/12392
5128 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5129 symbols if necessary.
5130 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5131
24d47b34
ILT
51322011-07-05 Ian Lance Taylor <iant@google.com>
5133
5134 PR gold/12952
5135 * resolve.cc (Symbol::override_base_with_special): Simply override
5136 version with special symbol version, ignoring previous version.
5137
41f9cbbe
ILT
51382011-07-05 Ian Lance Taylor <iant@google.com>
5139
5140 * object.cc (Sized_relobj_file::include_section_group): Add
5141 information to comment about signature location.
5142
886288f1
ILT
51432011-07-02 Ian Lance Taylor <iant@google.com>
5144
5145 PR gold/12957
5146 * options.h (class General_options): Add -f and -F.
5147 * options.cc (General_options::finalize): Fatal error if -f/-F
5148 are used without -shared.
5149 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5150
ae3a6d4f
ILT
51512011-07-02 Ian Lance Taylor <iant@google.com>
5152
5153 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5154
21131061
ILT
51552011-07-01 Ian Lance Taylor <iant@google.com>
5156
5157 PR gold/12525
5158 PR gold/12952
5159 * resolve.cc (Symbol::override_base_with_special): Don't override
5160 the version if the overriding symbol has a different name.
5161 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5162 all callers. If we give an error about an undefined version,
5163 define the base version if necessary.
5164 * dynobj.h (class Versions): Update declaration.
5165 * testsuite/weak_alias_test_5.cc: New file.
5166 * testsuite/weak_alias_test.script: New file.
5167 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5168 and versioned_alias have the right value, and call t2.
5169 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5170 weak_alias_test_5.so.
5171 (weak_alias_test_LDADD): Likewise.
5172 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5173 * testsuite/Makefile.in: Rebuild.
5174
611062c0
ILT
51752011-07-01 Ian Lance Taylor <iant@google.com>
5176
5177 PR gold/12525
5178 * options.h (class General_options): Support -z notext.
5179 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5180 -Wl,-z,notext.
5181 (two_file_shared_nonpic.so): Likewise.
5182 (two_file_shared_mixed.so): Likewise.
5183 (two_file_shared_mixed_1.so): Likewise.
5184 (weak_undef_lib_nonpic.so): Likewise.
5185 (alt/weak_undef_lib_nonpic.so): Likewise.
5186 (tls_test_shared_nonpic.so): Likewise.
5187 * testsuite/Makefile.in: Rebuild.
5188
328c7c2f
ILT
51892011-07-01 Ian Lance Taylor <iant@google.com>
5190
5191 PR gold/12525
5192 * configure.ac: Test whether static linking works, setting
5193 the automake conditional HAVE_STATIC.
5194 * testsuite/Makefile.am: Disable tests using -static if
5195 HAVE_STATIC is not true.
5196 * configure, testsuite/Makefile.in: Rebuild.
5197
02d7cd44
ILT
51982011-07-01 Ian Lance Taylor <iant@google.com>
5199
5200 PR gold/12525
5201 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5202 Assert if we see DW_EH_PE_indirect.
5203 * target.h (Target::ehframe_datarel_base): New function.
5204 (Target::do_ehframe_datarel_base): New target function.
5205 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5206 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5207 function.
5208
07a60597
ILT
52092011-07-01 Ian Lance Taylor <iant@google.com>
5210
5211 PR gold/12571
5212 * options.h (class General_options): Add
5213 --ld-generated-unwind-info.
5214 * ehframe.cc (Fde::write): Add address parameter. Change all
5215 callers. If associated with PLT, fill in address and size.
5216 (Cie::set_output_offset): Only add merge mapping if there is an
5217 object.
5218 (Cie::write): Add address parameter. Change all callers.
5219 (Eh_frame::add_ehframe_for_plt): New function.
5220 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5221 input_offset_ fields into union u_, with new plt field.
5222 (Fde::Fde): Adjust for new union field.
5223 (Fde::Fde) [Output_data version]: New constructor.
5224 (Fde::add_mapping): Only add merge mapping if there is an object.
5225 (class Cie): Update declarations.
5226 (class Eh_frame): Declare add_ehframe_for_plt.
5227 * layout.cc (Layout::layout_eh_frame): Break out code into
5228 make_eh_frame_section, and call it.
5229 (Layout::make_eh_frame_section): New function.
5230 (Layout::add_eh_frame_for_plt): New function.
5231 * layout.h (class Layout): Update declarations.
5232 * merge.cc (Merge_map::add_mapping): Add assertion.
5233 * i386.cc: Include "dwarf.h".
5234 (class Output_data_plt_i386): Make first_plt_entry,
5235 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5236 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5237 and plt_eh_frame_fde.
5238 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5239 boundary. Call add_eh_frame_for_plt if appropriate.
5240 * x86_64.cc: Include "dwarf.h".
5241 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5242 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5243 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5244 and plt_eh_frame_fde.
5245 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5246 appropriate.
5247
14788a3f
ILT
52482011-06-29 Ian Lance Taylor <iant@google.com>
5249
5250 PR gold/12629
5251 * object.cc (Sized_relobj_file::layout_section): Change shdr
5252 parameter to be const.
5253 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5254 out of do_layout.
5255 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5256 appropriate. Call layout_eh_frame_section.
5257 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5258 sections.
5259 * object.h (class Sized_relobj_file): Update declarations.
5260
6c21fce1
ILT
52612011-06-29 Ian Lance Taylor <iant@google.com>
5262
37e41b03 5263 PR gold/12652
6c21fce1
ILT
5264 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5265 modifier.
5266 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5267
4d5e4e62
ILT
52682011-06-29 Ian Lance Taylor <iant@google.com>
5269
5270 PR gold/12675
5271 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5272 SHT_X86_64_UNWIND.
5273 * layout.cc (Layout::layout_eh_frame): Likewise.
5274
886f533a
ILT
52752011-06-29 Ian Lance Taylor <iant@google.com>
5276
5277 PR gold/12695
5278 * layout.cc (Layout::symtab_section_shndx): New function.
5279 * layout.h (class Layout): Declare symtab_section_shndx.
5280 * output.cc (Output_section::write_header): Call it.
5281
f3ae1b28
ILT
52822011-06-29 Ian Lance Taylor <iant@google.com>
5283
5284 PR gold/12818
5285 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5286 symbols which are not used in a relocation.
5287
aecf301f
ILT
52882011-06-28 Ian Lance Taylor <iant@google.com>
5289
5290 PR gold/12898
5291 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5292 script create indistinguishable segments.
5293 (Layout::set_segment_offsets): Use stable_sort when sorting
5294 segments. Pass this to Compare_segments constructor.
5295 * layout.h (class Layout): Make segment_precedes non-static.
5296 (class Compare_segments): Change from struct to class. Add
5297 layout_ field. Add constructor.
5298 * script-sections.cc
5299 (Script_sections::attach_sections_using_phdrs_clause): Rename
5300 local orphan to is_orphan. Don't report failure to put empty
5301 section in segment. On attachment failure, report name of
5302 section, and attach to first PT_LOAD segment.
5303
03ef7571
ILT
53042011-06-28 Ian Lance Taylor <iant@google.com>
5305
5306 PR gold/12934
5307 * target-select.cc (Target_selector::Target_selector): Add
5308 emulation parameter. Change all callers.
5309 (select_target_by_bfd_name): Rename from select_target_by_name.
5310 Change all callers.
5311 (select_target_by_emulation): New function.
5312 (supported_emulation_names): New function.
5313 * target-select.h (class Target_selector): Add emulation_ field.
5314 Update declarations.
5315 (Target_selector::recognize_by_bfd_name): Rename from
5316 recognize_by_name. Change all callers.
5317 (Target_selector::supported_bfd_names): Rename from
5318 supported_names. Change all callers.
5319 (Target_selector::recognize_by_emulation): New function.
5320 (Target_selector::supported_emulations): New function.
5321 (Target_selector::emulation): New function.
5322 (Target_selector::do_recognize_by_bfd_name): Rename from
5323 do_recognize_by_name. Change all callers.
5324 (Target_selector::do_supported_bfd_names): Rename from
5325 do_supported_names. Change all callers.
5326 (Target_selector::do_recognize_by_emulation): New function.
5327 (Target_selector::do_supported_emulations): New function.
5328 (select_target_by_bfd_name): Change name in declaration.
5329 (select_target_by_emulation): Declare.
5330 (supported_emulation_names): Declare.
5331 * parameters.cc (parameters_force_valid_target): Try to find
5332 target based on emulation from -m option.
5333 * options.h (class General_options): Change doc string for -m.
5334 * options.cc (help): Print emulations.
5335 (General_options::parse_V): Likewise.
5336 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5337 Add emulation parameter. Change all callers.
5338
200b2bb9
ILT
53392011-06-28 Ian Lance Taylor <iant@google.com>
5340
5341 * target.h (class Target): Add osabi_ field.
5342 (Target::osabi): New function.
5343 (Target::set_osabi): New function.
5344 (Target::Target): Initialize osabi_.
5345 (Target::do_adjust_elf_header): Make pure virtual.
5346 (Sized_target::do_adjust_elf_header): Declare.
5347 * target.cc (Sized_target::do_adjust_elf_header): New function.
5348 (class Sized_target): Instantiate all versions.
5349 * freebsd.h (class Target_freebsd): Remove.
5350 (Target_selector_freebsd::do_recognize): Call set_osabi on
5351 Target.
5352 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5353 (Target_selector_freebsd::set_osabi): Remove.
5354 * i386.cc (class Target_i386): Inherit from Sized_target rather
5355 than Target_freebsd.
5356 * x86_64.cc (class Target_x86_64): Likewise.
5357
b3ce541e
ILT
53582011-06-28 Ian Lance Taylor <iant@google.com>
5359
5360 * target.h (Target::can_check_for_function_pointers): Rewrite.
5361 Make non-virtual.
5362 (Target::can_icf_inline_merge_sections): Likewise.
5363 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5364 (Target::Target_info): Add can_icf_inline_merge_sections field.
5365 (Target::do_can_check_for_function_pointers): New virtual
5366 function.
5367 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5368 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5369 from can_check_for_function_pointers, move in file.
5370 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5371 section_may_have_icf_unsafe_poineters, move in file.
5372 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5373 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5374 Rename from can_check_for_function_pointers, move in file.
5375 (Target_i386::can_icf_inline_merge_sections): Remove.
5376 (Target_i386::i386_info): Initialize
5377 can_icf_inline_merge_sections.
5378 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5379 Initialize can_icf_inline_merge_sections.
5380 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5381 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5382 Rename from can_check_for_function_pointers, move in file.
5383 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5384 (Target_x86_64::x86_64_info): Initialize
5385 can_icf_inline_merge_sections.
5386 * testsuite/testfile.cc (Target_test::test_target_info):
5387 Likewise.
5388 * icf.cc (get_section_contents): Correct formatting.
5389
6d1c4efb
ILT
53902011-06-27 Ian Lance Taylor <iant@google.com>
5391
5392 * symtab.cc (Symbol::versioned_name): New function.
5393 (Symbol_table::add_to_final_symtab): Use versioned_name when
5394 appropriate.
5395 (Symbol_table::sized_write_symbol): Likewise.
5396 * symtab.h (class Symbol): Declare versioned_name.
5397 * stringpool.h (class Stringpool_template): Add variant of add
5398 which takes a std::basic_string.
5399 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5400 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5401 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5402 (ver_test_12.o): New target.
5403 * testsuite/Makefile.in: Rebuild.
5404
57eb9b50
DK
54052011-06-27 Doug Kwan <dougkwan@google.com>
5406
5407 * arm.cc (Arm_relocate_functions::thm_jump8,
5408 Arm_relocate_functions::thm_jump11): Use a wider signed
5409 type to compute offset.
5410 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5411 arm_thm_jump8.
5412 * testsuite/Makefile.in: Regenerate.
5413 * testsuite/arm_branch_in_range.sh: Check test results of
5414 arm_thm_jump11 and arm_thm_jump8.
5415 * testsuite/arm_thm_jump11.s: New test source file.
5416 * testsuite/arm_thm_jump11.t: New linker script.
5417 * testsuite/arm_thm_jump8.s: New test source file.
5418 * testsuite/arm_thm_jump8.t: New linker script.
5419
487b39df
ILT
54202011-06-24 Ian Lance Taylor <iant@google.com>
5421
5422 * layout.cc: Include "object.h".
5423 (ctors_sections_in_init_array): New static variable.
5424 (Layout::is_ctors_in_init_array): New function.
5425 (Layout::layout): Add entry to ctors_sections_in_init_array if
5426 appropriate.
5427 * layout.h (class Layout): Declare is_ctors_in_init_array.
5428 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5429 is_ctors_reverse_view is set.
5430 (Sized_relobj_file::write_sections): Add layout parameter. Change
5431 all callers. Set is_ctors_reverse_view field of View_size.
5432 (Sized_relobj_file::reverse_words): New function.
5433 * object.h (Sized_relobj_file::View_size): Add
5434 is_ctors_reverse_view field.
5435 (class Sized_relobj_file): Update declarations.
5436 * testsuite/initpri3.c: New test.
5437 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5438 initpri3b.
5439 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5440 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5441 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5442 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5443 * testsuite/Makefile.in: Rebuild.
5444
472076e4
CC
54452011-06-24 Cary Coutant <ccoutant@google.com>
5446
5447 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5448 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5449 (debug_msg_cdebug.err): New targets.
5450 * testsuite/Makefile.in: Regenerate.
5451 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5452 Fix checks for link with shared library.
5453
a60af0db
DK
54542011-06-24 Doug Kwan <dougkwan@google.com>
5455
5456 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5457 skip empty text sections.
5458 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5459
5393d741
ILT
54602011-06-22 Ian Lance Taylor <iant@google.com>
5461
5462 PR gold/12910
5463 * options.h (class General_options): Add --ctors-in-init-array.
5464 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5465 friends as SHT_PROGBITS for merging sections.
5466 (Layout::layout): Remove special handling of .init_array and
5467 friends. Don't sort if doing relocatable link. Sort for .ctors
5468 and .dtors if ctors_in_init_array.
5469 (Layout::make_output_section): Force correct section types for
5470 .init_array and friends. Don't sort if doing relocatable link,
5471 Don't sort .ctors and .dtors if ctors_in_init_array.
5472 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5473 (Layout::output_section_name): Add relobj parameter. Change all
5474 callers. Handle .ctors. and .dtors. in code rather than table.
5475 Handle .ctors and .dtors if ctors_in_init_array.
5476 (Layout::match_file_name): New function, moved from output.cc.
5477 * layout.h (class Layout): Update declarations.
5478 * output.cc: Include "layout.h".
5479 (Input_section_sort_entry::get_priority): New function.
5480 (Input_section_sort_entry::match_file_name): Just call
5481 Layout::match_file_name.
5482 (Output_section::Input_section_sort_init_fini_compare::operator()):
5483 Handle .ctors and .dtors. Sort by explicit priority rather than
5484 by name.
5485 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5486 * testsuite/initpri2.c: New test.
5487 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5488 (check_PROGRAMS): Add initpri2.
5489 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5490 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5491 * configure, testsuite/Makefile.in: Rebuild.
5492
e1f74f98
ILT
54932011-06-19 Ian Lance Taylor <iant@google.com>
5494
5495 PR gold/12880
5496 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5497 .interp section to a PT_INTERP segment even if we have seen a
5498 --dynamic-linker option. Don't do it if we have seen a PHDRS
5499 clause in a linker script.
5500 (Layout::finalize): Don't create a .interp section if we've
5501 already create a PT_INTERP segment.
5502 (Layout::create_interp): Always call choose_output_section (revert
5503 patch of 2011-06-17). Don't create PT_INTERP segment.
5504 * script-sections.cc
5505 (Script_sections::create_note_and_tls_segments): Add a .interp
5506 section to a PT_INTERP segment even if we have seen a
5507 --dynamic-linker option.
5508
766f91bb
ILT
55092011-06-18 Ian Lance Taylor <iant@google.com>
5510
5511 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5512 merely because a non-PT_LOAD segment has a dynamic reloc.
5513
0d212c3a
ILT
55142011-06-18 Ian Lance Taylor <iant@google.com>
5515
5516 * layout.cc (Layout::finish_dynamic_section): Don't create
5517 DT_FLAGS entry if not needed.
5518
911a5072
ILT
55192011-06-18 Ian Lance Taylor <iant@google.com>
5520
5521 PR gold/12745
5522 * layout.cc (Layout::layout_eh_frame): Correct handling of
5523 writable .eh_frame section.
5524
534b4e5f
ILT
55252011-06-17 Ian Lance Taylor <iant@google.com>
5526
5527 PR gold/12893
5528 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5529 symbol is redefined with the exact same object and value.
5530
10b4f102
ILT
55312011-06-17 Ian Lance Taylor <iant@google.com>
5532
5533 PR gold/12880
5534 * layout.h (class Layout): Add interp_segment_ field.
5535 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5536 (Layout::attach_allocated_section_to_segment): If making shared
5537 library, put .interp section in PT_INTERP segment.
5538 (Layout::finalize): Also call create_interp if -dynamic-linker
5539 option was used.
5540 (Layout::create_interp): Assert that there is no PT_INTERP
5541 segment. If not using a SECTIONS clause, use make_output_section.
5542 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5543 * script-sections.cc
5544 (Script_sections::create_note_and_tls_segments): If making shared
5545 library, put .interp section in PT_INTERP segment.
5546
a29b0dad
ILT
55472011-06-17 Ian Lance Taylor <iant@google.com>
5548
e588ea8d
ILT
5549 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5550 when making a shared library.
5551
55522011-06-17 Ian Lance Taylor <iant@google.com>
5553
5554 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5555 parameter. Change all callers. Don't issue warning about PC32
5556 against locally defined symbol.
a29b0dad 5557
9d3b0698
ILT
55582011-06-16 Ian Lance Taylor <iant@google.com>
5559
5560 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5561 occurs in same object.
5562
85b0f90c
AM
55632011-06-14 Alan Modra <amodra@gmail.com>
5564
5565 * po/POTFILES.in: Regenerate.
5566
a94907d9
ILT
55672011-06-09 Ian Lance Taylor <iant@google.com>
5568
5569 * script-sections.cc
5570 (Orphan_output_section::set_section_addresses): For a relocatable
5571 link set address to 0.
5572
4fb3a1c3
CC
55732011-06-09 Cary Coutant <ccoutant@google.com>
5574
5575 PR gold/12804
5576 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5577 used with --compress-debug-sections.
5578 * gold/object.cc (Sized_relobj_file::do_layout): Report
5579 uncompressed size of compressed input sections.
5580
61220854
CC
55812011-06-08 Cary Coutant <ccoutant@google.com>
5582
5583 PR gold/12804
5584 * testsuite/two_file_test_2_v1.cc: Change initialization of
5585 v2 to keep it in .data.
5586
e6455dfb
CC
55872011-06-07 Cary Coutant <ccoutant@google.com>
5588
5589 * common.cc (Symbol_table::do_allocate_commons_list): Call
5590 gold_fallback.
5591 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5592 (Errors::fallback): New function.
5593 (gold_fallback): New function.
5594 * errors.h (Errors::fallback): New function.
5595 * gold.cc (gold_exit): Change status parameter to enum; adjust
5596 all callers.
5597 (queue_initial_tasks): Call gold_fallback.
5598 * gold.h: Include cstdlib.
5599 (Exit_status): New enum type.
5600 (gold_exit): Change status parameter to enum.
5601 (gold_fallback): New function.
5602 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5603 (Layout::create_symtab_sections): Likewise.
5604 (Layout::create_shdrs): Likewise.
5605 * main.cc (main): Adjust call to gold_exit.
5606 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5607 (Output_data_got::add_got_entry_pair): Likewise.
5608 (Output_section::add_input_section): Likewise.
5609 (Output_section::add_output_section_data): Likewise.
5610 (Output_segment::set_section_list_addresses): Likewise.
5611 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5612
fb0e076f
CC
56132011-06-07 Cary Coutant <ccoutant@google.com>
5614
5615 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5616 for incremental links.
5617 * output.cc (Output_segment::set_section_list_addresses): Remove
5618 FIXME and test for TLS or BSS.
5619
a5ee4d5d
CC
56202011-06-07 Cary Coutant <ccoutant@google.com>
5621
5622 * testsuite/Makefile.am: Add incremental_copy_test,
5623 incremental_common_test_1.
5624 * testsuite/Makefile.in: Regenerate.
5625 * testsuite/common_test_1_v1.c: New source file.
5626 * testsuite/common_test_1_v2.c: New source file.
5627 * testsuite/copy_test_v1.cc: New source file.
5628
5146f448
CC
56292011-06-07 Cary Coutant <ccoutant@google.com>
5630
5631 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5632 update, allocate common from bss section's free list.
5633 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5634 linker-defined symbols.
5635 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5636 Skip GOT and PLT entries that are no longer referenced.
5637 (Output_section_incremental_inputs::write_info_blocks): Mark
5638 linker-defined symbols.
5639 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5640 * output.cc (Output_section::allocate): New function.
5641 * output.h (Output_section::allocate): New function.
5642 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5643 linker-defined symbols.
5644 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5645 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5646 (Symbol::init_base_output_data): Likewise.
5647 (Symbol::init_base_output_segment): Likewise.
5648 (Symbol::init_base_constant): Likewise.
5649 (Sized_symbol::init_output_data): Likewise.
5650 (Sized_symbol::init_output_segment): Likewise.
5651 (Sized_symbol::init_constant): Likewise.
5652 (Symbol_table::do_define_in_output_data): Likewise.
5653 (Symbol_table::do_define_in_output_segment): Likewise.
5654 (Symbol_table::do_define_as_constant): Likewise.
5655 * symtab.h (Symbol::is_predefined): New function.
5656 (Symbol::init_base_output_data): Add is_predefined parameter.
5657 (Symbol::init_base_output_segment): Likewise.
5658 (Symbol::init_base_constant): Likewise.
5659 (Symbol::is_predefined_): New data member.
5660 (Sized_symbol::init_output_data): Add is_predefined parameter.
5661 (Sized_symbol::init_output_segment): Likewise.
5662 (Sized_symbol::init_constant): Likewise.
5663 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5664
26d3c67d
CC
56652011-06-07 Cary Coutant <ccoutant@google.com>
5666
5667 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5668 instead of emit_copy_reloc.
5669 (Copy_relocs::emit_copy_reloc): Refactor.
5670 (Copy_relocs::make_copy_reloc): New function.
5671 (Copy_relocs::add_copy_reloc): Remove.
5672 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5673 section.
5674 (Copy_relocs::make_copy_reloc): New function.
5675 (Copy_relocs::add_copy_reloc): Remove.
5676 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5677 unchanged input files.
5678 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5679 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5680 Reserve BSS space for COPY relocations.
5681 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5682 (Output_section_incremental_inputs::write_info_blocks): Record
5683 whether a symbol is copied from a shared object.
5684 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5685 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5686 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5687 (Incremental_input_entry_reader::get_output_symbol_index): Add
5688 is_copy parameter.
5689 (Incremental_binary::emit_copy_relocs): New function.
5690 (Incremental_binary::do_emit_copy_relocs): New function.
5691 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5692 new data member.
5693 (Sized_incremental_binary::add_copy_reloc): New function.
5694 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5695 (Sized_incremental_binary::Copy_reloc): New struct.
5696 (Sized_incremental_binary::Copy_relocs): New typedef.
5697 (Sized_incremental_binary::copy_relocs_): New data member.
5698 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5699 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5700 * target.h (Sized_target::emit_copy_reloc): New function.
5701 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5702
7cdb37d9
CC
57032011-06-02 Cary Coutant <ccoutant@google.com>
5704
5705 PR gold/12163
5706 * gold/archive.cc (Archive::Archive): Initialize new data member.
5707 (Archive::include_all_members): Return if archive has already been
5708 included.
5709 * gold/archive.h (Archive::include_all_members_): New data member.
5710
cc643b88
NC
57112011-06-02 Nick Clifton <nickc@redhat.com>
5712
5713 * dynobj.h: Fix spelling mistake in comment.
5714 * output.cc: Likewise.
5715
f62a3ca7 57162011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 5717 Asier Llano
f62a3ca7
DK
5718
5719 PR gold/12826
cc643b88 5720 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
5721 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5722 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5723 redundant arm_exidx_test.so.
5724 * testsuite/Makefile.in: Regenerate.
5725 (check_SCRIPTS): Add pr12826.sh
5726 (check_DATA): Add pr12826.stdout
5727 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5728 * testsuite/pr12826.sh: New file.
5729 * testsuite/pr12826_1.s: Ditto.
5730 * testsuite/pr12826_1.s: Ditto.
5731
8dbe1edc
ILT
57322011-05-30 Ian Lance Taylor <iant@google.com>
5733
5734 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5735 sections.
5736
c49875be
ILT
57372011-05-29 Ian Lance Taylor <iant@google.com>
5738
5739 PR gold/12804
5740 * testsuite/Makefile.am: Use different file name for two_file_test
5741 temporary file for each incremental test.
5742 * testsuite/Makefile.in: Rebuild.
5743
69d53f7a
ILT
57442011-05-29 Ian Lance Taylor <iant@google.com>
5745
5746 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5747 binary input file is empty.
5748
41d0ab5f
ILT
57492011-05-27 Ian Lance Taylor <iant@google.com>
5750
5751 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5752 (ver_test_9.so): Likewise.
5753 * testsuite/Makefile.in: Rebuild.
5754
89d8a36b
CC
57552011-05-26 Cary Coutant <ccoutant@google.com>
5756
5757 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5758 * incremental.cc (Incremental_inputs::report_input_section): Fix
5759 comment, indentation.
5760 (Incremental_inputs::report_comdat_group): New function.
5761 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5762 of data for incremental input file entry.
5763 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5764 group count, COMDAT group signatures.
5765 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5766 an unchanged input file.
5767 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5768 Initialize new data member.
5769 (Incremental_object_entry::add_comdat_group): New function.
5770 (Incremental_object_entry::get_comdat_group_count): New function.
5771 (Incremental_object_entry::get_comdat_signature_key): New function.
5772 (Incremental_object_entry::groups_): New data member.
5773 (Incremental_inputs::report_comdat_group): New function.
5774 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5775 data for incremental input file entry.
5776 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5777 (Incremental_input_entry_reader::get_input_section): Adjust size of
5778 data for incremental input file entry.
5779 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5780 (Incremental_input_entry_reader::get_comdat_group_signature): New
5781 function.
5782 * object.cc (Sized_relobj::include_section_group): Report kept
5783 COMDAT groups for incremental links.
5784
1706a06f
ILT
57852011-05-24 David Meyer <pdox@google.com>
5786
5787 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5788 with name parameter. Add found_name parameter.
5789 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5790 * dirsearch.h (class Dirsearch): Update declaration.
5791
a10ae760
ILT
57922011-05-24 Ian Lance Taylor <iant@google.com>
5793
5794 * archive.cc (Library_base::should_include_member): Pull in object
5795 from archive if it defines the entry symbol.
5796 * parameters.cc (Parameters::entry): New function.
5797 * parameters.h (class Parameters): Declare entry.
5798 * output.h (class Output_file_header): Remove entry_ field.
5799 * output.cc (Output_file_header::Output_file_header): Remove entry
5800 parameter. Change all callers.
5801 (Output_file_header::entry): Use parameters->entry.
5802 * gold.cc (queue_middle_tasks): Likewise.
5803 * plugin.cc (Plugin_hook::run): Likewise.
5804
aa92d6ed
CC
58052011-05-24 Cary Coutant <ccoutant@google.com>
5806
5807 * gold.cc (queue_initial_tasks): Pass incremental base filename
5808 to Output_file::open_base_file; don't print error message.
5809 * incremental-dump.cc (main): Adjust call to
5810 Output_file::open_for_modification.
5811 * incremental-dump.cc (main): Likewise.
5812 * incremental.cc (Incremental_inputs::report_command_line):
5813 Ignore --incremental-base option when comparing command lines.
5814 Ignore parameter when given as separate argument.
5815 * options.h (class General_options): Add --incremental-base.
5816 * output.cc (Output_file::Output_file):
5817 (Output_file::open_base_file): Add base_name and writable parameters;
5818 read base file into new file; print error message here.
5819 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5820 callers.
5821 * output.h (Output_file::open_for_modification): Rename to...
5822 (Output_file::open_base_file): ...this; add base_name and
5823 writable parameters; adjust all callers.
5824 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5825 callers.
5826 * testsuite/Makefile.am (incremental_test_4): Test
5827 --incremental-base.
5828 * testsuite/Makefile.in: Regenerate.
5829
2eedd706
CC
58302011-05-24 Cary Coutant <ccoutant@google.com>
5831
5832 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5833 incremental_test_4.
5834 * testsuite/Makefile.in: Regenerate.
5835 * testsuite/two_file_test_1_v1.cc: New test source file.
5836 * testsuite/two_file_test_1b_v1.cc: New test source file.
5837 * testsuite/two_file_test_2_v1.cc: New test source file.
5838
0f1c85a6
CC
58392011-05-24 Cary Coutant <ccoutant@google.com>
5840
5841 * dynobj.h (Dynobj::do_dynobj): New function.
5842 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5843 flag and soname for shared objects.
5844 * incremental.cc (Incremental_inputs::report_object): Make
5845 either Incremental_object_entry or Incremental_dynobj_entry; add
5846 soname to string table.
5847 (Incremental_inputs::report_input_section): Add assertion.
5848 (Output_section_incremental_inputs::set_final_data_size): Adjust
5849 type of input file entry for shared libraries; adjust size of
5850 shared library info entry.
5851 (Output_section_incremental_inputs::write_input_files): Write
5852 as_needed flag for shared libraries.
5853 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5854 of input file entry for shared libraries; write soname.
5855 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5856 soname from incremental info.
5857 * incremental.h (enum Incremental_input_flags): Add
5858 INCREMENTAL_INPUT_AS_NEEDED.
5859 (Incremental_input_entry::Incremental_input_entry): Initialize new
5860 data member.
5861 (Incremental_input_entry::set_as_needed): New function.
5862 (Incremental_input_entry::as_needed): New function.
5863 (Incremental_input_entry::do_dynobj_entry): New function.
5864 (Incremental_input_entry::as_needed_): New data member.
5865 (Incremental_object_entry::Incremental_object_entry): Don't check
5866 for shared library.
5867 (Incremental_object_entry::do_type): Likewise.
5868 (class Incremental_dynobj_entry): New class.
5869 (Incremental_input_entry_reader::as_needed): New function.
5870 (Incremental_input_entry_reader::get_soname): New function.
5871 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5872 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5873 size of shared library info entry.
58797674 5874 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
5875 incremental link when adding DT_NEEDED entries.
5876 * object.h (Object::Object): Initialize new data member.
5877 (Object::dynobj): New function.
5878 (Object::set_as_needed): New function.
5879 (Object::as_needed): New function.
5880 (Object::do_dynobj): New function.
5881 (Object::as_needed_): New data member.
5882
6fa2a40b
CC
58832011-05-24 Cary Coutant <ccoutant@google.com>
5884
5885 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5886 info; adjust display of GOT entries.
5887 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5888 vector of input objects; remove file_status_.
5889 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5890 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5891 got_plt reader; call target hooks to reserve GOT entries.
5892 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5893 of input file info header and GOT info entry.
5894 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5895 relocation info.
5896 (Got_plt_view_info::got_descriptor): Remove.
5897 (Got_plt_view_info::sym_index): New data member.
5898 (Got_plt_view_info::input_index): New data member.
5899 (Local_got_offset_visitor::visit): Write input file index.
5900 (Global_got_offset_visitor::visit): Write 0 for input file index.
5901 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5902 with sym_index and input_index.
5903 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5904 incremental info GOT entry; replace got_descriptor with input_index.
5905 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5906 map from input file index to object.
5907 (Sized_relobj_incr::do_layout): Replace direct data member reference
5908 with accessor function.
5909 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5910 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5911 Adjust size of input file info header.
5912 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5913 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5914 (Incremental_input_entry_reader::get_input_section): Adjust size of
5915 input file info header.
5916 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5917 of incremental info GOT entry.
5918 (Incremental_got_plt_reader::get_got_desc): Remove.
5919 (Incremental_got_plt_reader::get_got_symndx): New function.
5920 (Incremental_got_plt_reader::get_got_input_index): New function.
5921 (Sized_incremental_binary::Sized_incremental_binary): Remove
5922 file_status_; add input_objects_.
5923 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5924 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5925 (Sized_incremental_binary::file_is_unchanged): Remove.
5926 (Sized_incremental_binary::set_input_object): New function.
5927 (Sized_incremental_binary::input_object): New function.
5928 (Sized_incremental_binary::file_status_): Remove.
5929 (Sized_incremental_binary::input_objects_): New data member.
5930 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5931 references.
5932 (Sized_relobj_incr::invalid_address): Move to base class.
5933 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5934 class.
5935 (Sized_relobj_incr::do_output_section_offset): Likewise.
5936 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5937 (Sized_relobj_incr::section_offsets_): Likewise.
5938 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5939 function.
5940 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5941 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5942 with accessor function.
5943 (Sized_relobj_file::do_layout): Likewise.
5944 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5945 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5946 (Sized_relobj_file::compute_final_local_value): Replace refs to
5947 section_offsets_ with accessor function.
5948 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5949 * object.h (Relobj::Relobj): Initialize new data members.
5950 (Relobj::add_dyn_reloc): New function.
5951 (Relobj::first_dyn_reloc): New function.
5952 (Relobj::dyn_reloc_count): New function.
5953 (Relobj::first_dyn_reloc_): New data member.
5954 (Relobj::dyn_reloc_count_): New data member.
5955 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5956 references.
5957 (Sized_relobj::Address): New typedef.
5958 (Sized_relobj::invalid_address): Move here from child class.
5959 (Sized_relobj::Sized_relobj): Initialize new data members.
5960 (Sized_relobj::sized_relobj): New function.
5961 (Sized_relobj::is_output_section_offset_invalid): Move here from
5962 child class.
5963 (Sized_relobj::get_output_section_offset): Likewise.
5964 (Sized_relobj::local_has_got_offset): Likewise.
5965 (Sized_relobj::local_got_offset): Likewise.
5966 (Sized_relobj::set_local_got_offset): Likewise.
5967 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5968 (Sized_relobj::clear_got_offsets): New function.
5969 (Sized_relobj::section_offsets): Move here from child class.
5970 (Sized_relobj::do_output_section_offset): Likewise.
5971 (Sized_relobj::do_set_section_offset): Likewise.
5972 (Sized_relobj::Local_got_offsets): Likewise.
5973 (Sized_relobj::local_got_offsets_): Likewise.
5974 (Sized_relobj::section_offsets_): Likewise.
5975 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5976 references.
5977 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5978 class.
5979 (Sized_relobj_file::sized_relobj): New function
5980 (Sized_relobj_file::local_has_got_offset): Move to base class.
5981 (Sized_relobj_file::local_got_offset): Likewise.
5982 (Sized_relobj_file::set_local_got_offset): Likewise.
5983 (Sized_relobj_file::get_output_section_offset): Likewise.
5984 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5985 (Sized_relobj_file::do_output_section_offset): Likewise.
5986 (Sized_relobj_file::do_set_section_offset): Likewise.
5987 (Sized_relobj_file::Local_got_offsets): Likewise.
5988 (Sized_relobj_file::local_got_offsets_): Likewise.
5989 (Sized_relobj_file::section_offsets_): Likewise.
5990 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5991 (all constructors).
5992 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5993 (Output_reloc::get_symbol_index): Likewise.
5994 (Output_reloc::local_section_offset): Likewise.
5995 (Output_reloc::get_address): Likewise.
5996 (Output_reloc::symbol_value): Likewise.
5997 (Output_data_got::reserve_slot): Move to class definition.
5998 (Output_data_got::reserve_local): New function.
5999 (Output_data_got::reserve_slot_for_global): Remove.
6000 (Output_data_got::reserve_global): New function.
6001 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6002 (all constructors, two instantiations).
6003 (Output_reloc::get_relobj): New function (two instantiations).
6004 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6005 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6006 (Output_data_reloc::add_global): Adjust type of relobj.
6007 (Output_data_reloc::add_global_relative): Likewise.
6008 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6009 (Output_data_reloc::add_local): Likewise.
6010 (Output_data_reloc::add_local_relative): Likewise.
6011 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6012 (Output_data_reloc::add_local_section): Likewise.
6013 (Output_data_reloc::add_output_section): Likewise.
6014 (Output_data_reloc::add_absolute): Likewise.
6015 (Output_data_reloc::add_target_specific): Likewise.
6016 (Output_data_got::reserve_slot): Move definition here.
6017 (Output_data_got::reserve_local): New function.
6018 (Output_data_got::reserve_global): New function.
6019 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6020 section_offsets_ with accessor function.
6021 (Sized_relobj_file::write_sections): Likewise.
6022 (Sized_relobj_file::do_relocate_sections): Likewise.
6023 * target.h (Sized_target::reserve_local_got_entry): New function.
6024 (Sized_target::reserve_global_got_entry): New function.
6025 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6026 (Target_x86_64::reserve_global_got_entry): New function.
6027 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6028
4829d394
CC
60292011-05-23 Cary Coutant <ccoutant@google.com>
6030
6031 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6032 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6033 bit when checking got_type.
6034 * incremental.cc (Sized_incremental_binary::setup_readers):
6035 Store symbol table and string table locations; initialize bit vector
6036 of file status flags.
6037 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6038 unchanged files.
6039 (Sized_incremental_binary::do_process_got_plt): New function.
6040 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6041 (Output_section_incremental_inputs::set_final_data_size): Record
6042 file index for each input file.
6043 (Output_section_incremental_inputs::write_got_plt): Store file index
6044 instead of input entry offset for each GOT entry.
6045 * incremental.h
6046 (Incremental_input_entry::Incremental_input_entry): Initialize new
6047 data member.
6048 (Incremental_input_entry::set_offset): Store file index.
6049 (Incremental_input_entry::get_file_index): New function.
6050 (Incremental_input_entry::file_index_): New data member.
6051 (Incremental_binary::process_got_plt): New function.
6052 (Incremental_binary::do_process_got_plt): New function.
6053 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6054 data members.
6055 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6056 (Sized_incremental_binary::set_file_is_unchanged): New function.
6057 (Sized_incremental_binary::file_is_unchanged): New function.
6058 (Sized_incremental_binary::do_process_got_plt): New function.
6059 (Sized_incremental_binary::file_status_): New data member.
6060 (Sized_incremental_binary::main_symtab_loc_): New data member.
6061 (Sized_incremental_binary::main_strtab_loc_): New data member.
6062 * output.cc (Output_data_got::Got_entry::write): Add case
6063 RESERVED_CODE.
6064 (Output_data_got::add_global): Call add_got_entry.
6065 (Output_data_got::add_global_plt): Likewise.
6066 (Output_data_got::add_global_with_rel): Likewise.
6067 (Output_data_got::add_global_with_rela): Likewise.
6068 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6069 (Output_data_got::add_global_pair_with_rela): Likewise.
6070 (Output_data_got::add_local): Call add_got_entry.
6071 (Output_data_got::add_local_plt): Likewise.
6072 (Output_data_got::add_local_with_rel): Likewise.
6073 (Output_data_got::add_local_with_rela): Likewise.
6074 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6075 (Output_data_got::add_local_pair_with_rela): Likewise.
6076 (Output_data_got::reserve_slot): New function.
6077 (Output_data_got::reserve_slot_for_global): New function.
6078 (Output_data_got::add_got_entry): New function.
6079 (Output_data_got::add_got_entry_pair): New function.
6080 (Output_section::add_output_section_data): Edit FIXME.
6081 * output.h
6082 (Output_section_data_build::Output_section_data_build): New
6083 constructor with size parameter.
6084 (Output_data_space::Output_data_space): Likewise.
6085 (Output_data_got::Output_data_got): Initialize new data member; new
6086 constructor with size parameter.
6087 (Output_data_got::add_constant): Call add_got_entry.
6088 (Output_data_got::reserve_slot): New function.
6089 (Output_data_got::reserve_slot_for_global): New function.
6090 (class Output_data_got::Got_entry): Add RESERVED_CODE.
6091 (Output_data_got::add_got_entry): New function.
6092 (Output_data_got::add_got_entry_pair): New function.
6093 (Output_data_got::free_list_): New data member.
6094 * target.h (Sized_target::init_got_plt_for_update): New function.
6095 (Sized_target::register_global_plt_entry): New function.
6096 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
6097 Initialize new data member; call init; add constructor with PLT count.
6098 (Output_data_plt_x86_64::init): New function.
6099 (Output_data_plt_x86_64::add_relocation): New function.
6100 (Output_data_plt_x86_64::reserve_slot): New function.
6101 (Output_data_plt_x86_64::free_list_): New data member.
6102 (Target_x86_64::init_got_plt_for_update): New function.
6103 (Target_x86_64::register_global_plt_entry): New function.
6104 (Output_data_plt_x86_64::add_entry): Allocate from free list for
6105 incremental updates.
6106 (Output_data_plt_x86_64::add_relocation): New function.
6107 * testsuite/object_unittest.cc (Object_test): Set default options.
6108
ec69d6da
ILT
61092011-05-16 Ian Lance Taylor <iant@google.com>
6110
6111 * options.h (class General_options): Make -i a synonym for -r.
6112
732e31de
ILT
61132011-05-16 Ian Lance Taylor <iant@google.com>
6114
6115 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6116
403676b5
CC
61172011-05-10 Cary Coutant <ccoutant@google.com>
6118
6119 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6120 strip_all (-s).
6121
5b7b7d6e
ILT
61222011-05-06 Ian Lance Taylor <iant@google.com>
6123
6124 * layout.cc (Layout::layout): If the output section flags change,
6125 update the ordering.
6126
f0f9babf
CC
61272011-04-25 Cary Coutant <ccoutant@google.com>
6128
6129 * incremental-dump.cc (dump_incremental_inputs): Print local
6130 symbol info for each input file.
6131 * incremental.cc
6132 (Output_section_incremental_inputs::set_final_data_size): Add local
6133 symbol info to input file entries in incremental info.
6134 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6135 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6136 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6137 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6138 implementation.
6139 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6140 (Sized_incr_relobj::do_relocate): Write the local symbols.
6141 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6142 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6143 Adjust size of input file header.
6144 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6145 (Incremental_inputs_reader::get_local_symbol_count): New function.
6146 (Incremental_inputs_reader::get_input_section): Adjust size of input
6147 file header.
6148 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6149 (Sized_incr_relobj::This): New typedef.
6150 (Sized_incr_relobj::sym_size): New const data member.
6151 (Sized_incr_relobj::Local_symbol): New struct.
6152 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6153 (Sized_incr_relobj::do_local_symbol_offset): New function.
6154 (Sized_incr_relobj::local_symbol_count_): New data member.
6155 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6156 (Sized_incr_relobj::local_symbol_index_): New data member.
6157 (Sized_incr_relobj::local_symbol_offset_): New data member.
6158 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6159 (Sized_incr_relobj::local_symbols_): New data member.
6160 * object.h (Relobj::output_local_symbol_count): New function.
6161 (Relobj::local_symbol_offset): New function.
6162 (Relobj::do_output_local_symbol_count): New function.
6163 (Relobj::do_local_symbol_offset): New function.
6164 (Sized_relobj::do_output_local_symbol_count): New function.
6165 (Sized_relobj::do_local_symbol_offset): New function.
6166
d0a9ace3
ILT
61672011-04-22 Vladimir Simonov <sv@sw.ru>
6168
6169 * descriptors.cc (set_close_on_exec): New function.
6170 (Descriptors::open): Use set_close_on_exec.
6171 * output.cc (S_ISLNK): Define if not defined.
6172
94a3fc8b
CC
61732011-04-22 Cary Coutant <ccoutant@google.com>
6174
6175 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6176 global symbol map.
6177 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6178 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6179 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6180 relocations.
6181 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6182 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6183 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6184 * incremental.h
6185 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6186 function.
6187 (Incremental_binary::apply_incremental_relocs): New function.
6188 (Incremental_binary::do_apply_incremental_relocs): New function.
6189 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6190 data member.
6191 (Sized_incremental_binary::add_global_symbol): New function.
6192 (Sized_incremental_binary::global_symbol): New function.
6193 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6194 (Sized_incremental_binary::symbol_map_): New data member.
6195 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6196 * target.h (Sized_target::apply_relocation): New function.
6197 * target-reloc.h (apply_relocation): New function.
6198 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6199
c87e4302
DK
62002011-04-22 Doug Kwan <dougkwan@google.com>
6201
6202 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6203 flag of a SHT_ARM_EXIDX section.
2e702c99 6204 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
6205 * testsuite/Makefile.in: Regenerate.
6206 * testsuite/arm_exidx_test.s: New file.
6207 * testsuite/arm_exidx_test.sh: Same.
6208
e7782cf6
CC
62092011-04-20 Cary Coutant <ccoutant@google.com>
6210
6211 PR gold/12689
6212 * archive.h (Incremental_archive_entry::Archive_member):
6213 Initialize arg_serial_ (second constructor).
6214
308ecdc7
ILT
62152011-04-17 Ian Lance Taylor <iant@google.com>
6216
6217 * object.cc (Relocate_info::location): Simplify location string.
6218 * errors.cc (Errors::error_at_location): Don't print program
6219 name.
6220 (Errors::warning_at_location): Likewise.
6221 (Errors::undefined_symbol): Likewise.
6222 * testsuite/debug_msg.sh: Update accordingly.
6223
bec5b579
CC
62242011-04-14 Cary Coutant <ccoutant@google.com>
6225
6226 * gold/layout.cc (Layout::symtab_section_offset): New function.
6227 * gold/layout.h (Layout::symtab_section_offset): New function.
6228 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6229
88597d34
ILT
62302011-04-12 Ian Lance Taylor <iant@google.com>
6231
6232 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6233 with MREMAP_MAYMOVE.
6234 * output.h (class Output_file): Add map_is_allocated_ field.
6235 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6236 not available, provide stubs. If mremap is not available, #define
6237 it to gold_mremap.
6238 (MREMAP_MAYMOVE): Define if not defined.
6239 (Output_file::Output_file): Initialize map_is_allocated_.
6240 (Output_file::resize): Check map_is_allocated_.
6241 (Output_file::map_anonymous): If mmap fails, use malloc.
6242 (Output_file::unmap): Don't do anything for an anonymous map.
6243 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6244 is not available, provide stubs.
6245 (File_read::View::~View): Use free rather than delete[].
6246 (File_read::make_view): Use malloc rather than new[]. If mmap
6247 fails, use malloc.
6248 (File_read::find_or_make_view): Use malloc rather than new[].
6249 * gold.h: Remove HAVE_REMAP code.
6250 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6251 exists. Rename mremap to gold_mremap. If mmap is not available
6252 don't do anything.
6253 * configure, config.in: Rebuild.
6254
11e361bc
ILT
62552011-04-11 Ian Lance Taylor <iant@google.com>
6256
6257 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6258 initialize local variable v.
6259
cdc29364
CC
62602011-04-11 Cary Coutant <ccoutant@google.com>
6261
6262 * archive.cc (Archive::include_member): Adjust call to
6263 report_object.
6264 (Add_archive_symbols::run): Track argument serial numbers.
6265 (Lib_group::include_member): Likewise.
6266 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6267 * archive.h (Incremental_archive_entry::Archive_member):
6268 Initialize arg_serial_.
6269 (Archive_member::arg_serial_): New data member.
6270 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6271 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6272 incremental link.
6273 (Sized_dynobj::do_for_all_local_got_entries): New function.
6274 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6275 function.
6276 * fileread.cc (get_mtime): New function.
6277 * fileread.h (get_mtime): New function.
6278 * gold.cc (queue_initial_tasks): Check for incremental update.
6279 (process_incremental_input): New function.
6280 (queue_middle_tasks): Don't force valid target for incremental
6281 update.
6282 * incremental-dump.cc (find_input_containing_global): Adjust
6283 size of symbol info entry.
6284 (dump_incremental_inputs): Dump argument serial number and
6285 in_system_directory flag; bias shndx by 1; print symbol names
6286 when dumping per-file symbol lists; use new symbol info readers.
6287 * incremental.cc
6288 (Output_section_incremental_inputs:update_data_size): New function.
6289 (Sized_incremental_binary::setup_readers): Setup input readers
6290 for each input file; build maps for files added from libraries
6291 and scripts.
6292 (Sized_incremental_binary::check_input_args): New function.
6293 (Sized_incremental_binary::do_check_inputs): Build map of argument
6294 serial numbers to input arguments.
6295 (Sized_incremental_binary::do_file_has_changed): Rename
6296 do_file_is_unchanged to this; compare file modification times.
6297 (Sized_incremental_binary::do_init_layout): New function.
6298 (Sized_incremental_binary::do_reserve_layout): New function.
6299 (Sized_incremental_binary::do_get_input_reader): Remove.
6300 (Sized_incremental_binary::get_symtab_view): New function.
6301 (Incremental_checker::can_incrementally_link_output_file): Remove.
6302 (Incremental_inputs::report_command_line): Exclude --debug options.
6303 (Incremental_inputs::report_archive_begin): Add parameter; track
6304 argument serial numbers; don't put input file entry for archive
6305 before archive members.
6306 (Incremental_inputs::report_archive_end): Put input file entry
6307 for archive after archive members.
6308 (Incremental_inputs::report_object): Add parameter; track argument
6309 serial numbers and in_system_directory flag.
6310 (Incremental_inputs::report_script): Add parameter; track argument
6311 serial numbers.
6312 (Output_section_incremental_inputs::set_final_data_size): Adjust
6313 size of symbol info entry; check for forwarding symbols.
6314 (Output_section_incremental_inputs::write_input_files): Write
6315 in_system_directory flag and argument serial number.
6316 (Output_section_incremental_inputs::write_info_blocks): Map section
6317 indices between incremental info and original input file; store
6318 input section index for each symbol.
6319 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6320 change operator() to visit().
6321 (class Global_got_offset_visitor): Likewise.
6322 (class Global_symbol_visitor_got_plt):
6323 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6324 classes.
6325 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6326 (Sized_incr_relobj::do_read_symbols): New function.
6327 (Sized_incr_relobj::do_layout): New function.
6328 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6329 (Sized_incr_relobj::do_add_symbols): New function.
6330 (Sized_incr_relobj::do_should_include_member): New function.
6331 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6332 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6333 (Sized_incr_relobj::do_section_size): New function.
6334 (Sized_incr_relobj::do_section_name): New function.
6335 (Sized_incr_relobj::do_section_contents): New function.
6336 (Sized_incr_relobj::do_section_flags): New function.
6337 (Sized_incr_relobj::do_section_entsize): New function.
6338 (Sized_incr_relobj::do_section_address): New function.
6339 (Sized_incr_relobj::do_section_type): New function.
6340 (Sized_incr_relobj::do_section_link): New function.
6341 (Sized_incr_relobj::do_section_info): New function.
6342 (Sized_incr_relobj::do_section_addralign): New function.
6343 (Sized_incr_relobj::do_initialize_xindex): New function.
6344 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6345 (Sized_incr_relobj::do_read_relocs): New function.
6346 (Sized_incr_relobj::do_gc_process_relocs): New function.
6347 (Sized_incr_relobj::do_scan_relocs): New function.
6348 (Sized_incr_relobj::do_count_local_symbols): New function.
6349 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6350 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6351 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6352 (Sized_incr_relobj::do_relocate): New function.
6353 (Sized_incr_relobj::do_set_section_offset): New function.
6354 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6355 (Sized_incr_dynobj::do_read_symbols): New function.
6356 (Sized_incr_dynobj::do_layout): New function.
6357 (Sized_incr_dynobj::do_add_symbols): New function.
6358 (Sized_incr_dynobj::do_should_include_member): New function.
6359 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6360 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6361 (Sized_incr_dynobj::do_section_size): New function.
6362 (Sized_incr_dynobj::do_section_name): New function.
6363 (Sized_incr_dynobj::do_section_contents): New function.
6364 (Sized_incr_dynobj::do_section_flags): New function.
6365 (Sized_incr_dynobj::do_section_entsize): New function.
6366 (Sized_incr_dynobj::do_section_address): New function.
6367 (Sized_incr_dynobj::do_section_type): New function.
6368 (Sized_incr_dynobj::do_section_link): New function.
6369 (Sized_incr_dynobj::do_section_info): New function.
6370 (Sized_incr_dynobj::do_section_addralign): New function.
6371 (Sized_incr_dynobj::do_initialize_xindex): New function.
6372 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6373 (make_sized_incremental_object): New function.
6374 (Incremental_library::copy_unused_symbols): New function.
6375 (Incremental_library::do_for_all_unused_symbols): New function.
6376 * incremental.h (enum Incremental_input_flags): New type.
6377 (class Incremental_checker): Remove.
6378 (Incremental_input_entry::Incremental_input_entry): Add argument
6379 serial number.
6380 (Incremental_input_entry::arg_serial): New function.
6381 (Incremental_input_entry::set_is_in_system_directory): New function.
6382 (Incremental_input_entry::is_in_system_directory): New function.
6383 (Incremental_input_entry::arg_serial_): New data member.
6384 (Incremental_input_entry::is_in_system_directory_): New data member.
6385 (class Script_info): Move here from script.h.
6386 (Script_info::Script_info): Add filename parameter.
6387 (Script_info::filename): New function.
6388 (Script_info::filename_): New data member.
6389 (Incremental_script_entry::Incremental_script_entry): Add argument
6390 serial number.
6391 (Incremental_object_entry::Incremental_object_entry): Likewise.
6392 (Incremental_object_entry::add_input_section): Build list of input
6393 sections with map to original shndx.
6394 (Incremental_object_entry::get_input_section_index): New function.
6395 (Incremental_object_entry::shndx_): New data member.
6396 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6397 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6398 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6399 serial number.
6400 (Incremental_inputs::report_archive_begin): Likewise.
6401 (Incremental_inputs::report_object): Likewise.
6402 (Incremental_inputs::report_script): Likewise.
6403 (class Incremental_global_symbol_reader): New class.
6404 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6405 and store flags and input file type.
6406 (Incremental_input_entry_reader::arg_serial): New function.
6407 (Incremental_input_entry_reader::type): Extract type from flags.
6408 (Incremental_input_entry_reader::is_in_system_directory): New function.
6409 (Incremental_input_entry_reader::get_input_section_count): Call
6410 accessor function for type.
6411 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6412 function for type; adjust size of global symbol entry.
6413 (Incremental_input_entry_reader::get_global_symbol_count): Call
6414 accessor function for type.
6415 (Incremental_input_entry_reader::get_object_count): Likewise.
6416 (Incremental_input_entry_reader::get_object_offset): Likewise.
6417 (Incremental_input_entry_reader::get_member_count): Likewise.
6418 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6419 (Incremental_input_entry_reader::get_member_offset): Likewise.
6420 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6421 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6422 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6423 (Incremental_input_entry_reader::get_global_symbol_reader): New
6424 function.
6425 (Incremental_input_entry_reader::get_output_symbol_index): New
6426 function.
6427 (Incremental_input_entry_reader::type_): Remove.
6428 (Incremental_input_entry_reader::flags_): New data member.
6429 (Incremental_inputs_reader::input_file_offset): New function.
6430 (Incremental_inputs_reader::input_file_index): New function.
6431 (Incremental_inputs_reader::input_file): Call input_file_offset.
6432 (Incremental_inputs_reader::input_file_at_offset): New function.
6433 (Incremental_relocs_reader::get_r_type): Reformat.
6434 (Incremental_relocs_reader::get_r_shndx): Reformat.
6435 (Incremental_relocs_reader::get_r_offset): Reformat.
6436 (Incremental_relocs_reader::data): New function.
6437 (Incremental_binary::Incremental_binary): Initialize new data members.
6438 (Incremental_binary::check_inputs): Add cmdline parameter.
6439 (Incremental_binary::file_is_unchanged): Remove.
6440 (Input_reader::arg_serial): New function.
6441 (Input_reader::get_unused_symbol_count): New function.
6442 (Input_reader::get_unused_symbol): New function.
6443 (Input_reader::do_arg_serial): New function.
6444 (Input_reader::do_get_unused_symbol_count): New function.
6445 (Input_reader::do_get_unused_symbol): New function.
6446 (Incremental_binary::input_file_count): New function.
6447 (Incremental_binary::get_input_reader): Change signature to use
6448 index instead of filename.
6449 (Incremental_binary::file_has_changed): New function.
6450 (Incremental_binary::get_input_argument): New function.
6451 (Incremental_binary::get_library): New function.
6452 (Incremental_binary::get_script_info): New function.
6453 (Incremental_binary::init_layout): New function.
6454 (Incremental_binary::reserve_layout): New function.
6455 (Incremental_binary::output_file): New function.
6456 (Incremental_binary::do_check_inputs): New function.
6457 (Incremental_binary::do_file_is_unchanged): Remove.
6458 (Incremental_binary::do_file_has_changed): New function.
6459 (Incremental_binary::do_init_layout): New function.
6460 (Incremental_binary::do_reserve_layout): New function.
6461 (Incremental_binary::do_input_file_count): New function.
6462 (Incremental_binary::do_get_input_reader): Change signature.
6463 (Incremental_binary::input_args_map_): New data member.
6464 (Incremental_binary::library_map_): New data member.
6465 (Incremental_binary::script_map_): New data member.
6466 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6467 new data members.
6468 (Sized_incremental_binary::output_section): New function.
6469 (Sized_incremental_binary::inputs_reader): Add const.
6470 (Sized_incremental_binary::symtab_reader): Add const.
6471 (Sized_incremental_binary::relocs_reader): Add const.
6472 (Sized_incremental_binary::got_plt_reader): Add const.
6473 (Sized_incremental_binary::get_symtab_view): New function.
6474 (Sized_incremental_binary::Inputs_reader): New typedef.
6475 (Sized_incremental_binary::Input_entry_reader): New typedef.
6476 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6477 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6478 (Sized_incremental_binary::do_file_has_changed): New function.
6479 (Sized_incremental_binary::do_init_layout): New function.
6480 (Sized_incremental_binary::do_reserve_layout): New function.
6481 (Sized_input_reader::Inputs_reader): Remove.
6482 (Sized_input_reader::Input_entry_reader): Remove.
6483 (Sized_input_reader::do_arg_serial): New function.
6484 (Sized_input_reader::do_get_unused_symbol_count): New function.
6485 (Sized_input_reader::do_get_unused_symbol): New function.
6486 (Sized_incremental_binary::do_input_file_count): New function.
6487 (Sized_incremental_binary::do_get_input_reader): Change signature;
6488 use index instead of filename.
6489 (Sized_incremental_binary::section_map_): New data member.
6490 (Sized_incremental_binary::input_entry_readers_): New data member.
6491 (class Sized_incr_relobj): New class.
6492 (class Sized_incr_dynobj): New class.
6493 (make_sized_incremental_object): New function.
6494 (class Incremental_library): New class.
6495 * layout.cc (Free_list::num_lists): New static data member.
6496 (Free_list::num_nodes): New static data member.
6497 (Free_list::num_removes): New static data member.
6498 (Free_list::num_remove_visits): New static data member.
6499 (Free_list::num_allocates): New static data member.
6500 (Free_list::num_allocate_visits): New static data member.
6501 (Free_list::init): New function.
6502 (Free_list::remove): New function.
6503 (Free_list::allocate): New function.
6504 (Free_list::dump): New function.
6505 (Free_list::print_stats): New function.
6506 (Layout_task_runner::run): Resize output file for incremental updates.
6507 (Layout::Layout): Initialize new data members.
6508 (Layout::set_incremental_base): New function.
6509 (Layout::init_fixed_output_section): New function.
6510 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6511 incremental updates.
6512 (Layout::create_gold_note): Do not create gold note section for
6513 incremental updates.
6514 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6515 for incremental updates.
6516 (Layout::set_section_offsets): For incremental updates, allocate space
6517 from free list.
6518 (Layout::create_symtab_sections): Layout with offsets relative to
6519 start of section; for incremental updates, allocate space from free
6520 list.
6521 (Layout::create_shdrs): For incremental updates, allocate space from
6522 free list.
6523 (Layout::finish_dynamic_section): For incremental updates, do not
6524 check --as-needed (fixed in subsequent patch).
6525 * layout.h (class Free_list): New class.
6526 (Layout::set_incremental_base): New function.
6527 (Layout::incremental_base): New function.
6528 (Layout::init_fixed_output_section): New function.
6529 (Layout::allocate): New function.
6530 (Layout::incremental_base_): New data member.
6531 (Layout::free_list_): New data member.
6532 * main.cc (main): Print Free_list statistics.
6533 * object.cc (Relobj::finalize_incremental_relocs): Add
6534 clear_counts parameter; clear counts only when clear_counts is set.
6535 (Sized_relobj::Sized_relobj): Initialize new base class.
6536 (Sized_relobj::do_layout): Don't report special sections.
6537 (Sized_relobj::do_for_all_local_got_entries): New function.
6538 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6539 symtab_off to all symbol table offsets.
6540 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6541 * object.h (class Got_offset_list): Move to top of file.
6542 (Object::Object): Allow case where input_file == NULL.
6543 (Object::~Object): Likewise.
6544 (Object::input_file): Assert that input_file != NULL.
6545 (Object::lock): Allow case where input_file == NULL.
6546 (Object::unlock): Likewise.
6547 (Object::is_locked): Likewise.
6548 (Object::token): Likewise.
6549 (Object::release): Likewise.
6550 (Object::is_incremental): New function.
6551 (Object::get_mtime): New function.
6552 (Object::for_all_local_got_entries): New function.
6553 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6554 (Object::set_is_in_system_directory): New function.
6555 (Object::is_in_system_directory): New function.
6556 (Object::do_is_incremental): New function.
6557 (Object::do_get_mtime): New function.
6558 (Object::do_for_all_local_got_entries): New function.
6559 (Object::is_in_system_directory_): New data member.
6560 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6561 (class Sized_relobj_base): New class.
6562 (class Sized_relobj): Derive from Sized_relobj_base.
6563 (class Sized_relobj::Symbols): Redeclare from base class.
6564 (class Sized_relobj::local_got_offset_list): Remove.
6565 (class Sized_relobj::Output_sections): Redeclare from base class.
6566 (class Sized_relobj::do_for_all_local_got_entries): New function.
6567 (class Sized_relobj::write_local_symbols): Add offset parameter.
6568 (class Sized_relobj::local_symbol_offset_): Update comment.
6569 (class Sized_relobj::local_dynsym_offset_): Update comment.
6570 * options.cc (Input_arguments::add_file): Remove const.
6571 * options.h (Input_file_argument::Input_file_argument):
6572 Initialize arg_serial_ (all constructors).
6573 (Input_file_argument::set_arg_serial): New function.
6574 (Input_file_argument::arg_serial): New function.
6575 (Input_file_argument::arg_serial_): New data member.
6576 (Input_arguments::Input_arguments): Initialize file_count_.
6577 (Input_arguments::add_file): Remove const.
6578 (Input_arguments::number_of_input_files): New function.
6579 (Input_arguments::file_count_): New data member.
6580 (Command_line::number_of_input_files): Call
6581 Input_arguments::number_of_input_files.
6582 * output.cc (Output_segment_headers::Output_segment_headers):
6583 Set current size.
6584 (Output_section::Input_section::current_data_size): New function.
6585 (Output_section::Output_section): Initialize new data members.
6586 (Output_section::add_input_section): Don't do merge sections for
6587 an incremental link; allocate space from free list for an
6588 incremental update.
6589 (Output_section::add_output_section_data): Allocate space from
6590 free list for an incremental update.
6591 (Output_section::update_data_size): New function.
6592 (Output_section::set_fixed_layout): New function.
6593 (Output_section::reserve): New function.
6594 (Output_segment::set_section_addresses): Remove const.
6595 (Output_segment::set_section_list_addresses): Remove const; allocate
6596 space from free list for an incremental update.
6597 (Output_segment::set_offset): Adjust size of RELRO segment for an
6598 incremental update.
6599 * output.h (Output_data::current_data_size): Move here from
6600 child classes.
6601 (Output_data::pre_finalize_data_size): New function.
6602 (Output_data::update_data_size): New function.
6603 (Output_section_headers::update_data_size): new function.
6604 (Output_section_data_build::current_data_size): Move to Output_data.
6605 (Output_data_strtab::update_data_size): New function.
6606 (Output_section::current_data_size): Move to Output_data.
6607 (Output_section::set_fixed_layout): New function.
6608 (Output_section::has_fixed_layout): New function.
6609 (Output_section::reserve): New function.
6610 (Output_section::update_data_size): New function.
6611 (Output_section::has_fixed_layout_): New data member.
6612 (Output_section::free_list_): New data member.
6613 (Output_segment::set_section_addresses): Remove const.
6614 (Output_segment::set_section_list_addresses): Remove const.
6615 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6616 New function.
6617 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6618 New function.
6619 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6620 parameter when calling Add_symbols constructor; store argument
6621 serial number for members of a lib group.
6622 (Add_symbols::locks): Allow case where token == NULL.
6623 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6624 (Read_member::~Read_member): New function.
6625 (Read_member::is_runnable): New function.
6626 (Read_member::locks): New function.
6627 (Read_member::run): New function.
6628 (Check_script::~Check_script): New function.
6629 (Check_script::is_runnable): New function.
6630 (Check_script::locks): New function.
6631 (Check_script::run): New function.
6632 (Check_library::~Check_library): New function.
6633 (Check_library::is_runnable): New function.
6634 (Check_library::locks): New function.
6635 (Check_library::run): New function.
6636 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6637 (Add_symbols::library_): New data member.
6638 (class Read_member): New class.
6639 (class Check_script): New class.
6640 (class Check_library): New class.
6641 * reloc.cc (Read_relocs::is_runnable): Allow case where
6642 token == NULL.
6643 (Read_relocs::locks): Likewise.
6644 (Scan_relocs::locks): Likewise.
6645 (Relocate_task::locks): Likewise.
6646 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6647 to clear counters.
6648 (Sized_relobj::incremental_relocs_scan): Fix comment.
6649 (Sized_relobj::do_relocate): Pass output file offset to
6650 write_local_symbols.
6651 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6652 from class declaration.
6653 * script.cc (read_input_script): Allocate Script_info; pass
6654 argument serial number to report_script.
6655 * script.h (class Script_info): Move to incremental.h.
6656 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6657 * symtab.h (Symbol_table::add_from_incrobj): New function.
6658 (Symbol_table::set_file_offset): New function.
6659
b961d0d7
CC
66602011-04-05 Cary Coutant <ccoutant@google.com>
6661
6662 * incremental-dump.cc (dump_incremental_inputs): Change signature
6663 to take a Sized_incremental_binary; change caller. Use readers
6664 in Sized_incremental_binary.
6665 * incremental.cc
6666 (Sized_incremental_binary::find_incremental_inputs_sections):
6667 Rename do_find_incremental_inputs_sections to this.
6668 (Sized_incremental_binary::setup_readers): New function.
6669 (Sized_incremental_binary::do_check_inputs): Check
6670 has_incremental_info_ flag; move setup code to setup_readers;
6671 use input readers.
6672 (Sized_incremental_binary::do_file_is_unchanged): New function.
6673 (Sized_incremental_binary::do_get_input_reader): New function.
6674 * incremental.h (class Incremental_binary): Move to end of file.
6675 (Incremental_binary::file_is_unchanged): New function.
6676 (Incremental_binary::do_file_is_unchanged): New function.
6677 (Incremental_binary::Input_reader): New class.
6678 (Incremental_binary::get_input_reader): New function.
6679 (class Sized_incremental_binary): Move to end of file.
6680 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6681 input section reader classes.
6682 (Sized_incremental_binary::has_incremental_info): New function.
6683 (Sized_incremental_binary::inputs_reader): New function.
6684 (Sized_incremental_binary::symtab_reader): New function.
6685 (Sized_incremental_binary::relocs_reader): New function.
6686 (Sized_incremental_binary::got_plt_reader): New function.
6687 (Sized_incremental_binary::do_file_is_unchanged): New function.
6688 (Sized_incremental_binary::Sized_input_reader): New class.
6689 (Sized_incremental_binary::get_input_reader): New function.
6690 (Sized_incremental_binary::find_incremental_inputs_sections):
6691 Rename do_find_incremental_inputs_sections to this.
6692 (Sized_incremental_binary::setup_readers): New function.
6693 (Sized_incremental_binary::has_incremental_info_): New data member.
6694 (Sized_incremental_binary::inputs_reader_): New data member.
6695 (Sized_incremental_binary::symtab_reader_): New data member.
6696 (Sized_incremental_binary::relocs_reader_): New data member.
6697 (Sized_incremental_binary::got_plt_reader_): New data member.
6698 (Sized_incremental_binary::current_input_file_): New data member.
6699
a869183f
PP
67002011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6701
6702 PR gold/12640
6703 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6704 violation.
6705
67062011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
6707
6708 * archive.cc (Archive::include_member): Adjust call to report_object.
6709 (Add_archive_symbols::run): Add script_info to call to
6710 report_archive_begin.
6711 (Lib_group::include_member): Adjust call to report_object.
6712 (Add_lib_group_symbols::run): Adjust call to report_object.
6713 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6714 blocks. Add object count for script input files.
6715 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6716 script_info parameter; change all callers.
6717 (Incremental_inputs::report_object): Add script_info parameter;
6718 change all callers.
6719 (Incremental_inputs::report_script): Store backpointer to
6720 incremental info entry.
6721 (Output_section_incremental_inputs::set_final_data_size): Record
6722 additional information for scripts.
6723 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6724 * incremental.h (Incremental_script_entry::add_object): New function.
6725 (Incremental_script_entry::get_object_count): New function.
6726 (Incremental_script_entry::get_object): New function.
6727 (Incremental_script_entry::objects_): New data member; adjust
6728 constructor.
6729 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6730 (Incremental_inputs::report_object): Add script_info parameter.
6731 (Incremental_inputs_reader::get_object_count): New function.
6732 (Incremental_inputs_reader::get_object_offset): New function.
6733 * options.cc (Input_arguments::add_file): Return reference to
6734 new input argument.
6735 * options.h (Input_argument::set_script_info): New function.
6736 (Input_argument::script_info): New function.
6737 (Input_argument::script_info_): New data member; adjust all
6738 constructors.
6739 (Input_file_group::add_file): Return reference to new input argument.
6740 (Input_file_lib::add_file): Likewise.
6741 (Input_arguments::add_file): Likewise.
6742 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6743 * script.cc (Parser_closure::Parser_closure): Add script_info
6744 parameter; adjust all callers.
6745 (Parser_closure::script_info): New function.
6746 (Parser_closure::script_info_): New data member.
6747 (read_input_script): Report scripts earlier to incremental info.
6748 (script_add_file): Set script_info in Input_argument.
6749 (script_add_library): Likewise.
6750 * script.h (Script_options::Script_info): Rewrite class.
6751
a869183f 67522011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
6753
6754 * archive.cc (Library_base::should_include_member): Move
6755 method here from class Archive.
6756 (Archive::Archive): Initialize base class.
6757 (Archive::should_include_member): Move to base class.
6758 (Archive::do_for_all_unused_symbols): New function.
6759 (Add_archive_symbols::run): Remove redundant access to
6760 incremental_inputs.
6761 (Lib_group::Lib_group): Initialize base class.
6762 (Lib_group::do_filename): New function.
6763 (Lib_group::include_member): Pass pointer to Lib_group to
6764 report_object.
6765 (Lib_group::do_for_all_unused_symbols): New function.
6766 (Add_lib_group_symbols::run): Report archive information for
6767 incremental links.
6768 * archive.h (class Library_base): New base class.
6769 (class Archive): Derive from Library_base.
6770 (Archive::filename): Move to base class.
6771 (Archive::set_incremental_info): Likewise.
6772 (Archive::incremental_info): Likewise.
6773 (Archive::Should_include): Likewise.
6774 (Archive::should_include_member): Likewise.
6775 (Archive::Armap_entry): Remove.
6776 (Archive::Unused_symbol_iterator): Remove.
6777 (Archive::unused_symbols_begin): Remove.
6778 (Archive::unused_symbols_end): Remove.
6779 (Archive::do_filename): New function.
6780 (Archive::do_get_mtime): New function.
6781 (Archive::do_for_all_unused_symbols): New function.
6782 (Archive::task_): Move to base class.
6783 (Archive::incremental_info_): Likewise.
6784 (class Lib_group): Derive from Library_base.
6785 (Lib_group::do_filename): New function.
6786 (Lib_group::do_get_mtime): New function.
6787 (Lib_group::do_for_all_unused_symbols): New function.
6788 (Lib_group::task_): Move to base class.
6789 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6790 function.
6791 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6792 function.
6793 * incremental.cc (Incremental_inputs::report_archive_begin):
6794 Use Library_base; call library's get_mtime; add incremental inputs
6795 entry before members.
6796 (class Unused_symbol_visitor): New class.
6797 (Incremental_inputs::report_archive_end): Use Library_base; use
6798 visitor class to record unused symbols; don't add incremental inputs
6799 entry after members.
6800 (Incremental_inputs::report_object): Use Library_base.
6801 * incremental.h
6802 (Incremental_archive_entry::Incremental_archive_entry): Remove
6803 unused Archive parameter.
6804 (Incremental_inputs::report_archive_begin): Use Library_base.
6805 (Incremental_inputs::report_archive_end): Likewise.
6806 (Incremental_inputs::report_object): Likewise.
6807 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6808 function.
6809 * object.h (Object::for_all_global_symbols): New function.
6810 (Object::do_for_all_global_symbols): New function.
6811 (Sized_relobj::do_for_all_global_symbols): New function.
6812 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6813 function.
6814 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6815 function.
6816
61ab3e40
ILT
68172011-03-27 Ian Lance Taylor <iant@google.com>
6818
6819 * archive.cc (Archive::interpret_header): Return -1 if something
6820 goes wrong. Change callers accordingly.
6821
30e1f9e6
CC
68222011-03-25 Cary Coutant <ccoutant@google.com>
6823
6824 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6825 * testsuite/Makefile.in: Regenerate.
6826
9370ce59 68272011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
6828
6829 * plugin.cc (get_view): New.
6830 (Plugin::load): Pass get_view to the plugin.
6831 (Plugin_manager::get_view): New.
6832
9312bb0a
ILT
68332011-03-21 Ian Lance Taylor <iant@google.com>
6834
6835 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 6836 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 6837
7e12ba9e
ST
68382011-03-21 Sriraman Tallam <tmsriram@google.com>
6839
6840 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6841 Change == to -eq.
6842 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6843 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6844 Change == to -eq.
6845 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6846 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6847
fd7a005d
ILT
68482011-03-14 Ian Lance Taylor <iant@google.com>
6849
6850 * script-sections.cc (Sort_output_sections::script_compare):
6851 Rename from is_before, change return type.
6852 (Sort_output_sections::operator()): Adjust accordingly.
6853
ed16fd1b
ILT
68542011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6855
6856 PR gold/12572
6857 * testsuite/odr_violation2.cc: Add comment to make all error line
6858 numbers double digits.
6859 * testsuite/debug_msg.sh: Adjust expected errors.
6860
71ff8986
ILT
68612011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6862
6863 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6864 but mark earlier ones as non-canonical
6865 (offset_to_iterator): Update search target and example
6866 (do_addr2line): Return extra lines in a vector*
6867 (format_file_lineno): Extract from do_addr2line
6868 (one_addr2line): Add vector* out-param
6869 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6870 when a lineno entry appeared last for its instruction
6871 (Dwarf_line_info): Add vector* out-param
6872 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6873 * symtab.cc (Odr_violation_compare): Include the lineno in the
6874 comparison again.
6875 (linenos_from_loc): New. Combine the canonical line for an
6876 address with its other lines.
6877 (True_if_intersect): New. Helper functor to make
6878 std::set_intersection a query.
6879 (detect_odr_violations): Compare sets of lines instead of just
6880 one line for each function. This became less deterministic, but
6881 has fewer false positives.
6882 * symtab.h: Declarations.
6883 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6884 mix an optimized and non-optimized object in the same binary
6885 (odr_violation2.so): Same.
6886 * testsuite/Makefile.in: Regenerate from Makefile.am.
6887 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6888 * testsuite/debug_msg.sh: Update line numbers and add
6889 assertions.
6890 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6891 non-optimized context.
6892 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6893 isn't inlined, and use OdrDerived in an optimized context.
6894 * testsuite/odr_header1.h: Defines OdrDerived, where
6895 optimization will change the
6896 first-instruction-in-the-destructor's file and line number.
6897 * testsuite/odr_header2.h: Defines OdrBase.
6898
a19fefdc
ILT
68992011-03-09 Ian Lance Taylor <iant@google.com>
6900
6901 * fileread.cc (File_read::clear_views): Don't delete the whole
6902 file view.
6903
ecb351e9
ILT
69042011-03-08 Ian Lance Taylor <iant@google.com>
6905
6906 PR gold/12525
6907 * fileread.cc: #include <climits>.
6908 (GOLD_IOV_MAX): Define.
6909 (File_read::read_multiple): Limit number of entries by iov_max.
6910 * fileread.h (class File_read): Always set max_readv_entries to
6911 128.
6912
b821d13c
ILT
69132011-03-07 Ian Lance Taylor <iant@google.com>
6914
6915 PR gold/12525
6916 * options.h (class General_options): Add -dy and -dn.
6917
89243142
CC
69182011-03-02 Cary Coutant <ccoutant@google.com>
6919
6920 * testsuite/script_test_9.t: Add TLS segment.
6921
d0773f31
ILT
69222011-03-02 Simon Baldwin <simonb@google.com>
6923
6924 * configure.ac: Add check for gnu_indirect_function support in
6925 the toolchain building binutils.
6926 * configure: Rebuild.
6927
9370ce59 69282011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
6929
6930 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6931 plugin only symbols.
6932 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6933 in plugin files as not needed in the symbol table.
6934
4cf7a849
ST
69352011-02-11 Sriraman Tallam <tmsriram@google.com>
6936
6937 * output.cc (Output_section::add_input_section): Delay fill
6938 generation for section ordering.
6939
b578bd7d
ILT
69402011-02-09 Ian Lance Taylor <iant@google.com>
6941
6942 PR gold/12316
6943 * object.h (class Sized_relobj): Remove clear_local_symbols.
6944 * reloc.cc (Sized_relobj::do_relocate): Don't call
6945 clear_local_symbols.
6946
9370ce59 69472011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
6948
6949 * plugin.cc (is_visible_from_outside): Return true for symbols
6950 in the -u option.
6951
55382fb7
ILT
69522011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6953
6954 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6955 filename.
6956
4e271fff
ST
69572011-02-02 Sriraman Tallam <tmsriram@google.com>
6958
6959 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 6960 to std::string.
4e271fff 6961 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 6962 section_name to be std::string.
4e271fff
ST
6963 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6964
d433c3ac
ILT
69652011-01-25 Ian Lance Taylor <iant@google.com>
6966
6967 * script.cc (script_add_extern): Rewrite to use
6968 add_symbol_reference.
6969
880473a6
DK
69702011-01-25 Doug Kwan <dougkwan@google.com>
6971
d433c3ac 6972 * icf.cc (get_section_contents): Always lock section's object.
880473a6 6973
f30f86fa
ILT
69742011-01-24 Ian Lance Taylor <iant@google.com>
6975
6976 * options.h (class General_options): Accept
6977 --no-detect-odr-violations.
6978
8e51a0b9
ILT
69792011-01-24 Ian Lance Taylor <iant@google.com>
6980
6981 * version.cc (version_string): Bump to 1.11.
6982
0f3b89d8
ILT
69832011-01-24 Ian Lance Taylor <iant@google.com>
6984
6985 * plugin.cc (class Plugin_rescan): Define new class.
6986 (Plugin_manager::claim_file): Set any_claimed_.
6987 (Plugin_manager::save_archive): New function.
6988 (Plugin_manager::save_input_group): New function.
6989 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6990 necessary.
6991 (Plugin_manager::new_undefined_symbol): New function.
6992 (Plugin_manager::rescan): New function.
6993 (Plugin_manager::rescannable_defines): New function.
6994 (Plugin_manager::add_input_file): Set any_added_.
6995 * plugin.h (class Plugin_manager): define new fields rescannable_,
6996 undefined_symbols_, any_claimed_, and any_added_. Declare
6997 Plugin_rescan as friend. Declare new functions.
6998 (Plugin_manager::Rescannable): Define type.
6999 (Plugin_manager::Rescannable_list): Define type.
7000 (Plugin_manager::Undefined_symbol_list): Define type.
7001 (Plugin_manager::Plugin_manager): Initialize new fields.
7002 * archive.cc (Archive::defines_symbol): New function.
7003 (Add_archive_symbols::run): Pass archive to plugins if any.
7004 * archive.h (class Archive): Declare defines_symbol.
7005 * readsyms.cc (Input_group::~Input_group): New function.
7006 (Finish_group::run): Pass input_group to plugins if any.
7007 * readsyms.h (class Input_group): Declare destructor.
7008 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7009 any.
7010
3bb951e5
ILT
70112011-01-10 Ian Lance Taylor <iant@google.com>
7012
7013 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7014 section as relro.
7015 (Layout::set_segment_offsets): Reset increase_relro before calling
7016 set_section_addresses a second time.
7017
0aa45fac
CC
70182011-01-04 Cary Coutant <ccoutant@google.com>
7019
7020 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7021 sections before NOBITS sections.
7022
0db46eb4
L
70232011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7024
7025 * version.cc (print_version): Update copyright to 2011.
7026
829c9745
CC
70272010-12-23 Cary Coutant <ccoutant@google.com>
7028
7029 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7030 of OS to this->add. Add OD parameter to second form of the function.
7031
7500420b
ILT
70322010-12-20 Ian Lance Taylor <iant@google.com>
7033
7034 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7035 second of two consecutive entries with same offset.
7036
f8e9a930
RW
70372010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7038
7039 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7040 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7041 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7042 to avoid unneeded links against $(LDADD).
7043 * testsuite/Makefile.in: Regenerate.
7044
2fbb4320
ILT
70452010-12-15 Ian Lance Taylor <iant@google.com>
7046
7047 PR gold/12324
7048 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
7049 for R_X86_64_32 and R_X86_64_PC32.
7050 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7051 ver_matching_def_pic.o.
7052 (ver_matching_def_pic.o): New target.
7053
fedb228d
RW
70542010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7055
7056 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7057 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7058 Move definition before File_read::View member definitions.
7059 (File_read::View::~View): Initialize and hold lock before
7060 updating current_mapped_bytes.
7061
9b547ce6
RW
70622010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7063
7064 * dwarf_reader.cc: Remove outdated comment.
7065 * gold-threads.cc: Fix typo in error message.
7066 * archive.cc: Fix typos in comments.
7067 * archive.h: Likewise.
7068 * arm-reloc-property.cc: Likewise.
7069 * arm-reloc-property.h: Likewise.
7070 * arm-reloc.def: Likewise.
7071 * arm.cc: Likewise.
7072 * attributes.h: Likewise.
7073 * cref.cc: Likewise.
7074 * ehframe.cc: Likewise.
7075 * fileread.h: Likewise.
7076 * gold.h: Likewise.
7077 * i386.cc: Likewise.
7078 * icf.cc: Likewise.
7079 * incremental.h: Likewise.
7080 * int_encoding.cc: Likewise.
7081 * layout.h: Likewise.
7082 * main.cc: Likewise.
7083 * merge.h: Likewise.
7084 * object.cc: Likewise.
7085 * object.h: Likewise.
7086 * options.cc: Likewise.
7087 * readsyms.cc: Likewise.
7088 * reduced_debug_output.cc: Likewise.
7089 * reloc.cc: Likewise.
7090 * script-sections.cc: Likewise.
7091 * sparc.cc: Likewise.
7092 * symtab.h: Likewise.
7093 * target-reloc.h: Likewise.
7094 * target.cc: Likewise.
7095 * target.h: Likewise.
7096 * timer.cc: Likewise.
7097 * timer.h: Likewise.
7098 * x86_64.cc: Likewise.
7099
83e17bd5
CC
71002010-12-09 Cary Coutant <ccoutant@google.com>
7101
7102 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
7103 stack.
7104 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
7105 parameter; change all callers.
7106 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
7107 * options.h (warn_execstack): New option.
7108
017257f8
DK
71092010-12-07 Doug Kwan <dougkwan@google.com>
7110
7111 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
7112 like function call relocations.
7113
c20cbc06
ILT
71142010-12-07 Ian Lance Taylor <iant@google.com>
7115
7116 * archive.cc (Archive::get_elf_object_for_member): Permit
7117 punconfigured to be NULL.
7118 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7119 (Archive::include_member): Pass NULL to get_elf_object_for_member
7120 if we searched for the archive and this is the first included
7121 object.
7122
4dbfafcc
ILT
71232010-12-01 Ian Lance Taylor <iant@google.com>
7124
7125 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7126 track_relocs_type_ field.
7127 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7128 Set track_relocs_type_.
7129 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7130 contents when using RELA relocs.
7131 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7132 reloc_map_.
7133 * reloc.cc (Track_relocs::next_addend): New function.
7134 * reloc.h (class Track_relocs): Declare next_addend.
7135
e5e19edd
ILT
71362010-12-01 Ian Lance Taylor <iant@google.com>
7137
7138 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7139 virtual destructor.
7140
9a5ce24c
ILT
71412010-12-01 Ian Lance Taylor <iant@google.com>
7142
7143 * README: Update compilers known to work and fail.
7144
c7791212
NC
71452010-11-23 Matthias Klose <doko@ubuntu.com>
7146
7147 * configure.in: For --enable-gold, handle value `default' instead of
7148 `both*'. Always install ld as ld.bfd, install as ld if gold is
7149 not the default.
7150 * configure: Regenerate.
7151
0ad220c9
DK
71522010-11-18 Doug Kwan <dougkwan@google.com>
7153
7154 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7155 and right_alignment to be zero. Store result alignment only if it is
7156 greater than existing alignment.
7157
ab8056e0
CC
71582010-11-16 Cary Coutant <ccoutant@google.com>
7159
7160 PR gold/12220
7161 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7162 Check for ".zdebug_line".
7163
fd064a5b
CC
71642010-11-16 Doug Kwan <dougkwan@google.com>
7165 Cary Coutant <ccoutant@google.com>
7166
7167 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7168 by reference; adjust all callers.
7169 * output.cc (Output_segment::set_section_addresses): Adjust references
7170 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7171 list is empty.
7172 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7173 end at page boundary.
7174
6fc6ea19
CC
71752010-11-16 Cary Coutant <ccoutant@google.com>
7176
7177 PR gold/12220
7178 * layout.cc (Layout::choose_output_section): Transform names of
7179 compressed sections even when using a script with a SECTIONS clause.
7180 (Layout::output_section_name): Remove code to transform
7181 compressed debug section names.
7182 * output.cc (Output_section::add_input_section): Use uncompressed
7183 section size when tracking input sections.
7184
95a2c8d6
RS
71852010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7186
7187 * symtab.h (Symbol::NON_PIC_REF): Remove.
7188 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7189 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7190 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7191 (Symbol::use_plt_offset): Take a flags argument and pass it
7192 directly to needs_dynamic_reloc. Restrict check for undefined
7193 weak symbols to function calls.
7194 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7195 (Target_arm::Scan::global): Use it.
7196 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7197 (Target_arm::Relocate::relocate): Likewise.
7198 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7199 parameter with an r_type parameter. Use get_reference_flags
7200 to get the flags.
7201 (Target_arm::Relocate::relocate): Update accordingly.
7202 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7203 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7204 (Target_i386::Scan::global): Likewise.
7205 (Target_i386::Relocate::relocate): Likewise.
7206 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7207 parameter with an r_type parameter. Use get_reference_flags
7208 to get the flags.
7209 (Target_i386::Relocate::relocate): Update accordingly.
7210 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7211 (Target_powerpc::Scan::global): Use it.
7212 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7213 (Target_powerpc::Relocate::relocate): Likewise.
7214 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7215 (Target_sparc::Scan::global): Use it.
7216 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7217 (Target_sparc::Relocate::relocate): Likewise.
7218 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7219 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7220 (Target_x86_64::Scan::global): Likewise.
7221 (Target_x86_64::Relocate::relocate): Likewise.
7222
f625ae50
DK
72232010-11-08 Doug Kwan <dougkwan@google.com>
7224 Cary Coutant <ccoutant@google.com>
7225
7226 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7227 (Arm_exidx_merge_section::section_contents_): New data member.
7228 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7229 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 7230 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
7231 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7232 in parameters instead of calling Object::section_contents without
7233 locking.
7234 (Arm_output_section::group_section): New parameter TASK. Pass it
7235 to callees that need locking objects.
7236 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7237 to lock EXIDX input sections. Fix a formatting issue. Call
7238 Arm_exidx_merged_section::build_contents to create merged section
7239 contents.
7240 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7241 to lock object of stub table owner.
7242 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7243 TEXT_SIZE to initialize data member TEXT_SIZE_.
7244 (Arm_exidx_input_section::addralign): Fix typo in comment.
7245 (Arm_exidx_input_section::text_size): New method.
7246 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7247 that require locking objects. Lock objects before scanning for stubs
7248 and updating local symbols.
7249 (Arm_input_section<big_endian>::init): Copy contents of original
7250 input section.
2e702c99 7251 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
7252 original input section instead of calling Object::section_contents
7253 without locking.
7254 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7255 size without calling Object::section_size().
7256 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7257 for size. Allocate a buffer for merged EXIDX entries.
7258 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7259 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7260 building code to Arm_exidx_merged_section::build_contetns. Write
7261 out contetns in buffer instead of building it on the fly.
7262 (Arm_relobj::make_exidx_input_section): Also pass text section size
7263 to Arm_exidx_input_section constructor.
7264 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7265 (Arm_dynobj::do_read_symbols): Fix memory leak.
7266 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7267 * target.h: (class Task): Add forward declaration.
7268 (Target::relax): Add new parameter TASK and pass it to
7269 Target::do_relax().
7270 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7271
5f9bcf58
CC
72722010-11-05 Cary Coutant <ccoutant@google.com>
7273
7274 PR gold/10708
7275 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7276 object when reading from the file.
7277 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7278 second layout pass.
7279 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7280 when reading section contents.
7281 (get_section_contents): Likewise.
7282 (icf::find_identical_sections): Likewise.
7283 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7284 object when reading from the file.
7285 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7286 the object when doing deferred section layout.
7287
e597fa08
NC
72882010-11-03 Nick Clifton <nickc@redhat.com>
7289
7290 PR gold/12001
7291 * script.h (class Symbol_assignment: name): New member. Returns
7292 the name of the symbol.
7293 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7294 Returns true if the given symbol name is on the list of
7295 assignments wating to be processed.
7296 * archive.cc (should_incldue_member): If the symbol is undefined,
7297 check to see if it is on the list of symbols pending assignment.
7298
3f9a3278
ILT
72992010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7300
7301 * script-sections.cc (Script_sections::find_memory_region): Check
7302 for a NULL output section pointer.
7303
d06fb4d1
DK
73042010-10-29 Doug Kwan <dougkwan@google.com>
7305
7306 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7307 Output_section::add_relaxed_input_section.
7308 * output.cc (Output_section::add_relaxed_input_section): Add new
7309 arguments LAYOUT and NAME. Set section order index.
7310 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7311 Copy section order index.
7312 * output.h (Output_section::add_relaxed_input_section): Add new
7313 arguments LAYOUT and NAME.
7314
90e24de5
ILT
73152010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7316
7317 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7318 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7319 * testsuite/Makefile.in: Regenerate.
7320
c9484ea5
DK
73212010-10-20 Doug Kwan <dougkwan@google.com>
7322
7323 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7324 without SHF_LINK_ORDER flags.
7325 * layout.cc (Layout::choose_output_section): Do not filter
7326 SHF_LINK_ORDER flag in a relocatable link.
7327
5bc2f5be
CC
73282010-10-17 Cary Coutant <ccoutant@google.com>
7329
7330 * output.h (Output_segment::set_section_addresses): Change function
7331 signature. Update all callers.
7332 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7333 sections.
7334 (Output_segment::set_section_addresses): Align after last TLS
7335 section. Add padding before last relro section instead of after.
7336
0c91cf04
DK
73372010-10-17 Doug Kwan <dougkwan@google.com>
7338
7339 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7340 GOT output section to be writable.
7341
8c21d9d3
CC
73422010-10-14 Cary Coutant <ccoutant@google.com>
7343
7344 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7345 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7346 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7347 mode.
7348 * incremental.cc (report_command_line): Ignore all forms of
7349 --incremental.
7350 * layout.cc (Layout::Layout): Check parameters for incremental link
7351 mode.
7352 * options.cc (General_options::parse_incremental): New function.
7353 (General_options::parse_no_incremental): New function.
7354 (General_options::parse_incremental_full): New function.
7355 (General_options::parse_incremental_update): New function.
7356 (General_options::incremental_mode_): New data member.
7357 (General_options::finalize): Check incremental_mode_.
7358 * options.h (General_options): Update help text for --incremental.
7359 Add --no-incremental, --incremental-full, --incremental-update.
7360 (General_options::Incremental_mode): New enum type.
7361 (General_options::incremental_mode): New function.
7362 (General_options::incremental_mode_): New data member.
7363 * parameters.cc (Parameters::incremental_mode_): New data member.
7364 (Parameters::set_options): Set incremental_mode_.
7365 (Parameters::set_incremental_full): New function.
7366 (Parameters::incremental): New function.
7367 (Parameters::incremental_update): New function.
7368 (set_parameters_incremental_full): New function.
7369 * parameters.h (Parameters::set_incremental_full): New function.
7370 (Parameters::incremental): New function.
7371 (Parameters::incremental_update): New function.
7372 (Parameters::incremental_mode_): New data member.
7373 (set_parameters_incremental_full): New function.
7374 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7375 incremental link mode.
7376 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7377 (Sized_relobj::do_relocate_sections): Likewise.
7378 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7379 option.
7380 * testsuite/Makefile.in: Regenerate.
7381 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7382
bb32aa18 73832010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7384
7385 * script-sections.h (class Script_sections): Make
7386 Sections_elements typedef public.
7387 * script-sections.cc (class Sort_output_sections): Add elements_
7388 field. Add constructor which sets it; change all callers.
7389 (Sort_output_sections::is_before): New function.
7390 (Sort_output_sections::operator()): Call is_before.
7391 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7392 conditional.
7393 * testsuite/script_test_10.sh: New test. Test script section
7394 order.
7395 * testsuite/script_test_10.t: Likewise.
7396 * testsuite/script_test_10.s: Likewise.
7397 * testsuite/Makefile.am: Wrap the cross linker tests and the
7398 common tests into NATIVE_OR_CROSS_LINKER.
7399 (check_SCRIPTS): Add script_test_10.sh.
7400 (check_DATA): Add script_test_10.stdout.
7401 (script_test_10.o, script_test_10): New targets.
7402 (script_test_10.stdout): New target.
7403 * configure, testsuite/Makefile.in: Regenerate.
7404
3cef7179
ILT
74052010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7406
7407 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7408 error for the deprecated relocations.
7409 (Target_arm::Scan::global): Likewise.
7410 (Target_arm::Relocate::relocate): Likewise.
7411
7411e9a8
RS
74122010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7413
7414 * fileread.cc (Input_file::find_file): Initialize *found_name
7415 and *namep when using the fallback search for case 4.
7416
6a9da32a
CC
74172010-10-11 Cary Coutant <ccoutant@google.com>
7418
7419 * options.h (class General_options): Redefine -z lazy as an alias for
7420 the negation of -z now.
7421
ac897c20
ILT
74222010-10-11 Ian Lance Taylor <iant@google.com>
7423
7424 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7425 binding.
7426
ea5cae92
NC
74272010-10-06 Nick Clifton <nickc@redhat.com>
7428
7429 * script-sections.cc(class Memory_region): Remove
7430 current_lma_offset_ field. Rename current_vma_offset_ to
7431 current_offset_. Add last_section_ field.
7432 (Memory_region::get_current_vma_address): Rename to
7433 get_current_address.
7434 (Memory_region::get_current_lma_address): Delete.
7435 (Memory_region::increment_vma_offset): Rename to
7436 increment_offset.
7437 (Memory_region::increment_lma_offset): Delete.
7438 (Memory_region::attributes_compatible): New method. Returns
7439 true if the provided section is compatible with the region.
7440 (Memory_region::get_last_section): New method. Returns the last
7441 section to use the region.
7442 (Memory_region::set_last_section): New method. Stores the last
7443 section to use the region.
7444 (Script_sections::block_in_region): New method. Returns true if
7445 a block of memory is contained within a region.
7446 (Script_sections::find_memory_region): New method. Locates a
7447 memory region to be used to set a VMA or LMA address.
7448 (Output_section_definition::set_section_addresses): Add code to
7449 check for addresses set by memory regions.
7450 (Output_segment::set_section_addresses): Remove memory region
7451 walking code.
7452 (Script_sections::create_segment): Add a warning if a header
7453 segment is created outside of any region.
7454 * script-sections.h (class Script_sections): Add prototypes for
7455 find_memory_region and block_in_region methods.
7456 * testsuite/memory_test.s: Use .long instead of .word.
7457 * testsuite/memory_test.t: Add some more output sections.
7458 * testsuite/memory_test.sh: Update expected output.
7459
a9bfd952
DK
74602010-10-02 Doug Kwan <dougkwan@google.com>
7461
7462 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7463 defintion to symtab.h
7464 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7465 declaration to defintion.
7466
bacff3ab
NC
74672010-10-01 Nick Clifton <nickc@redhat.com>
7468
7469 * expression.cc (eval): Replace dummy argument with NULL.
7470 (eval_maybe_dot): Check for a NULL result section pointer.
7471 (Symbol_expression::value): Likewise.
7472 (Dot_expression::value): Likewise.
7473 (BINARY_EXPRESSION): Likewise.
7474 (Max_expression::value): Likewise.
7475 (Min_expression::value): Likewise.
7476 (Absolute_expression::value): Likewise.
7477 (Addr_expression::value_from_output_section): Likewise.
7478 (Loaddddr_expression::value_from_output_section): Likewise.
7479 (Segment_start_expression::value): Likewise.
7480 * script-sections.cc
7481 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7482 argument with NULL.
7483 (Sections_elememt_dot_assignment::set_section_addresses):
7484 Likewise.
7485 (Output_data_expression::do_write_to_buffer): Likewise.
7486 (Output_section_definition::finalize_symbols): Likewise.
7487 (Output_section_definition::set_section_addresses): Likewise.
7488
f81bc8b5
DK
74892010-09-30 Doug Kwan <dougkwan@google.com>
7490
7491 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7492
c95e9f27
ST
74932010-09-28 Sriraman Tallam <tmsriram@google.com>
7494
7495 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 7496 function.
c95e9f27
ST
7497 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7498 virtual function.
7499 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7500 virtual function.
7501 * icf.cc (get_section_contents): Inline merge sections only when
7502 target allows it.
7503
3cac54d2
RW
75042010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7505
7506 * configure: Regenerate.
7507
2904037a
ILT
75082010-09-17 Ian Lance Taylor <iant@google.com>
7509
7510 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7511 * testsuite/Makefile.am (memory_test.o): New target.
7512 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7513 memory_test.t.
7514 * testsuite/Makefile.in: Rebuild.
2904037a 7515
bca7fb63
DK
75162010-09-17 Doug Kwan <dougkwan@google.com>
7517
7518 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7519 defintion if relocation uses GOT entries of the symbol.
7520 * testsuite/icf_safe_test.sh: Fix test.
7521 * testsuite/icf_safe_so_test.sh: Fix test.
7522
4ef28648
CC
75232010-09-16 Cary Coutant <ccoutant@google.com>
7524
7525 * script_sections.cc (class Memory_region): Remove "NULL" from
7526 vector initializations.
7527
793990de
CC
75282010-09-15 Cary Coutant <ccoutant@google.com>
7529
7530 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7531 Resolve forwarding symbols.
7532
81e015e2
DK
75332010-09-15 Doug Kwan <dougkwan@google.com>
7534
7535 * gold/testsuite/script_test_3.t: Add ARM special sections.
7536 * gold/testsuite/script_test_4.t: Same.
7537 * gold/testsuite/script_test_5.t: Same.
7538 * gold/testsuite/script_test_6.t: Same.
7539 * gold/testsuite/script_test_7.t: Same.
7540 * gold/testsuite/script_test_7.t: Same.
7541 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7542
36171d64
CC
75432010-09-14 Cary Coutant <ccoutant@google.com>
7544
7545 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7546 (Target_x86_64::Relocate::relocate_tls): Replace check for
7547 saw_tls_block_reloc_ with test for executable section.
7548
d89051bd
CC
75492010-09-12 Cary Coutant <ccoutant@google.com>
7550
7551 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7552 position-independent executables to shared libraries need dynamic
7553 relocations.
7554 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7555 position-independent executables.
7556 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7557 * testsuite/Makefile.in: Regenerate.
7558
fca41f0f
NC
75592010-09-10 Nick Clifton <nickc@redhat.com>
7560
7561 PR gold/11997
7562 * testsuite/memory_test.t: Discard any sections that are not
7563 needed.
7564
6695e4b3
L
75652010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7566
7567 PR gold/11996
7568 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7569 "This::" to work around a bug in gcc 4.2.
7570
7571 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7572
0f72bf6f
RÁE
75732010-09-09 Rafael Espindola <espindola@google.com>
7574
7575 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7576 sections with different PF_X flags in the same segment.
7577 (Layout::find_first_load_seg): Search all segments to find the first
7578 one.
7579 * options.h (rosegment): New.
7580
75812010-09-08 Rafael Espindola <espindola@google.com>
a6577478 7582
05a79166 7583 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 7584
aa98ff75
DK
75852010-09-08 Doug Kwan <dougkwan@google.com>
7586
7587 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7588 (Arm_relobj::do_relocate_sections): Add new parameter for output
7589 file to match the parent.
7590 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7591 of local symbols instead of input values. Update code to track
7592 changes in gold::relocate_section.
7593 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7594 (Sized_relobj::compute_final_local_value_internal): New methods.
7595 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7596 body into private version of Sized_relobj::compute_final_local_value.
7597 Call the inline method.
7598 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7599 merged symbol value if there is one.
7600 (Symbol_value::has_output_value): New method defintiion.
7601 (Sized_relobj::Compute_final_local_value_status): New enum type.
7602 (Sized_relobj::compute_final_local_value): New methods.
7603 (Sized_relobj::compute_final_local_value_internal): New methods.
7604 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7605 and arm_cortex_a8.sh.
7606 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7607 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7608 New tests.
7609 * Makefile.in: Regenerate.
7610 * testsuite/arm_bl_out_of_range.s: Update test.
7611 * testsuite/thumb_bl_out_of_range.s: Ditto.
7612 * testsuite/thumb_blx_out_of_range.s: Ditto.
7613 * testsuite/arm_branch_out_of_range.sh: New file.
7614 * testsuite/arm_cortex_a8.sh: Ditto.
7615 * testsuite/arm_cortex_a8_b.s: Ditto.
7616 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7617 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7618 * testsuite/arm_cortex_a8_bl.s: Ditto.
7619 * testsuite/arm_cortex_a8_blx.s: Ditto.
7620 * testsuite/arm_cortex_a8_local.s: Ditto.
7621 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7622 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7623
05a79166
L
76242010-09-08 Rafael Espindola <espindola@google.com>
7625
7626 * Makefile.am (memory_test.stdout): Run readelf with -W.
7627 * Makefile.in: Regenerate.
7628 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7629 64 bit output.
7630
33dbc701
RÁE
76312010-09-08 Rafael Espindola <espindola@google.com>
7632
7633 * script-sections.cc (Script_sections::add_memory_region): Convert
7634 field precision to int.
7635 * script.cc (script_set_section_region, script_set_section_region):
7636 Convert field precision to int.
7637
731ca54a
RÁE
76382010-09-08 Rafael Espindola <espindola@google.com>
7639
7640 * arm.cc (do_finalize_sections): Create the __exidx_start and
7641 __exdix_end symbols even when the section is missing.
7642
7f8cd844
NC
76432010-09-08 Nick Clifton <nickc@redhat.com>
7644
7645 * README: Remove claim that MEMORY is not supported.
7646 * expression.cc (script_exp_function_origin)
7647 (script_exp_function_length): Move from here to ...
7648 * script.cc: ... here.
7649 (script_set_section_region, script_add_memory)
7650 (script_parse_memory_attr, script_include_directive): New
7651 functions.
7652 * script-sections.cc
7653 (class Memory_region): New class.
7654 (class Output_section_definition): Add set_memory_region,
7655 set_section_vma, set_section_lma and get_section_name methods.
7656 (class Script_Sections): Add add_memory_region,
7657 find_memory_region, find_memory_region_origin,
7658 find_memory_region_length and set_memory_region methods.
7659 Have set_section_addresses method walk the list of set memory
7660 regions.
7661 Extend the print methos to display memory regions.
7662 * script-sections.h: Add prototypes for new methods.
7663 Add enum for MEMORY region attributes.
7664 * yyscript.y: Add support for parsing MEMORY regions.
7665 * script-c.h: Add prototypes for new functions.
7666 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7667 * testsuite/Makefile.in: Regenerate.
7668 * testsuite/memory_test.sh: New script.
7669 * testsuite/memory_test.s: New assembler source file.
7670 * testsuite/memory_test.t: New linker script.
7671
a4649286
DK
76722010-08-27 Doug Kwan <dougkwan@google.com>
7673
7674 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7675 reference override an existing dynamic weak reference.
7676 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7677 * testsuite/Makefile.in: Regenerate.
7678 * testsuite/dyn_weak_ref.sh: New file.
7679 * testsuite/dyn_weak_ref_1.c: Ditto.
7680 * testsuite/dyn_weak_ref_2.c: Ditto.
7681
b56648ad
ILT
76822010-08-27 Ian Lance Taylor <iant@google.com>
7683
7684 * incremental.h (class Incremental_input_entry): Add virtual
7685 destructor.
7686
809313cb
ILT
76872010-08-27 Ian Lance Taylor <iant@google.com>
7688
7689 * testsuite/start_lib_test_3.c: Mark t3 as used.
7690
11e32464
NC
76912010-08-27 Nick Clifton <nickc@redhat.com>
7692
7693 * options.cc (version_script): Fix small typo in previous
7694 whitespace tidyup.
7695
ca09d69a
NC
76962010-08-25 Nick Clifton <nickc@redhat.com>
7697
7698 * archive.cc: Formatting fixes: Remove whitespace between
7699 typename and following asterisk. Remove whitespace between
7700 function name and opening parenthesis.
7701 * archive.h: Likewise.
7702 * arm.cc: Likewise.
7703 * attributes.cc: Likewise.
7704 * attributes.h: Likewise.
7705 * common.cc: Likewise.
7706 * copy-relocs.cc: Likewise.
7707 * dirsearch.h: Likewise.
7708 * dynobj.cc: Likewise.
7709 * ehframe.cc: Likewise.
7710 * ehframe.h: Likewise.
7711 * expression.cc: Likewise.
7712 * fileread.cc: Likewise.
7713 * fileread.h: Likewise.
7714 * gc.h: Likewise.
7715 * gold-threads.cc: Likewise.
7716 * gold.cc: Likewise.
7717 * i386.cc: Likewise.
7718 * icf.h: Likewise.
7719 * incremental-dump.cc: Likewise.
7720 * incremental.cc: Likewise.
7721 * layout.cc: Likewise.
7722 * layout.h: Likewise.
7723 * main.cc: Likewise.
7724 * merge.cc: Likewise.
7725 * merge.h: Likewise.
7726 * object.cc: Likewise.
7727 * object.h: Likewise.
7728 * options.cc: Likewise.
7729 * options.h: Likewise.
7730 * output.cc: Likewise.
7731 * output.h: Likewise.
7732 * plugin.cc: Likewise.
7733 * plugin.h: Likewise.
7734 * powerpc.cc: Likewise.
7735 * reloc.cc: Likewise.
7736 * script-c.h: Likewise.
7737 * script-sections.cc: Likewise.
7738 * script.cc: Likewise.
7739 * stringpool.cc: Likewise.
7740 * symtab.cc: Likewise.
7741 * symtab.h: Likewise.
7742 * target.cc: Likewise.
7743 * timer.cc: Likewise.
7744 * timer.h: Likewise.
7745 * version.cc: Likewise.
7746 * x86_64.cc: Likewise.
7747
b8fa8750
NC
77482010-08-24 Nick Clifton <nickc@redhat.com>
7749
7750 PR 11899
7751 * layout.cc (segment_precedes): Sort segments by their physical
7752 addresses, if they have been set.
7753
9919d93b
CC
77542010-08-23 Cary Coutant <ccoutant@google.com>
7755
7756 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7757 symbols data.
7758 (Lib_group::include_member): Unlock object after deleting its
7759 symbols data.
7760 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7761 the bug fixed here.
7762
97b4be1c
CC
77632010-08-19 Neil Vachharajani <nvachhar@google.com>
7764 Cary Coutant <ccoutant@google.com>
7765
7766 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7767 constructor, and set_blocker.
7768 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7769 readsyms_blocker_.
7770 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7771 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7772 * testsuite/Makefile.am (start_lib_test): New test case.
7773 * testsuite/Makefile.in: Regenerate.
7774 * testsuite/start_lib_test_main.c: New file.
7775 * testsuite/start_lib_test_1.c: New file.
7776 * testsuite/start_lib_test_2.c: New file.
7777 * testsuite/start_lib_test_3.c: New file.
7778
dd0b1884
ILT
77792010-08-19 Ian Lance Taylor <iant@google.com>
7780
7781 * Makefile.in: Rebuild with automake 1.11.1.
7782 * aclocal.m4: Likewise.
7783 * testsuite/Makefile.in: Likewise.
7784
7223e9ca
ILT
77852010-08-19 Ian Lance Taylor <iant@google.com>
7786
7787 PR 10893
7788 * i386.cc (class Output_data_plt_i386): Update declarations.
7789 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7790 local_ifuncs_ fields.
7791 (Target_i386::do_plt_section_for_global): New function.
7792 (Target_i386::do_plt_section_for_local): New function.
7793 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7794 parameter; change all callers. Initialize global_ifuncs_ and
7795 local_ifuncs_. If doing a static link define __rel_iplt_start and
7796 __rel_iplt_end.
7797 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7798 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7799 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7800 symbols.
7801 (Target_i386::make_plt_section): New function, broken out of
7802 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7803 (Target_i386::make_plt_entry): Call make_plt_section.
7804 (Target_i386::make_local_ifunc_plt_entry): New function.
7805 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7806 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7807 R_386_IRELATIVE to switch.
7808 (Target_i386::Scan::global): Likewise.
7809 (Target_i386::Relocate::relocate): Likewise.
7810 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7811 switch.
7812 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7813 (Target_x86_64::do_plt_section_for_global): New function.
7814 (Target_x86_64::do_plt_section_for_local): New function.
7815 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7816 parameter; change all callers. If doing a static link define
7817 __rela_iplt_start and __rela_iplt_end.
7818 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7819 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7820 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7821 to point to .plt.
7822 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7823 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7824 switch.
7825 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7826 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7827 R_X86_64_IRELATIVE to switch.
7828 (Target_x86_64::Scan::global): Likewise.
7829 (Target_x86_64::Relocate::relocate): Likewise.
7830 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7831 switch.
7832 * target.h (class Target): Add plt_section_for_global and
7833 plt_section_for_local functions. Add do_plt_section_for_global
7834 and do_plt_section_for_local virtual functions.
7835 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7836 clarifying comments.
7837 (Symbol::use_plt_offset): Handle IFUNC symbol.
7838 * object.cc (Sized_relobj::Sized_relobj): Initialize
7839 local_plt_offsets_.
7840 (Sized_relobj::local_has_plt_offset): New function.
7841 (Sized_relobj::local_plt_offset): New function.
7842 (Sized_relobj::set_local_plt_offset): New function.
7843 (Sized_relobj::do_count): Handle IFUNC symbol.
7844 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7845 a bit away from input_shndx_ field. Add set_is_func_symbol and
7846 is_ifunc_symbol functions.
7847 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7848 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7849 local_plt_offsets_ field.
7850 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7851 * output.h (class Output_section_data): Add non-const
7852 output_section function.
7853 (class Output_data_got): Update declarations.
7854 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7855 Add use_plt_offset parameter to global and local constructors.
7856 Change all callers. Change local_sym_index_ field to 31 bits.
7857 Change GSYM_CODE and CONSTANT_CODE accordingly.
7858 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7859 doing a static link don't set sh_link field.
7860 (Output_data_got::Got_entry::write): Use PLT offset if
7861 appropriate.
7862 (Output_data_got::add_global_plt): New function.
7863 (Output_data_got::add_local_plt): New function.
7864 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7865 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7866 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7867 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7868 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7869 IFUNC conditional.
7870 * testsuite/ifunc-sel.h: New file.
7871 * testsuite/ifuncmain1.c: New file.
7872 * testsuite/ifuncmain1vis.c: New file.
7873 * testsuite/ifuncmod1.c: New file.
7874 * testsuite/ifuncdep2.c: New file.
7875 * testsuite/ifuncmain2.c: New file.
7876 * testsuite/ifuncmain3.c: New file.
7877 * testsuite/ifuncmod3.c: New file.
7878 * testsuite/ifuncmain4.c: New file.
7879 * testsuite/ifuncmain5.c: New file.
7880 * testsuite/ifuncmod5.c: New file.
7881 * testsuite/ifuncmain6pie.c: New file.
7882 * testsuite/ifuncmod6.c: New file.
7883 * testsuite/ifuncmain7.c: New file.
7884 * configure, testsuite/Makefile.in: Rebuild.
7885
56f75c03
ILT
78862010-08-18 Ian Lance Taylor <iant@google.com>
7887
7888 * incremental.cc
7889 (Output_section_incremental_inputs::write_input_files): Add cast
7890 to avoid signed/unsigned comparison warning.
7891 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7892
55455f89
CC
78932010-08-12 Cary Coutant <ccoutant@google.com>
7894
7895 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7896
e2054bcb
ILT
78972010-08-13 Ian Lance Taylor <iant@google.com>
7898
7899 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7900
74f67560
DK
79012010-08-12 Cary Coutant <ccoutant@google.com>
7902 Doug Kwan <dougkwan@google.com>
7903
7904 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7905 defintion overrides non-weak undef, remember that the original undef
7906 is not weak.
7907 * symtab.cc (Symbol_table::sized_write_global): For undef without
7908 an original weak binding, set binding to global in output.
7909 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7910 * testsuite/Makefile.in: Regenerate.
7911 * testsuite/strong_ref_weak_def.sh: New file.
7912 * testsuite/strong_ref_weak_def_1.c: Ditto.
7913 * testsuite/strong_ref_weak_def_2.c: Ditto.
7914
d1238d12
CC
79152010-08-12 Cary Coutant <ccoutant@google.com>
7916
7917 * testsuite/incremental_test.sh: Rewrite.
7918 * testsuite/incremental_test_1.c: Rewrite.
7919 * testsuite/incremental_test_2.c: Rewrite.
7920
0e70b911
CC
79212010-08-12 Cary Coutant <ccoutant@google.com>
7922
7923 * arm.cc (Target_arm::got_size): Add const.
7924 (Target_arm::got_entry_count): New function.
7925 (Target_arm::plt_entry_count): New function.
7926 (Target_arm::first_plt_entry_offset): New function.
7927 (Target_arm::plt_entry_size): New function.
7928 (Output_data_plt_arm::entry_count): New function.
7929 (Output_data_plt_arm::first_plt_entry_offset): New function.
7930 (Output_data_plt_arm::get_plt_entry_size): New function.
7931 * i386.cc (Target_i386::got_size): Add const.
7932 (Target_i386::got_entry_count): New function.
7933 (Target_i386::plt_entry_count): New function.
7934 (Target_i386::first_plt_entry_offset): New function.
7935 (Target_i386::plt_entry_size): New function.
7936 (Output_data_plt_i386::entry_count): New function.
7937 (Output_data_plt_i386::first_plt_entry_offset): New function.
7938 (Output_data_plt_i386::get_plt_entry_size): New function.
7939 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7940 find_incremental_inputs_sections. Dump incremental_got_plt section.
7941 * incremental.cc: Include target.h.
7942 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7943 parameter. Adjust all callers. Find incremental_got_plt section.
7944 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7945 section.
7946 (Output_section_incremental_inputs::set_final_data_size): Calculate
7947 size of incremental_got_plt section.
7948 (Output_section_incremental_inputs::do_write): Write the
7949 incremental_got_plt section.
7950 (Got_plt_view_info): New struct.
7951 (Local_got_offset_visitor): New class.
7952 (Global_got_offset_visitor): New class.
7953 (Global_symbol_visitor_got_plt): New class.
7954 (Output_section_incremental_inputs::write_got_plt): New function.
7955 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7956 Add parameter. Adjust all callers.
7957 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7958 (Incremental_inputs::got_plt_section): New function.
7959 (Incremental_inputs::got_plt_section_): New data member.
7960 (Incremental_got_plt_reader): New class.
7961 * layout.cc (Layout::create_incremental_info_sections): Add the
7962 incremental_got_plt section.
7963 * object.h (Got_offset_list::get_list): New function.
7964 (Got offset_list::for_all_got_offsets): New function.
7965 (Sized_relobj::local_got_offset_list): New function.
7966 * powerpc.cc (Target_powerpc::got_size): Add const.
7967 (Target_powerpc::got_entry_count): New function.
7968 (Target_powerpc::plt_entry_count): New function.
7969 (Target_powerpc::first_plt_entry_offset): New function.
7970 (Target_powerpc::plt_entry_size): New function.
7971 (Output_data_plt_powerpc::entry_count): New function.
7972 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7973 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7974 * sparc.cc (Target_sparc::got_size): Add const.
7975 (Target_sparc::got_entry_count): New function.
7976 (Target_sparc::plt_entry_count): New function.
7977 (Target_sparc::first_plt_entry_offset): New function.
7978 (Target_sparc::plt_entry_size): New function.
7979 (Output_data_plt_sparc::entry_count): New function.
7980 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7981 (Output_data_plt_sparc::get_plt_entry_size): New function.
7982 * symtab.h (Symbol::got_offset_list): New function.
7983 (Symbol_table::for_all_symbols): New function.
7984 * target.h (Sized_target::got_entry_count): New function.
7985 (Sized_target::plt_entry_count): New function.
7986 (Sized_target::plt_entry_size): New function.
7987 * x86_64.cc (Target_x86_64::got_size): Add const.
7988 (Target_x86_64::got_entry_count): New function.
7989 (Target_x86_64::plt_entry_count): New function.
7990 (Target_x86_64::first_plt_entry_offset): New function.
7991 (Target_x86_64::plt_entry_size): New function.
7992 (Output_data_plt_x86_64::entry_count): New function.
7993 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7994 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7995
09ec0418
CC
79962010-08-12 Cary Coutant <ccoutant@google.com>
7997
7998 * archive.cc: Include incremental.h.
7999 (Archive::Archive): Initialize incremental_info_.
8000 (Archive::include_member): Record archive members in incremental info.
8001 (Add_archive_symbols::run): Record begin and end of an archive in
8002 incremental info.
8003 (Lib_group::include_member): Record objects in incremental info.
8004 * archive.h (Incremental_archive_entry): Forward declaration.
8005 (Archive::set_incremental_info): New member function.
8006 (Archive::incremental_info): New member function.
8007 (Archive::Unused_symbol_iterator): New class.
8008 (Archive::unused_symbols_begin): New member function.
8009 (Archive::unused_symbols_end): New member function.
8010 (Archive::incremental_info_): New data member.
8011 * incremental-dump.cc (find_input_containing_global): New function.
8012 (dump_incremental_inputs): Dump new incremental info sections.
8013 * incremental.cc: Include symtab.h.
8014 (Output_section_incremental_inputs): New class.
8015 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8016 new incremental info sections.
8017 (Sized_incremental_binary::do_check_inputs): Likewise.
8018 (Incremental_inputs::report_archive): Remove.
8019 (Incremental_inputs::report_archive_begin): New function.
8020 (Incremental_inputs::report_archive_end): New function.
8021 (Incremental_inputs::report_object): New function.
8022 (Incremental_inputs::finalize_inputs): Remove.
8023 (Incremental_inputs::report_input_section): New function.
8024 (Incremental_inputs::report_script): Rewrite.
8025 (Incremental_inputs::finalize): Do nothing but finalize string table.
8026 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8027 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8028 (Incremental_inputs::create_data_sections): New function.
8029 (Incremental_inputs::relocs_entsize): New function.
8030 (Output_section_incremental_inputs::set_final_data_size): New function.
8031 (Output_section_incremental_inputs::do_write): New function.
8032 (Output_section_incremental_inputs::write_header): New function.
8033 (Output_section_incremental_inputs::write_input_files): New function.
8034 (Output_section_incremental_inputs::write_info_blocks): New function.
8035 (Output_section_incremental_inputs::write_symtab): New function.
8036 * incremental.h (Incremental_script_entry): Forward declaration.
8037 (Incremental_object_entry): Forward declaration.
8038 (Incremental_archive_entry): Forward declaration.
8039 (Incremental_inputs): Forward declaration.
8040 (Incremental_inputs_header_data): Remove.
8041 (Incremental_inputs_header): Remove.
8042 (Incremental_inputs_header_write): Remove.
8043 (Incremental_inputs_entry_data): Remove.
8044 (Incremental_inputs_entry): Remove.
8045 (Incremental_inputs_entry_write): Remove.
8046 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
8047 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
8048 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8049 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
8050 Likewise.
8051 (Incremental_input_entry): New class.
8052 (Incremental_script_entry): New class.
8053 (Incremental_object_entry): New class.
8054 (Incremental_archive_entry): New class.
8055 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8056 (Incremental_inputs::report_inputs): Remove.
8057 (Incremental_inputs::report_archive): Remove.
8058 (Incremental_inputs::report_archive_begin): New function.
8059 (Incremental_inputs::report_archive_end): New function.
8060 (Incremental_inputs::report_object): Change prototype.
8061 (Incremental_inputs::report_input_section): New function.
8062 (Incremental_inputs::report_script): Change prototype.
8063 (Incremental_inputs::get_reloc_count): New function.
8064 (Incremental_inputs::set_reloc_count): New function.
8065 (Incremental_inputs::create_data_sections): New function.
8066 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8067 (Incremental_inputs::inputs_section): New function.
8068 (Incremental_inputs::symtab_section): New function.
8069 (Incremental_inputs::relocs_section): New function.
8070 (Incremental_inputs::get_stringpool): Add const.
8071 (Incremental_inputs::command_line): Add const.
8072 (Incremental_inputs::inputs): Remove.
8073 (Incremental_inputs::command_line_key): New function.
8074 (Incremental_inputs::input_file_count): New function.
8075 (Incremental_inputs::input_files): New function.
8076 (Incremental_inputs::relocs_entsize): New function.
8077 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8078 (Incremental_inputs::finalize_inputs): Remove.
8079 (Incremental_inputs::Input_info): Remove.
8080 (Incremental_inputs::lock_): Remove.
8081 (Incremental_inputs::inputs_): Change type.
8082 (Incremental_inputs::inputs_map_): Remove.
8083 (Incremental_inputs::current_object_entry_): New data member.
8084 (Incremental_inputs::inputs_section_): New data member.
8085 (Incremental_inputs::symtab_section_): New data member.
8086 (Incremental_inputs::relocs_section_): New data member.
8087 (Incremental_inputs::reloc_count_): New data member.
8088 (Incremental_inputs_reader): New class.
8089 (Incremental_symtab_reader): New class.
8090 (Incremental_relocs_reader): New class.
8091 * layout.cc (Layout::finalize): Move finalization of incremental info
8092 and creation of incremental info sections to follow finalization of
8093 symbol table. Set offsets for postprocessing sections.
8094 (Layout::create_incremental_info_sections): Call
8095 Incremental_inputs::create_data_sections. Add incremental symtab
8096 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
8097 sections to layout after input sections.
8098 * layout.h (struct Timespec): Forward declaration.
8099 (Layout::incremental_inputs): Add const.
8100 (Layout::create_incremental_info_sections): Add parameter.
8101 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
8102 * object.cc: Include incremental.h.
8103 (Relobj::finalize_incremental_relocs): New function.
8104 (Sized_relobj::do_layout): Record input sections in incremental info.
8105 * object.h (Object::output_section): New function.
8106 (Object::output_section_offset): Moved from Relobj.
8107 (Object::get_incremental_reloc_base): New function.
8108 (Object::get_incremental_reloc_count): New function.
8109 (Object::do_output_section): New function.
8110 (Object::do_output_section_offset): Moved from Relobj.
8111 (Object::do_get_incremental_reloc_base): New function.
8112 (Object::do_get_incremental_reloc_count): New function.
8113 (Object::Object): Initialize new data members.
8114 (Relobj::output_section): Renamed do_output_section and moved to
8115 protected.
8116 (Relobj::output_section_offset): Moved to Object.
8117 (Relobj::do_get_incremental_reloc_base): New function.
8118 (Relobj::do_get_incremental_reloc_count): New function.
8119 (Relobj::allocate_incremental_reloc_counts): New function.
8120 (Relobj::count_incremental_reloc): New function.
8121 (Relobj::finalize_incremental_relocs): New function.
8122 (Relobj::next_incremental_reloc_index): New function.
8123 (Relobj::reloc_counts_): New data member.
8124 (Relobj::reloc_bases_): New data member.
8125 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8126 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8127 (Sized_relobj::incremental_relocs_scan): New function.
8128 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8129 (Sized_relobj::incremental_relocs_write): New function.
8130 (Sized_relobj::incremental_relocs_write_reltype): New function.
8131 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8132 incremental link.
8133 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8134 archives and object files elsewhere.
8135 (Add_symbols::run): Report object files here.
8136 (Finish_group::run): Report end of archive at end of group.
8137 * reloc.cc: Include layout.h, incremental.h.
8138 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8139 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8140 (Sized_relobj::incremental_relocs_scan): New function.
8141 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8142 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8143 (Sized_relobj::incremental_relocs_write): New function.
8144 (Sized_relobj::incremental_relocs_write_reltype): New function.
8145 * script.cc (read_input_script): Rewrite test for incremental link.
8146 Change call to Incremental_inputs::report_script.
8147 * symtab.h (Symbol_table::first_global_index): New function.
8148 (Symbol_table::output_count): New function.
8149
ce0d1972
DK
81502010-08-12 Doug Kwan <dougkwan@google.com>
8151
8152 * arm.cc (Target_arm::merge_object_attributes): Check command line
8153 options --no-wchar-size-warning and --no-enum-size-warning.
8154 * options.h (General_options): Add ld-compatible options
8155 --no-enum-size-warning and --no-wchar-size-warning.
8156
6e5710ce
ILT
81572010-08-04 Ian Lance Taylor <iant@google.com>
8158
8159 * x86_64.cc (Target_x86_64::Scan::local): Use
8160 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8161 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8162 (Target_x86_64::Scan::global): Likewise.
8163 (Target_x86_64::Relocate::relocate): Likewise.
8164 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8165 Likewise.
8166
fef830db
CC
81672010-08-03 Cary Coutant <ccoutant@google.com>
8168
8169 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8170 to reserve space in merged_strings vector. Keep total input size
8171 for stats.
8172 (Output_merge_string::do_print_merge_stats): Print total input size.
8173 * merge.h (Output_merge_string): Add input_size_ field.
8174 * stringpool.cc (Stringpool_template::string_length): Move
8175 implementations out of Stringpool_template class and place in
8176 stringpool.h.
8177 * stringpool.h (string_length): Move out of Stringpool_template.
8178
1e3811b0
ILT
81792010-08-03 Ian Lance Taylor <iant@google.com>
8180
8181 PR 11712
8182 * layout.cc (relaxation_loop_body): If address of load segment is
8183 set, adjust address to include headers if possible.
8184
7af0c620
ILT
81852010-08-03 Ian Lance Taylor <iant@google.com>
8186
8187 * version.cc (version_string): Bump to 1.10.
8188
22f0da72
ILT
81892010-08-03 Ian Lance Taylor <iant@google.com>
8190
8191 PR 11805
8192 * layout.h (enum Output_section_order): Define.
8193 (class Layout): Update declarations.
8194 * layout.cc (Layout::get_output_section): Add order parameter.
8195 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8196 is_first_non_relro parameters. Change all callers.
8197 (Layout::choose_output_section): Likewise.
8198 (Layout::add_output_section_data): Likewise.
8199 (Layout::make_output_section): Likewise. Set order.
8200 (Layout::default_section_order): New function.
8201 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8202 * output.cc (Output_section::Output_section): Initialize order_.
8203 Don't initialize deleted fields.
8204 (Output_segment::Output_segment): Don't initialize deleted
8205 fields.
8206 (Output_segment::add_output_section_to_load): New function
8207 replacing add_output_section. Change all callers to call this or
8208 add_output_section_to_nonload.
8209 (Output_segment::add_output_section_to_nonload): New function.
8210 (Output_segment::remove_output_section): Rewrite.
8211 (Output_segment::add_initial_output_data): Likewise.
8212 (Output_segment::has_any_data_sections): Likewise.
8213 (Output_segment::is_first_section_relro): Likewise.
8214 (Output_segment::maximum_alignment): Likewise.
8215 (Output_segment::has_dynamic_reloc): New function replacing
8216 dynamic_reloc_count. Change all callers.
8217 (Output_segment::has_dynamic_reloc_list): New function replacing
8218 dynamic_reloc_count_list. Change all callers.
8219 (Output_segment::set_section_addresses): Rewrite.
8220 (Output_segment::set_offset): Rewrite.
8221 (Output_segment::find_first_and_last_list): Remove.
8222 (Output_segment::set_tls_offsets): Rewrite.
8223 (Output_segment::first_section_load_address): Likewise.
8224 (Output_segment::output_section_count): Likewise.
8225 (Output_segment::section_with_lowest_load_address): Likewise.
8226 (Output_segment::write_section_headers): Likewise.
8227 (Output_segment::print_sections_to_map): Likewise.
8228 * output.h (class Output_data): Remove dynamic_reloc_count_
8229 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8230 (Output_data::add_dynamic_reloc): Rewrite.
8231 (Output_data::has_dynamic_reloc): New function.
8232 (Output_data::dynamic_reloc_count): Remove.
8233 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8234 is_last_relro_, is_first_non_relro_, is_interp_,
8235 is_dynamic_linker_section_ fields. Add order and set_order
8236 functions. Remove is_relro_local, set_is_relro_local,
8237 is_last_relro, set_is_last_relro, is_first_non_relro,
8238 set_is_first_non_relro functions, is_interp, set_is_interp,
8239 is_dynamic_linker_section, and set_is_dynamic_linker_section
8240 functions.
8241 (class Output_segment): Change Output_data_list from std::list to
8242 std:;vector. Add output_lists_ field. Remove output_data_ and
8243 output_bss_ fields. Update declarations.
8244
3ff2ccb0
ILT
82452010-08-02 Ian Lance Taylor <iant@google.com>
8246
8247 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8248 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8249 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8250
88a4108b
ILT
82512010-08-02 Ian Lance Taylor <iant@google.com>
8252
8253 PR 11855
8254 * script.cc (Script_options::Script_options): Initialize
8255 symbol_definitions_ and symbol_references_.
8256 (Script_options::add_symbol_assignment): Update
8257 symbol_definitions_ and symbol_references_.
8258 (Script_options::add_symbol_reference): New function.
8259 (script_symbol): New function.
8260 * script.h (class Script_options): Add symbol_definitions_ and
8261 symbol_references_ fields.
8262 (Script_options::referenced_const_iterator): New type.
8263 (Script_options::referenced_begin): New function.
8264 (Script_options::referenced_end): New function.
8265 (Script_options::is_referenced): New function.
8266 (Script_options::any_unreferenced): New function.
8267 * script-c.h (script_symbol): Declare.
8268 * yyscript.y (exp): Call script_symbol.
8269 * symtab.cc: Include "script.h".
8270 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8271 Change all callers. Check symbols referenced by scripts.
8272 (Symbol_table::add_undefined_symbols_from_command_line): Add
8273 layout parameter. Change all callers.
8274 (Symbol_table::do_add_undefined_symbols_from_command_line):
8275 Likewise. Break out loop body. Check symbols referenced by
8276 scripts.
8277 (Symbol_table::add_undefined_symbol_from_command_line): New
8278 function broken out of
8279 do_add_undefined_symbols_from_command_line.
8280 * symtab.h (class Symbol_table): Update declarations.
8281 * archive.cc: Include "layout.h".
8282 (Archive::should_include_member): Add layout parameter. Change
8283 all callers. Check for symbol mentioned in expression.
8284 * archive.h (class Archive): Update declaration.
8285 * object.cc (Sized_relobj::do_should_include_member): Add layout
8286 parameter.
8287 * object.h (Object::should_include_member): Add layout parameter.
8288 Change all callers.
8289 (Object::do_should_include_member): Add layout parameter.
8290 (class Sized_relobj): Update declaration.
8291 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8292 parameter.
8293 * dynobj.h (class Sized_dynobj): Update declaration.
8294 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8295 layout parameter.
8296 * plugin.h (class Sized_pluginobj): Update declaration.
8297
5f1ab67a
ILT
82982010-08-02 Ian Lance Taylor <iant@google.com>
8299
8300 PR 11866
8301 * output.cc (Output_segment::set_offset): Search for the first and
8302 last sections rather than assuming that the list is in order.
8303 (Output_segment::find_first_and_last_list): New function.
8304 * output.h (class Output_segment): Update declarations.
8305 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8306 (relro_strip_test_SOURCES): New variable.
8307 (relro_strip_test_DEPENDENCIES): New variable.
8308 (relro_strip_test_LDFLAGS): New variable.
8309 (relro_strip_test_LDADD): New variable.
8310 (relro_strip_test.so): New target.
8311
a8df5856
ILT
83122010-08-02 Ian Lance Taylor <iant@google.com>
8313
8314 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8315 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8316 (Target_i386::got_tlsdesc_section): New function.
8317 (Target_i386::got_section): Create space for GOT entries for
8318 TLSDESC relocations.
8319 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8320 R_386_TLS_GOTDESC.
8321 (Target_i386::Scan::global): Likewise.
8322 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8323 using TLSDESC GOT.
8324 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8325 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8326 (Target_x86_64::got_tlsdesc_section): New function.
8327 (Target_x86_64::got_section): Create space for GOT entries for
8328 TLSDESC relocations.
8329 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8330 R_386_TLS_GOTDESC.
8331 (Target_x86_64::Scan::global): Likewise.
8332 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8333 using TLSDESC GOT.
8334
0c10a0a6
ILT
83352010-08-02 Ian Lance Taylor <iant@google.com>
8336
8337 * testsuite/final_layout.sh: Use dc to convert from hex to
8338 decimal.
8339
41cbeecc
ST
83402010-07-29 Sriraman Tallam <tmsriram@google.com>
8341
8342 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8343 paramter to the call to gold::gc_process_relocs.
8344 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8345 paramter to the call to gold::gc_process_relocs.
8346 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8347 parameter to the call to gold::gc_process_relocs.
8348 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8349 template parameter to the call to gold::gc_process_relocs.
8350 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8351 paramter to the call to gold::gc_process_relocs.
8352 * gc.h (get_embedded_addend_size): New function.
8353 (gc_process_relocs): Save the size of the reloc for use by ICF.
8354 * icf.cc (get_section_contents): Get the addend from the text section
8355 for SHT_REL relocation sections.
8356 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8357 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8358 * int_encoding.h (read_from_pointer): New overloaded function.
8359 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8360 * testsuite/icf_sht_rel_addend_test.sh: New file.
8361 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8362 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8363
6ea55b82
RW
83642010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8365
8366 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8367 * Makefile.in: Regenerate.
8368 * testsuite/Makefile.in: Regenerate.
8369
9691462b
ILT
83702010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8371
8372 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8373 * gold/testsuite/debug_msg.cc: Likewise.
8374 * gold/testsuite/odr_violation1.cc
8375 * gold/testsuite/odr_violation2.cc
8376
76897331
CC
83772010-07-21 Cary Coutant <ccoutant@google.com>
8378
8379 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8380 string, and length fields.
8381 (Output_merge_string::Merged_strings_list): New type.
8382 (Output_merge_string::Merged_strings_lists): New typedef.
8383 (Output_merge_string): Replace merged_strings_ with
8384 merged_strings_lists_.
8385 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8386 Merged_strings_list per input object and section. Don't store pointer
8387 to the string. Don't store length with each merged string entry.
8388 (Output_merge_string::finalize_merged_data): Loop over list of merged
8389 strings lists. Recompute length of each merged string.
8390
78384e8f
CC
83912010-07-15 Cary Coutant <ccoutant@google.com>
8392
8393 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8394 here.
8395
783659f9
ILT
83962010-07-14 Ian Lance Taylor <iant@google.com>
8397
8398 * descriptors.cc (Descriptors::open): Report correct name in error
8399 message.
8400
131687b4
DK
84012010-07-13 Doug Kwan <dougkwan@google.com>
8402
8403 * arm.cc (Arm_input_section::Arm_input_section): For a
8404 SHT_ARM_EXIDX section, always keeps the input sections.
8405 (Arm_input_section::set_exidx_section_link): New method.
8406 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8407 has_errors_ to false.
8408 (Arm_exidx_input_section::has_errors,
8409 Arm_exidx_input_section::set_has_errors): New methods.
8410 (Arm_exidx_input_section::has_errors_): New data member.
8411 (Arm_relobj::get_exidx_shndx_list): New method.
8412 (Arm_output_section::append_text_sections_to_list): Do not skip
8413 section without SHF_EXECINSTR.
8414 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8415 errors.
2e702c99 8416 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8417 section header. Make error messages more verbose. Check for
8418 a non-executable section linked to an EXIDX section.
8419 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8420 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8421 check that there is no deferred EXIDX section if we exit early.
8422 Instead of not making an EXIDX section in case of an error, make one
8423 and set the has_errors flag of it.
8424 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8425 in a relocatable link.
8426 (Target_arm::do_relax): Look for the EXIDX output section instead of
8427 assuming that it is called .ARM.exidx.
2e702c99 8428 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8429 section list. Do not check for SHF_EXECINSTR section flags but
8430 skip any input section with errors.
8431 * output.cc (Output_section::Output_section): Initialize
8432 always_keeps_input_sections_ to false.
8433 (Output_section::add_input_section): Check for
8434 always_keeps_input_sections_.
8435 * output.h (Output_section::always_keeps_input_sections,
8436 Output_section::set_always_keeps_input_sections): New methods.
8437 (Output_section::always_keeps_input_sections): New data member.
8438
69517287
RÁE
84392010-07-13 Rafael Espindola <espindola@google.com>
8440
8441 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8442 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8443
82742395
ILT
84442010-07-13 Philip Herron <herron.philip@googlemail.com>
8445 Ian Lance Taylor <iant@google.com>
8446
8447 * output.h (Output_section_lookup_maps::add_merge_section):
8448 Correct check of whether value was inserted.
8449 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8450 (Output_section_lookup_maps::add_relaxed_input_section):
8451 Likewise.
8452 * arm.cc (Target_arm::got_section): Remove used local os.
8453 * i386.cc (Target_i386::got_section): Likewise.
8454 * x86_64.cc (Target_x86_64::got_section): Likewise.
8455 * sparc.cc (Target_sparc::got_section): Likewise.
8456 (Target_sparc::relocate): Remove unused local have_got_offset.
8457 * powerpc.cc (Target_powerpc::relocate): Likewise.
8458
f2d707b5
ILT
84592010-07-13 Ian Lance Taylor <iant@google.com>
8460
241531d6
ILT
8461 * compressed_output.cc (zlib_decompress): Fix signature in
8462 !HAVE_ZLIB_H case.
8463
f2d707b5
ILT
8464 * archive.cc (Archive::include_member): Unlock an external member
8465 of a thin archive. Don't bother to delete an object we know is
8466 NULL.
8467
a2e47362
CC
84682010-07-12 Cary Coutant <ccoutant@google.com>
8469
8470 * compressed_output.cc (zlib_decompress): New function.
8471 (get_uncompressed_size): New function.
8472 (decompress_input_section): New function.
8473 * compressed_output.h (get_uncompressed_size): New function.
8474 (decompress_input_section): New function.
8475 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8476 Handle compressed debug sections.
8477 * layout.cc (is_compressed_debug_section): New function.
8478 (Layout::output_section_name): Map compressed section names to
8479 canonical names.
8480 * layout.h (is_compressed_debug_section): New function.
8481 (is_debug_info_section): Recognize compressed debug sections.
8482 * merge.cc: Include compressed_output.h.
8483 (Output_merge_data::do_add_input_section): Handle compressed
8484 debug sections.
8485 (Output_merge_string::do_add_input_section): Handle compressed
8486 debug sections.
8487 * object.cc: Include compressed_output.h.
8488 (Sized_relobj::Sized_relobj): Initialize new data members.
8489 (build_compressed_section_map): New function.
8490 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8491 * object.h (Object::section_is_compressed): New method.
8492 (Object::do_section_is_compressed): New method.
8493 (Sized_relobj::Compressed_section_map): New type.
8494 (Sized_relobj::do_section_is_compressed): New method.
8495 (Sized_relobj::compressed_sections_): New data member.
8496 * output.cc (Output_section::add_input_section): Handle compressed
8497 debug sections.
8498 * reloc.cc: Include compressed_output.h.
8499 (Sized_relobj::write_sections): Handle compressed debug sections.
8500
ce279a62
CC
85012010-07-08 Cary Coutant <ccoutant@google.com>
8502
8503 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8504 weak when resolving to a dynamic def.
8505 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8506 for weak undef/dynamic def cases. Adjust callers.
8507 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8508 undef_binding_weak_.
8509 (Symbol_table::sized_write_globals): Adjust symbol binding.
8510 (Symbol_table::sized_write_symbol): Add binding parameter.
8511 * symtab.h (Symbol::set_undef_binding): New method.
8512 (Symbol::is_undef_binding_weak): New method.
8513 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8514 (Symbol_table::should_override): Add new parameter.
8515 (Symbol_table::sized_write_symbol): Add new parameter.
8516
8517 * testsuite/weak_undef_file1.cc: Add new test case.
8518 * testsuite/weak_undef_file2.cc: Fix header comment.
8519 * testsuite/weak_undef_test.cc: Add new test case.
8520
b2286c10
DK
85212010-06-29 Doug Kwan <dougkwan@google.com>
8522
8523 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8524 Initialize USE_SYMBOL_.
8525 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8526 definition.
8527 (Arm_reloc_property::uses_symbol_): New data member declaration.
8528 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8529 uses symbol value and symbol is undefined but not weakly undefined.
8530
4802450a
RÁE
85312010-06-28 Rafael Espindola <espindola@google.com>
8532
8533 * plugin.cc (Plugin::load): Use dlerror.
8534
e5ca47ba
ILT
85352010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8536
8537 * symtab.cc (detect_odr_violations): When reporting an ODR
8538 violation, report an object where the symbol is defined.
8539
8a75a161
DK
85402010-06-25 Doug Kwan <dougkwan@google.com>
8541
8542 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8543 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8544 definition.
8545 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8546 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8547 target hook to detect function points.
8548 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8549 * icf.h (Icf::check_section_for_function_pointers): Change type of
8550 parameter SECTION_NAME to const reference to std::string. Use
8551 target hook to determine if section may have unsafe pointers.
8552 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8553 method definition.
8554
42218b9f
RÁE
85552010-06-21 Rafael Espindola <espindola@google.com>
8556
8557 * fileread.cc (Input_file::find_fie): New
8558 (Input_file::open): Use Input_file::find_fie.
8559 * fileread.h (Input_file::find_fie): New
8560 * plugin.cc (set_extra_library_path): New.
8561 (Plugin::load): Add set_extra_library_path to the transfer vector.
8562 (Plugin_manager::set_extra_library_path): New.
8563 (Plugin_manager::add_input_file): Use the extra search path if set.
8564 (set_extra_library_path(): New.
8565 * plugin.h (Plugin_manager): Add set_extra_library_path and
8566 extra_search_path_.
8567
a0506cca
CC
85682010-06-19 Cary Coutant <ccoutant@google.com>
8569
8570 * layout.cc (gdb_sections): Add .debug_types.
8571 (lines_only_debug_sections): Likewise.
8572
6508b958
RÁE
85732010-06-18 Rafael Espindola <espindola@google.com>
8574
8575 * plugin.cc (add_input_file,add_input_library)
8576 (Plugin_manager::add_input_file): Make filename arguments const.
8577 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8578 const.
8579
3e235302
DK
85802010-06-16 Doug Kwan <dougkwan@google.com>
8581
8582 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8583 .ARM.attributes section if we have not merged any input
8584 attributes sections.
8585
106e8a6c
DK
85862010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8587
8588 * arm.cc: Allow combining objects with no EABI version
8589 information.
8590
91ff43fe
RÁE
85912010-06-15 Rafael Espindola <espindola@google.com>
8592
8593 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8594
68ed838c
ILT
85952010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8596
8597 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8598 (struct iovec): Correct !HAVE_READV definition.
8599
f3a2388f
CC
86002010-06-10 Cary Coutant <ccoutant@google.com>
8601
8602 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8603 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8604 reloc sections.
8605 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8606
8607 PR 11683
8608 * symtab.h (Symbol::is_placeholder): New member function.
8609 * target-reloc.h (relocate_section): Check for placeholder symbols.
8610
8611 * testsuite/Makefile.am (plugin_test_8): New test.
8612 (plugin_test_9): New test.
8613 * testsuite/Makefile.in: Regenerate.
8614
e1df38aa
NC
86152010-06-09 Nick Clifton <nickc@redhat.com>
8616
8617 * yyscript.y (input_list_element): Allow strings prefixed with
8618 the '-' character. Treat these as libraries.
8619 * script.cc (script_add_library): New function. Adds a library
8620 specified by "-l<name>" found in an input script.
8621 * script-c.h: Add prototype for script_add_library.
8622
25bbe950
DK
86232010-06-07 Doug Kwan <dougkwan@google.com>
8624
8625 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8626 Restrict stub-group size to be within long conditional branch
8627 range when working around cortex-A8 erratum.
8628
0f32ea4c
ILT
86292010-06-07 Damien Diederen <dd@crosstwine.com>
8630
8631 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8632 #ifdef typo.
8633
8fe2a369
ST
86342010-06-03 Sriraman Tallam <tmsriram@google.com>
8635
8636 PR gold/11658
8637 * output.cc
8638 (Output_section::Input_section_sort_entry::compare_section_ordering):
8639 Change to return non-zero correctly.
8640 (Output_section::Input_section_sort_section_order_index_compare
8641 ::operator()): Change to fix ambiguity in comparisons.
8642
6e9ba2ca
ST
86432010-06-01 Sriraman Tallam <tmsriram@google.com>
8644
8645 * gold.h (is_wildcard_string): New function.
8646 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8647 (Layout::layout_eh_frame): Ditto.
8648 (Layout::find_section_order_index): New method.
8649 (Layout::read_layout_from_file): New method.
8650 * layout.h (Layout::find_section_order_index): New method.
8651 (Layout::read_layout_from_file): New method.
8652 (Layout::input_section_position_): New private member.
8653 (Layout::input_section_glob_): New private member.
8654 * main.cc (main): Call read_layout_from_file here.
8655 * options.h (--section-ordering-file): New option.
8656 * output.cc (Output_section::input_section_order_specified_): New
8657 member.
8658 (Output_section::Output_section): Initialize new member.
8659 (Output_section::add_input_section): Add new parameter.
8660 Keep input sections when --section-ordering-file is used.
8661 (Output_section::set_final_data_size): Sort input sections when
8662 section ordering file is specified.
8663 (Output_section::Input_section_sort_entry): Add new parameter.
8664 Check sorting type.
8665 (Output_section::Input_section_sort_entry::compare_section_ordering):
8666 New method.
8667 (Output_section::Input_section_sort_compare::operator()): Change to
8668 consider section_order_index.
8669 (Output_section::Input_section_sort_init_fini_compare::operator()):
8670 Change to consider section_order_index.
8671 (Output_section::Input_section_sort_section_order_index_compare
8672 ::operator()): New method.
8673 (Output_section::sort_attached_input_sections): Change to sort
8674 according to section order when specified.
e1df38aa
NC
8675 (Output_section::add_input_section<32, true>): Add new parameter.
8676 (Output_section::add_input_section<64, true>): Add new parameter.
8677 (Output_section::add_input_section<32, false>): Add new parameter.
8678 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
8679 * output.h (Output_section::add_input_section): Add new parameter.
8680 (Output_section::input_section_order_specified): New
8681 method.
8682 (Output_section::set_input_section_order_specified): New method.
8683 (Input_section::Input_section): Initialize section_order_index_.
8684 (Input_section::section_order_index): New method.
8685 (Input_section::set_section_order_index): New method.
8686 (Input_section::section_order_index_): New member.
8687 (Input_section::Input_section_sort_section_order_index_compare): New
8688 struct.
8689 (Output_section::input_section_order_specified_): New member.
8690 * script-sections.cc (is_wildcard_string): Delete and move modified
8691 method to gold.h.
8692 (Output_section_element_input::Output_section_element_input): Modify
8693 call to is_wildcard_string.
8694 (Output_section_element_input::Input_section_pattern
8695 ::Input_section_pattern): Ditto.
8696 (Output_section_element_input::Output_section_element_input): Ditto.
8697 * testsuite/Makefile.am (final_layout): New test case.
8698 * testsuite/Makefile.in: Regenerate.
8699 * testsuite/final_layout.cc: New file.
8700 * testsuite/final_layout.sh: New file.
8701
3537c84b
RÁE
87022010-06-01 Rafael Espindola <espindola@google.com>
8703
8704 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8705
105b6afd
RÁE
87062010-06-01 Rafael Espindola <espindola@google.com>
8707
8708 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8709 visibility of symbols.
8710
29e11421
DK
87112010-05-27 Doug Kwan <dougkwan@google.com>
8712
8713 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8714 from start of output section instead of address for a local symbol
8715 in a merged or relaxed section when doing a relocatable link.
8716
5e0f337e
RÁE
87172010-05-26 Rafael Espindola <espindola@google.com>
8718
703d02da 8719 PR 11604
5e0f337e
RÁE
8720 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8721 adding sections the garbage collector removed.
8722 * gold/testsuite/Makefile.am: Add test.
8723 * gold/testsuite/Makefile.in: Regenerate.
8724 * gold/testsuite/plugin_test_7.sh: New.
8725 * gold/testsuite/plugin_test_7_1.c: New.
8726 * gold/testsuite/plugin_test_7_2.c: New.
8727
f4187277
RÁE
87282010-05-26 Rafael Espindola <espindola@google.com>
8729
8730 * script-sections.cc (Output_section_definition::set_section_addresses):
8731 Check for --section-start.
8732
5c388529
DK
87332010-05-26 Doug Kwan <dougkwan@google.com>
8734
8735 * arm.cc (Arm_scan_relocatable_relocs): New class.
8736 (Target_arm::relocate_special_relocatable): New method.
8737 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8738 (Arm_relocate_functions::thumb_branch_common): Same.
8739 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8740 instead of Default_scan_relocatable_relocs.
8741 * target-reloc.h (relocate_for_relocatable): Let target handle
8742 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8743 * target.h (Sized_target::relocate_special_relocatable): New method.
8744
bca1c3ae
ILT
87452010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8746
8747 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8748
0439c796
DK
87492010-05-23 Doug Kwan <dougkwan@google.com>
8750
8751 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8752 instead of a cast.
8753 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8754 with a direct branch, not a conditional branch, to a stub.
8755 * merge.cc (Output_merge_base::record_input_section): New method
8756 defintion.
8757 (Output_merge_data::do_add_input_section): Record input section if
8758 keeps-input-sections flag is set.
8759 (Output_merge_string::do_add_input_section): Ditto.
8760 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8761 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8762 INPUT_SECTIONS_.
8763 (Output_merge_base::keeps_input_sections,
8764 Output_merge_base::set_keeps_input_sections,
8765 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8766 method definitions.
8767 (Output_merge_base::Input_sections): New type declaration.
8768 (Output_merge_base::input_sections_begin,
8769 Output_merge_base::input_sections_end,
8770 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8771 (Output_merge_base::bool keeps_input_sections_,
8772 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8773 Output_merge_base::input_sections_): New data members.
8774 (Output_merge_data::do_set_keeps_input_sections): New method
8775 defintion.
8776 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8777 * output.cc (Output_section::Input_section::relobj): Move method
8778 defintion from class declaration to here and handle merge sections.
8779 (Output_section::Input_section::shndx): Ditto.
8780 (Output_section::Output_section): Remove initializations of removed
8781 data members and initialize new data member LOOKUP_MAPS_.
8782 (Output_section::add_input_section): Set keeps-input-sections flag
8783 for a newly created merge output section as appropriate. Adjust code
8784 to use Output_section_lookup_maps class.
8785 (Output_section::add_relaxed_input_section): Adjst code for lookup
8786 maps code refactoring.
2e702c99 8787 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
8788 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8789 class. If adding input section to a newly created merge output
8790 section fails, remove the new merge section.
8791 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 8792 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 8793 (Output_section::find_merge_section): Ditto.
0439c796 8794 (Output_section::build_lookup_maps): New method defintion.
2e702c99 8795 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
8796 Output_section_lookup_maps class.
8797 (Output_section::get_input_sections): Export merge sections. Adjust
8798 code to use Output_section_lookup_maps class.
8799 (Output_section:::add_script_input_section): Adjust code to use
8800 Output_section_lookup_maps class. Update lookup maps for merge
8801 sections also.
8802 (Output_section::discard_states): Use Output_section_lookup_maps.
8803 (Output_section::restore_states): Same.
8804 * output.h (Merge_section_properties): Move class defintion out of
8805 Output_section.
8806 (Output_section_lookup_maps): New class.
8807 (Output_section::Input_section::is_merge_section): New method
8808 defintion.
8809 (Output_section::Input_section::relobj): Move defintion out of class
8810 defintion. Declare method only.
8811 (Output_section::Input_section::shndx): Ditto.
8812 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 8813 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
8814 (Output_section::Merge_section_by_properties_map,
8815 Output_section::Output_section_data_by_input_section_map,
8816 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8817 Remove types.
2e702c99 8818 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
8819 KEEPS_INPUT_SECTIONS.
8820 (Output_section::build_lookup_maps): New method declaration.
8821 (Output_section::merge_section_map_,
8822 Output_section::merge_section_by_properties_map_,
8823 Output_section::relaxed_input_section_map_,
8824 Output_section::is_relaxed_input_section_map_valid_): Remove data
8825 members.
8826 (Output_section::lookup_maps_): New data member.
8827
76295588
L
88282010-05-21 Doug Kwan <dougkwan@google.com>
8829
8830 PR gold/11619
8831 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8832 avoid a compilation error.
8833
d103a984
RÁE
88342010-05-19 Rafael Espindola <espindola@google.com>
8835
8836 * script-sections.cc (Output_section_definition::allocate_to_segment):
8837 Update the phdrs_list even when the output section is NULL.
8838 * testsuite/Makefile.am: Add test.
8839 * testsuite/Makefile.in: Regenerate.
8840 * testsuite/script_test_9.cc: New.
8841 * testsuite/script_test_9.sh: New.
8842 * testsuite/script_test_9.t: New.
8843
6625d24e
DK
88442010-05-19 Doug Kwan <dougkwan@google.com>
8845
8846 * arm.cc (Arm_input_section::original_size): New method.
8847 (Arm_input_section::do_addralign): Add a cast.
8848 (Arm_input_section::do_output_offset): Remove static cast.
8849 (Arm_input_section::original_addralign,
8850 Arm_input_section::original_size_): Change type to uint32_t.
8851 (Arm_input_section::init): Add safe casts for section alignment
8852 and size.
8853 (Arm_input_section::set_final_data_size): Do not set address and
8854 offset of stub table.
8855 (Arm_output_section::fix_exidx_coverage): Change use of of
8856 Output_section::Simple_input_section to that of
8857 Output_section::Input_section.
8858 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8859 except for the first pass.
8860 * output.cc (Output_section::get_input_sections): Change type of
8861 input_sections to std::list<Input_section>.
8862 (Output_section::add_script_input_section): Rename from
8863 Output_section::add_simple_input_section. Change type of SIS
8864 parameter from Simple_input_section to Input_section.
8865 * output.h (Output_section::Simple_input_section): Remove class.
8866 (Output_section::Input_section): Change class visibility to public.
8867 (Output_section::Input_section::addralign): Use stored alignments
8868 for special input sections if set.
8869 (Output_section::Input_section::set_addralign): New method.
8870 (Output_section::get_input_sections): Change parameter type from
8871 list of Simple_input_section to list of Input_section.
8872 (Output_section::add_script_input_section): Rename from
8873 Output_section::add_simple_input_section. Change first parameter's
8874 type from Simple_input_section to Input_section and remove the
8875 second and third parameters.
8876 * script-sections.cc (Input_section::Input_section_list): Change
8877 type to list of Output_section::Input_section/
8878 (Input_section_info::Input_section_info): Change parameter type of
8879 INPUT_SECTION to Output_section::Input_section.
8880 (Input_section_info::input_section): Change return type.
8881 (Input_section_info::input_section_): Change type to
8882 Output_section::Input_section.
8883 (Output_section_element_input::set_section_addresses): Adjust code
8884 to use Output_section::Input_section instead of
8885 Output_section::Simple_input_section. Adjust code for renaming
8886 of Output_section::add_simple_input_section.
8887 (Orphan_output_section::set_section_addresses): Ditto.
8888
e1e82ea4
RW
88892010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8890
8891 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8892 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8893
91e75c8a
RÁE
88942010-05-18 Rafael Espindola <espindola@google.com>
8895
8896 * options.cc (General_options::finalize): Handle -nostdlib.
8897 * options.h (nostdlib): New option.
8898 * script.cc (script_add_search_dir): Handle -nostdlib.
8899
da59ad79
DK
89002010-05-12 Doug Kwan <dougkwan@google.com>
8901
8902 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8903 attributes section only if there no attributes section after merging.
8904 (Target_arm::merge_object_attributes): Move value of
e1df38aa 8905 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
8906 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8907 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8908 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8909 and arm_attr_merge_7.stdout.
8910 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8911 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8912 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8913 arm_attr_merge_7b.o): New rules.
8914 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8915 arm_attr_merge_7
8916 * testsuite/Makefile.in: Regenerate.
8917 * testsuite/arm_attr_merge.sh: New file.
8918 * testsuite/arm_attr_merge_[67][ab].s: Same.
8919
3e01a7fd
NC
89202010-05-05 Nick Clifton <nickc@redhat.com>
8921
8922 * po/es.po: Updated Spanish translation.
8923
7ad2014a
L
89242010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8925
8926 * Makefile.am (install-exec-local): Properly install gold as
8927 default cross linker.
8928 * Makefile.in: Regenerated.
8929
4fda8867
NC
89302010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8931 Nick Clifton <nickc@redhat.com>
8932
8933 * configure.ac (install_as_default): Define and set to false
8934 unless --enable-gold or --enable-gold=both/gold has been
8935 specified.
8936 * configure: Regenerate.
8937
8938 * Makefile.am (install-exec-local): Install the executable as
8939 'ld.gold'. If install_as_default is true then also install it as
8940 'ld'.
8941 * Makefile.in: Regenerated.
8942
bd288ea2
ILT
89432010-04-24 Ian Lance Taylor <iant@google.com>
8944
8945 * layout.cc (Layout::layout_reloc): In relocatable link don't
8946 combine reloc sections for grouped sections.
8947
ef38fd8a
ST
89482010-04-23 Sriraman Tallam <tmsriram@google.com>
8949
8950 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8951 sections that are not ordinary to icf.
8952 * icf.cc (get_section_contents): Handle relocation pointing to section
8953 with no object or shndx information.
8954 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8955 * testsuite/Makefile.in: Regenerate.
8956 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8957 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8958
f6973bdc
ILT
89592010-04-22 Ian Lance Taylor <iant@google.com>
8960
8961 * expression.cc (Expression::Expression_eval_info): Add
8962 result_alignment_pointer field.
8963 (Expression::eval_with_dot): Add result_alignment_pointer
8964 parameter. Change all callers.
8965 (Expression::eval_maybe_dot): Likewise.
8966 (class Binary_expression): Add alignment_pointer parameter to
8967 left_value and right_value. Change all callers.
8968 (BINARY_EXPRESSION): Set result alignment.
8969 (class Trinary_expression): Add alignment_pointer parameter to
8970 arg2_value and arg3_value. Change all callers.
8971 (Trinary_cond::value): Set result alignment.
8972 (Max_expression::value, Min_expression::value): Likewise.
8973 (Align_expression::value): Likewise.
8974 * script-sections.cc (class Sections_element): Add dot_alignment
8975 parameter to set_section_addresses virtual function. Update
8976 instantiations.
8977 (class Output_section_element): Likewise.
8978 (Script_sections::create_segments): Add dot_alignment parameter.
8979 Change all callers.
8980 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8981 (Script_sections::set_phdrs_clause_addresses): Likewise.
8982 * script-sections.h: Update declarations.
8983 * script.h: Update declarations.
8984 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8985 min_p_align.
8986 * testsuite/script_test_3.t: Set large alignment.
8987 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8988 segment has expected alignment.
8989
9c9c98a5
NC
89902010-04-22 Nick Clifton <nickc@redhat.com>
8991
8992 * po/gold.pot: Updated by the Translation project.
8993 * po/vi.po: Updated Vietnamese translation.
8994
2253bfba
L
89952010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8996
8997 * testsuite/Makefile.am (check_PROGRAMS): Add
8998 icf_virtual_function_folding_test.
8999 * testsuite/Makefile.in: Regenerated.
9000
85fdf906
AH
90012010-04-15 Andrew Haley <aph@redhat.com>
9002
9003 * options.h (merge_exidx_entries): New option.
9004 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9005 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9006 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9007 (Target_arm::merge_exidx_entries): New function.
9008 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9009 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9010 to Arm_exidx_fixup constructor.
9011 Add new arg, merge_exidx_entries.
9012 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9013 Arm_output_section::fix_exidx_coverage.
9014
ce97fa81
ST
90152010-04-18 Sriraman Tallam <tmsriram@google.com>
9016
9017 * icf.cc (get_section_contents): Check for preemptible functions.
9018 Ignore addend when appropriate.
9019 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9020 section folded.
9021 (add_from_relobj): Check for section folded.
9022 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9023 * symtab.h (should_add_dynsym_entry): Add new parameter.
9024 * target-reloc.h (scan_relocs): Check for section folded.
9025 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9026 Check reloc types for function pointers in shared objects.
9027 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9028 case.
9029 (icf_preemptible_functions_test): New test case.
9030 (icf_string_merge_test): New test case.
9031 * testsuite.Makefile.in: Regenerate.
9032 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9033 bar_glob. Refactor code.
9034 * testsuite/icf_preemptible_functions_test.cc: New file.
9035 * testsuite/icf_preemptible_functions_test.sh: New file.
9036 * testsuite/icf_string_merge_test.cc: New file.
9037 * testsuite/icf_string_merge_test.sh: New file.
9038 * testsuite/icf_virtual_function_folding_test.cc: New file.
9039 * testsuite/icf_virtual_function_folding_test.sh: New file.
9040
04ceb17c
DK
90412010-04-14 Doug Kwan <dougkwan@google.com>
9042
9043 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
9044 for local symbol recounting if we remove a section due to ICF.
9045 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
9046 there are no regular objects in input.
9047
153e7da4
DK
90482010-04-13 Doug Kwan <dougkwan@google.com>
9049
9050 * arm.cc (Arm_input_section::set_final_data_size): Compute
9051 accurate final data size instead of using current data size.
9052
4dbd9faf
DK
90532010-04-09 Doug Kwan <dougkwan@google.com>
9054
9055 * layout.cc (Layout::choose_output_section): Handle script section
9056 types.
9057 (Layout::make_output_section_for_script): Add section type parameter.
9058 Handle script section types.
9059 * layout.h (Layout::make_output_section_for_script): Add section
9060 type parameter.
9061 * output.cc (Output_section::Output_section): Initialize data member
9062 is_noload_.
9063 (Output_section::do_reset_address_and_file_offset): Do not set address
9064 to 0 if section is a NOLOAD section.
9065 * output.h (Output_section::is_noload): New method.
9066 (Output_section::set_is_noload): Ditto.
9067 (Output_section::is_noload_): New data member.
9068 * script-c.h (Script_section_type): New enum type.
9069 (struct Parser_output_section_header): Add new file section_type.
9070 * script-sections.cc (Sections_element::output_section_name): Add
9071 parameter for returning script section type.
9072 (Output_section_definition::output_section_name): Ditto.
9073 (Output_section_definition::section_type)P; New method.
9074 (Output_section_definiton::script_section_type_name): Ditto.
9075 (Output_section_definition::script_section_type_): New data member.
9076 (Output_section_definition::Output_section_definition): Initialize
9077 data member Output_section_definition::script_section_type_.
9078 (Output_section_definition::create_sections): Pass script section type
9079 to Layout::make_output_section_for_script.
9080 (Output_section_definition::output_section_name): Return script
9081 section type to caller.
9082 (Output_section_definition::set_section_address): Do not advance
9083 dot value and load address if section type is NOLOAD. Set address
9084 of NOLOAD sections regardless of section flags.
9085 (Output_section_definition::print): Print section type if it is
9086 not SCRIPT_SECTION_TYPE_NONE.
9087 (Output_section_definition::section_type): New method.
9088 (Output_section_definition::script_section_type_name): Ditto.
9089 (Script_sections::output_section_name): Add new parameter
9090 PSECTION_TYPE for returning script section type. Pass it to
9091 section elements. Handle discard sections.
9092 (Sort_output_sections::operator()): Handle NOLOAD sections.
9093 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 9094 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
9095 returning script section type.
9096 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
9097 INFO and NOLOAD.
9098 * yyscript.y (union): Add new field SECTION_TYPE.
9099 (COPY, DSECT, INFO, NOLOAD): New tokens.
9100 (opt_address_and_section_type): Change type to output_section_header.
9101 (section_type): New non-terminal
9102 (section_header): Handle section type.
2253bfba 9103 (opt_address_and_section_type): Return section type value.
4dbd9faf 9104
721ea635
L
91052010-04-09 H.J. Lu <hongjiu.lu@intel.com>
9106
9107 * testsuite/plugin_common_test_1.c (foo): Add prototype.
9108 * testsuite/plugin_common_test_2.c (foo): Likewise.
9109
6bf924b0
DK
91102010-04-08 Doug Kwan <dougkwan@google.com>
9111
9112 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
9113 Output_merge_data.
9114 * output.cc (Output_section::add_merge_input_section): Simplify
9115 code and return status of Output_merge_base::add_input_section.
e1df38aa 9116 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
9117 returns true.
9118
24af6f92
DK
91192010-04-07 Doug Kwan <dougkwan@google.com>
9120
9121 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9122 if section is marked as containing instructions but has no mapping
9123 symbols.
9124 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9125 correct section index.
9126 (Arm_relobj::find_linked_text_section): Ditto.
9127
00698fc5
CC
91282010-04-07 Cary Coutant <ccoutant@google.com>
9129
9130 * archive.cc (include_member): Destroy Read_symbols_data object before
9131 releasing file.
9132 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9133 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9134 (Read_symbols_data::~Read_symbols_data) New destructor.
9135 (Section_relocs::Section_relocs) New constructor.
9136 (Section_relocs::~Section_relocs) New destructor.
9137 (Read_relocs_data::Read_relocs_data) New constructor.
9138 (Read_relocs_data::~Read_relocs_data) New destructor.
9139 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9140 pointers to NULL after deleting.
9141
7296d933
DK
91422010-04-07 Doug Kwan <dougkwan@google.com>
9143
9144 * arm.cc: Replace "endianity" with "endianness" in comments.
9145 (Arm_exidx_cantunwind): Ditto.
9146 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9147 (Arm_relobj::merge_flags_and_attributes): New method.
9148 (Arm_relobj::merge_flags_and_attributes_): New data member.
9149 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9150 (Arm_relobj::scan_sections_for_stubs): Ditto.
9151 (Arm_relobj::do_read_symbols): Check to see if we really want to
9152 merge processor-specific flags and attributes. Exit early if
9153 an object is empty except for section names and the undefined symbol.
9154 (Target_arm::do_finalize_sections): Move check for ELF format to
9155 Arm_relobj::do_read_symbols. Merge processor specific flags and
9156 attributes from a regular object only when we have determined that
9157 it is aapropriate. Do not create an .ARM.attributes section in
9158 output if there is no regular input object.
9159 (Target_arm::merge_processor_specific_flags): Check
9160 --warn-mismatch before printing any error.
9161 (Target_arm::merge_object_attributes): Ditto.
9162 * gold.cc (queue_middle_tasks): Handle the case in which there is
9163 no regular object in input.
9164 * options.cc (General_options::parse_EB): New method.
9165 (General_options::parse_EL): Same.
9166 (General_options::General_options): Initialize endianness_.
9167 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9168 New options.
9169 (General_options::Endianness): New enum.
9170 (General_options::endianness): New method.
9171 (General_options::endianness_): New data member.
9172 * parameters.cc (Parameters::set_options): Check target endianness.
9173 (Parameters::set_target_once): Ditto.
9174 (Parameters::check_target_endianness): New method.
9175 (parameters_force_valid_target): If either -EL or -EB is specified,
9176 use it to define endianness of default target.
9177 * parameters.h (Parameters::check_target_endianness): New method
9178 declaration.
9179 * target.h (class Target): Change "endianity" to "endianness"
9180 in comments.
9181
efc8d4f2
RW
91822010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9183
9184 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9185 * configure: Regenerate.
9186 * Makefile.in: Regenerate.
9187 * testsuite/Makefile.in: Regenerate.
9188
be234d88
CC
91892010-04-06 Cary Coutant <ccoutant@google.com>
9190
9191 gcc PR lto/42757
9192 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9193 prevailing definitions of common symbols.
9194 * testsuite/plugin_test_6.sh: New test case.
9195 * testsuite/plugin_common_test_1.c: New test case.
9196 * testsuite/plugin_common_test_2.c: New test case.
9197 * testsuite/Makefile.am (plugin_test_6): New test case.
9198 * testsuite/Makefile.in: Regenerate.
9199
bd32c6bd
NC
92002010-04-06 Nick Clifton <nickc@redhat.com>
9201
9202 * po/vi.po: New Vietnamese translation.
9203
323c532f
DK
92042010-03-30 Doug Kwan <dougkwan@google.com>
9205
9206 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9207
4fcd97eb
DK
92082010-03-25 Doug Kwan <dougkwan@google.com>
9209
9210 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9211 to avoid a conversion warning on a 32-bit host.
9212
4ebf39db
ILT
92132010-03-24 Ian Lance Taylor <iant@google.com>
9214
9215 * testsuite/script_test_3.t: Add a TLS segment.
9216 * testsuite/Makefile.am (check_PROGRAMS): Add
9217 tls_phdrs_script_test.
9218 (tls_phdrs_script_test_SOURCES): Define.
9219 (tls_phdrs_script_test_DEPENDENCIES): Define.
9220 (tls_phdrs_script_test_LDFLAGS): Define.
9221 (tls_phdrs_script_test_LDADD): Define.
9222 * testsuite/Makefile.in: Rebuild.
9223
4a599bdd
CC
92242010-03-23 Cary Coutant <ccoutant@google.com>
9225
9226 * fileread.cc (find_or_make_view): Fix comment.
9227
6c93b22c
ILT
92282010-03-23 Ian Lance Taylor <iant@google.com>
9229
9230 * script-sections.cc (class Orphan_section_placement): Define
9231 PLACE_TLS and PLACE_TLS_BSS.
9232 (Orphan_section_placement::Orphan_section_placement): Initialize
9233 new places.
9234 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9235 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9236 (tls_script_test_SOURCES): Define.
9237 (tls_script_test_DEPENDENCIES): Define.
9238 (tls_script_test_LDFLAGS): Define.
9239 (tls_script_test_LDADD): Define.
9240 * testsuite/Makefile.in: Rebuild.
9241
a2c7281b
DK
92422010-03-22 Doug Kwan <dougkwan@google.com>
9243
9244 * arm.cc (Arm_relocate_functions::abs8,
9245 Arm_relocate_functions::abs16): Use correct check for overflow
9246 specified in the ARM ELF specs.
9247 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9248 target of a BLX instruction specially.
9249 (Reloc_stub::stub_type_for_reloc): Ditto.
9250 (Relocate::relocate): Use symbolic names instead of numeric relocation
9251 codes to report error.
9252 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9253 workaround.
9254 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9255 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9256 thumb2_blx_out_of_range.stdout
9257 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9258 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9259 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9260 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9261 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9262 thumb2_blx_in_range, thumb2_blx_in_range.o,
9263 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9264 thumb2_blx_out_of_range.o): New rules.
2e702c99 9265 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
9266 thumb2_blx_in_range and thumb2_blx_out_of_range.
9267 * testsuite/Makefile.in: Regenerate.
9268 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9269 * testsuite/thumb_blx_in_range.s: New file.
9270 * testsuite/thumb_blx_out_of_range.s: New file.
9271
b0193076
RÁE
92722010-03-22 Rafael Espindola <espindola@google.com>
9273
9274 * archive.cc (Should_include): Move to archive.h.
9275 (should_include_member): Make it a member of Archive.
9276 (Lib_group): New.
9277 (Add_lib_group_symbols): New.
9278 * archive.h: Include options.h.
9279 (Archive_member): Moved from Archive.
9280 (Should_include): Moved from archive.cc.
9281 (Lib_group): New.
9282 (Add_lib_group_symbols): New.
9283 * dynobj.cc (do_should_include_member): New.
9284 * dynobj.h (do_should_include_member): New.
9285 * gold.cc (queue_initial_tasks): Update call to queue.
9286 * main.cc (main): Print lib group stats.
9287 * object.cc (do_should_include_member): New.
9288 * object.h: Include archive.h.
9289 (Object::should_include_member): New.
9290 (Object::do_should_include_member): New.
9291 (Sized_relobj::do_should_include_member): New.
9292 * options.cc (General_options::parse_start_lib): New.
9293 (General_options::parse_end_lib): New.
9294 (Input_arguments::add_file): Handle lib groups.
9295 (Input_arguments::start_group): Check we are not in a lib.
9296 (Input_arguments::start_lib): New.
9297 (Input_arguments::end_lib): New.
9298 * options.h (General_options): Add start_lib and end_lib.
9299 (Input_argument::lib_): New.
9300 (Input_argument::lib): New.
9301 (Input_argument::is_lib): New.
9302 (Input_file_lib): New.
9303 (Input_arguments::in_lib_): New.
9304 (Input_arguments::in_lib): New.
9305 (Input_arguments::start_lib): New.
9306 (Input_arguments::end_lib_): New.
9307 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9308 in unused members as preempted.
9309 (Sized_pluginobj::do_should_include_member): New.
9310 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9311 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9312 return the blocker.
9313 (Read_symbols::do_whole_lib_group): New.
9314 (Read_symbols::do_lib_group): New.
9315 (Read_symbols::do_read_symbols): Handle lib groups.
9316 (Read_symbols::get_name): Handle lib groups.
9317 * readsyms.h (Read_symbols): Add an archive member pointer.
9318 (Read_symbols::do_whole_lib_group): New.
9319 (Read_symbols::do_lib_group): New.
9320 (Read_symbols::member_): New.
9321 * script.cc (read_input_script): Update call to queue_soon.
9322
d099120c
DK
93232010-03-19 Doug Kwan <dougkwan@google.com>
9324
9325 * arm.cc (Stub_table::Stub_table): Initialize new data members
9326 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9327 (Stub_table::add_reloc_stub): Assign stub offset and update
9328 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9329 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9330 New data members.
2e702c99 9331 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9332 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9333 instead of going over all reloc stubs.
2e702c99 9334 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9335 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9336 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9337 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9338 Stringpool_template::offset_.
9339 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9340 Stringpool_template::offset_ to zero.
9341
1aa37384
DK
93422010-03-15 Doug Kwan <dougkwan@google.com>
9343
9344 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9345 offset_.
9346 (Stringpool_template::new_key_offset): New method.
9347 (Stringpool_template::add_string): Assign offsets when adding new
9348 strings.
9349 (Stringpool_template::set_string_offsets): Do not set string offsets
9350 when not optimizing.
9351 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9352 member size_.
2e702c99
RM
9353 (Chunked_vector::clear): Clear size_.
9354 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9355 (Chunked_vector::size): Return size_.
9356 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9357 (Chunked_vector::size_): New data member.
1aa37384
DK
9358 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9359 (Stringpool_template::new_key_offset): New method declaration.
9360 (Stringpool_template::offset_): New data member.
9361
b672b057
RÁE
93622010-03-15 Rafael Espindola <espindola@google.com>
9363
9364 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9365 Add_symbols' constructor.
9366 * readsyms.h (Add_symbols): Remove the input_group member.
9367
b6848d3c
ILT
93682010-03-10 Ian Lance Taylor <iant@google.com>
9369
9370 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9371 target to ask whether a reference to a symbol requires a stack
9372 split.
9373 * target.h (Target::is_call_to_non_split): New function.
9374 (Target::do_is_call_to_non_split): Declare virtual function.
9375 * target.cc: Include "symtab.h".
9376 (Target::do_is_call_to_non_split): New function.
9377 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9378
a2a5469e
CC
93792010-03-10 Cary Coutant <ccoutant@google.com>
9380
9381 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9382 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9383 (File_read::open[2]): Add whole_file_view_ to list of views.
9384 (File_read::make_view): Remove test of whole_file_view_.
9385 (File_read::find_or_make_view): Create whole_file_view_ if
9386 necessary.
9387 (File_read::clear_views): Replace bool parameter with enum;
9388 adjust all callers. Don't delete views with permanent data;
9389 do delete cached views and views from archives if
9390 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9391 if clearing the corresponding view.
9392 * fileread.h (File_read::Clear_views_mode): New enum.
9393 (File_read::View::is_permanent_view): New method.
9394 (File_read::clear_views): Replace bool parameter
9395 with enum; adjust all callers.
9396 * options.h (General_options): Change keep_files_mapped option;
9397 add map_whole_files.
9398 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9399 releasing the file.
9400 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9401 the file.
9402
8861f32b
DM
94032010-03-10 David S. Miller <davem@davemloft.net>
9404
9405 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9406
d62d0f5f
ST
94072010-03-09 Sriraman Tallam <tmsriram@google.com>
9408
9409 * icf.cc (get_section_contents): Add '@' marker after processing the
9410 merge reloc.
9411
9177756d
DK
94122010-03-08 Doug Kwan <dougkwan@google.com>
9413
9414 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9415 due to a conversion warning.
9416 (Arm_relobj::update_output_local_symbol_count): Check for local
9417 symbol with unset output index.
9418
9e9e071b
ILT
94192010-03-05 Ian Lance Taylor <iant@google.com>
9420
9421 * options.h (class General_options): Add --spare-dynamic-tags.
9422 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9423 --spare-dynamic-tags.
9424
a81ee015
ILT
94252010-03-05 Ian Lance Taylor <iant@google.com>
9426
9427 * incremental.cc: Include "libiberty.h".
9428
44ec90b9
RO
94292010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9430
9431 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9432 function, is_info_ member.
9433 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9434 (Versions::Versions): Update caller.
9435 (Versions::define_base_version): Likewise.
9436 (Versions::add_def): Likewise.
9437
0897ed3b
ST
94382010-03-03 Sriraman Tallam <tmsriram@google.com>
9439
9440 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9441 (Scan::possible_function_pointer_reloc): New function.
9442 (Scan::local_reloc_may_be_function_pointer): Change to call
9443 possible_function_pointer_reloc.
9444 (Scan::global_reloc_may_be_function_pointer): Ditto.
9445 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9446 relocations in ".data.rel.ro._ZTV" section.
9447 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9448 * testsuite/icf_safe_so_test.cc: Ditto.
9449 * testsuite/icf_safe_test.cc: Ditto.
9450 * testsuite/icf_safe_test.sh: Ditto.
9451
d3bbad62
ILT
94522010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9453 Ian Lance Taylor <iant@google.com>
9454
9455 * target-reloc.h (relocate_section): Check the symbol table index
9456 for -1U before setting the local symbol index.
9457 (scan_relocatable_relocs): If copying the relocation, record that
9458 the local symbol is required.
9459 * object.h (Symbol_value::is_output_symtab_index_set): New
9460 function.
9461 (Symbol_value::may_be_discarded_from_output_symtab): New
9462 function.
9463 (Symbol_value::has_output_symtab_entry): New function.
9464 (Symbol_value::needs_output_symtab_entry): Remove.
9465 (Symbol_value::output_symtab_index): Make sure the symbol index is
9466 set.
9467 (Symbol_value::set_output_symtab_index): Make sure the symbol
9468 index is not set. Make sure the new index is valid.
9469 (Symbol_value::set_must_have_output_symtab_entry): New function.
9470 (Symbol_value::has_output_dynsym_entry): New function.
9471 (Symbol_value::set_output_dynsym_index): Make sure the new index
9472 is valid.
9473 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9474 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9475 local symbol if permitted.
9476 (Sized_relobj::do_finalize_local_symbols): Call
9477 is_output_symtab_index_set rather than needs_output_symtab_entry.
9478 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9479 rather than needs_output_symtab_entry. Call
9480 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9481 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9482 is_output_symtab_index_set rather than needs_output_symtab_entry.
9483 * testsuite/discard_locals_relocatable_test.c: New file.
9484 * testsuite/discard_locals_test.sh: Test -r.
9485 * testsuite/Makefile.am (check_DATA): Add
9486 discard_locals_relocatable_test1.syms,
9487 discard_local_relocatable_test2.syms.
9488 (MOSTLYCLEANFILES): Likewise. Also add
9489 discard_locals_relocatable_test1.lout and
9490 discard_locals_relocatable_test2.out.
9491 (discard_locals_relocatable_test1.syms): New target.
9492 (discard_locals_relocatable_test.o): New target.
9493 (discard_locals_relocatable_test1.out): New target.
9494 (discard_locals_relocatable_test2.syms): New target.
9495 (discard_locals_relocatable_test2.out): New target.
9496 (various): Add missing ../ld-new dependencies.
9497 * testsuite/Makefile.in: Rebuild.
9498
7e8ccf26
NC
94992010-03-03 Nick Clifton <nickc@redhat.com>
9500
9501 * po/fi.po: New Finnish translation.
9502
2a0ff005
DK
95032010-03-01 Doug Kwan <dougkwan@google.com>
9504
9505 * layout.cc (Layout::Layout): Force section types of .init_array*,
9506 .preinit_array* and .fini_array* sections.
9507 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9508 Fix check of return value of std::string::find.().
9509 (Output_section::Input_section_sort_compare::operator()): Remove
9510 comment about .init_array.
9511 (Output_section::Input_section_sort_init_fini_compare::operator()):
9512 New method.
9513 (Output_section::sort_attached_input_sections): Handle .init_array
9514 and .fini_array specially.
9515 * output.h (Output_section::Inut_section_sort_compare): Update
9516 comment.
9517 (Output_section::Input_section_sort_init_fini_compare): New struct.
9518
c3e4ae29
DK
95192010-02-26 Doug Kwan <dougkwan@google.com>
9520
9521 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9522 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9523 * testsuite/debug_msg.sh: Avoid matching source line number for
9524 use of global variable undef_int.
9525
2fd9ae7a
DK
95262010-02-26 Doug Kwan <dougkwan@google.com>
9527
9528 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9529 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9530 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9531 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9532 * options.cc (General_options::General_options): Initialize member
9533 fix_v4bx_.
9534 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9535 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9536 and rm_no_fix_v4bx.stdout
9537 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9538 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9539 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9540 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9541 and arm_no_fix_v4bx.
9542 * Makefile.in: Regenerate.
9543 * testsuite/arm_fix_v4bx.s: New file.
9544 * testsuite/arm_fix_v4bx.sh: Ditto.
9545
67ec7d0b
DK
95462010-02-24 Doug Kwan <dougkwan@google.com>
9547
9548 * arm.cc (Target_arm::got_section): Make the .got section the first
9549 non RELRO section in the data segment.
9550 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9551 suffixes of section names.
9552
10165461
DK
95532010-02-24 Doug Kwan <dougkwan@google.com>
9554
9555 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9556 flags and attributes merging if an input file is a binary file.
9557 * fileread.cc (Input_file::open): Record format of original file.
9558 * fileread.h (Input_file::Format): New enum type.
2e702c99 9559 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9560 (Input_file::format): New method definition.
9561 (Input_file::format_):: New data member.
9562
4a54abbb
DK
95632010-02-24 Doug Kwan <dougkwan@google.com>
9564
9565 * arm.cc (Arm_output_data_got): New class.
9566 (ARM_TCB_SIZE): New constant
9567 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9568 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9569 If user uses a script with a SECTIONS clause, issue only a warning
9570 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9571 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9572 garbage collection.
9573 (Target_arm::got_mode_index_entry): Handle static linking.
9574 (Target_arm::Scan::local): Ditto.
9575 (Target_arm::Scan::global): Ditto.
9576 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9577 all incorrectly implemented relocations.
e1df38aa 9578 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
9579 Arm_output_section::fix_exidx_coverage.
9580 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9581 from ".ARM.exidx." and ".ARM.extab.".
9582
ca419a6f
ILT
95832010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9584
9585 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9586 section if it does not already exist.
9587 * attributes.cc (Attributes_section_data::Attributes_section_data):
9588 Don't crash if size is zero.
9589
135b9c78
ILT
95902010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9591 Ian Lance Taylor <iant@google.com>
9592
9593 * gold.cc (queue_middle_tasks): If no input files were opened,
9594 exit.
9595 * workqueue.h (Task_function::Task_function): Assert that there is
9596 a blocker.
9597
bb0bfe4f
DK
95982010-02-22 Doug Kwan <dougkwan@google.com>
9599
9600 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9601 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9602 types to avoid warnings due to different uint64_t implementations
9603 on different hosts.
9604
2a2b6d42
DK
96052010-02-21 Doug Kwan <dougkwan@google.com>
9606
9607 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9608 handling of the maximum backward branch offset.
2e702c99 9609 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
9610 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9611 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 9612 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
9613 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9614 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9615 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9616 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9617 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9618 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9619 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9620 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9621 thumb2_bl_out_of_range.o): New rules.
9622 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9623 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9624 thumb2_bl_out_of_range
9625 * testsuite/Makefile.in: Regenerate.
9626 * testsuite/arm_bl_in_range.s: New file.
9627 * testsuite/arm_bl_out_of_range.s: Ditto.
9628 * testsuite/arm_branch_in_range.sh: Ditto.
9629 * testsuite/arm_branch_range.t: Ditto.
9630 * testsuite/thumb2_branch_range.t: Ditto.
9631 * testsuite/thumb_bl_in_range.s: Ditto.
9632 * testsuite/thumb_bl_out_of_range.s: Ditto.
9633 * testsuite/thumb_branch_range.t: Ditto.
9634
b487ad64
ST
96352010-02-20 Sriraman Tallam <tmsriram@google.com>
9636
9637 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9638 Add reloc offset information.
9639 * icf.cc (get_section_contents): Change iterators to point to the new
9640 vectors. Add reloc offset information to the contents.
9641 * icf.h (Icf::Sections_reachable_info): New typedef.
9642 (Icf::Sections_reachable_list): New typedef.
9643 (Icf::Offset_info): New typedef.
9644 (Icf::Reloc_info): New struct typedef.
9645 (Icf::Reloc_info_list): New typedef.
9646 (Icf::symbol_reloc_list): Delete method.
9647 (Icf::addend_reloc_list): Delete method.
9648 (Icf::section_reloc_list): Delete method.
9649 (Icf::reloc_info_list): New method.
9650 (Icf::reloc_info_list_): New member.
9651
f96accdf
DK
96522010-02-19 Doug Kwan <dougkwan@google.com>
9653
9654 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9655 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9656 * arm.cc (Arm_relocation_functions): New forward declaration.
9657 (Target_arm::Target_arm): Initialize new data members
9658 got_mod_index_offset_ and tls_base_symbol_defined_.
9659 (Target_arm::Relocate::relocate_tls): New method.
9660 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9661 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9662 New methods.
2e702c99 9663 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
9664 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9665 (Target_arm::got_mod_index_offset_,
9666 Target_arm::tls_base_symbol_defined_): New data members.
9667 (Target_arm::Scan::local, Target::Scan::global,
9668 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9669 relocations.
9670
c8761b9a
DK
96712010-02-18 Doug Kwan <dougkwan@google.com>
9672
9673 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9674 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9675 text section as a parameter becuase some broken tools may not set
9676 the link in section header.
9677 (Target_arm::has_got_section): New method.
9678 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9679 without any mapping symbol as data only. Remove warning.
9680 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9681 link in its section header, try to discover the link by inspecting the
9682 REL31 relocation at the beginning of the section.
9683 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9684 in error message.
9685 (Target_arm::Scan::global): Treat any reference to the symbol
9686 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9687
21bb3914
ST
96882010-02-12 Sriraman Tallam <tmsriram@google.com>
9689
9690 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9691 (Scan::global_reloc_may_be_function_pointer): New function.
9692 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9693 (Scan::global_reloc_may_be_function_pointer): New function.
9694 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9695 (Scan::global_reloc_may_be_function_pointer): New function.
9696 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9697 (Scan::global_reloc_may_be_function_pointer): New function.
9698 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9699 (Scan::global_reloc_may_be_function_pointer): New function.
9700 (Scan::possible_function_pointer_reloc): New function.
9701 (Target_x86_64::can_check_for_function_pointers): New function.
9702 * gc.h (gc_process_relocs): Scan relocation types to determine if
9703 function pointers were taken for targets that support it.
9704 * icf.cc (Icf::find_identical_sections): Include functions for
9705 folding in safe ICF whose pointer is not taken.
9706 * icf.h (Secn_fptr_taken_set): New typedef.
9707 (fptr_section_id_): New member.
9708 (section_has_function_pointers): New function.
9709 (set_section_has_function_pointers): New function.
9710 (check_section_for_function_pointers): New function.
9711 * options.h: Fix comment for safe ICF option.
9712 * target.h (can_check_for_function_pointers): New function.
9713 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9714 Modify icf_safe_test for X86-64.
9715 * testsuite/Makefile.in: Regenerate.
9716 * testsuite/icf_safe_so_test.cc: New file.
9717 * testsuite/icf_safe_so_test.sh: New file.
9718 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9719 (main): Change to take pointer to function kept_func_3.
9720 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9721 folding is done correctly for X86-64.
9722
0da6fa6c
DM
97232010-02-12 David S. Miller <davem@davemloft.net>
9724
9725 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9726 is_symbolless parameter.
9727 (Output_reloc<SHT_REL>::is_symbolless): New.
9728 (Output_reloc<SHT_REL>::is_symbolless_): New.
9729 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9730 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9731 (Output_reloc<SHT_RELA>::is_symbolless): New.
9732 (Output_data_reloc::add_global): Handle is_symbolless.
9733 (Output_data_reloc::add_global_relative): Likewise.
9734 (Output_data_reloc::add_local): Likewise.
9735 (Output_data_reloc::add_local_relative): Likewise.
9736 (Output_data_reloc::add_symbolless_global_addend): New.
9737 (Output_data_reloc::add_symbolless_local_addend): New.
9738 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9739 is_symbolless.
9740 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9741 instead of ->is_relative_
9742 (Output_reloc::write): Likewise.
9743 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9744 (Output_reloc::write_rel): Simplify.
9745
9746 * sparc.cc (Target_sparc::Scan::local): Use
9747 ->add_symbolless_local_addend as needed.
9748 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9749 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9750 based upon relocation offset.
9751
e4782e83
DK
97522010-02-11 Doug Kwan <dougkwan@google.com>
9753
9754 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9755 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9756 beginning of function.
9757 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9758 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9759 parameter is_32bit in calls to should_apply_static_reloc.
9760 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9761 (check_DATA): Add arm_abs_global.stdout.
9762 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9763 arm_abs_global.stdout): New rules.
9764 (MOSTLLYCLEANFILES): Add arm_abs_global
9765 * Makefile.in: Regenerate.
9766 * testsuite/arm_abs_global.s: New file.
9767 * testsuite/arm_abs_global.sh: Ditto.
9768 * testsuite/arm_abs_lib.s: Ditto.
9769
93ceb764
ILT
97702010-02-11 Ian Lance Taylor <iant@google.com>
9771
9772 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9773 Read_relocs task.
9774 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9775 Allocate_commons_task first.
9776 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9777 task, rather than symtab_lock_.
9778 (Gc_process_relocs::~Gc_process_relocs): New function.
9779 (Gc_process_relocs::is_runnable): Check this_blocker_.
9780 (Gc_process_relocs::locks): Use next_blocker_ rather than
9781 blocker_.
9782 (Scan_relocs::~Scan_relocs): New function.
9783 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9784 symtab_lock_.
9785 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9786 next_blocker_.
9787 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9788 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9789 constructor accordingly.
9790 (class Gc_process_relocs): Likewise.
9791 (class Scan_relocs): Likewise.
9792 * common.h (class Allocate_commons_task): Remove symtab_lock_
9793 field, and corresponding constructor parameter.
9794 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9795 symtab_lock_.
9796 (Allocate_commons_task::locks): Likewise.
9797
114dfbe1
ILT
97982010-02-11 Ian Lance Taylor <iant@google.com>
9799
9800 * gold-threads.h (class Once): Define.
9801 (class Initialize_lock): Rewrite as child of Once.
9802 * gold-threads.cc (class Once_initialize): Define.
9803 (once_pointer_control): New static variable.
9804 (once_pointer, once_arg): New static variables.
9805 (c_run_once): New static function.
9806 (Once::Once, Once::run_once, Once::internal_run): New functions.
9807 (class Initialize_lock_once): Remove.
9808 (initialize_lock_control): Remove.
9809 (initialize_lock_pointer): Remove.
9810 (initialize_lock_once): Remove.
9811 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9812 (Initialize_lock::initialize): Rewrite.
9813 (Initialize_lock::do_run_once): New function.
9814 * archive.cc (Archive::interpret_header): Only clear name if it is
9815 not already empty.
9816 * fileread.cc: Include "gold-threads.h"
9817 (file_counts_lock): New static variable.
9818 (file_counts_initialize_lock): Likewise.
9819 (File_read::release): Only increment counts when using --stats.
9820 Use a lock around the increment.
9821 * parameters.cc (class Set_parameters_target_once): Define.
9822 (set_parameters_target_once): New static variable.
9823 (Parameters::Parameters): Move here from parameters.h.
9824 (Parameters::set_target): Rewrite.
9825 (Parameters::set_target_once): New function.
9826 (Parameters::clear_target): Move here and rewrite.
9827 * parameters.h (class Parameters): Update declarations. Add
9828 set_parameters_target_once_ field.
9829 (Parameters::Parameters): Move to parameters.cc.
9830 (Parameters::clear_target): Likewise.
9831 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9832 task.
9833 (Start_group::~Start_group): New function.
9834 (Start_group::is_runnable): New function.
9835 (Start_group::locks, Start_group::run): New functions.
9836 (Finish_group::run): Change saw_undefined to size_t.
9837 * readsyms.h (class Start_group): Define.
9838 (class Finish_group): Change saw_undefined_ field to size_t.
9839 (Finish_group::Finish_group): Remove saw_undefined and
9840 this_blocker parameters. Change all callers.
9841 (Finish_group::set_saw_undefined): New function.
9842 (Finish_group::set_blocker): New function.
9843 * symtab.h (class Symbol_table): Change saw_undefined to return
9844 size_t. Change saw_undefined_ field to size_t.
9845 * target-select.cc (Set_target_once::do_run_once): New function.
9846 (Target_selector::Target_selector): Initialize set_target_once_
9847 field. Don't initialize lock_ and initialize_lock_ fields.
9848 (Target_selector::instantiate_target): Rewrite.
9849 (Target_selector::set_target): New function.
9850 * target-select.h (class Set_target_once): Define.
9851 (class Target_selector): Update declarations. Make
9852 Set_target_once a friend. Remove lock_ and initialize_lock_
9853 fields. Add set_target_once_ field.
9854
fa17a3f4
ILT
98552010-02-10 Ian Lance Taylor <iant@google.com>
9856
9857 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9858 queueing any tasks.
9859 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9860 (queue_middle_tasks): Add all blockers before queueing any tasks.
9861 (queue_final_tasks): Likewise.
9862 * token.h (Task_token::add_blockers): New function.
9863 * object.h (Input_objects::number_of_relobjs): New function.
9864
c7177d31
ILT
98652010-02-10 Ian Lance Taylor <iant@google.com>
9866
5de0e392
ILT
9867 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9868 shared, not if not position independent.
9869 * x86_64.cc (Relocate::relocate_tls): Likewise.
9870 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9871 (tls_pie_pic_test): New target.
9872 * testsuite/Makefile.in: Rebuild.
9873
c7177d31
ILT
9874 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9875 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9876 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9877 * testsuite/Makefile.in: Rebuild.
9878
684b268a
DM
98792010-02-09 David S. Miller <davem@davemloft.net>
9880
9881 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9882 R_SPARC_RELATIVE using ->add_local_relative().
9883 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9884
612a8d3d
DM
9885 * output.h (Output_data_dynamic::add_section_size): New method
9886 that takes two Output_data objects.
9887 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9888 entry param. Handle it in initializers.
9889 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9890 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9891 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9892 arg.
9893 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9894 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9895 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9896 for dynrel_includes_plt.
9897 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9898 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9899 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9900 before .rela.plt
9901 (Target_sparc::do_finalize_sections): Update to pass true for
9902 dynrel_includes_plt.
9903 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9904 output before .rela.plt
9905 (Target_powerpc::do_finalize_sections): Update to pass true for
9906 dynrel_includes_plt when 32-bit.
9907
cb1be87e
DK
99082010-02-08 Doug Kwan <dougkwan@google.com>
9909
9910 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9911 method.
9912 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9913 Arm_relobj::scan_section_for_cortex_a8_stubs,
9914 Arm_relobj::do_relocation_section): Instead of calling
9915 Output_section::output_address, use faster
9916 Arm_relobj::simple_input_section_output_address.
9917
705b5121
DM
99182010-02-08 David S. Miller <davem@davemloft.net>
9919
9920 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9921 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9922 relocation helper function.
9923
024c4466
DM
9924 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9925 just like R_SPARC_GOT{10,13,22}.
9926 (Target_sparc::Scan::local): Likewise.
9927 (Target_sparc::Relocate:relocate): Likewise.
9928
9109c078
ILT
99292010-02-06 Ian Lance Taylor <iant@google.com>
9930
9931 * configure.ac: Rewrite targetobjs duplicate removal code to use
9932 only shell constructs.
9933 * configure: Rebuild.
9934
cf846138
DK
99352010-02-05 Doug Kwan <dougkwan@google.com>
9936
9937 PR 11247
9938 * arm.cc (Arm_relobj::section_is_scannable): New method.
9939 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9940 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9941
6cfaf60b
DK
99422010-02-04 Doug Kwan <dougkwan@google.com>
9943
9944 PR 11247
9945 * arm-reloc-property.cc (cstdio): Include.
9946 * configure.ac (targetobjs): Remove duplicates.
9947 * configure: Regenerate.
9948 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9949 big and little endian version for a given address size.
9950
5c57f1be
DK
99512010-02-03 Doug Kwan <dougkwan@google.com>
9952
9953 * arm-reloc-property.cc
9954 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9955 definition.
9956 * arm-reloc-property.h
9957 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9958 New method definition.
9959 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9960 declaration.
9961 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9962 overflow to N.
9963 (GOT_PREL): Change implemented to Y.
9964 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9965 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9966 (Arm_relocate_functions::movw_abs_nc): Remove method.
9967 (Arm_relocate_functions::movt_abs): Ditto.
9968 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9969 (Arm_relocate_functions::thm_movt_abs): Ditto.
9970 (Arm_relocate_functions::movw_rel_nc): Ditto.
9971 (Arm_relocate_functions::movw_rel): Ditto.
9972 (Arm_relocate_functions::movt_rel): Ditto.
9973 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9974 (Arm_relocate_functions:thm_movw_rel): Ditto.
9975 (Arm_relocate_functions:thm_movt_rel): Ditto.
9976 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9977 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9978 New method definitions.
9979 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9980 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9981 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9982 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9983 (Target_arm::Relocate::relocate): Check for non-static or
9984 unimplemented relocation code and exit early. Change calls to
9985 Target_arm::reloc_uses_thumb_bit and
9986 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9987 instead. Refactor code to handle similar relocations to increase
9988 code sharing. Remove check for unsupported relocation code in switch
9989 statement.
9990 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9991 relocation property table to find out size. Change error message to
9992 print out the name of a relocation code instead of the numeric value.
9993 (Target_arm::scan_reloc_for_stub): Use relocation property table
9994 instead of calling Target_arm::reloc_uses_thumb_bit().
9995
218c5831
DK
99962010-02-02 Doug Kwan <dougkwan@google.com>
9997
9998 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9999 types of relaxed input section.
10000
0d31c79d
DK
100012010-02-02 Doug Kwan <dougkwan@google.com>
10002
10003 * Makefile.am (HFILES): Add arm-reloc-property.h.
10004 (DEFFILES): New.
2e702c99
RM
10005 (TARGETSOURCES): Add arm-reloc-property.cc
10006 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
10007 (libgold_a_SOURCES): $(DEFFILES)
10008 * Makefile.in: Regenerate.
10009 * arm-reloc-property.cc: New file.
10010 * arm-reloc-property.h: New file.
10011 * arm-reloc.def: New file.
10012 * arm.cc: Update comments.
10013 (arm-reloc-property.h): New included header.
10014 (arm_reloc_property_table): New global variable.
10015 (Target_arm::do_select_as_default_target): New method definition.
10016 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10017 arm-reloc-property to targ_extra_obj.
10018 * parameters.cc (set_parameters_target): Call
10019 Target::select_as_default_target().
10020 * target.h (Target::select_as_default_target): New method definition.
10021 (Target::do_select_as_default_target): Same.
10022
546c7457
DK
100232010-02-01 Doug Kwan <dougkwan@google.com>
10024
10025 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10026 first_output_text_section_.
10027 (Arm_exidx_fixup::first_output_text_section): New method definition.
10028 (Arm_exidx_fixup::first_output_text_section_): New data member.
10029 (Arm_exidx_fixup::process_exidx_section): Record the first text
10030 output section seen.
10031 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10032 and entsize in output section header.
10033
11b861d5
DK
100342010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10035
10036 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10037 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10038 (Arm_relocate_functions::thm_alu11): New Method.
10039 (Arm_relocate_functions::thm_pc8): New Method.
10040 (Arm_relocate_functions::thm_pc12): New Method.
10041 (Target_arm::Scan::local): Handle the relocations.
10042 (Target_arm::Scan::global): Likewise.
10043 (Target_arm::Relocate::relocate): Likewise.
10044 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10045
c9a2c125
DK
100462010-01-29 Doug Kwan <dougkwan@google.com>
10047
10048 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
10049 of relocation types as ld.
10050
1521477a
DK
100512010-01-29 Doug Kwan <dougkwan@google.com>
10052
10053 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10054 to public.
10055 (Arm_relocate_functions::thumb_branch_common): Ditto.
10056 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10057 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10058 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10059 Arm_relocate_functions::jump24): Remove.
10060 (Target_arm::Relocate::relocate): Adjust code to call
10061 Arm_relocation_functions::arm_branch_common and
10062 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 10063 wrappers. Merge switch-cases together to reduce source code size.
1521477a 10064
e7eca48c
DK
100652010-01-29 Doug Kwan <dougkwan@google.com>
10066
10067 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10068 output_local_symbol_count_needs_update_.
10069 (Arm_relobj::output_local_symbol_count_needs_update,
10070 Arm_relobj::set_output_local_symbol_count_needs_update,
10071 Arm_relobj::update_output_local_symbol_count): New methods.
10072 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10073 member.
10074 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10075 of pointed function as in a R_ARM_PREL31 relocation.
10076 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10077 for output local symbol count updating.
10078 (Target_arm::do_relax): Update output local symbol counts in objects
10079 if necessary.
10080 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10081
02961d7e
ILT
100822010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10083
10084 * arm.cc: Added support for the ARM relocations:
10085 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
10086 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
10087 (Arm_relocate_functions::movw_rel_nc): Renamed (was
10088 movw_prel_nc).
10089 (Arm_relocate_functions::movw_rel): New method.
10090 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
10091 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
10092 thm_movw_prel_nc).
10093 (Arm_relocate_functions::thm_movw_rel): New method.
10094 (Arm_relocate_functions::thm_movt_rel): Renamed (was
10095 thm_movt_prel).
10096 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
10097 relocations.
10098 (Target_arm::Scan::global): Likewise.
10099 (Target_arm::Relocate::relocate): Likewise.
10100 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10101 Likewise.
10102
b10d2873
ILT
101032010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10104
10105 * arm.cc: Added support for ARM group relocations.
10106 (Target_arm::reloc_needs_sym_origin): New method.
10107 (Arm_relocate_functions::calc_grp_kn): New method.
10108 (Arm_relocate_functions::calc_grp_residual): New method.
10109 (Arm_relocate_functions::calc_grp_gn): New method.
10110 (Arm_relocate_functions::arm_grp_alu): New Method.
10111 (Arm_relocate_functions::arm_grp_ldr): New Method.
10112 (Arm_relocate_functions::arm_grp_ldrs): New Method.
10113 (Arm_relocate_functions::arm_grp_ldc): New Method.
10114 (Target_arm::Scan::local): Handle the ARM group relocations.
10115 (Target_arm::Scan::global): Likewise.
10116 (Target_arm::Relocate::relocate): Likewise.
10117 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10118 Likewise.
10119
2b328d4e
DK
101202010-01-26 Doug Kwan <dougkwan@google.com>
10121
10122 * arm.cc (set): Include.
10123 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10124 pointer type.
2e702c99 10125 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
10126 (Arm_output_section::append_text_sections_to_list): New method.
10127 (Arm_output_section::fix_exidx_coverage): Ditto.
10128 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 10129 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
10130 Relobj::set_section_offset() instead of
10131 Sized_relobj::invalidate_section_offset().
2e702c99 10132 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
10133 parameter for section headers. Ignore relocation sections for
10134 unallocated sections and EXIDX sections.
10135 (Target_arm::fix_exidx_coverage): New method.
10136 (Target_arm::output_section_address_less_than): New type.
10137 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10138 linked text section instead of the EXIDX section.
10139 (Arm_output_section::create_stub_group): Add an assertion to check
10140 that this is not an EXIDX output section.
10141 (Arm_output_section::append_text_sections_to_list): New method.
10142 (Arm_output_section::fix_exidx_coverage): Ditto.
10143 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 10144 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
10145 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10146 first pass.
10147 (Target_arm::fix_exidx_coverage): New method.
10148 * object.h (Relobj::set_output_section): New method.
10149 (Sized_relobj::invalidate_section_offset): Remove method.
10150 (Sized_relobj::do_invalidate_section_offset): Remove method.
10151 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10152
c7f3c371
DK
101532010-01-25 Doug Kwan <dougkwan@google.com>
10154
10155 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10156 Fix warning due to signed and unsigned comparison on a 32-bit host.
10157
8923b24c
DK
101582010-01-22 Doug Kwan <dougkwan@google.com>
10159
10160 * arm.cc (Target_arm::do_relax): Record an output section for section
10161 offset adjustment it contains any stub table that has changed.
10162 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10163 offsets in an output section if necessary.
10164 * output.cc (Output_section::Output_section): Initialize
10165 section_offsets_need_adjustments_.
10166 (Output_section::add_input_section_for_script): Renamed to
10167 Output_section::add_simple_input_section.
10168 (Output_section::save_states): Add a comment.
10169 (Output_section::discard_states): New method defintion.
10170 (Output_section::adjust_section_offsets): Same.
10171 * output.h (Output_section::add_input_section_for_script): Renamed to
10172 Output_section::add_simple_input_section.
10173 (Output_section::discard_states): New method declaration.
10174 (Output_section::adjust_section_offsets): Same.
10175 (Output_section::section_offsets_need_adjustment,
10176 Output_section::set_section_offsets_need_adjustment): New method
10177 definitions.
10178 (Output_section::section_offsets_need_adjustment_): New data member.
10179 * script-sections.cc
10180 (Output_section_element_input::set_section_address): Adjust code for
10181 renaming of Output_section::add_input_section_for_script.
10182 (Orphan_output_section::set_section_address): Same.
10183
9b2fd367
DK
101842010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10185
10186 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10187 Fix_v4bx enum values .
10188 * gold/options.h (General_options): New option definitions.
10189 (General_options::fix_v4bx): New method.
10190 (General_options::Fix_v4bx): New enum.
10191 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10192 (General_options::parse_fix_v4bx_interworking): New method.
10193
80d0d023
DK
101942010-01-22 Doug Kwan <dougkwan@google.com>
10195
10196 * arm.cc (Arm_exidx_fixup): New class.
10197
af2cdeae
DK
101982010-01-21 Doug Kwan <dougkwan@google.com>
10199
10200 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10201 classes.
10202 (Arm_exidx_section_offset_map): New type.
10203
993d07c1
DK
102042010-01-21 Doug Kwan <dougkwan@google.com>
10205
10206 * arm.cc (Arm_exidx_input_section): New class.
10207 (Arm_relobj::exidx_input_section_by_link,
10208 Arm_relobj::exidx_input_section_by_shndx,
10209 Arm_relobj::make_exidx_input_section): New methods.
10210 (read_arm_attributes_section): Remove.
10211 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10212 information about them.
10213 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10214 to here.
10215
5ac169d4
DK
102162010-01-20 Doug Kwan <dougkwan@google.com>
10217
10218 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10219 Input_section_specifier to Section_id.
10220 (Target_arm::new_arm_input_section: Adjust code for change of key
10221 type.
10222 (Target_arm::find_arm_input_section): Ditto.
10223 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10224 (Section_id): Remove.
10225 (Garbage_collection::Section_id_hash): Remove.
10226 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10227 (Section_id): Remove.
10228 (Icf::Section_id_hash): Remove.
10229 * object.h (Section_id, Const_section_id, Section_id_hash,
10230 Const_section_id_hash): New type definitions.
10231 * output.cc (Output_section::add_relaxed_input_section): Change to
10232 use Const_section_id instead of Input_section_specifier as key type.
10233 (Output_section::add_merge_input_section): Ditto.
10234 (Output_section::build_relaxation_map): Change to use Section_id
10235 instead of Input_section_specifier as key type.
2e702c99 10236 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
10237 Ditto.
10238 (Output_section::convert_input_sections_to_relaxed_sections): Change
10239 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 10240 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
10241 (Output_section::find_relaxed_input_section): Ditto.
10242 * output.h (Input_section_specifier): Remove class.
10243 (Output_section::Output_section_data_by_input_section_map): Change
10244 key type to Const_section_id.
10245 (Output_section::Output_relaxed_input_section_by_input_section_map):
10246 Ditto.
10247 (Output_section::Relaxation_map): Change key type to Section_id.
10248
a2162063
ILT
102492010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10250
10251 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10252 (class Arm_v4bx_stub): New class.
10253 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10254 (Stub_factory::make_arm_v4bx_stub): New method.
10255 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10256 (Stub_table::empty): Handle v4bx stubs.
10257 (Stub_table::add_arm_v4bx_stub): New method.
10258 (Stub_table::find_arm_v4bx_stub): New method.
10259 (Arm_relocate_functions::v4bx): New method.
10260 (Target_arm::fix_v4bx): New method.
10261 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10262 (Stub_table::relocate_stubs): Likewise.
10263 (Stub_table::do_write): Likewise.
10264 (Stub_table::update_data_size_and_addralign): Likewise.
10265 (Stub_table::finalize_stubs): Likewise.
10266 (Target_arm::Scan::local): Likewise.
10267 (Target_arm::Scan::global): Likewise.
10268 (Target_arm::do_finalize_sections): Likewise.
10269 (Target_arm::Relocate::relocate): Likewise.
10270 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10271 Likewise.
10272 (Target_arm::scan_reloc_for_stub): Likewise.
10273 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10274
5696ab0b
ILT
102752010-01-19 Ian Lance Taylor <iant@google.com>
10276
10277 * output.cc (Output_section_headers::do_sized_write): Write large
10278 segment count to sh_info field.
10279 (Output_file_header::do_sized_write): For large segment count,
10280 write PN_XNUM to e_phnum field.
10281
800d0f56
ILT
102822010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10283
10284 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10285 (Arm_relocate_functions::thm_jump8): New function.
10286 (Arm_relocate_functions::thm_jump11): New function.
10287 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10288 R_ARM_THM_JUMP11.
10289 (Target_arm::Scan::global): Likewise.
10290 (Target_arm::Relocate::relocate): Likewise.
10291 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10292 Likewise.
10293
41263c05
DK
102942010-01-14 Doug Kwan <dougkwan@google.com>
10295
10296 * arm.cc (map, utility): Include headers.
10297 (Target_arm::apply_cortex_a8_workaround): New method.
10298 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10299 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10300 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10301 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10302 the --[no-]fix-cortex-a8 command line options.
10303 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10304 (Target_arm::relocate_stub): Use addend in instruction template.
10305 * options.h (DEFINE_bool): Set the user-set flag.
10306 (General_options): Add --[no-]-fix-cortex options.
10307 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10308 : Update fast look-up map after conversion.
41263c05 10309
459e9b03
ST
103102010-01-14 Sriraman Tallam <tmsriram@google.com>
10311
10312 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10313 in the first pass of do_layout.
10314
b521dfe4
DK
103152010-01-13 Doug Kwan <dougkwan@google.com>
10316
10317 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10318 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10319 apparent compiler problem of not folding static constant integral
10320 data members of elfcpp::Elf_sizes<32>.
10321
44272192
DK
103222010-01-13 Doug Kwan <dougkwan@google.com>
10323
10324 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10325 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10326 Arm_relobj::scan_section_for_cortex_a8_erratum,
10327 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10328 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10329 sections to scan for relocation stubs into a new method
10330 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10331 relocation and Cortex-A8 stub scanning.
10332 (Target_arm::do_relax): Force stubs to be after stubbed sections
10333 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10334 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10335 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10336
44b71ece
ILT
103372010-01-12 Ian Lance Taylor <iant@google.com>
10338
10339 * target-reloc.h (visibility_error): New inline function.
10340 (relocate_section): Call visibility_error.
10341 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10342 (MOSTLYCLEANFILES): Likewise.
10343 (protected_4_pic.o, protected_3.err): New targets.
10344 * testsuite/protected_4.cc: New file.
10345
a120bc7f
DK
103462010-01-12 Doug Kwan <dougkwan@google.com>
10347
10348 * arm.cc (Cortex_a8_reloc): New class.
10349 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10350 and cortex_a8_relocs_info_.
10351 (Target_arm::fix_cortex_a8): New method definition.
10352 (Target_arm::Cortex_a8_relocs_info): New type.
10353 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10354 New data member declarations.
10355 (Target_arm::scan_reloc_for_stub): Record information about
10356 relocations for THUMB branches that might be exempted from the
10357 Cortex-A8 workaround.
10358 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10359 at the beginning of a relaxation pass.
10360
20138696
DK
103612010-01-12 Doug Kwan <dougkwan@google.com>
10362
10363 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10364 (Arm_relobj::Mapping_symbol_position,
10365 Arm_reloj::Mapping_symbol_position_less,
10366 Arm_relobj::Mapping_symbols_info): New types.
10367 (Target_arm::is_mapping_symbol_name): New method definition.
10368 (Arm_relobj::do_count_local_symbols): Save information about mapping
10369 symbols.
10370
089d69dc
DK
103712010-01-11 Doug Kwan <dougkwan@google.com>
10372
10373 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10374 Arm_relocate_functions::thumb32_branch_upper,
10375 Arm_relocate_functions::thumb32_branch_lower,
10376 Arm_relocate_functions::thumb32_cond_branch_offset,
10377 Arm_relocate_functions::thumb32_cond_branch_upper,
10378 Arm_relocate_functions::thumb32_cond_branch_lower,
10379 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10380 branch offset encoding.
10381 (Arm_relocate_functions::thumb_branch_common): Use new branch
10382 offset encoding methods to avoid code duplication.
10383 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10384 (Stub_addend_reader::operator()): Use new branch encoding method
10385 to avoid code duplication.
10386
99e5bff2
DK
103872010-01-11 Doug Kwan <dougkwan@google.com>
10388
10389 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10390 (Target_arm::do_finalize_sections): Define special EXIDX section
10391 symbols only if referenced.
10392 * gc.h (Garbage_collection::add_reference): New method.
10393 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10394 code duplication.
10395
98e090bd
ILT
103962010-01-11 Ian Lance Taylor <iant@google.com>
10397
d0a91bd8
ILT
10398 * script.cc (Version_script_info::build_expression_list_lookup):
10399 Change complaing about duplicate wildcard match from error to
10400 warning.
10401
98e090bd
ILT
10402 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10403 of 2009-12-30.
10404 (Version_script_info::Version_script_info): Initialize globs_,
10405 default_version_, default_is_global_, and exact_. Don't
10406 initialize globals_ or locals_.
10407 (Version_script_info::build_lookup_tables): Build local symbols
10408 first.
10409 (Version_script_info::unquote): New function.
10410 (Version_script_info::add_exact_match): New function.
10411 (Version_script_info::build_expression_list_lookup): Remove lookup
10412 parameter. Add is_global parameter. Change all callers. Handle
10413 wildcard pattern specially. Unquote pattern. Call
10414 add_exact_match.
10415 (Version_script_info::get_name_to_match): New function.
10416 (Version_script_info::get_symbol_version): New function.
10417 (Version_script_info::get_symbol_version_helper): Remove.
10418 (Version_script_info::check_unmatched_names): Call unquote.
10419 * script.h (class Version_script_info): Change get_symbol_version
10420 to be non-inline and add is_global parameter; change all callers.
10421 Rewrite symbol_is_local. Update declarations. Define struct
10422 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10423 Remove globals_ and locals_ members. Add exact_, globs_,
10424 default_version_, is_global_.
10425 (Version_script_info::Glob): Remove pattern, add expression and
10426 is_global. Update constructor. Change all callers.
10427 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10428 default version.
10429 (Versions::symbol_section_contents): If a symbol is undefined, or
10430 defined in a dynamic object, set the version index to
10431 VER_NDX_LOCAL.
10432 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10433 symbol_is_local.
10434 (Symbol_table::add_from_pluginobj): Likewise.
10435 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10436
d56962d3
DK
104372010-01-11 Doug Kwan <dougkwan@google.com>
10438
10439 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10440 (incremental_dump_LDADD): Add linking option for libintl.
10441 * Makefile.in: Regenerate.
10442
94e6ee91
L
104432010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10444
10445 PR gold/11144
10446 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10447 instead of -Ds.
10448 * testsuite/Makefile.in: Regenerated.
10449
e96c574b
DK
104502010-01-10 Doug Kwan <dougkwan@google.com>
10451
10452 * options.h (DEFINE_var): Use parentheses around argument varname__
10453 in macro body to avoid any unintended subsequent substitutions.
10454
7198066b
ILT
104552010-01-10 Ian Lance Taylor <iant@google.com>
10456
ba4d53bf
ILT
10457 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10458 candidates before doing symbol resolution.
10459
7198066b
ILT
10460 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10461 ODR candidates if only one is weak.
10462
a2beed37
ILT
104632010-01-08 Ian Lance Taylor <iant@google.com>
10464
10465 * script.cc (Version_script_info::build_expression_list_lookup):
10466 Don't warn about ambiguous version, just record the ambiguity.
10467 (Version_script_info::get_symbol_version_helper): Give error if
10468 version is ambiguous.
10469
2fb7225c
DK
104702010-01-08 Doug Kwan <dougkwan@google.com>
10471
10472 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10473 prev_data_size_ and prev_addralign_. Remove initializer for
10474 deleted data member has_been_changed_.
10475 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10476 to determine if the table is empty.
10477 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10478 Remove.
10479 (Stub_table::add_reloc_stub): Define method in class definition
10480 instead of just declaring it there.
10481 (Stub_table::add_cortex_a8_stub): New method definition.
10482 (Stub_table::update_data_size_and_addralign): Ditto.
10483 (Stub_table::finalize_stubs): Ditto.
10484 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10485 (Stub_table::do_addralign_): Return address alignment in the
10486 (Stub_table::do_reset_address_and_file_offset): Define method in
10487 class definition instead of declaring it there. Set current data
10488 size to be the data size of the previous pass.
10489 (Stub_table::set_final_data_size): Use current data size as the
10490 final data size.
10491 (Stub_table::relocate_stub): Change parameter type of stub from
10492 Reloc_stub pointer to Stub pointer.
10493 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10494 (Stub_table::Cortex_a8_stub_list): New typedef.
10495 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10496 Stub_table::prev_addralign_): New data member.
10497 (Arm_relobj::Arm_relobj): Initialize data member
10498 section_has_cortex_a8_workaround_.
10499 (Arm_relobj::section_has_cortex_a8_workaround,
10500 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10501 definitions.
10502 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10503 declarations.
10504 (Target_arm::relocate_stub): Change parameter type of stub from
10505 Reloc_stub pointer to Stub pointer.
10506 (Insn_template::size, Insn_template::alignment): Handle
10507 THUMB16_SPECIAL_TYPE.
10508 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10509 Stub_table::update_data_size_and_addralign,
10510 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10511 definitions.
10512 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10513 (Stub_table::do_write): Ditto.
10514 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10515
880cd20d
ILT
105162010-01-08 Ian Lance Taylor <iant@google.com>
10517
10518 PR 11108
10519 * symtab.h (class Symbol): Remove fields is_target_special_ and
10520 has_plt_offset_. Add field is_defined_in_discarded_section_.
10521 (Symbol::is_defined_in_discarded_section): New function.
10522 (Symbol::set_is_defined_in_discarded_section): New function.
10523 (Symbol::has_plt_offset): Rewrite.
10524 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10525 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10526 Don't initialize is_target_special_ or has_plt_offset_.
10527 Initialize is_defined_in_discarded_section_.
10528 (Symbol_table::add_from_relobj): If appropriate, set
10529 is_defined_in_discarded_section.
10530 * resolve.cc (Symbol::override_base_with_special): Don't test
10531 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10532 * target-reloc.h (relocate_section): Do special handling for
10533 symbols defined in discarded sections for global symbols as well
10534 as local symbols.
10535
2703e3eb
ILT
105362010-01-08 Ian Lance Taylor <iant@google.com>
10537
10538 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10539 the SHT_SYMTAB case.
10540
339d40a3
ILT
105412010-01-08 Ian Lance Taylor <iant@google.com>
10542
10543 * object.cc (Sized_relobj::do_layout): Don't get confused if
10544 layout_eh_frame returns NULL.
10545
abecea76
ILT
105462010-01-08 Ian Lance Taylor <iant@google.com>
10547
10548 PR 11084
10549 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10550 dynamic symbol table, use the normal symbol table.
10551 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10552 symbol table.
10553
6b7dd3f3
ILT
105542010-01-08 Ian Lance Taylor <iant@google.com>
10555
10556 PR 11072
10557 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10558 sections.
10559
36c50e63
L
105602010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10561
10562 * version.cc (print_version): Change to "Copyright 2010".
10563
e291e7b9
ILT
105642010-01-08 Ian Lance Taylor <iant@google.com>
10565
10566 PR 10287
10567 PR 11063
10568 * i386.cc (class Target_i386): Change return type of plt_section
10569 to be non-const.
10570 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10571 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10572 tls_desc_rel_ field.
10573 (Output_data_plt_i386::rel_tls_desc): New function.
10574 (Target_i386::rel_tls_desc_section): New function.
10575 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10576 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10577 R_386_TLS_DESC reloc in rel_tls_desc_section.
10578 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10579 Define struct Tlsdesc_info.
10580 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10581 (Target_x86_64::do_reloc_symbol_index): New function.
10582 (Target_x86_64::add_tlsdesc_info): New function.
10583 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10584 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10585 tlsdesc_rel_ field.
10586 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10587 all callers.
10588 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10589 (Target_x86_64::rela_tlsdesc_section): New function.
10590 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10591 handling.
10592 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10593 (Target_x86_64::do_reloc_addend): New function.
10594 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10595 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10596 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10597 (Output_reloc::type): New function.
10598 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10599 (Output_reloc::is_target_specific): New function.
10600 (Output_reloc::target_arg): New function.
10601 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10602 absolute relocs and target specific relocs.
10603 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10604 add_target_specific.
10605 (class Output_data_reloc) [SHT_RELA]: Likewise.
10606 * output.cc (Output_reloc::Output_reloc): Add four new versions
10607 for absolute relocs and target specific relocs.
10608 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10609 (Output_reloc::get_symbol_index): Likewise.
10610 (Output_reloc::local_section_offset): Check that local_sym_index_
10611 is not TARGET_CODE or 0.
10612 (Output_reloc::symbol_value): Likewise.
10613 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10614 reloc.
10615 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10616 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10617 functions.
10618 * layout.cc (add_target_dynamic_tags): Use output section for
10619 DT_PLTRELSZ and DT_JMPREL.
10620
3a44184e
ILT
106212010-01-07 Ian Lance Taylor <iant@google.com>
10622
10623 PR 11061
10624 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10625 function.
10626 (class Output_data_reloc_generic): Define.
10627 (class Output_data_reloc_base): Change base class to
10628 Output_data_reloc_generic. Change add() method to call
10629 bump_relative_reloc_count for a relative reloc. Remove
10630 sort_relocs_ field.
10631 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10632 to sort_relocs().
10633 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10634 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10635 appropriate.
10636 * layout.h (class Layout): Update declaration.
10637
ea715a34
ILT
106382010-01-07 Ian Lance Taylor <iant@google.com>
10639
10640 * output.h (class Output_data): Add const version of
10641 output_section and do_output_section.
10642 (class Output_section_data): Add const version of
10643 do_output_section.
10644 (class Output_section): Likewise.
10645 * layout.cc (Layout::add_target_dynamic_tags): New function.
10646 * layout.h (class Layout): Update declarations.
10647 * arm.cc (Target_arm::do_finalize_sections): Use
10648 add_target_dynamic_tags.
10649 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10650 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10651 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10652 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10653
659948a4
ILT
106542010-01-07 Ian Lance Taylor <iant@google.com>
10655
10656 PR 11042
10657 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10658 object as needed.
10659
9d3b86f6
ILT
106602010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10661 Ian Lance Taylor <iant@google.com>
10662
10663 PR 11019
10664 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10665 Xindex::read_symtab_xindex.
10666
bb0d3eb0
DK
106672010-01-07 Doug Kwan <dougkwan@google.com>
10668
10669 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10670 (Insn_template::thumb16_bcond_insn): New method declaration.
10671 (Insn_template): Fix spelling.
10672 (Stub::thumb16_special): New method declaration.
10673 (Stub::do_write): Define virtual method which was previously pure
10674 virtual.
10675 (Stub::do_thumb16_special): New method declaration.
10676 (Stub::do_fixed_endian_write): New template member.
10677 (Reloc_stub::do_write): Remove.
10678 (Reloc_stub::do_fixed_endian_write): Remove.
10679 (Cortex_a8_stub): New class definition.
10680 (Stub_factory::make_cortex_a8_stub): New method definition.
10681 (Stub_factory::Stub_factory): Add missing static storage class
10682 qualifier for elf32_arm_stub_a8_veneer_blx.
10683
ffeef7df
ILT
106842010-01-07 Ian Lance Taylor <iant@google.com>
10685
dc3f80fe
ILT
10686 PR 10980
10687 * options.h (class General_options): Add --warn-unresolved-symbols
10688 and --error-unresolved-symbols.
10689 * errors.cc (Errors::undefined_symbol): Implement
10690 --warn-unresolved-symbols.
10691
ffeef7df
ILT
10692 * options.h (class General_options): Add -z text and -z textoff.
10693 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10694
f1ec9ded
ST
106952010-01-06 Sriraman Tallam <tmsriram@google.com>
10696
10697 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10698 (Garbage_collection::cident_sections): New function.
10699 (Garbage_collection::add_cident_section): New function.
10700 (Garbage_collection::cident_sections_): New member.
10701 (gc_process_relocs): Add references to sections whose names are C
10702 identifiers.
10703 * gold.h (cident_section_start_prefix): New constant.
10704 (cident_section_stop_prefix): New constant.
10705 (is_cident): New function.
10706 * layout.cc (Layout::define_section_symbols): Replace string constants
10707 with the newly defined constants.
10708 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10709 C identifiers.
10710 * testsuite/Makefile.am: Add gc_orphan_section_test.
10711 * testsuite/Makefile.in: Regenerate.
10712 * testsuite/gc_orphan_section_test.cc: New file.
10713 * testsuite/gc_orphan_section_test.sh: New file.
10714
6eda8c29
ILT
107152010-01-06 Ian Lance Taylor <iant@google.com>
10716
b9674e17
ILT
10717 PR 10980
10718 * options.h (class General_options): Add --warn-shared-textrel.
10719 * layout.cc (Layout::finish_dynamic_section): Implement
10720 --warn-shared-textrel.
10721
6eda8c29
ILT
10722 PR 10980
10723 * options.h (class General_options): Add --warn-multiple-gp.
10724
32dcd44e
ILT
107252010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10726
10727 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10728 $(THREADSLIB) and $(LIBDL).
10729 * Makefile.in: Rebuild.
10730
a192ba05
ILT
107312010-01-06 Ian Lance Taylor <iant@google.com>
10732
10733 PR 10980
10734 * options.cc (General_options::parse_section_start): New function.
10735 (General_options::section_start): New function.
10736 (General_options::General_options): Initialize all members.
10737 * options.h: Include <map>
10738 (class General_options): Add --section-start. Add section_starts_
10739 member.
10740 * layout.cc (Layout::attach_allocated_section_to_segment): If
10741 --section-start was used, set the address of the segment. Remove
10742 local sort_sections.
10743 (Layout::relaxation_loop_body): If the address of the load segment
10744 has been set by --section-start, don't use it.
10745 * output.h (Output_segment::update_flags_for_output_section): New
10746 function.
10747 * output.cc (Output_segment::add_output_section): Call
10748 update_flags_for_output_section.
10749
dde3f402
ILT
107502010-01-05 Ian Lance Taylor <iant@google.com>
10751
62dfdd4d
ILT
10752 PR 10980
10753 * options.h (class General_options): Add --undefined-version.
10754 * script.cc (struct Version_expression): Add was_matched_by_symbol
10755 field.
10756 (Version_script_info::matched_symbol): New function.
10757 (Version_script_info::get_symbol_version_helper): Call
10758 matched_symbol.
10759 (Version_script_info::check_unmatched_names): New function.
10760 * script.h (class Version_script_info): Update declarations.
10761 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10762
9c4ae156
ILT
10763 * options.h (class General_options): Use DEFINE_bool_alias for
10764 allow_multiple_definition.
10765 * resolve.cc (Symbol_table::should_override): Don't test
10766 allow_multiple_definition.
10767
dde3f402
ILT
10768 PR 10980
10769 * options.h (class General_options): Add --cref.
10770 * main.cc (main): Print cref table if --cref. Don't close mapfile
10771 until after printing cref table.
10772 * cref.cc: Include "symtab.h".
10773 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10774 (Cref_table_compare::operator()): New function.
10775 (Cref_inputs::gather_cref): New function.
10776 (filecol): New static const.
10777 (Cref_inputs::print_cref): New function.
10778 (Cref::print_cref): New function.
10779 * cref.h: Include <cstdio>.
10780 (class Cref): Update declarations.
10781 * mapfile.h (Mapfile::file): New function.
10782 * object.h (class Object): Define Symbols. Declare virtual
10783 do_get_global_symbols.
10784 (Object::get_global_symbols): New function.
10785 * object.cc (Input_objects::add_object): Pass object to cref_ if
10786 --cref.
10787 (Input_objects::archive_start): Likewise.
10788 (Input_objects::archive_stop): Likewise.
10789 (Input_objects::print_cref): New function.
10790 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10791 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10792 --cref.
10793 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10794 function.
10795 * plugin.h (class Sized_pluginobj): Update declarations.
10796
8781f709
ILT
107972010-01-05 Ian Lance Taylor <iant@google.com>
10798
10799 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10800 to is_default_version. Rename insdef to insdefault.
10801 (Symbol_table::add_from_relobj): Rename def to is_default_version
10802 and local to is_forced_local.
10803 (Symbol_table::add_from_pluginobj): Likewise.
10804 (Symbol_table::add_from_dynobj): Likewise.
10805 (Symbol_table::define_special_symbol): Rename insdef to
10806 insdefault.
10807
fe35d28d
ILT
108082010-01-04 Ian Lance Taylor <iant@google.com>
10809
30bc8c46
ILT
10810 PR 10980
10811 * options.h (class General_options): Add
10812 --allow-multiple-definition and -z muldefs.
10813 * resolve.cc (Symbol_table::should_override): Don't warn about a
10814 multiple symbol definition if --allow-multiple-definition or -z
10815 muldefs.
10816
7eaea549
ILT
10817 PR 10980
10818 * options.h (class General_options): Add --add-needed and
10819 --copy-dt-needed-entries. Tweak --as-needed help entry.
10820 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10821 error if --copy-dt-needed-entries aka --add-needed is used and
10822 would cause a change in behaviour.
10823
fe35d28d
ILT
10824 PR 10980
10825 * options.h (class General_options): Add -G as a short version of
10826 --shared. Add no-op options -assert, -g, and -i.
10827
55a2bb35
ST
108282010-01-04 Sriraman Tallam <tmsriram@google.com>
10829
10830 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10831 check for .text or .gnu.linkonce.t sections.
10832 * icf.cc (Icf::find_identical_sections): Ditto.
10833 Change the detection for mangled function name within the section
10834 name.
10835 * icf.h (is_section_foldable_candidate): New function.
10836
719328e1
ILT
108372009-12-30 Ian Lance Taylor <iant@google.com>
10838
10839 PR 10980
10840 * options.h (class General_options): Permit two dashes with
10841 --retain-symbols-file.
10842
d7bb5745
ILT
108432009-12-30 Ian Lance Taylor <iant@google.com>
10844
403a15dd
ILT
10845 PR 10979
10846 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10847 don't put the file header and segment headers in the text
10848 segment.
10849
eda294df
ILT
10850 PR 10979
10851 * common.cc (Sort_commons::operator()): Stabilize sort when both
10852 entries are NULL.
10853 (Symbol_table::do_allocate_commons_list): When allocating common
10854 symbols, skip a symbol which is no longer common.
10855 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10856 an object before checking its type.
10857 * testsuite/common_test_2.c: New file.
10858 * testsuite/common_test_3.c: New file.
10859 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10860 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10861 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10862 (common_test_2_pic.o, common_test_2.so): New targets.
10863 (common_test_3_pic.o, common_test_3.so): New targets.
10864 * testsuite/Makefile.in: Rebuild.
10865
d7bb5745
ILT
10866 PR 10979
10867 * script.cc (read_input_script): If we see a new SECTIONS clause,
10868 and we have added an input section, give an error.
10869 * layout.h (class Layout): Add have_added_input_section function.
10870 Add have_added_input_section_ field.
10871 * layout.cc (Layout::Layout): Initialize
10872 have_added_input_section_.
10873 (Layout::layout): Set have_added_input_section_.
10874 (Layout::layout_eh_frame): Likewise.
10875
fc59c572
ILT
108762009-12-30 Ian Lance Taylor <iant@google.com>
10877
10878 PR 10931
10879 * options.h (class General_options): Add --sort-common option.
10880 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10881 * common.cc (Sort_common): Add sort_order parameter to
10882 constructor. Add sort_order_ field.
10883 (Sort_commons::operator): Check sort_order_.
10884 (Symbol_table::allocate_commons): Determine the sort order.
10885 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10886 Change all callers.
10887 (Symbol_table::do_allocate_commons_list): Likewise.
10888
1c74fab0
ILT
108892009-12-30 Ian Lance Taylor <iant@google.com>
10890
10891 PR 10916
10892 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10893 symbols from this object, don't change the visibility of an
10894 undefined symbol.
10895 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10896
6affe781
ILT
108972009-12-30 Ian Lance Taylor <iant@google.com>
10898
10899 PR 10861
10900 * script.h (class Version_script_info): Define Language enum.
10901 Update declarations. Define Glob, Exact, and Lookup types. Add
10902 new fields globals_, locals_, and is_finalized_.
10903 * script.cc: Various formatting fixes.
10904 (class Parser_closure): Change language_stack_ from a vector of
10905 std::string to one of Version_script_info::Language. Adjust all
10906 uses accordingly.
10907 (class Lazy_demangler): Remove.
10908 (struct Version_expression): Change language from std::string to
10909 Version_script_info::Language.
10910 (Version_script_info::Version_script_info): New function.
10911 (Version_script_info::~Version_script_info): Don't call clear.
10912 (Version_script_info::finalize): New function.
10913 (Version_script_info::build_lookup_tables): New function.
10914 (Version_script_info::build_expression_list_lookup): New
10915 function.
10916 (Version_script_info::get_symbol_version_helper): Rewrite to use
10917 lookup tables.
10918 (Version_script_info::print_expression_list): Adjust to use
10919 Version_script_info::Language.
10920 (script_push_lex_into_version_mode): Check that the version script
10921 has not been finalized.
10922 (version_script_push_lang): Change language string to
10923 Version_script_info::Language.
10924 * options.cc (Command_line::version_script): New function.
10925 * options.h (class General_options): Add finalize_dynamic_list
10926 function. Change version_script from declaration to definition.
10927 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10928 * testsuite/version_script.map: Remove duplicate def of foo.
10929 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10930 version_script.map.
10931 * testsuite/Makefile.in: Rebuild.
10932
818bf354
ILT
109332009-12-30 Ian Lance Taylor <iant@google.com>
10934
10935 PR 10843
10936 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10937 if the input symbol index is 0, make the output symbol index 0.
10938
ebcc8304
ILT
109392009-12-30 Ian Lance Taylor <iant@google.com>
10940
10941 PR 10670
10942 * options.h (class General_options): Add -x/--discard-all.
10943 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10944 --discard-all. If the local symbol needs a dynamic entry, check
10945 that before handling --discard-locals.
10946
176fe33f
ILT
109472009-12-30 Ian Lance Taylor <iant@google.com>
10948
bb321bb1
ILT
10949 PR 10450
10950 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10951 flags to PF_R.
10952 (Output_segment::add_output_section): Don't change the flags if
10953 the type is PT_TLS.
10954
176fe33f
ILT
10955 PR 10450
10956 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10957 GNU hash table if they need a dynamic value. Otherwise, don't add
10958 them if they are defined in a dynamic object or are forced local.
10959
e8cd95c7
ILT
109602009-12-29 Ian Lance Taylor <iant@google.com>
10961
1b81fb71
ILT
10962 PR 10450
10963 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10964 .gnu.hash table for a 32-bit target.
10965
8d6d383d
ILT
10966 PR 10450
10967 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10968 regular and a dynamic object only needs a dynamic symbol table
10969 entry if it is externally visible.
10970
e785ec03
ILT
10971 PR 10450
10972 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10973 constructor. Add global_offset_table_ field.
10974 (Target_i386::got_section): Set global_offset_table_.
10975 (Target_i386::do_finalize_sections): Set global_offset_table_
10976 size.
10977 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10978 in constructor. Add global_offset_table_ field.
10979 (Target_x86_64::got_section): Set global_offset_table_.
10980 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10981 size.
10982
1a2dff53
ILT
10983 * layout.cc (Layout::Layout): Initialize increase_relro_.
10984 (Layout::get_output_section): Add is_relro, is_last_relro, and
10985 is_first_non_relro parameters. Change all callers.
10986 (Layout::choose_output_section): Likewise.
10987 (Layout::add_output_section_data): Likewise.
10988 (Layout::make_output_section): Likewise.
10989 (Layout::set_segment_offsets): Clear increase_relro when using a
10990 linker script.
10991 * layout.h (class Layout): Add increase_relro method. Add
10992 increase_relro_ field. Update declarations.
10993 * output.cc (Output_section::Output_section): Initialize
10994 is_last_relro_ and is_first_non_relro_.
10995 (Output_segment::add_output_section): Group relro sections is
10996 do_sort is true. Handle is_last_relro and is_first_non_relro.
10997 (Output_segment::maximum_alignment): Remove relro handling.
10998 (Output_segment::set_section_addresses): Add increase_relro
10999 parameter. Change all callers. Add initial alignment to align
11000 relro sections on separate page. Remove old relro handling.
11001 (Output_segment::set_section_list_addresses): Remove in_relro
11002 parameter. Change all callers.
11003 (Output_segment::set_offset): Add increase parameter. Change all
11004 callers. Remove old relro handling.
11005 * output.h (class Output_section): Add new methods: is_last_relro,
11006 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11007 Add is_last_relro_ and is_first_non_relro_ fields.
11008 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11009 Create separate .got.plt section. Call increase_relro.
11010 * x86_64.cc (Target_x86_64::got_section): Likewise.
11011 * testsuite/relro_script_test.t: Add .got.plt.
11012
f0ba79e2
ILT
11013 PR 10450
11014 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11015 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11016 (Layout::finalize): Call set_dynamic_symbol_size.
11017 (Layout::set_dynamic_symbol_size): New function.
11018 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11019 set_dynamic_symbol_size.
11020
e8cd95c7
ILT
11021 PR 10450
11022 * output.h (class Output_section): Add is_entsize_zero_ field.
11023 * output.cc (Output_section::Output_section): Initialize
11024 is_entsize_zero_.
11025 (Output_section::set_entsize): If two different entsizes are
11026 requested, force it to zero.
11027 (Output_section::add_input_section): Set flags for .debug_str
11028 before updating section flags. Set entsize.
11029 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11030 and SHF_STRING if all input sections have those flags.
11031
3e1b9a8a
RÁE
110322009-12-29 Rafael Espindola <espindola@google.com>
11033
11034 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
11035 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11036 reporting.
3e1b9a8a 11037
3dcad376
ST
110382009-12-29 Sriraman Tallam <tmsriram@google.com>
11039
11040 * options.cc (General_options::parse_version): Allow -v to exit
11041 without an error if there is nothing to link.
11042
084e2665
ILT
110432009-12-29 Ian Lance Taylor <iant@google.com>
11044
11045 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
11046 using a version of gcc before 4.1.
11047 * configure: Rebuild.
11048
250acde3
CD
110492009-12-28 Chris Demetriou <cgd@google.com>
11050
11051 * attributes.cc (Output_attributes_section_data::do_write): Use
11052 std::vector::front rather than std::vector::data.
11053
99fff23b
ILT
110542009-12-28 Ian Lance Taylor <iant@google.com>
11055
11056 * symtab.h (class Symbol_table): Add enum Defined.
11057 * resolve.cc (Symbol_table::should_override): Add defined
11058 parameter. Change all callers. Test whether object is NULL
11059 before calling a method on it.
11060 (Symbol_table::report_resolve_problem): Add defined parameter.
11061 Change all callers.
11062 (Symbol_table::should_override_with_special): Likewise.
11063 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11064 parameter. Change all callers.
11065 (Symbol_table::do_define_in_output_data): Likewise.
11066 (Symbol_table::define_in_output_segment): Likewise.
11067 (Symbol_table::do_define_in_output_segment): Likewise.
11068 (Symbol_table::define_as_constant): Likewise.
11069 (Symbol_table::do_define_as_constant): Likewise.
11070 * script.h (class Symbol_assignment): Add is_defsym parameter to
11071 constructor; change all callers.
11072 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11073 parameter. Change all callers. Add is_defsym_ field.
11074 (class Parser_closure): Add parsing_defsym parameter to
11075 constructor; change all callers. Add parsing_defsym accessor
11076 function. Add parsing_defsym_ field.
11077
556bd683
ILT
110782009-12-28 Ian Lance Taylor <iant@google.com>
11079
11080 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 11081 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 11082
1782c879
ILT
110832009-12-23 Ian Lance Taylor <iant@google.com>
11084
11085 * i386.cc (Target_i386::do_calls_non_split): Recognize
11086 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
11087 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
11088 -fsplit-stack prologue when using %r11.
1782c879 11089
329ca2b1
ST
110902009-12-21 Sriraman Tallam <tmsriram@google.com>
11091
11092 * options.cc (General_options::parse_version): Make -v continue and do
11093 the link like GNU ld does.
11094
d675ff46
RÁE
110952009-12-17 Rafael Avila de Espindola <espindola@google.com>
11096
11097 * Makefile.am (CCFILES): Add timer.cc.
11098 (HFILES): Add timer.h.
11099 * configure.ac: Check for sysconf and times.
11100 * main.cc: include timer.h.
11101 (main): Use Timer instead of get_run_time.
11102 * timer.cc: New.
11103 * timer.h: New.
11104 * workqueue.cc: include timer.h.
11105 (Workqueue::find_and_run_task):
11106 Report user, sys and wall time.
11107 * Makefile.in: Regenerate.
11108 * config.in: Regenerate.
11109 * configure: Regenerate.
11110
d6344fb5
DK
111112009-12-16 Doug Kwan <dougkwan@google.com>
11112
11113 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
11114 sections.
11115 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11116 relaxed input sections.
11117 * output.cc (Output_section::find_relaxed_input_section): Change
11118 return type to Output_relaxed_input_section pointer. Adjust code
11119 for new type of relaxed_input_section_map_.
11120 * output.h (Output_section::find_relaxed_input_section): Change
11121 return type to Output_relaxed_input_section pointer.
11122 (Output_section::Output_relaxed_input_section_by_input_section_map):
11123 New type.
11124 (Output_section::relaxed_input_section_map_): Change type to
11125 Output_section::Output_relaxed_input_section_by_input_section_map.
11126 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11127 input section.
11128
0e0d5469
ILT
111292009-12-15 Ian Lance Taylor <iant@google.com>
11130
11131 * layout.cc (Layout::create_shstrtab): Only write out after input
11132 sections if we are compressing debug sections.
11133
0649a889
ILT
111342009-12-15 Ian Lance Taylor <iant@google.com>
11135
11136 * archive.cc (Archive::add_symbols): Only look up a symbol without
11137 a version if there is, in fact, a version.
11138
2ea97941
ILT
111392009-12-14 Ian Lance Taylor <iant@google.com>
11140
11141 Revert -Wshadow changes, all changes from:
11142 2009-12-11 Doug Kwan <dougkwan@google.com>
11143 2009-12-11 Nick Clifton <nickc@redhat.com>
11144 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11145
b0eec2cc
DK
111462009-12-11 Doug Kwan <dougkwan@google.com>
11147
11148 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11149 due to -Wshadow.
11150 * attributes.cc (Object_attribute::size): Ditto.
11151 (Attributes_section_data::size): Ditto.
11152 (Attributes_section_data::Attributes_section_data): Ditto.
11153 (Output_attributes_section_data::do_write): Ditto.
11154 * attributes.h (Object_attribute::set_type): Ditto.
11155 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11156
91d6fa6a
NC
111572009-12-11 Nick Clifton <nickc@redhat.com>
11158
11159 * archive.cc: Fix shadowed variable warnings.
11160 * arm.cc: Likewise.
11161 * compressed_output.cc: Likewise.
11162 * compressed_output.h: Likewise.
11163 * configure: Likewise.
11164 * dwarf_reader.cc: Likewise.
11165 * dynobj.cc: Likewise.
11166 * dynobj.h: Likewise.
11167 * ehframe.cc: Likewise.
11168 * ehframe.h: Likewise.
11169 * errors.cc: Likewise.
11170 * expression.cc: Likewise.
11171 * fileread.cc: Likewise.
11172 * fileread.h: Likewise.
11173 * freebsd.h: Likewise.
11174 * i386.cc: Likewise.
11175 * icf.cc: Likewise.
11176 * incremental.h: Likewise.
11177 * layout.cc: Likewise.
11178 * layout.h: Likewise.
11179 * mapfile.cc: Likewise.
11180 * merge.cc: Likewise.
11181 * merge.h: Likewise.
11182 * object.cc: Likewise.
11183 * object.h: Likewise.
11184 * options.h: Likewise.
11185 * output.cc: Likewise.
11186 * output.h: Likewise.
11187 * parameters.cc: Likewise.
11188 * plugin.cc: Likewise.
11189 * powerpc.cc: Likewise.
11190 * reduced_debug_output.cc: Likewise.
11191 * reduced_debug_output.h: Likewise.
11192 * reloc.cc: Likewise.
11193 * reloc.h: Likewise.
11194 * resolve.cc: Likewise.
11195 * script-sections.cc: Likewise.
11196 * script.cc: Likewise.
11197 * script.h: Likewise.
11198 * sparc.cc: Likewise.
11199 * symtab.cc: Likewise.
11200 * symtab.h: Likewise.
11201 * target-select.cc: Likewise.
11202 * target-select.h: Likewise.
11203 * token.h: Likewise.
11204 * workqueue.cc: Likewise.
11205 * workqueue.h: Likewise.
11206 * x86_64.cc: Likewise.
11207
a0351a69
DK
112082009-12-10 Doug Kwan <dougkwan@google.com>
11209
11210 * arm.cc (attributes.h): New include.
11211 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11212 (Arm_relobj::~Arm_relobj): Delete object pointed by
11213 attributes_section_data_.
11214 (Arm_relobj::attributes_section_data): New method definition.
11215 (Arm_relobj::attributes_section_data_): New data member declaration.
11216 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11217 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11218 attributes_section_data_.
11219 (Arm_dynobj::attributes_section_data): New method definition.
11220 (Arm_dynobj::attributes_section_data_): New data member declaration.
11221 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11222 initialization value of may_use_blx_ to false.
2e702c99 11223 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
11224 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11225 object attributes to compute results instead of hard-coding.
11226 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11227 Target_arm::get_secondary_compatible_arch,
11228 Target_arm::set_secondary_compatible_arch
11229 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11230 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11231 New method declarations.
11232 (Target_arm::get_aeabi_object_attribute): New method definition.
11233 (Target_arm::attributes_section_data_): New data member declaration.
11234 (read_arm_attributes_section): New template definition.
11235 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11236 (Arm_dynobj::do_read_symbols): Ditto.
11237 (Target_arm::do_finalize_sections): Merge attributes sections from
11238 input. Check for BLX use after attributes section merging.
11239 Fix __exidx_start and __exidx_end visibility. Create an
11240 .ARM.attributes section if necessary.
11241 (Target_arm::get_secondary_compatible_arch,
11242 Target_arm::set_secondary_compatible_arch,
11243 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11244 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 11245 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
11246 New method definitions.
11247
b59befec
ILT
112482009-12-09 Ian Lance Taylor <iant@google.com>
11249
11250 * plugin.cc (Plugin::load): Don't cast from void* to a function
11251 pointer.
11252
1276bc89
ILT
112532009-12-09 Ian Lance Taylor <iant@google.com>
11254
11255 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11256 information fields.
11257
2f2de248
L
112582009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11259
11260 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11261 Replace two_file_shared_1.so with two_file_shared_2.so.
11262 * testsuite/Makefile.in: Regenerated.
11263
4f787271
DK
112642009-12-08 Doug Kwan <dougkwan@google.com>
11265
11266 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11267 (HFILES): Add attributes.h and int_encoding.h.
11268 * Makefile.in: Regenerate.
11269 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11270 function definitions to int_encoding.cc
11271 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11272 prototypes to int_encoding.h
11273 * reduced_debug_output.cc (int_encoding.h): New include.
11274 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11275 function definitions to int_encoding.cc
11276 (insert_into_vector, read_from_pointer): Move template definitions to
11277 int_encoding.h
11278 * attributes.cc: New file.
11279 * attributes.h: New file.
11280 * int_encoding.cc: New file.
11281 * int_encoding.h: New file.
11282
20b52f1a
RÁE
112832009-12-07 Rafael Avila de Espindola <espindola@google.com>
11284
11285 PR gold/11055
11286 * incremental-dump.cc (dump_incremental_inputs): New.
11287 (main): Use dump_incremental_inputs.
11288
53d7974c
L
112892009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11290
11291 PR gold/10893
11292 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11293 checking elfcpp::STT_FUNC.
11294 (Target_i386::Relocate::relocate): Likewise.
11295 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11296
11297 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11298 symbols from shared libraries into normal FUNC symbols.
11299
11300 * symtab.h (Symbol): Add is_func and use it.
11301
05a352e6
DK
113022009-12-05 Doug Kwan <dougkwan@google.com>
11303
11304 * arm.cc (Target_arm::arm_info): Initialize new fields
11305 attributes_section and attributes_vendor.
11306 * i386.cc (Target_i386::i386_info): Same.
11307 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11308 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11309 fields attributes_section and attributes_vendor.
53d7974c 11310 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11311 * target.h (Target::attributes_section, Target::attributes_vendor,
11312 Target::is_attributes_section, Target::attribute_arg_type,
11313 Target::attributes_order): New method definitions.
11314 (Target::Target_info::attributes_section,
11315 Target::Target_info::attributes_vendor): New fields.
11316 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11317 virtual method definitions.
11318 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11319 attributes_section and attributes_vendor.
11320 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11321
f4e5969c
DK
113222009-12-05 Doug Kwan <dougkwan@google.com>
11323
11324 * arm.cc: Update comments about interworking and stub generation.
11325 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11326 considered as non-PIC.
11327 (Arm_relocate_functions::base_abs): Fix formatting.
11328 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11329 of function to use GOT entry address instead of offset.
11330 (Target_arm::Scan::global): Issue an error if a symbol would need a
11331 PLT does not get one because it is untyped. Remove code to create
11332 dynamic symbols for relative branches.
11333 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11334 takes unsigned integer instead of boolean.
11335
1abce4a6
L
113362009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11337
11338 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11339 (two_file_test_LDADD): Likewise.
11340 (common_test_1_LDADD): Likewise.
11341 (exception_test_LDADD) Likewise.
11342 (weak_test_LDADD): Likewise.
11343 (many_sections_test_LDADD): Likewise.
11344 (initpri1_LDADD): Likewise.
11345 (script_test_1_LDADD): Likewise.
11346 (script_test_2_LDADD): Likewise.
11347 (justsyms_LDADD): Likewise.
11348 (binary_test_LDADD): Likewise.
11349 (large_LDADD): Likewise.
11350 * testsuite/Makefile.in: Regenerated.
11351
adcf2816 113522009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11353
adcf2816
L
11354 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11355 (Symbol_table::override_with_special): Likewise.
11356 (Symbol_table::add_from_object): Likewise.
11357
28e67f5d
RÁE
113582009-12-04 Rafael Avila de Espindola <espindola@google.com>
11359
11360 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11361 Don't set the data_offset twice.
11362
ae10a101
RÁE
113632009-12-04 Rafael Avila de Espindola <espindola@google.com>
11364
11365 * testsuite/Makefile.in: Regenerate.
11366
f59f41f3
DK
113672009-12-03 Doug Kwan <dougkwan@google.com>
11368
11369 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11370 (Target_arm::do_finalize_sections): Add parameter for symbol table
11371 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11372 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11373 parameter for symbol table pointer.
11374 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11375 an additional parameter for a pointer to symbol table.
11376 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11377 parameter for a symbol table pointer.
11378 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11379 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11380 Ditto.
11381 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11382 parameter for a symbol table pointer.
11383
ca55d848
RÁE
113842009-12-03 Rafael Avila de Espindola <espindola@google.com>
11385
11386 * incremental.cc (Incremental_inputs_header)
11387 (Incremental_inputs_header_write, Incremental_inputs_entry)
11388 (Incremental_inputs_entry_write): Move ...
11389 * incremental.h (Incremental_inputs_header)
11390 (Incremental_inputs_header_write, Incremental_inputs_entry)
11391 (Incremental_inputs_entry_write): here.
11392
3aec4f9c
RÁE
113932009-12-02 Rafael Avila de Espindola <espindola@google.com>
11394
11395 * incremental.cc (make_sized_incremental_binary): Set the target.
11396 Error if it is incompatible.
11397 * output.h (Output_file): Add filename method.
11398
9c0ae74d
RÁE
113992009-12-02 Rafael Avila de Espindola <espindola@google.com>
11400
11401 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11402 from the get_* methods.
11403
a45500ae
RÁE
114042009-12-02 Rafael Avila de Espindola <espindola@google.com>
11405
11406 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11407 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11408 Write 0 for the data_offset of scripts.
11409
325e6408
RÁE
114102009-12-02 Rafael Avila de Espindola <espindola@google.com>
11411
11412 * testsuite/Makefile.am: Add the incremental_test.sh test.
11413 * testsuite/incremental_test.sh: New.
11414 * testsuite/incremental_test_1.c: New.
11415 * testsuite/incremental_test_2.c: New.
11416
954c3e2e
RÁE
114172009-12-01 Rafael Avila de Espindola <espindola@google.com>
11418
703d02da 11419 * incremental-dump.cc (main): Fix typos.
954c3e2e 11420
f8086623
RÁE
114212009-11-27 Rafael Avila de Espindola <espindola@google.com>
11422
11423 PR gold/11025
11424 * incremental-dump.cc (main): Use llu to print 64 bit values.
11425
3b0dd6ac
L
114262009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11427 H.J. Lu <hongjiu.lu@intel.com>
11428
11429 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11430 $(LIBDL).
11431 (incremental_dump_LDADD): Likewise.
11432 * Makefile.in: Regenerated.
11433
a6d1ef57 114342009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11435
a6d1ef57
DK
11436 Revert:
11437
11438 2009-11-25 Doug Kwan <dougkwan@google.com>
11439
11440 * arm.cc (Target_arm::Target_arm): Move method definition
11441 outside of class definition. Add code to handle
11442 --target1-rel, --target1-abs and --target2= options.
11443 (Target_arm::get_reloc_reloc_type): Change method to be
11444 non-static and const.
11445 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11446 New data member declaration.
11447 (Target_arm::Scan::local, Target_arm::Scan::global,
11448 Target_arm::Relocate::relocate,
11449 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11450 Adjust call to Target_arm::get_real_reloc_type.
11451 (Target_arm::get_real_reloc_type): Use command line options
11452 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11453 * options.h (--target1-rel, --target1-abs, --target2): New
11454 ARM-only options.
11455
50aeb7d4
DK
114562009-11-25 Doug Kwan <dougkwan@google.com>
11457
11458 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11459 class definition. Add code to handle --target1-rel, --target1-abs
11460 and --target2= options.
11461 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11462 and const.
11463 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11464 member declaration.
11465 (Target_arm::Scan::local, Target_arm::Scan::global,
11466 Target_arm::Relocate::relocate,
11467 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11468 call to Target_arm::get_real_reloc_type.
11469 (Target_arm::get_real_reloc_type): Use command line options to
11470 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11471 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11472 options.
11473
51938283
DK
114742009-11-25 Doug Kwan <dougkwan@google.com>
11475
11476 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11477 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11478 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11479 formatting.
11480 (Arm_relocate_functions::thm_call): Replace body with a call to
11481 Arm_relocate_functions::thumb_branch_common.
11482 (Arm_relocate_functions::thm_jump24,
11483 Arm_relocate_functions::thm_xpc22): New method definitions.
11484 (Arm_relocate_functions::thumb_branch_common): New method definition.
11485 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11486 operator.
11487 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11488 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11489
e2b8f3c4
RÁE
114902009-11-24 Rafael Avila de Espindola <espindola@google.com>
11491
11492 * Makefile.am: Build incremental-dump
11493 * Makefile.in: Regenerate.
11494 * incremental-dump.cc: New.
11495 * incremental.cc (Incremental_inputs_header_data,
11496 Incremental_inputs_entry_data): Move to incremental.h
11497 * incremental.h: (Incremental_inputs_header_data,
11498 Incremental_inputs_entry_data): Move from incremental.cc
11499
bcba9aec
RÁE
115002009-11-24 Rafael Avila de Espindola <espindola@google.com>
11501
11502 * incremental.cc (Incremental_inputs_header,
11503 Incremental_inputs_header_write, Incremental_inputs_entry,
11504 Incremental_inputs_entry_write): Add a typedef with the data type.
11505
7c3afe08
RÁE
115062009-11-24 Rafael Avila de Espindola <espindola@google.com>
11507
11508 * incremental.cc (Incremental_inputs_header,
11509 Incremental_inputs_header_write, Incremental_inputs_entry,
11510 Incremental_inputs_entry_write): Update comment about which
11511 type has the filed descriptions.
11512
d204b6e9
DK
115132009-11-15 Doug Kwan <dougkwan@google.com>
11514
11515 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11516 (Arm_relocate_functions::arm_branch_common): Change method defintion
11517 in class definition to a method declaration and update list of formal
11518 parameters.
11519 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11520 Arm_relocation_functions::jump24): Adjust call to
11521 Arm_relocate_functions::arm_branch_common. Update list of formal
11522 parameters.
11523 (Arm_relocate_functions::xpc25): New method definition.
11524 (Arm_relocate_functions::arm_branch_common): Move method defintion
11525 out from class definition. Use stubs for mode-switching and extending
11526 branch ranges.
11527 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11528 specially. Change code to enable use of stubs in ARM branches.
11529
43d12afe
DK
115302009-11-10 Doug Kwan <dougkwan@google.com>
11531
11532 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11533 in method declaration.
11534 (Target_arm::relocate_stub): New method declaration.
11535 (Target_arm::default_target): Change to return a pointer instead of
11536 a const reference.
11537 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11538 Target_arm::default_target.
11539 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11540 method definition.
11541 (Target_arm::relocate_section): Adjust view.
11542 (Target_arm::relocate_stub): New method definition.
11543
ac33a407
DK
115442009-11-10 Doug Kwan <dougkwan@google.com>
11545
11546 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11547 a format warning.
11548 * incremental.cc (open_incremental_binary): Initialized local
11549 variables to avoid warnings.
11550 * object.cc (make_elf_object): Ditto.
11551 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11552 a format warning.
e1df38aa 11553
88ee28e9
L
11554009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11555
11556 PR gold/10930
11557 * testsuite/plugin_test.c: Include "config.h".
11558
2daedcd6
DK
115592009-11-09 Doug Kwan <dougkwan@google.com>
11560
11561 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11562 (arm_symbol_value): Remove.
11563 (Arm_relocate_functions::arm_branch_common,
11564 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11565 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11566 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11567 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11568 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11569 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11570 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11571 Arm_relocate_functions::thm_mobw_abs_nc,
11572 Arm_relocate_functions::thm_mov_abs,
11573 Arm_relocate_functions::movw_prel_nc,
11574 Arm_relocate_functions::thm_movt_abs,
11575 Arm_relocate_functions::movt_prel,
11576 Arm_relocate_functions::thm_movw_prel_nc,
11577 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11578 (Target_arm::Relocate::relocate): Only decompose address into two
11579 parts if relocation type uses the thumb-bit and pass the actual
11580 bit instead of a flag indicating that the thumb-bit is used. Adjust
11581 calls to methods in Arm_relocate_functions for this change.
11582
1276bc89 115832009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
11584
11585 PR 10925
11586 * reloc.cc: Instantiate
11587 Sized_relobj::initialize_input_to_output_maps and
11588 Sized_relobj:free_input_to_output_maps.
11589
e53ad1b5
ILT
115902009-11-06 Ian Lance Taylor <iant@google.com>
11591
11592 PR 10876
11593 * defstd.cc (in_segment): Set only_if_ref true for "end".
11594
eb44217c
DK
115952009-11-06 Doug Kwan <dougkwan@google.com>
11596
11597 * arm.cc (class Reloc_stub): Correct a comment.
11598 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11599 (Target_arm::scan_section_for_stubs): New method declaration.
11600 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11601 Change methods from private to protected.
11602 (Target_arm::do_may_relax): New method definition.
11603 (Target_arm::do_relax, Target_arm::group_sections,
11604 Target_arm::scan_reloc_for_stub,
11605 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11606 (Target_arm::arm_input_section_map_): New data member declaration.
11607 (Target_arm::scan_reloc_for_stub,
11608 Target_arm::scan_reloc_section_for_stubs,
11609 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11610 Target_arm::do_relax): New method definitions.
11611
5d329b7d
ILT
116122009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11613
11614 * configure.ac: Check for (struct stat)::st_mtim
11615 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11616 * config.in: Regenerate.
11617 * configure: Regenerate.
11618
96a0d71b
ILT
116192009-11-05 Ian Lance Taylor <iant@google.com>
11620
11621 PR 10910
11622 * output.cc (Output_segment::add_output_section): Add missing
11623 return statement.
11624
594c8e5e
ILT
116252009-11-04 Ian Lance Taylor <iant@google.com>
11626
11627 PR 10880
11628 * object.h (class Object): Add is_needed and set_is_needed
11629 methods. Add is_needed_ field. Make bool fields into bitfields.
11630 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11631 defined in a dynamic object and referenced by a regular object,
11632 set is_needed for the dynamic object.
11633 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11634 if the file is marked with as_needed and it is not needed.
11635
22b127cc
ILT
116362009-11-04 Ian Lance Taylor <iant@google.com>
11637
11638 PR 10887
11639 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11640 tags if data is discarded by linker script.
11641 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11642 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11643 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11644 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11645
f5c870d2
ILT
116462009-11-04 Ian Lance Taylor <iant@google.com>
11647
11648 * layout.cc (Layout::get_output_section): Add is_interp and
11649 is_dynamic_linker_section parameters. Change all callers.
11650 (Layout::choose_output_section): Likewise.
11651 (Layout::make_output_section): Likewise.
11652 (Layout::add_output_section_data): Add is_dynamic_linker_section
11653 parameter. Change all callers.
11654 * layout.h (class Layout): Update declarations.
11655 * output.h (class Output_section): Add is_interp, set_is_interp,
11656 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11657 Add is_interp_, is_dynamic_linker_section_ fields. Change
11658 generate_code_fills_at_write_ to a bitfield.
11659 * output.cc (Output_section::Output_sections): Initialize new
11660 fields.
11661 (Output_segment::add_output_section): Add do_sort parameter.
11662 Change all callers.
11663
1ae4d23b
ILT
116642009-11-03 Ian Lance Taylor <iant@google.com>
11665
11666 PR 10860
11667 * options.h (class General_options): Add --warn-common.
11668 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11669 merging two common symbols.
11670 (Symbol_table::should_override): Handle --warn-common when merging
11671 a common symbol with a defined symbol. Use report_resolve_problem
11672 for multiple definitions.
11673 (Symbol_table::report_resolve_problem): New function.
11674 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11675
55da9579
DK
116762009-11-03 Doug Kwan <dougkwan@google.com>
11677
11678 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11679 stub_factory_.
11680 (Target_arm::stub_factory): New method definition.
11681 (Target_arm::new_arm_input_section,
11682 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11683 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 11684 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
11685 New type definitions.
11686 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11687 member declarations.
11688 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11689 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11690 New method definitions.
11691
37a9ac43
ILT
116922009-11-03 Ian Lance Taylor <iant@google.com>
11693
11694 * options.h (class General_options): Add --warn_constructors.
11695
b3d6a3d4
ILT
116962009-11-03 Ian Lance Taylor <iant@google.com>
11697
11698 PR 10893
11699 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11700 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11701
934b01dd
ILT
117022009-11-03 Ian Lance Taylor <iant@google.com>
11703
11704 PR 10895
11705 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11706 --msgid-bugs-address.
11707 (install-pdf): New target.
11708 (install-data_yes): Look up one directory to find mkinstalldirs.
11709
03c1939b
L
117102009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11711
11712 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11713 tree.
11714
ebd95253
DK
117152009-10-30 Doug Kwan <dougkwan@google.com>
11716
11717 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11718
e9bbb538
DK
117192009-10-30 Doug Kwan <dougkwan@google.com>
11720
11721 * arm.cc (Stub_addend_reader): New struct template definition
11722 and partial specializations.
11723 (Stub_addend_reader::operator()): New method definition for a
11724 partially specialized template.
11725
d5b40221
DK
117262009-10-30 Doug Kwan <dougkwan@google.com>
11727
11728 * arm.cc (Arm_relobj::processor_specific_flags): New method
11729 definition.
11730 (Arm_relobj::do_read_symbols): New method declaration.
11731 (Arm_relobj::processor_specific_flags_): New data member declaration.
11732 (Arm_dynobj): New class definition.
11733 (Target_arm::do_finalize_sections): Add input_objects parameter.
11734 (Target_arm::do_adjust_elf_header): New method declaration.
11735 (Target_arm::are_eabi_versions_compatible,
11736 (Target_arm::merge_processor_specific_flags): New method declaration.
11737 (Target_arm::do_make_elf_object): New overloaded method definitions
11738 and declaration.
11739 (Arm_relobj::do_read_symbols): New method definition.
11740 (Arm_dynobj::do_read_symbols): Ditto.
11741 (Target_arm::do_finalize_sections): Add input_objects parameters.
11742 Merge processor-specific flags from all input objects.
11743 (Target_arm::are_eabi_versions_compatible,
11744 Target_arm::merge_processor_specific_flags,
11745 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11746 New method definitions.
11747 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11748 Input_objects pointer type parameter.
11749 * layout.cc (Layout::finalize): Pass input objects to target's.
11750 finalize_sections function.
11751 * output.cc (Output_file_header::do_sized_write): Set ELF file
11752 header's processor-specific flags.
11753 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11754 Input_objects pointer type parameter.
11755 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11756 * target.h (Input_objects): New forward class declaration.
11757 (Target::processor_specific_flags,
11758 Target::are_processor_specific_flags_sect): New method definitions.
11759 (Target::finalize_sections): Add input_objects parameter.
11760 (Target::Target): Initialize processor_specific_flags_ and
11761 are_processor_specific_flags_set_.
11762 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11763 parameter.
11764 (Target::set_processor_specific_flags): New method definition.
11765 (Target::processor_specific_flags_,
11766 Target::are_processor_specific_flags_set_): New data member
11767 declarations.
11768 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11769 Input_objects pointer type parameter.
11770
ebabffbd
DK
117712009-10-30 Doug Kwan <dougkwan@google.com>
11772
11773 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11774
ad0f2072
ILT
117752009-10-28 Ian Lance Taylor <iant@google.com>
11776
11777 * object.h (class Relobj): Drop options parameter from
11778 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11779 do_scan_relocs, do_relocate. Change all callers.
11780 (class Sized_relobj): Drop options parameters from
11781 do_gc_process_relocs, do_scan_relocs, do_relocate,
11782 do_relocate_sections, relocate_sections, emit_relocs_scan,
11783 emit_relocs_scan_reltype. Change all callers.
11784 (struct Relocate_info): Remove options field and all references to
11785 it.
11786 * reloc.h (class Read_relocs): Remove options constructor
11787 parameter and options_ field. Change all callers.
11788 (class Gc_process_relocs, class Scan_relocs): Likewise.
11789 (class Relocate_task): Likewise.
11790 * target-reloc.h (scan_relocs): Remove options parameter. Change
11791 all callers.
11792 (scan_relocatable_relocs): Likewise.
11793 * target.h (class Sized_target): Remove options parameter from
11794 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11795 all callers.
11796 * gc.h (gc_process_relocs): Remove options parameter. Change all
11797 callers.
11798 * arm.cc: Update functions to remove options parameters.
11799 * i386.cc: Likewise.
11800 * powerpc.cc: Likewise.
11801 * sparc.cc: Likewise.
11802 * x86_64.cc: Likewise.
11803 * testsuite/testfile.cc: Likewise.
11804
8ffa3667
DK
118052009-10-28 Doug Kwan <dougkwan@google.com>
11806
11807 * arm.cc (Arm_relobj): New class definition.
e1df38aa 11808 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
11809 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11810 New method definitions.
11811
40f36857
CC
118122009-10-28 Cary Coutant <ccoutant@google.com>
11813
11814 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11815 (Plugin::cleanup_done_): New member.
11816 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11817 (Plugin_manager::cleanup_done_): Remove.
11818 (Plugin_manager::add_input_file): Edit error message.
11819 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11820 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11821
2c849493
ILT
118222009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11823
11824 * fileread.cc: (File_read::View::~View): Use the new
11825 data_ownership_ filed.
11826 (File_read::~File_read): Dispose the new whole_file_view_.
11827 (File_read::open): Mmap the whole file if needed.
11828 (File_read::open): Use whole_file_view_ instead of contents_.
11829 (File_read::find_view): Use whole_file_view_ if applicable.
11830 (File_read::do_read): Use whole_file_view_ instead of contents_.
11831 (File_read::make_view): Use whole_file_view_ instead of contents_,
11832 update File_read::View::View call.
11833 (File_read::find_or_make_view): Update File_read::View::View
11834 call.
11835 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11836 remove contents_
11837 (File_read::View::Data_ownership): New enum.
11838 (File_read::View::View): Replace bool mapped_ with Data_ownership
11839 argument.
11840 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11841 (File_read::View::data_ownership_): New field.
11842 (File_read::contents_): Remove (replaced by whole_file_view_).
11843 (File_read::whole_file_view_): New field.
11844 * options.h (class General_options): Add --keep-files-mapped.
11845
24998053
CC
118462009-10-27 Cary Coutant <ccoutant@google.com>
11847
11848 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11849 * testsuite/Makefile.am (plugin_test_5): New test case.
11850 * testsuite/Makefile.in: Regenerate.
11851
72adc4fa
DK
118522009-10-25 Doug Kwan <dougkwan@google.com>
11853
11854 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11855 from private to protected to allow access by child class.
11856 (Sized_relobj::do_relocate_sections): New method declaration.
11857 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 11858 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
11859 Sized_relobj::relocate_sections. Instantiate template explicitly
11860 for different target sizes and endianity.
11861
07f508a2
DK
118622009-10-24 Doug Kwan <dougkwan@google.com>
11863
11864 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11865 (Arm_input_section::as_arm_input_section): New method.
11866 (Arm_output_section): New class definition.
11867 (Arm_output_section::create_stub_group,
11868 Arm_output_section::group_sections): New method definitions.
11869
10ad9fe5
DK
118702009-10-22 Doug Kwan <dougkwan@google.com>
11871
11872 * arm.cc (Arm_input_section): New class definition.
11873 (Arm_input_section::init, Arm_input_section:do_write,
11874 Arm_input_section::set_final_data_size,
11875 Arm_input_section::do_reset_address_and_file_offset): New method
11876 definitions.
11877
56ee5e00
DK
118782009-10-21 Doug Kwan <dougkwan@google.com>
11879
11880 * arm.cc (Stub_table, Arm_input_section): New forward class
11881 declarations.
11882 (Stub_table): New class defintion.
11883 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11884 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11885 New method definition.
11886
b569affa
DK
118872009-10-21 Doug Kwan <dougkwan@google.com>
11888
11889 * arm.cc: Update copyright comments.
11890 (Target_arm): New forward class template declaration.
11891 (Arm_address): New type.
11892 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11893 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11894 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11895 constants.
11896 (Insn_template): Same.
11897 (DEF_STUBS): New macro.
11898 (Stub_type): New enum type.
11899 (Stub_template): New class definition.
11900 (Stub): Same.
11901 (Reloc_stub): Same.
11902 (Stub_factory): Same.
11903 (Target_arm::Target_arm): Initialize may_use_blx_ and
11904 should_force_pic_veneer_.
11905 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11906 Target_arm::should_force_pic_veneer,
11907 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11908 Target_arm::using_thumb_only, Target_arm:;default_target): New
11909 method defintions.
11910 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11911 New data member declarations.
11912 (Insn_template::size, Insn_template::alignment): New method defintions.
11913 (Stub_template::Stub_template): New method definition.
11914 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11915 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11916 (Stub_factory::Stub_factory): New method definition.
11917 * gold.h (string_hash): New template.
11918 * output.h (Input_section_specifier::hash_value): Use
11919 gold::string_hash.
11920 (Input_section_specifier::string_hash): Remove.
11921 * stringpool.cc (Stringpool_template::string_hash): Use
11922 gold::string_hash.
11923
6c172549
DK
119242009-10-20 Doug Kwan <dougkwan@google.com>
11925
11926 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11927 symbols of relaxed input sections.
11928 * output.h (Output_section::find_relaxed_input_section): Make
11929 method public.
11930
c5617f2f
DK
119312009-10-16 Doug Kwan <dougkwan@google.com>
11932
11933 * dynobj.cc (Versions::Versions): Initialize version_script_.
11934 Only insert base version symbol definition for a shared object
11935 if version script defines any version versions.
11936 (Versions::define_base_version): New method definition.
11937 (Versions::add_def): Check that base version is not needed.
11938 (Versions::add_need): Define base version lazily.
11939 * dynobj.h (Versions::define_base_version): New method declaration.
11940 (Versions::needs_base_version_): New data member declaration.
11941 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11942 (check_DATA): Add no_version_test.stdout.
11943 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11944 New make rules.
11945 * testsuite/Makefile.in: Regenerate.
11946 * testsuite/no_version_test.c: New file.
11947 * testsuite/no_version_test.sh: Ditto.
11948
3c12dcdb
DK
119492009-10-16 Doug Kwan <dougkwan@google.com>
11950
11951 * expression.cc (class Segment_start_expression): New class definition.
11952 (Segment_start_expression::value): New method definition.
11953 (script_exp_function_segment_start): Return a new
11954 Segment_start_expression.
11955 * gold/script-c.h (script_saw_segment_start_expression): New function
11956 prototype.
11957 * script-sections.cc (Script_sections::Script_sections): Initialize
11958 SAW_SEGMENT_START_EXPRESSION_ to false.
11959 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11960 and -Tbbs options to specify section addresses if given in
11961 command line and no SEGMENT_START expression is seen in a script.
11962 * script-sections.h (Script_sections::saw_segment_start_expression,
11963 Script_sections::set_saw_segment_start_expression): New method
11964 definition.
11965 (Script_sections::saw_segment_start_expression_): New data member
11966 declaration.
11967 * script.cc (script_saw_segment_start_expression): New function.
11968 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11969 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11970 script_test_7.sh and script_test_8.sh.
11971 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11972 script_test_8.stdout.
11973 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11974 (script_test_6, script_test_6.stdout, script_test_7,
11975 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11976 * Makefile.in: Regenerate.
11977 * testsuite/script_test_6.sh: New file.
11978 * testsuite/script_test_6.t: Same.
11979 * testsuite/script_test_7.sh: Same.
11980 * testsuite/script_test_7.t: Same.
11981 * testsuite/script_test_8.sh: Same.
11982
64b1ae37
DK
119832009-10-16 Doug Kwan <dougkwan@google.com>
11984
11985 * output.cc (Output_segment::set_section_list_address): Cast
11986 expressions to unsigned long long type to avoid format warnings.
11987
661be1e2
ILT
119882009-10-15 Ian Lance Taylor <iant@google.com>
11989
12edd763 11990 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 11991 dot assignment to script_sections_.
12edd763
ILT
11992 * script-sections.cc (Script_sections::add_dot_assignment):
11993 Initialize if necessary.
11994
68b6574b
ILT
11995 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11996 program headers with no load segment if there is a linker script.
11997
661be1e2
ILT
11998 * layout.cc (Layout::set_segment_offsets): Align the file offset
11999 to the segment aligment for -N or -n with no load segment.
12000 * output.cc (Output_segment::add_output_section): Don't crash if
12001 the first section is a TLS section.
12002 (Output_segment::set_section_list_addresses): Print an error
12003 message if the address moves backward in a linker script.
12004 * script-sections.cc
12005 (Output_section_element_input::set_section_addresses): Don't
12006 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12007 (Orphan_output_section::set_section_addresses): Likewise.
12008
f15f61a7
DK
120092009-10-15 Doug Kwan <dougkwan@google.com>
12010
12011 * layout.cc (Layout::finish_dynamic_section): Generate tags
12012 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12013 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12014 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12015
82bb573a
ILT
120162009-10-14 Ian Lance Taylor <iant@google.com>
12017
12018 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12019 fields.
12020 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12021 data_shdr fields of relinfo.
12022 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12023 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12024 R_386_TLS_LDO_32, adjust based on section flags.
12025 (Target_i386::Relocate::fix_up_ldo): Remove.
12026
374ad285
ILT
120272009-10-13 Ian Lance Taylor <iant@google.com>
12028
12029 Add support for -pie.
12030 * options.h (class General_options): Add -pie and
12031 --pic-executable.
12032 (General_options::output_is_position_independent): Test -pie.
12033 (General_options::output_is_executable): Return true if not shared
12034 and not relocatable.
12035 (General_options::output_is_pie): Remove.
12036 * options.cc (General_options::finalize): Reject incompatible uses
12037 of -pie.
12038 * gold.cc (queue_middle_tasks): A -pie link is not static.
12039 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12040 * symtab.cc (Symbol::final_value_is_known): Return false if
12041 output_is_position_independent.
12042 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
12043 output_is_position_independent.
12044 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
12045 output_is_position_independent.
12046 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
12047 output_is_position_independent.
12048 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
12049 two_file_pie_test.
12050 (basic_pie_test.o, basic_pie_test): New targets.
12051 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12052 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12053 (two_file_pie_test): New target.
12054 * testsuite/Makefile.in: Rebuild.
12055 * README: Remove note saying that -pie is not supported.
12056
c6585162
ILT
120572009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12058
12059 * options.h (class General_options): Add -init and -fini.
12060 * layout.cc (Layout::finish_dynamic_section): Emit
12061 given init and fini functions.
12062
032ce4e9
ST
120632009-10-13 Sriraman Tallam <tmsriram@google.com>
12064
12065 * gc.h (gc_process_relocs): Check if icf is enabled using new
12066 function.
12067 * gold.cc (queue_initial_tasks): Likewise.
12068 (queue_middle_tasks): Likewise.
12069 * object.cc (do_layout): Likewise.
12070 * symtab.cc (is_section_folded): Likewise.
12071 * main.cc (main): Likewise.
12072 * reloc.cc (Read_relocs::run): Likewise.
12073 (Sized_relobj::do_scan_relocs): Likewise.
12074 * icf.cc (is_function_ctor_or_dtor): New function.
12075 (Icf::find_identical_sections): Check if function is ctor or dtor when
12076 safe icf is chosen.
12077 * options.h (General_options::icf): Change option to be an enum.
12078 (Icf_status): New enum.
12079 (icf_enabled): New method.
12080 (icf_safe_folding): New method.
12081 (set_icf_status): New method.
12082 (icf_status_): New variable.
12083 * (options.cc) (General_options::finalize): Set icf_status_.
12084 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12085 icf_test and icf_keep_unique_test to use the --icf enum flag.
12086 * testsuite/icf_safe_test.sh: New file.
e1df38aa 12087 * testsuite/icf_safe_test.cc: New file.
032ce4e9 12088
f345227a
ST
120892009-10-12 Sriraman Tallam <tmsriram@google.com>
12090
12091 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
12092 includes to gc.h and icf.h.
12093 * arm.cc: Include gc.h.
12094 * gold.cc: Likewise.
12095 * i386.cc: Likewise.
12096 * powerpc.cc: Likewise.
12097 * sparc.cc: Likewise.
12098 * x86_64.cc: Likewise.
12099 * gc.h: Include icf.h.
12100
1c7814ed
ILT
121012009-10-11 Ian Lance Taylor <iant@google.com>
12102
12103 * plugin.cc: Include "gold.h" before other header files.
12104
ae3b5189
CD
121052009-10-10 Chris Demetriou <cgd@google.com>
12106
12107 * options.h (Input_file_argument::Input_file_type): New enum.
12108 (Input_file_argument::is_lib_): Replace with...
12109 (Input_file_argument::type_): New member.
12110 (Input_file_argument::Input_file_argument): Take Input_file_type
12111 'type' rather than boolean 'is_lib' as second argument.
12112 (Input_file_argument::is_lib): Use type_.
12113 (Input_file_argument::is_searched_file): New function.
12114 (Input_file_argument::may_need_search): Handle is_searched_file.
12115 * options.cc (General_options::parse_library): Support -l:filename.
12116 (General_options::parse_just_symbols): Update for Input_file_argument
12117 changes.
12118 (Command_line::process): Likewise.
12119 * archive.cc (Archive::get_file_and_offset): Likewise.
12120 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12121 * script.cc (read_script_file, script_add_file): Likewise.
12122 * fileread.cc (Input_file::Input_file): Likewise.
12123 (Input_file::will_search_for): Handle is_searched_file.
12124 (Input_file::open): Likewise.
12125 * readsyms.cc (Read_symbols::get_name): Likewise.
12126 * testsuite/Makefile.am (searched_file_test): New test.
12127 * testsuite/Makefile.in: Regenerate.
12128 * testsuite/searched_file_test.cc: New file.
12129 * testsuite/searched_file_test_lib.cc: New file.
12130
f3048a1d
ILT
121312009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12132 Ian Lance Taylor <iant@google.com>
12133
12134 * descriptor.cc: Include <cstdio> and "binary-io.h".
12135 (Descriptors::open): Open the files in binary mode always.
12136 * script.cc (Lex::get_token): Treat \r as whitespace.
12137
d4780e57
ILT
121382009-10-09 Ian Lance Taylor <iant@google.com>
12139
12140 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12141
d9a893b8
ILT
121422009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12143 Ian Lance Taylor <iant@google.com>
12144
12145 * configure.ac: Check for readv function also.
12146 * fileread.cc (readv): Define if not HAVE_READV.
12147 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12148 does not exist.
12149 * config.in: Regenerate.
12150 * configure: Regenerate.
12151
c0a62865
DK
121522009-10-09 Doug Kwan <dougkwan@google.com>
12153
12154 * layout.cc (Layout::make_output_section): Call target hook to make
12155 ordinary output section.
12156 (Layout::finalize): Adjust parameter list of call the
12157 Target::may_relax().
12158 * layout.h (class Layout::section_list): New method.
12159 * merge.h (Output_merge_base::entsize): Change visibility to public.
12160 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12161 New methods.
12162 (Output_merge_string::do_is_string): New method.
12163 * object.cc (Sized_relobj::do_setup): renamed from
12164 Sized_relobj::set_up.
12165 * object.h (Sized_relobj::adjust_shndx,
12166 Sized_relobj::initializ_input_to_output_maps,
12167 Sized_relobj::free_input_to_output_maps): Change visibilities to
12168 protected.
12169 (Sized_relobj::setup): Virtualize.
12170 (Sized_relobj::do_setup): New method declaration.
12171 (Sized_relobj::invalidate_section_offset,
12172 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12173 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12174 * options.cc (parse_int): New function.
12175 * options.h (parse_int): New declaration.
12176 (DEFINE_int): New macro.
12177 (stub_group_size): New option.
12178 * output.cc (Output_section::Output_section): Initialize memebers
12179 merge_section_map_, merge_section_by_properties_map_,
12180 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12181 (Output_section::add_input_section): Handled deferred code-fill
12182 generation and remove an old comment.
12183 (Output_section::add_relaxed_input_section): New method definition.
12184 (Output_section::add_merge_input_section): Use merge section by
12185 properties map to speed to search. Update merge section maps
12186 as appropriate.
12187 (Output_section::build_relaxation_map): New method definition.
12188 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12189 Same.
12190 (Output_section::relax_input_section): Renamed to
12191 Output_section::convert_input_sections_to_relaxed_sections and change
12192 interface to take a vector of pointers to relaxed sections.
12193 (Output_section::find_merge_section,
12194 Output_section::find_relaxed_input_section): New method definitions.
12195 (Output_section::is_input_address_mapped,
12196 Output_section::output_offset, Output_section::output_address):
12197 Use output section data maps to speed up searching.
12198 (Output_section::find_starting_output_address): Add comments.
12199 (Output_section::do_write,
12200 Output_section::write_to_postprocessing_buffer): Do code-fill
12201 generation as appropriate.
12202 (Output_section::get_input_sections): Invalidate relaxed input section
12203 map.
12204 (Output_section::restore_states): Adjust type of checkpoint .
12205 Invalidate relaxed input section map.
12206 * output.h (Output_merge_base): New class declaration.
12207 (Input_section_specifier): New class defintion.
12208 (class Output_relaxed_input_section) Change base class to
12209 Output_section_data_build.
12210 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12211 base class initializer.
12212 (Output_section::add_relaxed_input_section): New method declaration.
12213 (Output_section::Input_section): Change visibility to protected.
2e702c99 12214 (Output_section::Input_section::relobj,
c0a62865
DK
12215 Output_section::Input_section::shndx): Handle relaxed input sections.
12216 Output_section::input_sections) Change visibility to protected. Also
12217 define overload to return a non-const pointer.
12218 (Output_section::Merge_section_properties): New class defintion.
12219 (Output_section::Merge_section_by_properties_map,
12220 Output_section::Output_section_data_by_input_section_map,
12221 Output_section::Relaxation_map): New types.
12222 (Output_section::relax_input_section): Rename method to
12223 Output_section::convert_input_sections_to_relaxed_sections and change
12224 interface to take a vector of relaxed section pointers.
12225 (Output_section::find_merge_section,
12226 Output_section::find_relaxed_input_section,
12227 Output_section::build_relaxation_map,
12228 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12229 New method declarations.
12230 (Output_section::merge_section_map_
12231 Output_section::merge_section_by_properties_map_,
12232 Output_section::relaxed_input_section_map_,
12233 Output_section::is_relaxed_input_section_map_valid_,
12234 Output_section::generate_code_fills_at_write_): New data members.
12235 * script-sections.cc
12236 (Output_section_element_input::set_section_addresses): Call
12237 current_data_size and addralign methods of relaxed input sections.
12238 (Orphan_output_section::set_section_addresses): Call current_data_size
12239 and addralign methods of relaxed input sections.
12240 * symtab.cc (Symbol_table::compute_final_value): Extract template
12241 from the body of Symbol_table::sized_finalize_symbol.
12242 (Symbol_table::sized_finalized_symbol): Call
12243 Symbol_table::compute_final_value.
12244 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12245 (Symbol_table::compute_final_value): New templated method declaration.
12246 * target.cc (Target::do_make_output_section): New method defintion.
12247 * target.h (Target::make_output_section): New method declaration.
12248 (Target::relax): Add more parameters for input objects, symbol table
12249 and layout. Adjust call to do_relax.
12250 (Target::do_make_output_section): New method declaration.
12251 (Target::do_relax): Add parameters for input objects, symbol table
12252 and layout.
12253
d446d6c4
ILT
122542009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12255
12256 * pread.c: Include stdio.h.
12257
bc06c745
ILT
122582009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12259
12260 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12261 defined.
12262
75aea3d0
ILT
122632009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12264
12265 * dwarf_reader.cc (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 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12271 Change read_shndx type to unsigned int.
12272 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12273 int.
12274 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12275 * layout.cc (Layout::create_symtab_sections): Cast the result of
12276 local_symcount * symsize to off_t in the gold_assert.
12277
be8fcb75
ILT
122782009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12279
12280 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12281 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12282 R_ARM_BASE_ABS.
12283 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12284 (Arm_relocate_functions::thm_abs5): New function.
12285 (Arm_relocate_functions::abs12): New function.
12286 (Arm_relocate_functions::abs16): New function.
12287 (Arm_relocate_functions::base_abs): New function.
12288 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12289 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12290 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12291 R_ARM_BASE_ABS.
12292 (Scan::global): Likewise.
12293 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12294 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12295 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12296 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12297 R_ARM_BASE_ABS.
12298
c2a122b6
ILT
122992009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12300
12301 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12302 (Arm_relocate_functions::movt_prel): New function.
12303 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12304 (Arm_relocate_functions::thm_movt_prel): New function.
12305 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12306 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12307 (Scan::global, Relocate::relocate): Likewise.
12308 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12309
c4aa1e2d
ILT
123102009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12311
12312 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12313 Incremental_checker.
12314 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12315 unsigned int.
12316 (class Incremental_inputs_header): New class.
12317 (Incremental_inputs_header_writer): Edit comment.
12318 (Incremental_inputs_entry): New class.
12319 (Incremental_inputs_entry_writer): Edit comment.
12320 (Sized_incremental_binary::do_find_incremental_inputs_section):
12321 Add *strtab_shndx parameter, fill it.
12322 (Sized_incremental_binary::do_check_inputs): New method.
12323 (Incremental_checker::can_incrementally_link_output_file): Use
12324 Sized_incremental_binary::check_inputs.
12325 (Incremental_inputs::report_command_line): Save command line in
12326 command_line_.
12327 * incremental.h:
12328 (Incremental_binary::find_incremental_inputs_section): New
12329 method.
12330 (Incremental_binary::do_find_incremental_inputs_section): Add
12331 strtab_shndx parameter.
12332 (Incremental_binary::do_check_inputs): New pure virtual method.
12333 (Sized_incremental_binary::do_check_inputs): Declare.
12334 (Incremental_checker::Incremental_checker): Add incremental_inputs
12335 parameter, use it to initialize incremental_inputs_.
12336 (Incremental_checker::incremental_inputs_): New field.
12337 (Incremental_checker::command_line): New method.
12338 (Incremental_checker::inputs): New method.
12339 (Incremental_checker::command_line_): New field.
12340
c549a694
ILT
123412009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12342
12343 * incremental.cc: Include <cstdarg> and "target-select.h".
12344 (vexplain_no_incremental): New function.
12345 (explain_no_incremental): New function.
12346 (Incremental_binary::error): New method.
12347 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12348 method.
12349 (make_sized_incremental_binary): New function.
12350 (open_incremental_binary): New function.
12351 (can_incrementally_link_file): Add checks if output is ELF and has
12352 inputs section.
12353 * incremental.h: Include "elfcpp_file.h" and "output.h".
12354 (Incremental_binary): New class.
12355 (Sized_incremental_binary): New class.
12356 (open_incremental_binary): Declare.
12357 * object.cc (is_elf_object): Use
12358 elfcpp::Elf_recognizer::is_elf_file.
12359 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12360 * output.h (Output_file::filesize): New method.
12361
fd3c5f0b
ILT
123622009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12363
12364 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12365 New function.
12366 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12367 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12368 function.
12369 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12370 function.
12371 (Arm_relocate_functions::movw_abs_nc): New function.
12372 (Arm_relocate_functions::movt_abs): New function.
12373 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12374 (Arm_relocate_functions::thm_movt_abs): New function.
12375 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12376 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12377 (Scan::global): Likewise.
12378 (Relocate::relocate): Likewise.
12379 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12380
7f5309a5
ILT
123812009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12382
12383 * arm.cc (Arm_relocate_functions::got_prel) New function.
12384 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12385 (Relocate::relocate): Likewise.
12386 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12387
364c7fa5
ILT
123882009-10-06 Ian Lance Taylor <iant@google.com>
12389
12390 * options.h (class General_options): Define
12391 split_stack_adjust_size parameter.
12392 * object.h (class Object): Add uses_split_stack_ and
12393 has_no_split_stack_ fields. Add uses_split_stack and
12394 has_no_split_stack accessor functions. Declare
12395 handle_split_stack_section.
12396 (class Reloc_symbol_changes): Define.
12397 (class Sized_relobj): Define Function_offsets. Declare
12398 split_stack_adjust, split_stack_adjust_reltype, and
12399 find_functions.
12400 * object.cc (Object::handle_split_stack_section): New function.
12401 (Sized_relobj::do_layout): Call handle_split_stack_section.
12402 * dynobj.cc (Sized_dynobj::do_layout): Call
12403 handle_split_stack_section.
12404 * reloc.cc (Sized_relobj::relocate_sections): Call
12405 split_stack_adjust for executable sections in split_stack
12406 objects. Pass reloc_map to relocate_section.
12407 (Sized_relobj::split_stack_adjust): New function.
12408 (Sized_relobj::split_stack_adjust_reltype): New function.
12409 (Sized_relobj::find_functions): New function.
12410 * target-reloc.h: Include "object.h".
12411 (relocate_section): Add reloc_symbol_changes parameter. Change
12412 all callers.
12413 * target.h (class Target): Add calls_non_split method. Declare
12414 do_calls_non_split virtual method. Declare match_view and
12415 set_view_to_nop.
12416 * target.cc: Include "elfcpp.h".
12417 (Target::do_calls_non_split): New function.
12418 (Target::match_view): New function.
12419 (Target::set_view_to_nop): New function.
12420 * gold.cc (queue_middle_tasks): Give an error if mixing
12421 split-stack and non-split-stack objects with -r.
12422 * i386.cc (Target_i386::relocate_section): Add
12423 reloc_symbol_changes parameter.
12424 (Target_i386::do_calls_non_split): New function.
12425 * x86_64.cc (Target_x86_64::relocate_section): Add
12426 reloc_symbol_changes parameter.
12427 (Target_x86_64::do_calls_non_split): New function.
12428 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12429 parameter.
12430 * powerpc.cc (Target_powerpc::relocate_section): Add
12431 reloc_symbol_changes parameter.
12432 * sparc.cc (Target_sparc::relocate_section): Add
12433 reloc_symbol_changes parameter.
12434 * configure.ac: Call AM_CONDITIONAL for the default target.
12435 * configure: Rebuild.
12436 * testsuite/Makefile.am (TEST_AS): New variable.
12437 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12438 (check_DATA): Add split_i386 and split_x86_64 files.
12439 (SPLIT_DEFSYMS): Define.
12440 (split_i386_[1234n].o): New targets.
12441 (split_i386_[124]): New targets.
12442 (split_i386_[1234r].stdout): New targets.
12443 (split_x86_64_[1234n].o): New targets.
12444 (split_x86_64_[124]): New targets.
12445 (split_x86_64_[1234r].stdout): New targets.
12446 (MOSTLYCLEANFILES): Add new executables.
12447 * testsuite/split_i386.sh: New file.
12448 * testsuite/split_x86_64.sh: New file.
12449 * testsuite/split_i386_1.s: New file.
12450 * testsuite/split_i386_2.s: New file.
12451 * testsuite/split_i386_3.s: New file.
12452 * testsuite/split_i386_4.s: New file.
12453 * testsuite/split_i386_n.s: New file.
12454 * testsuite/split_x86_64_1.s: New file.
12455 * testsuite/split_x86_64_2.s: New file.
12456 * testsuite/split_x86_64_3.s: New file.
12457 * testsuite/split_x86_64_4.s: New file.
12458 * testsuite/split_x86_64_n.s: New file.
12459 * testsuite/testfile.cc (Target_test): Update relocation_section
12460 function.
12461 * testsuite/Makefile.in: Rebuild.
12462
e8a9fcda
ILT
124632009-10-06 Ian Lance Taylor <iant@google.com>
12464
12465 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12466 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12467 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12468 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12469 the address on ldo_addrs_.
12470 (Target_i386::Relocate::fix_up_ldo): New function.
12471
e99daf92
ILT
124722009-10-06 Rafael Espindola <espindola@google.com>
12473
12474 * plugin.cc (add_input_library): New.
12475 (Plugin::load): Add add_input_library to tv.
12476 (Plugin_manager::add_input_file): Add the is_lib argument.
12477 (add_input_file): Update call to Plugin_manager::add_input_file.
12478 (add_input_library): New.
12479 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12480
966d4097
DK
124812009-09-30 Doug Kwan <dougkwan@google.com>
12482
12483 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12484 symbol and call Symbol::may_need_copy_reloc to determine if
12485 a copy reloc is needed.
12486 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12487 nocopyreloc is given in command line.
12488 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12489 given in command line.
12490 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12491 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12492 of the removed Target_i386::may_need_copy_reloc.
12493 * options.h (copyreloc): New option with default value false.
12494 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12495 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12496 instead of the removed Target_powerpc::may_need_copy_reloc.
12497 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12498 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12499 instead of the removed Target_sparc::may_need_copy_reloc.
12500 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12501 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12502 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12503 instead of the removed Target_x86_64::may_need_copy_reloc.
12504
029ba973
ILT
125052009-09-30 Ian Lance Taylor <iant@google.com>
12506
12507 * object.h (class Object): Remove target_ field, and target,
12508 sized_target, and set_target methods.
12509 (Object::sized_target): Remove.
12510 (class Sized_relobj): Update declarations. Remove sized_target.
12511 * object.cc (Sized_relobj::setup): Remove target parameter.
12512 Change all callers.
12513 (Input_objects::add_object): Don't do anything with the target.
12514 (make_elf_sized_object): Add punconfigured parameter. Change all
12515 callers. Set or test parameter target.
12516 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12517 Change all callers.
12518 * parameters.cc (Parameters::set_target): Change parameter type to
12519 be non-const.
12520 (Parameters::default_target): Remove.
12521 (set_parameters_target): Change parameter type to be non-const.
12522 (parameters_force_valid_target): New function.
12523 (parameters_clear_target): New function.
12524 * parameters.h (class Parameters): Update declarations. Remove
12525 default_target method. Add sized_target and clear_target
12526 methods. Change target_ to be non-const.
12527 (set_parameters_target): Update declaration.
12528 (parameters_force_valid_target): Declare.
12529 (parameters_clear_target): Declare.
12530 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12531 as NULL if we aren't searching.
12532 (Add_symbols::run): Don't check for compatible target.
12533 * fileread.cc (Input_file::open_binary): Call
12534 parameters_force_valid_target.
12535 * gold.cc (queue_middle_tasks): Likewise.
12536 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12537 set_target on object.
12538 * dynobj.h (class Sized_dynobj): Update declarations.
12539 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12540 make_elf_object returns NULL.
12541 (Archive::include_member): Don't check whether object target is
12542 compatible.
12543 * output.cc (Output_section::add_input_section): Get target from
12544 parameters.
12545 (Output_section::relax_input_section): Likewise.
12546 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12547 parameters.
12548 (Sized_relobj::do_scan_relocs): Likewise.
12549 (Sized_relobj::relocate_sections): Likewise.
12550 * resolve.cc (Symbol_table::resolve): Likewise.
12551 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12552 parameter. Change all callers.
12553 (Symbol_table::add_from_object): Get target from parameters.
12554 (Symbol_table::add_from_relobj): Don't check object target.
12555 (Symbol_table::add_from_dynobj): Likewise.
12556 (Symbol_table::define_special_symbol): Get target from
12557 parameters.
12558 * symtab.h (class Symbol_table): Update declaration.
12559 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12560 parameter. Change all callers. Clear parameter target.
12561 (Binary_test): Test target here.
12562 * testsuite/object_unittest.cc (gold_testsuite): Remove
12563 target_test_pointer parameter. Change all callers.
12564 (Object_test): Test target here.
12565
a6a22b83
ILT
125662009-09-26 Ian Lance Taylor <iant@google.com>
12567
12568 * testsuite/initpri1.c: Don't try to use constructor priorities if
12569 compiling with gcc before 4.3.
12570
6a8f49fe
ILT
125712009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12572
12573 * testsuite/retain_symbols_file_test.sh (check_present): Change
12574 output file name to retain_symbols_file_test.stdout.
12575 (check_absent): Likewise.
12576
8c604651
CS
125772009-09-18 Craig Silverstein <csilvers@google.com>
12578
12579 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12580 * options.cc: Include <cerrno> and <fstream>.
12581 (General_options::finalize): Parse -retain-symbols-file tag.
12582 * options.h: New flag.
12583 (General_options): New method should_retain_symbol, new
12584 variable symbols_to_retain.
12585 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12586 should_retain_symbol map.
12587 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12588 * testsuite/Makefile.in: Regenerate.
12589 * testsuite/retain_symbols_file_test.sh: New file.
12590
ca58b19f
NC
125912009-09-18 Nick Clifton <nickc@redhat.com>
12592
12593 * po/es.po: Updated Spanish translation.
12594
20e6d0d6
DK
125952009-09-17 Doug Kwan <dougkwan@google.com>
12596
12597 * debug.h (DEBUG_RELAXATION): New constant.
12598 (DEBUG_ALL): Add DEBUG_RELAXATION.
12599 (debug_string_to_enum): Add relaxation debug option.
12600 * layout.cc
12601 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12602 Layout::Relaxation_debug_check::read_sections,
12603 Layout::Relaxation_debug_check::read_sections): New method definitions.
12604 (Layout::Layout): Initialize data members
12605 record_output_section_data_from_scrips_,
12606 script_output_section_data_list_ and relaxation_debug_check_.
12607 (Layout::save_segments, Layout::restore_segments,
12608 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12609 Layout::relaxation_loop_body): New method definitions.
12610 (Layout::finalize): Support relaxation. Move section layout code to
12611 Layout::relaxation_loop_body.
12612 (Layout::set_asection_address_from_script): Move code for orphan
12613 section placement out.
12614 (Layout::place_orphan_sections_in_script): New method definition.
12615 * layout.h (Output_segment_headers, Output_file_header):
12616 New forward class declarations.
12617 (Layout::~Layout): Define.
12618 (Layout::new_output_section_data_from_script): New method definition.
12619 (Layout::place_orphan_sections_in_script): New method declaration.
12620 (Layout::Segment_states): New type declaration.
12621 (Layout::save_segments, Layout::restore_segments,
12622 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12623 Layout::relaxation_loop_body): New method declarations.
12624 (Layout::Output_section_data_list): New type declaration.
12625 (Layout::Relaxation_debug_check): New class definition.
12626 (Layout::record_output_section_data_from_script_,
12627 Layout::script_output_section_data_list_, Layout::segment_states_,
12628 Layout::relaxation_debug_check_): New data members.
12629 * output.cc: (Output_section_headers::do_size): New method definition.
12630 (Output_section_headers::Output_section_headers): Move size
12631 computation to Output_section_headers::do_size.
12632 (Output_segment_headers::do_size): New method definition.
e1df38aa 12633 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
12634 Output_file_header::do_size and call it.
12635 (Output_file_header::do_size): New method definition.
12636 (Output_data_group::Output_data_group): Adjust call to
12637 Output_section_data.
12638 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12639 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 12640 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
12641 RELAXED_INPUT_SECTION_CODE.
12642 (Output_section::Output_section): Initialize data member checkpoint_.
12643 (Output_section::~Output_section): Delete checkpoint object pointed
12644 by checkpoint_.
12645 (Output_section::add_input_section): Always add an Input_section if
12646 relaxing.
12647 (Output_section::add_merge_input_section): Add assert.
12648 (Output_section::relax_input_section): New method definition.
12649 (Output_section::set_final_data_size): Set load address to zero for
12650 an unallocated section.
12651 (Output_section::do_address_and_file_offset_have_reset_values):
12652 New method definition.
12653 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12654 Handle relaxed input section.
12655 (Output_section::sort_attached_input_sections): Checkpoint input
12656 section list lazily.
12657 (Output_section::get_input_sections): Change type of input_sections to
12658 list of Simple_input_section pointers. Checkpoint input section list
12659 lazily. Also handle relaxed input sections.
12660 (Output_section::add_input_section_for_script): Take a reference to
12661 a Simple_input_section object instead of Relobj pointer and section
12662 index as parameter. Handle relaxed input sections.
12663 (Output_section::save_states, Output_section::restore_states): New
12664 method definitions.
12665 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12666 (Output_data::is_data_size_fixed): New method definition.
12667 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12668 if it is fixed.
12669 (Output_data::address_and_file_offset_have_reset_values): New method
12670 definition.
12671 (Output_data::do_address_and_file_offset_have_reset_values): New method
12672 definition.
12673 (Output_data::set_data_size): Check that data size is not fixed.
12674 (Output_data::fix_data_size): New method definition.
12675 (Output_data::is_data_size_fixed_): New data member.
12676 (Output_section_headers::set_final_data_size): New method definition.
12677 (Output_section_headers::do_size): New method declaration.
12678 (Output_segment_headers::set_final_data_size): New method definition.
12679 (Output_segment_headers::do_size): New method declaration.
12680 (Output_file_header::set_final_data_size)::New method definition.
12681 (Output_file_header::do_size)::New method declaration.
12682 (Output_section_data::Output_section_data): Add new parameter
12683 is_data_size_fixed and use it to fix data size.
12684 (Output_data_const::Output_data_const): Adjust call to base class
12685 constructor and fix data size.
12686 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12687 base class constructor and fix data size.
12688 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12689 base class constructor and fix data size.
12690 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12691 class constructor and fix data size.
12692 (Output_data_group::set_final_data_size): New method definition.
12693 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12694 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12695 class constructor and fix data size.
12696 (Output_relaxed_input_section): New class definition.
12697 (Output_section::Simple_input_section): New class definition.
12698 (Output_section::get_input_sections): Adjust parameter list.
12699 (Output_section::add_input_section_for_script): Same.
12700 (Output_section::save_states, Output_section::restore_states,
12701 Output_section::do_address_and_file_offset_have_reset_values,
12702 (Output_section::Input_section::Input_section): Handle
12703 RELAXED_INPUT_SECTION_CODE. Add new overload for
12704 Output_relaxed_input_section.
12705 (Output_section::Input_section::is_input_section,
12706 Output_section::Input_section::set_output_section): Handle relaxed
12707 input section.
12708 (Output_section::Input_section::is_relaxed_input_section,
12709 Output_section::Input_section::output_section_data,
12710 Output_section::Input_section::relaxed_input_section): New method
12711 definitions.
12712 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12713 value.
12714 (Output_section::Input_section::u1_): Update comments.
12715 (Output_section::Input_section::u2_): Add new union member poris.
12716 (Output_section::Checkpoint_output_section): New classs definition.
12717 (Output_section::relax_input_section): New method declaration.
12718 (Output_section::checkpoint_): New data member.
12719 (Output_segment): Update comments.
12720 (Output_segment::Output_segment): Un-privatize copy constructor.
12721 (Output_segment::operator=): Un-privatize.
12722 * script-sections.cc (Output_section_element::Input_section_list):
12723 Change element type to Output_section::Simple_input_section.
12724 (Output_section_element_dot_assignment::set_section_addresses):
12725 Register output section data for relaxation clean up.
12726 (Output_data_exression::Output_data_expression): Adjust call to base
12727 constructor to fix data size.
12728 (Output_section_element_data::set_section_addresses): Register
12729 Output_data_expression object for relaxation clean up.
12730 (struct Input_section_info): Replace Relobj pointer and section index
12731 pair with Output_section::Simple_input_section and Convert struct to a
12732 class.
12733 (Input_section_sorter::operator()): Adjust access to
e1df38aa 12734 Input_section_info data member to use accessors.
20e6d0d6
DK
12735 (Output_section_element_input::set_section_addresses): Use layout
12736 parameter. Adjust code to use Output_section::Simple_input_section
12737 and Input_secction_info classes. Register filler for relaxation
12738 clean up.
12739 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12740 and section index pair with Output_section::Simple_input_section
12741 class. Adjust code accordingly.
12742 (Phdrs_element::release_segment): New method definition.
12743 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12744 segment list.
12745 (Script_sections::release_segments): New method definition.
12746 * gold/script-sections.h (Script_sections::release_segments): New
12747 method declaration.
12748 * gold/target.h (Target::may_relax, Target::relax,
12749 Target::do_may_relax, Target::do_relax): New method definitions.
12750
5e445df6
ILT
127512009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12752
12753 * arm.cc (has_signed_unsigned_overflow): New function.
12754 (Arm_relocate_functions::abs8): New function.
12755 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12756 (Target_arm::Scan::global): Likewise.
12757 (Target_arm::relocate::relocate): Likewise.
12758 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12759 Likewise.
12760
8c604651 127612009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
12762
12763 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12764 * testsuite/Makefile.in: Regenerate.
12765
1e9cc1c2
NC
127662009-09-11 Nick Clifton <nickc@redhat.com>
12767
12768 * po/gold.pot: Updated by the Translation project.
12769
6a89f575
CC
127702009-09-08 Cary Coutant <ccoutant@google.com>
12771
12772 * output.cc (Output_file::open): Add execute permission to empty file.
12773 * testsuite/Makefile.am (permission_test): New test.
12774 * testsuite/Makefile.in: Regenerate.
12775
fdcac5af
ILT
127762009-09-02 Ian Lance Taylor <iant@google.com>
12777
12778 * output.cc (Output_file::resize): Call map_no_anonymous rather
12779 than map.
12780
44453f85
ILT
127812009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12782
12783 * gold.cc: Include "incremental.h".
12784 (queue_initial_tasks): Call Incremental_checker methods.
12785 * incremental.cc: Include "output.h".
12786 (Incremental_checker::can_incrementally_link_output_file): New
12787 method.
12788 * incremental.h (Incremental_checker): New class.
12789
12790 * output.cc (Output_file::open_for_modification): New method.
12791 (Output_file::map_anonymous): Changed return type to bool. Record
12792 map in base_ field.
12793 (Output_file::map_no_anonymous): New method, broken out of map.
12794 (Output_file::map): Use map_no_anonymous and map_anonymous.
12795 * output.h (class Output_file): Update declarations.
12796
293c1386
CC
127972009-08-24 Cary Coutant <ccoutant@google.com>
12798
12799 * options.h (Command_line::Pre_options): New class.
12800 (Command_line::pre_options): New member.
12801 * options.cc (gold::options::ready_to_register): New variable.
12802 (One_option::register_option): Do nothing if not registering options.
12803 Assert if same short option registered twice.
12804 (General_options::General_options): Turn off option registration when
12805 done constructing.
12806 (Command_line::Pre_options::Pre_options): New constructor.
12807
f773f3d2
CC
128082009-08-24 Cary Coutant <ccoutant@google.com>
12809
06a73cfe
CC
12810 * options.h (General_options::no_keep_memory): Remove incorrect
12811 short option.
f773f3d2 12812
a15af8e2
RW
128132009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12814
12815 * Makefile.am (am__skiplex, am__skipyacc): New.
12816 * Makefile.in: Regenerate.
12817
c462b41b
RW
128182009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12819
14ec8efd
RW
12820 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12821 (INCLUDES): ... this.
12822 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12823 (AM_CPPFLAGS): Renamed from ...
12824 (INCLUDE): ... this.
12825 * Makefile.in, testsuite/Makefile.in: Regenerate.
12826
81ecdfbb
RW
12827 * Makefile.in: Regenerate.
12828 * aclocal.m4: Likewise.
12829 * config.in: Likewise.
12830 * configure: Likewise.
12831 * testsuite/Makefile.in: Likewise.
12832
c462b41b
RW
12833 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12834 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12835 * Makefile.in: Regenerate.
12836 * testsuite/Makefile.in: Regenerate.
12837
2da73f13
CC
128382009-08-19 Cary Coutant <ccoutant@google.com>
12839
12840 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12841 symbols in shared libraries overridden by hidden or internal symbols
12842 in the main program.
12843
2db70501
CD
128442009-08-19 Chris Demetriou <cgd@google.com>
12845
12846 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12847 checking source file names in error messages.
12848
f733487b
DK
128492009-08-18 Doug Kwan <dougkwan@google.com>
12850
12851 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12852 an elcpp::Ehdr as parameter. Adjust call to set_target.
12853 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12854 an elfcpp::Ehdr as parameter.
12855 * object.cc (Object::set_target): Remove the version that looks up
12856 a target and sets it.
12857 (Sized_relobj::setup): Take a Target object instead of
12858 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12859 (make_elf_sized_object): Find target and ask target to
12860 make an ELF object.
12861 * object.h: (Object::set_target): Remove the version that looks up
12862 a target and sets it.
12863 (Sized_relobj::setup): Take a Target object instead of
12864 an elfcpp:Ehdr as parameter.
12865 * target.cc: Include dynobj.h.
12866 (Target::do_make_elf_object_implementation): New.
2e702c99 12867 (Target::do_make_elf_object): New.
f733487b
DK
12868 * target.h (Target::make_elf_object): New template declaration.
12869 (Target::do_make_elf_object): New method declarations.
12870 (Target::do_make_elf_object_implementation): New template declaration.
12871
cc70f101
ILT
128722009-08-14 Ian Lance Taylor <iant@google.com>
12873
12874 * gold.h (FUNCTION_NAME): Define.
12875 (gold_unreachable): Use FUNCTION_NAME.
12876
ef5e0cb1
ST
128772009-08-12 Sriraman Tallam <tmsriram@google.com>
12878
12879 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12880 symbol in the --keep-unique list is not found.
12881
48c187ce
ST
128822009-08-12 Sriraman Tallam <tmsriram@google.com>
12883
12884 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12885 been maked as --keep-unique.
12886 (Icf::unfold_section): New function.
12887 * icf.h (Icf::unfold_section): New function.
12888 * options.h (General_options::keep_unique): New option.
12889 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12890 * testsuite/Makefile.in: Regenerate.
12891 * testsuite/icf_keep_unique_test.sh: New file.
12892 * testsuite/icf_keep_unique_test.cc: New file.
12893
645afe0c
CC
128942009-08-12 Cary Coutant <ccoutant@google.com>
12895
12896 PR 10471
12897 * resolve.cc (Symbol_table::resolve): Check for references from
12898 dynamic objects to hidden and internal symbols.
12899 * testsuite/Makefile.am (hidden_test.sh): New test.
12900 * testsuite/Makefile.in: Regenerate.
12901 * testsuite/hidden_test.sh: New script.
12902 * testsuite/hidden_test_1.c: New test source.
12903 * testsuite/hidden_test_main.c: New test source.
12904
11af873f
DK
129052009-08-11 Doug Kwan <dougkwan@google.com>
12906
12907 * arm.cc: Update comments.
12908 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12909 segment to locate the .ARM.exidx section if present.
12910
b9f7d72d
DK
129112009-08-09 Doug Kwan <dougkwan@google.com>
12912
12913 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12914 patch.
12915
ddd3c53c
ST
129162009-08-07 Sriraman Tallam <tmsriram@google.com>
12917 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12918 compiler warnings.
12919
27721062
ST
129202009-08-06 Sriraman Tallam <tmsriram@google.com>
12921
12922 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12923 valid tls_segment only for non-debug-section relocations.
12924 * testsuite/Makefile.am: Add gc_tls_test.
12925 * testsuite/Makefile.in: Regenerate.
12926 * testsuite/gc_tls_test.cc: New file.
12927 * testsuite/gc_tls_test.sh: New file.
12928
ef15dade 129292009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 12930
ef15dade
ST
12931 * icf.cc: New file.
12932 * icf.h: New file.
12933 * Makefile.am (CCFILES): Add icf.cc.
12934 (HFILES): Add icf.h
12935 * Makefile.in: Regenerate.
12936 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12937 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12938 section, symbol and addend information for the relocs.
12939 * gold.cc (queue_middle_tasks): Call identical code folding.
12940 * gold.h: Add defines for multimap.
12941 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12942 to the call of finalize_local_symbols.
12943 * main.cc (main): Create object of class Icf.
12944 * object.cc (Sized_relobj::do_layout): Allow this function to be
12945 called twice during icf.
12946 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12947 to sections marked as identical by icf.
12948 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12949 when available.
12950 (Sized_relobj::do_section_entsize): New function.
12951 * object.h (Object::section_entsize): New function.
12952 (Object::do_section_entsize): New pure virtual function.
12953 (Relobj::finalize_local_symbols): Add new parameter.
12954 (Relobj::do_section_entsize): New function.
12955 * options.h (General_options::icf): New option.
12956 (General_options::icf_iterations): New option.
12957 (General_options::print_icf_sections): New option.
12958 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12959 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12960 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12961 icf.
12962 * symtab.cc (Symbol_table::is_section_folded): New function.
12963 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12964 to sections marked as identical by icf.
12965 * symtab.h (Symbol_table::set_icf): New function.
12966 (Symbol_table::icf): New function.
12967 (Symbol_table::is_section_folded): New function.
12968 (Symbol_table::icf_): New data member.
12969 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12970 * testsuite/Makefile.am: Add commands to build icf_test.
12971 * testsuite/Makefile.in: Regenerate.
12972 * testsuite/icf_test.sh: New file.
12973 * testsuite/icf_test.cc: New file.
12974
c3b65ac4
CD
129752009-07-24 Chris Demetriou <cgd@google.com>
12976
12977 * layout.cc (is_compressible_debug_section): Fix incorrect
12978 comment about compressed section names.
12979
1caf2c51
ILT
129802009-07-20 Ian Lance Taylor <ian@airs.com>
12981
12982 PR 10419
12983 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12984
1ef4d87f
ILT
129852009-07-16 Ian Lance Taylor <iant@google.com>
12986
12987 PR 10400
12988 * layout.h: #include <map>.
12989 (class Kept_section): Change from struct to class. Add accessors
12990 and setters. Add section size to Comdat_group mapping. Change
12991 Comdat_group to std::map. Add is_comdat_ field. Add
12992 linkonce_size field in union.
12993 (class Layout): Update declaration of find_or_add_kept_section.
12994 Don't declare find_kept_object.
12995 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12996 parameter. Add object, shndx, is_comdat, and is_group_name
12997 parameters. Change all callers. Adjust for new Kept_section.
12998 (Layout::find_kept_object): Remove.
12999 * object.cc (Sized_relobj::include_section_group): Update use of
13000 Kept_section. Rename secnum to shndx. Only record
13001 Kept_comdat_section if sections are the same size.
13002 (Sized_relobj::include_linkonce_section): Update use of
13003 Kept_section. Only record Kept_comdat_section if sections are the
13004 same size. Set size of linkonce section.
13005 (Sized_relobj::map_to_kept_section): Update call to
13006 get_kept_comdat_section.
13007 * object.h (class Sized_relobj): Rename fields in
13008 Kept_comdat_section to drop trailing underscores; change object
13009 field to Relobj*. Change Kept_comdat_section_table to store
13010 struct rather than pointer.
13011 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13012 Add kept_object and kept_shndx parameters. Change all callers.
13013 (Sized_relobj::get_kept_comdat_section): Change return type to
13014 bool. Add kept_object and kept_shndx parameters. Change all
13015 callers.
13016 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13017 Layout::find_or_add_kept_section.
13018
37c3b7b0
ILT
130192009-07-09 Ian Lance Taylor <iant@google.com>
13020
13021 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13022 Reserve space in the hash table.
13023
98fa85cb
ILT
130242009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13025
13026 * fileread.cc (File_read::get_mtime): New method.
13027 * fileread.h (Timespec): New structure.
13028 (File_read::get_mtime): New method.
13029 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13030 Renamed from timestamp_nsec.
13031 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13032 Elf_Xword.
e1df38aa 13033 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 13034 timestamp_nsec.
e1df38aa 13035 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
13036 (Incremental_inputs::report_obejct): Save mtime; style fix.
13037 (Incremental_inputs::report_script): Save mtime; style fix.
13038 (Incremental_inputs::finalize_inputs): Style fix.
13039 (Incremental_inputs::finalize): Style fix.
13040 (Incremental_inputs::create_input_section_data): Store inputs
13041 mtime.
13042 * incremental.h (Incremental_inputs::report_script): Add mtime
13043 argument.
13044 (Incremental_inputs::Input_info::Input_info): Intialize only one
13045 union member.
13046 (Incremental_inputs::Input_info::archive): Move to nameless
13047 union.
13048 (Incremental_inputs::Input_info::obejct): Move to nameless union.
13049 (Incremental_inputs::Input_info::script): Move to nameless union.
13050 (Incremental_inputs::mtime): New field.
13051 * script.cc (read_input_script): Pass file mtime to
13052 Incremental_input.
13053 * script.h (Script_info::inputs): Style fix.
13054
c9d70757
ILT
130552009-07-01 Ian Lance Taylor <ian@airs.com>
13056
13057 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13058 instead of 32.
13059
9c547ec3
ILT
130602009-06-24 Ian Lance Taylor <iant@google.com>
13061
13062 PR 10156
13063 * layout.cc (Layout::choose_output_section): If we find an
13064 existing section, update the flags.
13065 (Layout::create_notes): New function, broken out of
13066 Layout::finalize.
13067 (Layout::finalize): Don't create note sections.
13068 (Layout::create_note): Don't crash if linker script discards
13069 section.
13070 (Layout::create_gold_note): Likewise.
13071 (Layout::create_build_id): Likewise. Don't set
13072 after_input_sections on the section.
13073 (Layout::create_executable_stack_info): Remove target parameter.
13074 Change caller.
13075 * layout.h (class Layout): Declare create_notes. Update
13076 declaration of create_executable_stack_info.
13077 * gold.cc (queue_middle_tasks): Call create_notes.
13078 * output.cc (Output_section::update_flags_for_input_section): Move
13079 here from output.h. If SHF_ALLOC flag is newly set, mark address
13080 invalid.
13081 * output.h (Output_data::mark_address_invalid): New function.
13082 (class Output_section): Only declare, not define,
13083 update_flags_for_input_section. Remove set_flags.
13084
55458500
ILT
130852009-06-24 Ian Lance Taylor <iant@google.com>
13086
13087 * script-sections.cc (Output_section_definition::
13088 set_section_addresses): Rename shadowing local load_address to
13089 laddr.
13090
1307d6cd
ILT
130912009-06-24 Ian Lance Taylor <iant@google.com>
13092
13093 PR 10244
13094 * reloc.cc (relocate_sections): Skip empty relocation sections.
13095
ec3f783e
ILT
130962009-06-23 Ian Lance Taylor <iant@google.com>
13097
13098 PR 10156
13099 * layout.cc (Layout::create_note): Use choose_output_section
13100 rather than make_output_section.
13101
459c9f1c
ILT
131022009-06-23 Ian Lance Taylor <iant@google.com>
13103
13104 PR 10237
13105 * options.cc (General_options::parse_V): Set printed_version_.
13106 (General_options::General_options): Initialize printed_version_.
13107 * options.h (class General_options): Add printed_version_ field.
13108 * gold.cc (queue_initial_tasks): If there are no input files,
13109 don't give a fatal error if we printed the version information.
13110 (queue_middle_tasks): If using -r with a shared object, give a
13111 fatal error rather than an ordinary error.
13112
1518dc8f
ILT
131132009-06-23 Ian Lance Taylor <iant@google.com>
13114
13115 PR 10219
13116 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13117 (Layout::make_output_section): Set have_stabstr_section_ if we see
13118 a .stab*str section.
13119 (Layout::finalize): Call link_stabs_sections.
13120 (Layout::link_stabs_sections): New file.
13121 * layout.h (class Layout): Add have_stabstr_section_ field.
13122 Declare link_stabs_sections.
13123
3d857b98
DK
131242009-06-23 Doug Kwan <dougkwan@google.com>
13125
13126 * Makefile.am (libgold_a_LIBADD): New.
13127 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 13128 * Makefile.in: Regenerate.
3d857b98
DK
13129 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13130 * configure: Regenerate.
13131 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13132 * fileread.cc: Include sys/state.h
13133 * gold.h: Declare memmem and strndup if found missing.
13134 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13135
0639a6f6
ILT
131362009-06-23 Ian Lance Taylor <iant@google.com>
13137
13138 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13139 * configure: Rebuild.
13140
8d63875c
ILT
131412009-06-23 Ian Lance Taylor <iant@google.com>
13142
13143 PR 10147
13144 * object.cc (Object::section_contents): Don't try to get a view if
13145 the section has length zero.
13146 (Object::handle_gnu_warning_section): If the section is empty, use
13147 the name of the section as the warning.
13148
f7c8a183
ILT
131492009-06-23 Ian Lance Taylor <iant@google.com>
13150
13151 PR 10133
13152 * stringpool.h (class Stringpool_template): Add optimize_ field.
13153 (Stringpool_template::set_optimize): New function.
13154 * stringpool.cc (Stringpool_template::Stringpool_template):
13155 Initialize optimize_ field.
13156 (Stringpool_template::set_string_offsets): Test local optimize
13157 fild rather than parameter.
13158 * layout.cc (Layout::Layout): Call set_optimize on the section
13159 name stringpool.
13160
e6a307ba
ILT
131612009-06-22 Ian Lance Taylor <iant@google.com>
13162
13163 PR 10030
13164 * yyscript.y: Parse TARGET.
13165 * script.cc (script_set_target): New function.
13166 * script-c.h (script_set_target): Declare.
13167 * options.cc (General_options::string_to_object_format): Rename
13168 from string_to_object_format in anonymous namespace. Change
13169 callers.
13170 * options.h (class General_options): Declare
13171 string_to_object_format.
13172
3ee173de
ILT
131732009-06-22 Ian Lance Taylor <iant@google.com>
13174
13175 * script-sections.cc (Script_sections::create_segments): Don't put
13176 program headers in a PT_LOAD segment if -n or -N.
13177
131782009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
13179
13180 PR 10141
13181 * options.h (class General_options): Add -z lazy and -z now. Sort
13182 -z options into alphabetical order.
13183 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13184
cd6739a1 131852009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
13186
13187 * layout.cc (Layout::make_output_section): Call
13188 Target::new_output_section.
13189 (Layout::attach_allocated_section_to_segment): Put large section
13190 sections in a separate load segment with the large segment flag
13191 set.
13192 (Layout::segment_precedes): Sort large data segments after other
13193 load segments.
13194 (align_file_offset): New static function.
13195 (Layout::set_segment_offsets): Use align_file_offset.
13196 * output.h (class Output_section): Add is_small_section_ and
13197 is_large_section_ fields.
13198 (Output_section::is_small_section): New function.
13199 (Output_section::set_is_small_section): New function.
13200 (Output_section::is_large_section): New function.
13201 (Output_section::set_is_large_section): New function.
13202 (Output_section::is_large_data_section): New function.
13203 (class Output_segment): Add is_large_data_segment_ field.
13204 (Output_segment::is_large_data_segment): New function.
13205 (Output_segment::set_is_large_data_segment): New function.
13206 * output.cc (Output_section::Output_section): Initialize new
13207 fields.
13208 (Output_segment::Output_segment): Likewise.
13209 (Output_segment::add_output_section): Add assertion that large
13210 data sections always go in large data segments. Force small data
13211 sections to the end of the list of data sections. Force small BSS
13212 sections to the start of the list of BSS sections. For large BSS
13213 sections to the end of the list of BSS sections.
13214 * symtab.h (class Symbol): Declare is_common_shndx.
13215 (Symbol::is_defined): Check Symbol::is_common_shndx.
13216 (Symbol::is_common): Likewise.
13217 (class Symbol_table): Define enum Commons_section_type. Update
13218 declarations. Add small_commons_ and large_commons_ fields.
13219 * symtab.cc (Symbol::is_common_shndx): New function.
13220 (Symbol_table::Symbol_table): Initialize new fields.
13221 (Symbol_table::add_from_object): Put small and large common
13222 symbols in the right list.
13223 (Symbol_table::sized_finalized_symbol): Check
13224 Symbol::is_common_shndx.
13225 (Symbol_table::sized_write_globals): Likewise.
13226 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13227 common symbol lists. Don't call do_allocate_commons_list if the
13228 list is empty.
13229 (Symbol_table::do_allocate_commons_list): Remove is_tls
13230 parameter. Add comons_section_type parameter. Change all
13231 callers. Handle small and large common symbols.
13232 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13233 Symbol::is_common_shndx.
13234 * resolve.cc (symbol_to_bits): Likewise.
13235 * target.h (Target::small_common_shndx): New function.
13236 (Target::small_common_section_flags): New function.
13237 (Target::large_common_shndx): New function.
13238 (Target::large_common_section_flags): New function.
13239 (Target::new_output_section): New function.
13240 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13241 small_common_section_flags, and large_common_section_flags
13242 fields.
13243 (Target::do_new_output_section): New virtual function.
13244 * arm.cc (Target_arm::arm_info): Initialize new fields.
13245 * i386.cc (Target_i386::i386_info): Likewise.
13246 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13247 Likewise.
13248 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13249 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13250 (Target_x86_64::do_new_output_section): New function.
13251 * configure.ac: Define conditional MCMODEL_MEDIUM.
13252 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13253 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13254 (large_LDFLAGS): Define.
13255 * testsuite/large.c: New file.
13256 * testsuite/testfile.cc (Target_test::test_target_info):
13257 Initialize new fields.
13258 * configure, testsuite/Makefile.in: Rebuild.
13259
bb04269c
DK
132602009-06-05 Doug Kwan <dougkwan@google.com>
13261
13262 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13263 * Makefile.in: Regenerate.
bb04269c
DK
13264 * i386.cc (class Target_i386): Define new virtual method to
13265 override do_is_local_label_name in parent.
13266 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13267 local symbols if --discard-locals or -X is given.
13268 * options.h (class General_options): Declare new options
13269 '--discard-locals' and '-X' for discarding locals.
13270 * target.h (class Target): Define new methods is_local_label_name.
13271 Declare new virtual method do_is_local_label_name.
13272 * target.cc: New file.
13273 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13274 (check_SCRIPTS): Add discard_locals_test.sh.
13275 (check_DATA): Add discard_local_tests.syms.
13276 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13277 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13278 * testsuite/Makefile.in: Regenerate.
13279 * testsuite/discard_locals_test.c: New file.
13280 * testsuite/discard_locals_test.sh: Same.
13281
805bb01c
DK
132822009-06-05 Doug Kwan <dougkwan@google.com>
13283
13284 * object.cc (Sized_relobj::Sized_relobj): Initialize
13285 discarded_eh_frame_shndx_ to -1U.
13286 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13287 section.
13288 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13289 a discarded .eh_frame section.
13290 (Sized_relobj::do_finalize_local_symbols): Ditto.
13291 * object.h (class Sized_relobj): Declare new member
13292 discarded_eh_frame_shndx_.
13293 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13294 (local_labels_test.o, local_labels_test): New rules.
13295 * testsuite/Makefile.in: Regenerate.
13296
1dcd334d
DK
132972009-06-04 Doug Kwan <dougkwan@google.com>
13298
13299 * layout.cc (Layout::section_name_mapping): Add mapping for
13300 special ARM sections.
13301
96d49306
DK
133022009-06-03 Doug Kwan <dougkwan@google.com>
13303
13304 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13305 (utils::has_overflow): Same.
13306
dff16297
ILT
133072009-06-03 Ian Lance Taylor <iant@google.com>
13308
13309 * layout.cc (Layout::section_name_mapping): New array, replacing
13310 Layout::linkonce_mapping.
13311 (Layout::section_name_mapping_count): New variable, replacing
13312 Layout::linkonce_mapping_count.
13313 (Layout::linkonce_output_name): Remove.
13314 (Layout::output_section_name): Rewrite.
13315 * layout.h (class Layout): Rename Linkonce_mapping to
13316 Section_name_mapping, linkonce_mapping to section_name_mapping,
13317 linkonce_mapping_count to section_name_mapping_count. Don't
13318 declare linkonce_output_name.
13319
c121c671
DK
133202009-06-03 Doug Kwan <dougkwan@google.com>
13321
13322 * gold/arm.cc (namespace utils): New.
13323 (Target_arm::reloc_is_non_pic): Define new method.
13324 (class Arm_relocate_functions): New.
13325 (Target_arm::Relocate::relocate): Handle relocation types used by
13326 Android.
13327
07800fab
ILT
133282009-06-03 Ian Lance Taylor <iant@google.com>
13329
13330 * arm.cc (Target_arm::scan::global): Use || instead of |.
13331
c121c671
DK
133322009-06-02 Doug Kwan <dougkwan@google.com>
13333
13334 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13335 issued_non_pic_error_.
13336 (class Target_arm::Scan): Declare new method check_non_pic.
13337 Define new method symbol_needs_plt_entry.
13338 Declare new data member issued_non_pic_error_.
13339 (class Target_arm::Relocate): Declare new method
13340 should_apply_static_reloc.
13341 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13342 (Target_arm::Scan::check_non_pic): Define new method.
13343 (Target_arm::Scan::local): Handle a small subset of reloc types used
13344 by Android.
13345 (Target_arm::Scan::local): Same.
13346 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13347
b19b0c6d
ILT
133482009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13349
13350 * incremental.cc (Incremental_inputs::report_command_line): Filter
13351 out --incremental-* options.
13352
94cdfcff
DK
133532009-05-29 Doug Kwan <dougkwan@google.com>
13354
13355 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13356 template class.
13357 (class Target_arm): Update comment.
13358 (Target_arm::Target_arm): Initialize new data members GOT_,
13359 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13360 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13361 and Target_arm::rel_dyn_section.
13362 Declare new_enum Target_arm::Got_type.
13363 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13364 and DYNBSS_.
13365 Update commments for member do_dynsym_value.
13366 (Target_arm::got_size, Target_arm::plt_section,
13367 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13368 new methods inside class defintion.
13369 (Target_arm::got_section): Define new method.
13370 (Target_arm::rel_dyn_section): Same.
13371 (Output_data_plt_arm): New template class.
13372 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13373 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13374 (Output_data_plt_arm::add_entry): Same.
13375 (Output_data_plt_arm::first_plt_entry): Define new
13376 static data member for PLT instruction template.
13377 (Output_data_plt_arm::plt_entry): Same.
13378 (Output_data_plt_arm::do_write): Define new method.
13379 (Target_arm::make_plt_entry): Same.
13380 (Target_arm::do_finalize_sections): Same.
13381 (Target_arm::do_dynsym_value): Same.
13382
4a657b0d
DK
133832009-05-28 Doug Kwan <dougkwan@google.com>
13384
13385 * Makefile.am (TARGETSOURCES): Add arm.cc.
13386 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13387 * Makefile.in: Regenerate.
13388 * arm.cc: New file.
13389 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13390
e7ae8c36
DK
133912009-05-26 Doug Kwan <dougkwan@google.com>
13392
13393 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13394 (General_options::check_excluded_libs): Strip off directories in
13395 archive name before matching like GNU ld does.
13396 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13397 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13398 (exclude_libs_test_LDFLAGS): Add linker option
13399 -Wl,--exclude-libs,libexclude_libs_test_3
13400 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13401 an explicit archive without using -l.
13402 (alt/libexclude_libs_test_3.a): New make rule.
13403 * testsuite/Makefile.in: Regenerate.
13404 * testsuite/exclude_libs_test.c : Declare lib3_default().
13405 (main): Call it.
13406 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13407 * exclude_libs_test_3.c: New file.
13408
f12e7348
NC
134092009-05-26 Nick Clifton <nickc@redhat.com>
13410
13411 * po/id.po: New Indonesian translation.
13412 * po/gold.pot: Updated template file.
13413
4daadc0d
ST
134142009-05-22 Sriraman Tallam <tmsriram@google.com>
13415
e1df38aa 13416 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13417 gc_comdat_test files. Add -Wl,--gc-sections to build
13418 gc_comdat_test.
13419 * testsuite/Makefile.in: Regenerate.
13420 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13421
531813ad
ST
134222009-05-21 Sriraman Tallam <tmsriram@google.com>
13423
13424 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13425 kept comdat section was garbage collected.
13426 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13427 * testsuite/Makefile.in: Regenerate.
13428 * testsuite/gc_comdat_test.sh: New file.
13429 * testsuite/gc_comdat_test_1.cc: New file.
13430 * testsuite/gc_comdat_test_2.cc: New file.
13431
65514900
CC
134322009-05-19 Doug Kwan <dougkwan@google.com>
13433
13434 * archive.cc (Archive::Archive): Move constructor from archive.h
13435 to here. Initialize no_export_.
13436 (Archive::get_elf_object_for_member): Set no_export flag of object.
13437 * archive.h (Archive::Archive): Move constructor body to
13438 archive.cc.
13439 (Archive::no_export): New method.
13440 (Archive::no_export_): New field.
13441 * object.h (Object::Object): Initialize no_export_ to false.
13442 (Object::no_export, Object::set_no_export): New methods.
13443 (Object::no_export_): New field.
13444 * options.cc (General_options::parse_exclude_libs): New method.
13445 (General_options::check_excluded_libs) Same.
13446 * options.h (exclude_libs): New option.
13447 (General_options::check_excluded_libs): New method declaration.
13448 (General_options::excluded_libs_): New field.
13449 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13450 default or protected visibility if an object has no-export flag set.
13451 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13452 (check_SCRIPTS): Add exclude_libs_test.sh.
13453 (check_DATA): Add exclude_libs_test.syms.
13454 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13455 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13456 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13457 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13458 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13459 libexclude_libs_test_2.a): New rules.
13460 * testsuite/Makefile.in: Regenerate.
13461 * testsuite/exclude_libs_test.c: New file.
13462 * testsuite/exclude_libs_test.sh: Ditto.
13463 * testsuite/exclude_libs_test_1.c: Ditto.
13464 * testsuite/exclude_libs_test_2.c: Ditto.
13465
1b77ea50
ILT
134662009-05-15 Ian Lance Taylor <iant@google.com>
13467
13468 * configure.ac: Check for declarations for cases where libiberty.h
13469 checks HAVE_DECL_xxx.
13470 * configure, config.in: Rebuild.
13471
072fe7ce
ILT
134722009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13473
13474 * gold.h (Incremental_argument_list): Remove (invalid) forward
13475 declaration.
13476 * incremental.cc (Incremental_inputs::report_achive): New method.
13477 (Incremental_inputs::report_object): New method.
13478 (Incremental_inputs::report_script): New method.
13479 (Incremental_inputs::finalize_inputs): New method.
13480 (Incremental_inputs::finalize): Call finalize_inputs().
13481 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13482 Create inputs entries.
13483 * incremental.h (Incremental_input_type): New enum.
13484 (Incremental_inputs::Incremental_input): Initialize new fields.
13485 (Incremental_inputs::report_inputs): New method.
13486 (Incremental_inputs::report_achive): New method.
13487 (Incremental_inputs::report_object): New method.
13488 (Incremental_inputs::report_script): New method.
13489 (Incremental_inputs::finalize_inputs): New method.
13490 (Incremental_inputs::Input_info): New struct.
13491 (Incremental_inputs::Input_info_map): New typedef.
13492 (Incremental_inputs::lock_): New field.
13493 (Incremental_inputs::Inputs_): New field.
13494 (Incremental_inputs::Inputs_map): New field.
13495 * main.cc (main): Call Incremental_input::report_inputs.
13496 * options.h (Input_argument_list): Typedef moved from
13497 Input_arguments.
13498 (Input_file_group::Files): Remove, use ::Input_argument_list.
13499 (Input_file_group::Input_argument_list): Remove, use
13500 ::Input_argument_list.
13501 * plugin.cc (Plugin_manager::add_input_file): Add error in
13502 incremental build.
13503 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13504 functions.
13505 * script.cc (read_input_script): Call
13506 Incremental_input::report_script.
13507 * script.h (Script_info): New class.
13508
b0481b0b
ILT
135092009-04-27 Ian Lance Taylor <iant@google.com>
13510
13511 * x86_64.cc (do_adjust_output_section): Set entsize to
13512 plt_entry_size.
13513
b22a5a41 135142009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13515
13516 * output.cc (Output_file::close): After short writes, continue
13517 writing from the correct offset in the buffer being written.
13518
40fde488
CD
135192009-04-23 Chris Demetriou <cgd@google.com>
13520
13521 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13522 * configure: Regenerate.
13523 * config.in: Regenerate.
13524 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13525 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13526
3ce2c28e
ILT
135272009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13528
13529 * incremental.cc (Incremental_inputs_header_data): Renamed from
13530 Incremental_input_header_data.
13531 (Incremental_inputs_header_data::data_size): New field.
13532 (Incremental_inputs_header_data::put_input_file_count): Renamed
13533 from input_file_count.
13534 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13535 from command_line_offset.
13536 (Incremental_inputs_header_data::put_reserved): Renamed from
13537 put_reserved.
13538 (Incremental_inputs_entry_data): Renamed from
13539 Incremental_input_entry_data.
13540 (Incremental_inputs_entry_data::data_size): New field.
13541 (Incremental_inputs::report_command_line): New method.
13542 (Incremental_inputs::finalize): New method.
13543 (Incremental_inputs::create_incremental_inputs_data): New method.
13544 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13545 * incremental.h: New file.
13546 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13547 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13548 incremental builds.
703d02da 13549 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13550 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13551 (Layout::create_incremental_info_sections): New method.
13552 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13553 * main.cc (main): Notify Incremental_input of the command line.
13554
e55bde5e
ILT
135552009-04-01 Ian Lance Taylor <iant@google.com>
13556 Mikolaj Zalewski <mikolajz@google.com>
13557
13558 * gold.h (reserve_unordered_map): Define, three versions, one for
13559 each version of Unordered_map.
13560 * layout.cc (Layout::Layout): Remove options parameter. Add
13561 number_of_input_files parameter. Don't initialize options_.
13562 Initialize number_of_input_files_ and resized_signatures_. Move
13563 sections_are_attached_.
13564 (Layout::layout_group): Reserve space for group_signatures_.
13565 (Layout::find_or_add_kept_section): Change name parameter to be a
13566 reference. Resize signatures_ map when it gets large enough.
13567 (Layout::layout_eh_frame): Use parameters->options() instead of
13568 this->options_.
13569 (Layout::make_output_section): Likewise.
13570 (Layout::attach_allocated_section_to_segment): Likewise.
13571 (Layout::finalize, Layout::create_executable_stack): Likewise.
13572 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13573 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13574 * layout.h (class Layout): Update declarations. Remove options_
13575 field. Add number_of_input_files_ and resized_signatures_
13576 fields. Move sections_are_attached_ field.
13577 * main.cc (main): Pass number of input files to Layout
13578 constructor. Don't pass options.
13579
154b857c
ILT
135802009-03-30 Ian Lance Taylor <iant@google.com>
13581
13582 * ffsll.c (ffsll): Correct implementation.
13583
2f35ab9b
ILT
135842009-03-27 Ian Lance Taylor <iant@google.com>
13585
fd03461a
ILT
13586 * ffsll.c: New file.
13587 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13588 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13589 * ftruncate.c (ftruncate): Declare before definition.
13590 * mremap.c (mremap): Likewise.
13591 * pread.c (pread): Likewise.
13592 * configure, Makefile.in, config.in: Rebuild.
13593
2f35ab9b
ILT
13594 * mremap.c: New file.
13595 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13596 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13597 (mremap): Declare if HAVE_MREMAP is not defined.
13598 * configure, Makefile.in, config.in: Rebuild.
13599
33aea2fd
CC
136002009-03-27 Cary Coutant <ccoutant@google.com>
13601
13602 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13603 position independent.
13604 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13605 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13606
6d479619
CC
136072009-03-24 Cary Coutant <ccoutant@google.com>
13608
13609 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13610 an executable.
13611 (needs_dynamic_reloc): Likewise.
13612
afc06bb8
ILT
136132009-03-24 Ian Lance Taylor <iant@google.com>
13614
13615 * yyscript.y (file_cmd): Recognize EXTERN.
13616 (extern_name_list, extern_name_list_body): New nonterminals.
13617 * script.cc (script_add_extern): Define.
13618 * script-c.h (script_add_extern): Declare.
13619
f6060a4d
ILT
136202009-03-24 Rafael Avila de Espindola <espindola@google.com>
13621
13622 * object.cc (is_elf_object): Define.
13623 * object.h (is_elf_object): Declare.
13624 * archive.cc (Archive::get_elf_object_for_member): Call
13625 is_elf_object.
33aea2fd 13626 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 13627
26736d8e
ILT
136282009-03-24 Elliott Hughes <enh@google.com>
13629
13630 * output.cc (Output_file::map_anonymous): Define.
13631 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13632 try an anonymous one. Report the size if the mmap fails.
13633 * output.h (class Output_file): Declare map_anonymous.
13634
22fd9730
ILT
136352009-03-24 Ian Lance Taylor <iant@google.com>
13636
13637 * target-select.cc (instantiate_target): Don't acquire the lock if
13638 the instantiated_target_ field has already been set.
13639
cb010894
ILT
136402009-03-23 Ian Lance Taylor <iant@google.com>
13641
7f055c20
ILT
13642 * gold-threads.h (class Initialize_lock): Define.
13643 * gold-threads.cc (class Initialize_lock_once): Define.
13644 (initialize_lock_control): New static variable.
13645 (initialize_lock_pointer): New static variable.
13646 (initialize_lock_once): New static function.
13647 (Initialize_lock::Initialize_lock): Define.
13648 (Initialize_lock::initialize): Define.
13649 * target-select.h: Include "gold-threads.h".
13650 (class Target_selector): Add lock_ and initialize_lock_ fields.
13651 Don't define instantiate_target, just declare it.
13652 * target-select.cc (Target_selector::Target_selector): Initialize
13653 new fields.
13654 (Target_selector::instantiate_target): Define.
13655 * descriptors.h: Include "gold-threads.h".
13656 (class Descriptors): Add initialize_lock_ field.
13657 * descriptors.cc (Descriptors::Descriptors): Initialize new
13658 field.
13659 (Descriptors::open): Use initialize_lock_ field
13660 * errors.h (class Errors): Add initialize_lock_ field.
13661 * errors.cc (Errors::Errors): Initialize new field.
13662 (Errors::initialize_lock): Use initialize_lock_ field.
13663 * powerpc.cc (class Target_selector_powerpc): Remove
13664 instantiated_target_ field. In do_recognize call
13665 instantiate_target rather than do_instantiate_target. In
13666 do_instantiate_target just allocate a new target.
13667 * sparc.cc (class Target_selector_sparc): Likewise.
13668
36959681
ILT
13669 * freebsd.h: New file.
13670 * i386.cc: Include "freebsd.h".
13671 (Target_i386): Derive from Target_freebsd rather than
13672 Sized_target.
13673 (Target_selector_i386): Derive from Target_selector_freebsd rather
13674 than Target_selector.
13675 * x86_64.cc: Include "freebsd.h".
13676 (Target_x86_64): Derive from Target_freebsd rather than
13677 Sized_target.
13678 (Target_selector_x86_64): Derive from Target_selector_freebsd
13679 rather than Target_selector.
13680 * target.h (class Target): Add adjust_elf_header and
13681 do_adjust_elf_header.
13682 * output.cc (Output_file_header:: do_sized_write): Call target
13683 adjust_elf_header routine.
13684 * configure.tgt: Set targ_osabi.
13685 * configure.ac: Define GOLD_DEFAULT_OSABI.
13686 * parameters.cc (Parameters::default_target): Pass
13687 GOLD_DEFAULT_OSABI to select_target.
13688 * target-select.h (class Target_selector): Make instantiate_target
13689 protected rather than private.
13690 * Makefile.am (HFILES): Add freebsd.h.
13691 * configure, Makefile.in, config.in: Rebuild.
13692
cb010894
ILT
13693 * merge.cc (do_add_input_section): Correct pend value. Change
13694 message about last entry not being null terminated from error to
13695 warning.
13696
0e879927
ILT
136972009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13698
13699 * incremental.cc: New file.
13700 * Makefile.am (CCFILES): Add incremental.cc.
13701 * Makefile.in: Rebuild.
13702
41105937
PP
137032009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13704
13705 * layout.cc (Layout::output_section_name): Preserve names
13706 of '.note.' sections.
e1df38aa 13707
60439920
ILT
137082009-03-19 Ian Lance Taylor <iant@google.com>
13709
13710 * descriptors.cc (Descriptors::open): Check that the options are
13711 valid before using them.
13712
0d371ad3
ILT
137132009-03-18 Ian Lance Taylor <iant@google.com>
13714
13715 * script-sections.h: Include <list>.
13716 (class Script_sections): Change Sections_elements from std::vector
13717 to std::list. Typedef public Elements_iterator. Add
13718 orphan_section_placement_, data_segment_align_start_, and
13719 saw_data_segment_align_ fields. Remove data_segment_align_index_
13720 field.
13721 * script-sections.cc (class Orphan_section_placement): New class.
13722 (class Sections_element): Add virtual functions is_relro and
13723 orphan_section_init. Remove virtual function place_orphan_here.
13724 (class Output_section_definition): Add is_relro and
13725 orphan_section_init. Remove place_orphan_here.
13726 (class Orphan_output_section): Likewise.
13727 (Script_sections::Script_sections): Update for field changes.
13728 (Script_sections::data_segment_align): Set saw_data_segment_align_
13729 and data_segment_align_start_, not data_segment_align_index.
13730 (Script_sections::data_segment_relro_end): Check
13731 saw_data_segment_align_. Use data_segment_align_start_ rather
13732 than data_segment_align_index_.
13733 (Script_sections::place_orphan): Rewrite to use
13734 Orphan_section_placement.
13735
9201d894
ILT
137362009-03-17 Ian Lance Taylor <iant@google.com>
13737
9c5b8369
ILT
13738 * archive.cc (Archive::add_symbols): Check for a version attached
13739 to the symbol name in the archive map.
13740 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13741 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13742 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13743 (ver_test_11.a): New target.
13744 * testsuite/Makefile.in: Rebuild.
13745
9201d894
ILT
13746 * configure.ac: Check for chsize and posix_fallocate. Replace
13747 ftruncate.
13748 * ftruncate.c: New file, from gnulib.
13749 * output.cc (posix_fallocate): Define dummy version if not
13750 HAVE_POSIX_FALLOCATE.
13751 (Output_file::map): Call posix_fallocate rather than lseek and
13752 write.
13753 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13754 * configure, Makefile.in, config.in: Rebuild.
13755
ef4ab7a8 137562009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 13757
ef4ab7a8
PP
13758 * layout.h (Layout::create_note): Add section_name parameter.
13759 * layout.cc (Layout::create_note): Likewise.
13760 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 13761
8c500701
ILT
137622009-03-17 Ian Lance Taylor <iant@google.com>
13763
e85b18e1
ILT
13764 * descriptors.cc: Include "options.h".
13765 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13766 (Descriptors::open): Always use O_CLOEXEC when opening a new
13767 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13768 then set FD_CLOEXEC.
13769
9efe6174
ILT
13770 * sparc.cc (class Target_sparc): Add has_got_section.
13771 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13772 make sure we have a GOT section.
13773
13774 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13775 (Target_sparc::Scan::local): Likewise.
13776 (Target_sparc::Scan::global): Likewise.
13777 (Target_sparc::Relocate::relocate): Likewise.
13778 (Target_sparc::Relocate::relocate_tls): Likewise.
13779
8c500701
ILT
13780 * symtab.cc (Symbol_table::define_default_version): New function,
13781 broken out of add_from_object.
13782 (Symbol_table::add_from_object): Call define_default_version.
13783 (Symbol_table::define_special_symbol): Add resolve_oldsym
13784 parameter. Change all callers. If the version for a symbol comes
13785 from a version script, resolve it with the symbol with the same
13786 name with no version. Also add the symbol without a version if
13787 appropriate.
13788 (do_define_in_output_data): If resolving with oldsym, don't delete
13789 sym.
13790 (do_define_in_output_segment): Likewise.
13791 (do_define_as_constant): Likewise.
13792 * symtab.h (class Symbol_table): Update declarations.
13793
f1ed28fb
ILT
137942009-03-13 Ian Lance Taylor <iant@google.com>
13795
15f8229b
ILT
13796 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13797 (Read_symbols::requeue): New function.
13798 (Read_symbols::do_read_symbols): If make_elf_object fails because
13799 the target type is not configured, and the file was searched for,
13800 issue a warning and retry with the next directory.
13801 (Add_symbols::run): If the file has an incompatible format, and
13802 it was searched for, requeue the Read_symbols task. On error,
13803 release the object.
13804 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13805 dirindex parameter to constructor. Change all callers. Declare
13806 incompatible_warning and requeue.
13807 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13808 input_argument_ and input_group_ fields. Add them to
13809 constructor. Change all callers.
13810 (class Read_script): Add dirindex_ field. Add it to constructor.
13811 Change all callers.
13812 * archive.cc (Archive::setup): Remove input_objects parameter.
13813 Change all callers.
13814 (Archive::get_file_and_offset): Likewise.
13815 (Archive::read_all_symbols): Likewise.
13816 (Archive::read_symbols): Likewise.
13817 (Archive::get_elf_object_for_member): Remove input_objects
13818 parameter. Add punconfigured parameter. Change all callers.
13819 (Archive::add_symbols): Change return type to bool. Check return
13820 value of include_member.
13821 (Archive::include_all_members): Likewise.
13822 (Archive::include_member): Change return type to bool. Return
13823 false if first included object has incompatible target. Set
13824 included_member_ field.
13825 (Add_archive_symbols::run): If add_symbols returns false, requeue
13826 Read_symbols task.
13827 * archive.h (class Archive): Add included_member_ field.
13828 Initialize it in constructor. Add input_file and searched_for
13829 methods. Update declarations.
13830 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13831 input_argument_ fields. Add them to constructor. Change all
13832 callers.
13833 * script.cc: Include "target-select.h".
13834 (class Parser_closure): Add skip_on_incompatible_target_ and
13835 found_incompatible_target_ fields. Add
13836 skip_on_incompatible_target parameter to constructor. Change all
13837 callers. Add methods skip_on_incompatible_target,
13838 clear_skip_on_incompatible_target, found_incompatible_target, and
13839 set_found_incompatible_target.
13840 (read_input_script): Add dirindex parameter. Change all callers.
13841 If parser finds an incompatible target, requeue Read_symbols
13842 task.
13843 (script_set_symbol): Clear skip_on_incompatible_target in
13844 closure.
13845 (script_add_assertion, script_parse_option): Likewise.
13846 (script_start_sections, script_add_phdr): Likewise.
13847 (script_check_output_format): New function.
13848 * script.h (read_input_script): Update declaration.
13849 * script-c.h (script_check_output_format): Declare.
13850 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13851 (ignore_cmd): Remove OUTPUT_FORMAT.
13852 * fileread.cc (Input_file::Input_file): Add explicit this.
13853 (Input_file::will_search_for): New function.
13854 (Input_file::open): Add pindex parameter. Change all callers.
13855 * fileread.h (class Input_file): Add input_file_argument method.
13856 Declare will_search_for. Update declarations.
13857 * object.cc (make_elf_object): Add punconfigured parameter.
13858 Change all callers.
13859 * object.h (class Object): Make input_file public. Add
13860 searched_for method.
13861 (make_elf_object): Update declaration.
13862 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13863 restart search.
13864 * dirsearch.h (class Dirsearch): Update declaration.
13865 * options.h (class General_options): Add --warn-search-mismatch.
13866 * parameters.cc (Parameters::is_compatible_target): New function.
13867 * parameters.h (class Parameters): Declare is_compatible_target.
13868 * workqueue.cc (Workqueue::add_blocker): New function.
13869 * workqueue.h (class Workqueue): Declare add_blocker.
13870
f1ed28fb
ILT
13871 * fileread.cc (Input_file::open): Remove options parameter.
13872 Change all callers.
13873 (Input_file::open_binary): Likewise.
13874 * script.cc (read_input_script): Likewise.
13875 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13876 options parameter from constructor. Change all callers.
13877 (class Read_script): Likewise.
13878 * fileread.h (class Input_file): Update declarations.
13879 * script.h (read_input_script): Update declaration.
13880
34dd024a
NC
138812009-03-10 Nick Clifton <nickc@redhat.com>
13882
13883 * po/es.po: New Spanish translation.
13884
6d71b17c
CC
138852009-03-06 Cary Coutant <ccoutant@google.com>
13886
13887 * options.cc (parse_short_option): Keep dash_z from registering itself.
13888
031cdbed
ILT
138892009-03-03 Ian Lance Taylor <iant@google.com>
13890
13891 PR 9918
13892 * target-reloc.h (relocate_section): Pass output_section to
13893 relocate.
13894 * i386.cc (Target_i386::should_apply_static_reloc): Add
13895 output_section parameter. Change all callers.
13896 (Target_i386::Relocate::relocate): Add output_section parameter.
13897 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13898 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13899 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13900 * testsuite/two_file_shared.sh: New script.
13901 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13902 (check_DATA): Add two_file_shared.dbg.
13903 (two_file_shared.dbg): New target.
13904 * testsuite/Makefile.in: Rebuild.
13905
15d5fa16
ILT
139062009-03-01 Ian Lance Taylor <iant@google.com>
13907
13908 * configure.ac: Check for byteswap.h.
13909 * configure: Rebuild.
13910 * config.in: Rebuild.
13911
8a4c0b0d
ILT
139122009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13913
13914 * layout.cc (Layout::find_or_add_kept_section): New function.
13915 (Layout::add_comdat): Removed.
13916 * layout.h (struct Kept_section): Move out of class Layout.
13917 Remove trailing underscores from field names. Add group_sections
13918 field. Rename group_ field to is_group. Change all uses.
13919 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13920 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13921 comdat_groups_ field.
13922 (Sized_relobj::include_section_group): Use
13923 find_or_add_kept_section and Kept_section::group_sections.
13924 (Sized_relobj::include_linkonce_section): Likewise.
13925 * object.cc (class Sized_relobj): Don't define Comdat_group or
13926 Comdat_group_table. Remove find_comdat_group and
13927 add_comdat_group. Remove comdat_groups_ field.
13928 * plugin.cc (include_comdat_group): Use
13929 Layout::find_or_add_kept_section.
13930
b4ecf66b
ILT
139312009-02-28 Ian Lance Taylor <iant@google.com>
13932
14359ca0
ILT
13933 * README: --gc-sections and map files are now supported. Document
13934 some build requirements.
13935
b4ecf66b
ILT
13936 PR 6992
13937 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13938 relocatable link set the value of the section symbol to zero.
13939 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13940 relocatable link don't include the section address in the local
13941 symbol value.
13942
0602e05a
ILT
139432009-02-27 Ian Lance Taylor <iant@google.com>
13944
fd9d194f
ILT
13945 PR 6811
13946 * options.h (class Search_directory): Add is_system_directory.
13947 (class General_options): Declare is_in_system_directory.
13948 * options.cc (get_relative_sysroot): Make static.
13949 (get_default_sysroot): Make static.
13950 (General_optoins::is_in_system_directory): New function.
13951 * fileread.cc (Input_file::is_in_system_directory): New function.
13952 * fileread.h (class Input_file): Declare is_in_system_directory.
13953 * object.h (class Object): Add is_in_system_directory.
13954 (class Input_objects): Remove system_library_directory_ field.
13955 * object.cc (Input_objects::add_object): Don't set
13956 system_library_directory_.
13957 (input_objects::found_in_system_library_directory): Remove.
13958 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13959 parameter. Change all callers.
13960 (Symbol_table::sized_write_globals): Likewise.
13961 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13962 Call Object::is_in_system_directory.
13963 * symtab.h (class Symbol_table): Update declarations.
13964
61edd21f
ILT
13965 PR 5990
13966 * descriptors.h (Open_descriptor): Add is_on_stack field.
13967 * descriptors.cc (Descriptors::open): If the descriptor is on the
13968 top of the stack, remove it. Initialize is_on_stack field.
13969 (Descriptors::release): Only add pod to stack if it is not on the
13970 stack already.
13971 (Descriptors::close_some_descriptor): Clear stack_next and
13972 is_on_stack fields.
13973
e29e076a
ILT
13974 PR 7091
13975 * output.cc (Output_section::find_starting_output_address): Rename
13976 from starting_output_address; add PADDR parameter; change return
13977 type.
13978 * output.h (class Output_section): Declare
13979 find_starting_output_address instead of starting_output_address.
13980 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13981 section symbol for which we can't find a merge section.
13982
0602e05a
ILT
13983 PR 9836
13984 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13985 hidden or internal, force the symbol to be local.
13986 * resolve.cc (Symbol::override_visibility): Define.
13987 (Symbol::override_base): Use override_visibility.
13988 (Symbol_table::resolve): Likewise.
13989 (Symbol::override_base_with_special): Likewise.
13990 (Symbol_table::override_with_special): If the visibility is hidden
13991 or internal, force the symbol to be local.
13992 * symtab.h (class Symbol): Add set_visibility and
13993 override_visibility.
13994 * testsuite/ver_test_1.sh: New file.
13995 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13996 (check_DATA): Add ver_test_1.syms.
13997 (ver_test_1.syms): New target.
13998 * testsuite/Makefile.in: Rebuild.
13999
401a9a73
CC
140002009-02-25 Cary Coutant <ccoutant@google.com>
14001
14002 * layout.cc (Layout::choose_output_section): Don't rename sections
14003 when using a linker script that has a SECTIONS clause.
14004 * Makefile.in: Regenerate.
14005
14006 * testsuite/Makefile.am (script_test_5.sh): New test case.
14007 * testsuite/Makefile.in: Regenerate.
14008 * testsuite/script_test_5.cc: New file.
14009 * testsuite/script_test_5.sh: New file.
14010 * testsuite/script_test_5.t: New file.
14011
f488e4b0
CC
140122009-02-13 Rafael Avila de Espindola <espindola@google.com>
14013
14014 * archive.cc (Archive::include_member): Update calls to add_symbols.
14015 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14016 the Layout argument.
14017 * dynobj.h (do_add_symbols): Add the Layout argument.
14018 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14019 Layout argument.
14020 * object.h (Object::add_symbols): Add the Layout argument.
14021 (Object::do_add_symbols): Add the Layout argument.
14022 (Sized_relobj::do_add_symbols): Add the Layout argument.
14023 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14024 Unify the two versions.
14025 (Add_plugin_symbols): Remove.
14026 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14027 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14028 (Add_plugin_symbols): Remove.
14029 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14030 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14031 (Add_symbols::run): Make it work with Pulginobj.
14032
89dd1680
ILT
140332009-02-06 Ian Lance Taylor <iant@google.com>
14034
14035 * object.cc (Sized_relobj::do_layout): Make info message start
14036 with lower case letter.
14037
266d0a74
ILT
140382009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14039
602b464e
ILT
14040 * binary.cc: Fix file comment.
14041
266d0a74
ILT
14042 * options.h (enum Incremental_disposition): Define.
14043 (class General_options): Add new options: --incremental,
14044 --incremental_changed, --incremental_unchanged,
14045 --incremental_unknown. Add incremental_disposition_ and
14046 implicit_incremental_ fields.
14047 (General_options::incremental_disposition): New function.
14048 (class Position_dependent_options): Add incremental_disposition
14049 option.
14050 (Position_dependent_options::copy_from_options): Set incremental
14051 dispositions.
14052 * options.cc (General_options::parse_incremental_changed): New
14053 function.
2e702c99
RM
14054 (General_options::parse_incremental_unchanged): New function.
14055 (General_options::parse_incremental_unknown): New function.
14056 (General_options::General_options): Initialize new fields
266d0a74 14057 incremental_disposition_ and implicit_incremental_.
2e702c99 14058 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
14059 without --incremental.
14060
f073bbf7
CD
140612009-02-06 Chris Demetriou <cgd@google.com>
14062
14063 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14064 pointer and to report location as the file name associated with
14065 the symbol.
14066 (gold_undefined_symbol_at_location): New function to replace the
14067 old gold_undefined_symbol functionality.
14068 * target-reloc.h (relocate_section): Update to use
14069 gold_undefined_symbol_at_location.
14070 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14071 Call gold_undefined_symbol function rather than gold_error.
14072 * errors.h (Errors::undefined_symbol): Take location as a
14073 string, rather than calculating it from a relocation.
14074 * errors.cc (Errors::fatal): Print "fatal error:" before the
14075 formatted message.
14076 (Errors::error, Errors::error_at_location): Print "error: "
14077 before the formatted message.
14078 (Errors::undefined_symbol): Take location as a string, rather
14079 than calculating it from a relocation.
14080 (gold_undefined_symbol_at_location): New function akin to
14081 old gold_undefined_symbol, calculates location from relocation.
14082 (gold_undefined_symbol): Change to take only a Symbol pointer
14083 and to report location as the file name associated with the symbol.
14084 * testsuite/debug_msg.sh: Update for changed error messages.
14085 * testsuite/undef_symbol.sh: Likewise.
14086
8e94a90c
ILT
140872009-02-04 Duncan Sands <baldrick@free.fr>
14088
14089 PR 9812
14090 * reduced_debug_output.h
14091 (Output_reduced_debug_abbrev_section::failed): Use format for
14092 gold_warning.
14093 (Output_reduced_debug_info_section::faild): Likewise.
14094
88a0e15b
ILT
140952009-01-31 Mikolaj Zalewski <mikolajz@google.com>
14096
14097 * script.cc (Lazy_demangler): New class.
2e702c99 14098 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
14099 symbol only once.
14100
5efc7cd2
CC
141012009-01-29 Cary Coutant <ccoutant@google.com>
14102
14103 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
14104 to __tls_get_addr.
14105 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14106
e0ebcf42
ILT
141072009-01-28 Ian Lance Taylor <iant@google.com>
14108
5efc7cd2 14109 * version.cc (version_string): Bump to 1.9.
75fe7426 14110
e0ebcf42
ILT
14111 * gold.h: Include <cstring> and <stdint.h>.
14112 * version.cc: Include <cstdio>.
14113 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
14114 warning.
14115 * reduced_debug_output.cc (insert_into_vector): Rename from
14116 Insert_into_vector; change all callers. Use Swap_unaligned to
14117 avoid aliasing issue; remove union since it is unnecessary.
14118
8e2813be 141192009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
14120
14121 * Makefile.am (CCFILES): Add gc.cc.
14122 (HFILES): Add gc.h.
14123 * Makefile.in: Regenerate.
14124 * gold.cc (Gc_runner): New class.
14125 (queue_initial_tasks): Call garbage collection related tasks
14126 when corresponding options are invoked.
14127 (queue_middle_gc_tasks): New function.
14128 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14129 processed early before laying out sections during garbage collection.
14130 * gold.h (queue_middle_gc_tasks): New function.
14131 (is_prefix_of): Move from "layout.cc".
14132 * i386.cc (Target_i386::gc_process_relocs): New function.
14133 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14134 * main.cc (main): Create object of class "Garbage_collection".
14135 * object.cc (Relobj::copy_symbols_data): New function.
14136 (Relobj::is_section_name_included): New function.
e1df38aa
NC
14137 (Sized_relobj::do_layout): Allow this function to be called twice
14138 during garbage collection and defer layout of section during the
6d03d481
ST
14139 first call.
14140 * object.h (Relobj::get_symbols_data): New function.
14141 (Relobj::is_section_name_included): New function.
14142 (Relobj::copy_symbols_data): New function.
14143 (Relobj::set_symbols_data): New function.
14144 (Relobj::get_relocs_data): New function.
14145 (Relobj::set_relocs_data): New function.
14146 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14147 (Relobj::gc_process_relocs): New function.
14148 (Relobj::do_gc_process_relocs): New pure virtual function.
14149 (Relobj::sd_): New data member.
14150 (Sized_relobj::is_output_section_offset_invalid): New function.
14151 (Sized_relobj::do_gc_process_relocs): New function.
14152 * options.h (General_options::gc_sections): Modify to not be a no-op.
14153 (General_options::print_gc_sections): New option.
14154 * plugin.cc (Plugin_finish::run): Remove function call to
14155 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14156 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14157 * reloc.cc (Read_relocs::run): Add task to process relocs and
14158 determine unreferenced sections when doing garbage collection.
14159 (Gc_process_relocs): New class.
14160 (Sized_relobj::do_gc_process_relocs): New function.
14161 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14162 sections that are garbage collected.
14163 * reloc.h (Gc_process_relocs): New class.
14164 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14165 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14166 symbols whose corresponding sections are garbage collected.
14167 (Symbol_table::Symbol_table): Add new parameter for the garbage
14168 collection object.
14169 (Symbol_table::gc_mark_undef_symbols): New function.
14170 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14171 (Symbol_table::gc_mark_dyn_syms): New function.
14172 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14173 as garbage.
14174 (Symbol_table::add_from_object): Likewise.
14175 (Symbol_table::add_from_relobj): When building shared objects, do not
14176 treat externally visible symbols as garbage.
14177 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14178 table information for static and relocatable links.
14179 * symtab.h (Symbol_table::set_gc): New function.
14180 (Symbol_table::gc): New function.
14181 (Symbol_table::gc_mark_undef_symbols): New function.
14182 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14183 (Symbol_table::gc_mark_dyn_syms): New function.
14184 (Symbol_table::gc_): New data member.
e1df38aa 14185 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
14186 function.
14187 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14188 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14189
3b293544
CF
141902009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14191
14192 * options.h (General_options::gc_sections): Define as a no-op for now.
14193 (General_options::no_keep_memory): Ditto.
14194 (General_options::Bshareable): Define.
14195 * options.cc (General_options::finalize): Honor -Bshareable.
14196
83d22aa8
AS
141972009-01-20 Andreas Schwab <schwab@suse.de>
14198
14199 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14200 read the value in the contents, since we don't use it. Use the
14201 template endianness when writing.
14202 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14203
cd536b21
AS
142042009-01-19 Andreas Schwab <schwab@suse.de>
14205
14206 * configure.tgt (powerpc64-*): Fix targ_obj.
14207
99e9a495
ILT
142082009-01-15 Ian Lance Taylor <iant@google.com>
14209
14210 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14211 local symbols when stripping all symbols.
14212
bbbfea06
CC
142132009-01-14 Cary Coutant <ccoutant@google.com>
14214
99e9a495 14215 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 14216
0f7c0701
CC
142172009-01-14 Cary Coutant <ccoutant@google.com>
14218
14219 * archive.cc (Archive::get_elf_object_for_member): Remove call
14220 to File_read::claim_for_plugin.
14221 * descriptors.cc (Descriptors::open): Remove reference to
14222 is_claimed.
14223 (Descriptors::claim_for_plugin): Remove.
14224 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14225 (Descriptors::is_claimed): Remove.
14226 (claim_descriptor_for_plugin): Remove.
14227 * fileread.cc (File_read::claim_for_plugin): Remove.
14228 * fileread.h (File_read::claim_for_plugin): Remove.
14229 (File_read::descriptor): Reopen descriptor if necessary.
14230 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14231 (Plugin_manager::all_symbols_read): Add task parameter. Change
14232 all callers.
14233 (Plugin_manager::get_input_file): New function.
14234 (Plugin_manager::release_input_file): New function.
14235 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14236 corresponding data member.
14237 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14238 and pass to base constructor. Change all callers.
14239 (get_input_file, release_input_file): New functions.
14240 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14241 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14242 (Plugin_manager::all_symbols_read): Add task parameter.
14243 (Plugin_manager::get_input_file): New function.
14244 (Plugin_manager::release_input_file): New function.
14245 (Plugin_manager::task_): New data member.
14246 (Pluginobj::Pluginobj): Add filesize parameter.
14247 (Pluginobj::filename): New function.
14248 (Pluginobj::descriptor): New function.
14249 (Pluginobj::filesize): New function.
14250 (Pluginobj::filesize_): New data member.
14251 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14252 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14253 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14254
14255 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14256 with archive libraries.
14257 * testsuite/Makefile.in: Regenerate.
14258 * testsuite/plugin_test.c (struct sym_info): New type.
14259 (get_input_file, release_input_file): New static variables.
14260 (onload): Capture new transfer vector entries.
14261 (claim_file_hook): Stop reading at end of file according to filesize.
14262 Factor out parsing of readelf output into separate function.
14263 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14264 APIs and get the source file name from the symbol table. Convert
14265 source file name to corresponding object file name. Print info
14266 message when adding new input files.
14267 (parse_readelf_line): New function.
14268 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14269 * testsuite/plugin_test_2.sh: Likewise.
14270 * testsuite/plugin_test_3.sh: Likewise.
14271 * testsuite/plugin_test_4.sh: New test case.
14272
62a6d109
ILT
142732009-01-07 Ian Lance Taylor <iant@google.com>
14274
14275 * version.cc (version_string): Bump to 1.8.
14276
483620e8
CC
142772008-12-23 Cary Coutant <ccoutant@google.com>
14278
14279 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14280 * plugin.cc (Plugin_manager::finish): Rename as
14281 layout_deferred_objects. Move cleanup to separate function.
14282 (Plugin_manager::cleanup): New function.
14283 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14284 separately.
14285 * plugin.h (Plugin_manager::finish): Rename as
14286 layout_deferred_objects.
14287 (Plugin_manager::cleanup): New function.
14288 (Plugin_manager::cleanup_done): New field.
14289
d66a9eb3
CC
142902008-12-23 Cary Coutant <ccoutant@google.com>
14291
14292 * plugin.cc (is_visible_from_outside): New function.
14293 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14294 so we don't return "IR only" status for exported symbols or -r links.
14295
14296 * testsuite/Makefile.am (plugin_test_3): New test case.
14297 * testsuite/Makefile.in: Regenerate.
14298 * testsuite/plugin_test_3.sh: New file.
14299
5995b570
CC
143002008-12-22 Cary Coutant <ccoutant@google.com>
14301
14302 * object.cc (Sized_relobj::layout_section): New function.
14303 (Sized_relobj::do_layout): Defer layout of input sections until after
14304 plugin has provided replacement files.
14305 (Sized_relobj::do_layout_deferred_sections): New function.
14306 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14307 (Relobj::layout_deferred_sections): New function.
14308 (Relobj::do_layout_deferred_sections): New function.
14309 (Sized_relobj::do_layout_deferred_sections): New function.
14310 (Sized_relobj::layout_section): New function.
14311 (Sized_relobj::Deferred_layout): New structure.
14312 (Sized_relobj::deferred_layout_): New field.
14313 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14314 Change all callers. Layout deferred sections.
14315 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14316 references.
14317 (Plugin_hook::run): Move code from do_plugin_hook inline.
14318 (Plugin_hook::do_plugin_hook): Remove.
14319 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14320 (Plugin_manager::finish): Renamed, was cleanup.
14321 (Plugin_manager::should_defer_layout): New function.
14322 (Plugin_manager::add_deferred_layout_object): New function.
14323 (Plugin_manager::Deferred_layout_list): New type.
14324 (Plugin_manager::deferred_layout_objects_): New field.
14325 (Plugin_hook::do_plugin_hook): Remove.
14326
ee769c88
ILT
143272008-12-17 Ian Lance Taylor <iant@google.com>
14328
14329 * options.h (class General_options): Add --no case for
14330 --export-dynamic.
14331
abc8dcba
CC
143322008-12-16 Cary Coutant <ccoutant@google.com>
14333
14334 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14335 vector.
14336 (Plugin_manager::claim_file): Create plugin object even if
14337 plugin did not call the add_symbols callback.
14338 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14339 asking for more symbols than were added.
14340 * testsuite/Makefile.am (plugin_test_1): Add test case with
14341 no global symbols.
14342 (empty.syms): New target.
14343 * testsuite/Makefile.in: Regenerate.
14344 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14345 message. Don't call add_symbols if no globals.
14346 (all_symbols_read_hook): Don't provide replacement for empty
14347 claimed file.
14348
b0074644
ILT
143492008-12-12 Ian Lance Taylor <iant@google.com>
14350
68943102
ILT
14351 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14352 r_type == 0 for a local symbol with r_sym == 0.
14353 (scan_relocatable_relocs): Pass r_sym to
14354 local_non_section_strategy.
14355 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14356 r_sym parameter.
14357
b0074644
ILT
14358 * configure.ac: Update test for TLS descriptors: they are
14359 supported as of glibc 2.9.
14360 * configure: Rebuild.
14361
c2508178
ILT
143622008-12-11 Ian Lance Taylor <iant@google.com>
14363
14364 PR 7091
14365 * target-reloc.h (Default_scan_relocatable_relocs): For each
14366 function, map r_type == 0 to RELOC_DISCARD.
14367
2756a258
CC
143682008-12-10 Cary Coutant <ccoutant@google.com>
14369
14370 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14371 object to override a kept COMDAT group from a plugin object.
14372
bb6f53d3
ILT
143732008-12-09 Ian Lance Taylor <iant@google.com>
14374
fbc558e1
ILT
14375 PR 7088
14376 * yyscript.y (file_cmd): Handle INPUT.
14377
bb6f53d3
ILT
14378 * testsuite/initpri1.c: Change all declarations to be full
14379 prototypes by adding void, to avoid compiler warnings.
14380
4674ecfc
CC
143812008-12-05 Rafael Avila de Espindola <espindola@google.com>
14382
14383 * options.cc (General_options::parse_plugin_opt): New.
14384 (General_options::add_plugin): The argument now is just the filename.
14385 (General_options::add_plugin_option): New.
14386 * options.h (plugin_opt): New.
14387 (add_plugin): Change argument name.
14388 (add_plugin_option): New.
14389 * plugin.cc (Plugin::load): Don't parse the plugin option.
14390 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14391 (Plugin::add_option): New.
14392 (Plugin::args_): Change type.
14393 (Plugin::filename_): New.
14394 (Plugin_manager::add_plugin_option): New.
14395 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14396 * testsuite/Makefile.in: Regenerate.
14397
fd06b4aa
CC
143982008-12-05 Cary Coutant <ccoutant@google.com>
14399
14400 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14401 Handle --strip-lto-sections option.
14402 * options.h (strip_lto_sections): New option.
14403
6c52134c
CC
144042008-12-01 Cary Coutant <ccoutant@google.com>
14405
14406 * plugin.cc (ld_plugin_message): Change format parameter to const.
14407 Fix mismatch between new[] and delete.
14408
a45248e0
CC
144092008-11-14 Cary Coutant <ccoutant@google.com>
14410
14411 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14412 instead of -1U.
14413
c82fbeee
CS
144142008-11-05 Craig Silverstein <csilvers@google.com>
14415
14416 * options.cc (General_options::parse_dynamic_list): New function.
14417 * options.h (General_options): New flags dynamic_list,
14418 dynamic_list_data, dynamic_list_cpp_new, and
14419 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14420 (General_options::in_dynamic_list): New function.
14421 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14422 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14423 (Lex::can_continue_name): Likewise.
14424 (yylex): Likewise.
14425 (read_script_file): New parameter script_options.
14426 (read_dynamic_list): New function.
14427 (Script_options::define_dynamic_list): New function.
14428 (dynamic_list_keyword_parsecodes): New variable.
14429 (dynamic_list_keywords): New variable.
14430 * script.h (Script_options::define_dynamic_list): New function
14431 prototype.
14432 (read_dynamic_list): New function prototype.
14433 * symtab.cc (strprefix): New macro.
14434 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14435 dynamic_list_data, dynamic_list_cpp_new, and
14436 dynamic_list_cpp_typeinfo.
14437 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14438 (dynamic_list_expr): New rule.
14439 (dynamic_list_nodes): Likewise.
14440 (dynamic_list_node): Likewise.
14441 * testsuite/Makefile.am (dynamic_list): New test.
14442 * testsuite/Makefile.in: Regenerated.
14443 * testsuite/dynamic_list.t: New file.
14444 * testsuite/dynamic_list.sh: New file.
14445
e0bb29a5
CS
144462008-11-05 Craig Silverstein <csilvers@google.com>
14447
14448 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14449 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14450 (t11_last): Likewise.
14451 * testsuite/ver_test_6.c (main): Likewise.
14452
4e1e25e0
CC
144532008-10-07 Cary Coutant <ccoutant@google.com>
14454
14455 * options.c (General_options::finalize): Add check for -static and
14456 -shared.
14457 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14458 is not empty.
14459
92f03fcb
CC
144602008-10-02 Cary Coutant <ccoutant@google.com>
14461
14462 * plugin.cc (make_sized_plugin_object): Fix conditional
14463 compilation to work when not all targets are enabled.
14464
fbd8a257
CC
144652008-09-29 Cary Coutant <ccoutant@google.com>
14466
14467 * archive.cc (Archive::get_file_and_offset): Use filename instead
14468 of name to get library path.
14469 (Archive::include_member): Unlock external member of a thin archive.
14470
14471 * testsuite/Makefile.am (TEST_AR): New variable.
14472 (thin_archive_test_1): New test.
14473 (thin_archive_test_2): New test.
81636b3f
CC
14474 * testsuite/Makefile.in: Regenerate.
14475 * testsuite/thin_archive_main.cc: New file.
14476 * testsuite/thin_archive_test_1.cc: New file.
14477 * testsuite/thin_archive_test_2.cc: New file.
14478 * testsuite/thin_archive_test_3.cc: New file.
14479 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14480
eff45813
CC
144812008-09-29 Cary Coutant <ccoutant@google.com>
14482
14483 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14484 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14485 instead of -1U.
14486 (Sized_relobj::do_finalize_local_symbols): Likewise.
14487 (Sized_relobj::map_to_kept_section): Likewise.
14488 * object.h (Sized_relobj::invalid_address): New constant.
14489 (Sized_relobj::do_output_section_offset): Check for invalid_address
14490 and return -1ULL.
14491 * output.cc (Output_reloc::local_section_offset): Use constant
14492 invalid_address instead of -1U.
14493 (Output_reloc::get_address): Likewise.
14494 (Output_section::output_address): Change -1U to -1ULL.
14495 * output.h (Output_reloc::invalid_address): New constant.
14496 * reloc.cc (Sized_relobj::write_sections): Use constant
14497 invalid_address instead of -1U.
14498 (Sized_relobj::relocate_sections): Likewise.
14499 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14500 values for merge sections.
14501 * target-reloc.h (relocate_for_relocatable): Use constant
14502 invalid_address instead of -1U.
14503
89fc3421
CC
145042008-09-19 Cary Coutant <ccoutant@google.com>
14505
14506 Add plugin functionality for link-time optimization (LTO).
14507 * configure.ac (plugins): Add --enable-plugins option.
14508 * configure: Regenerate.
14509 * config.in: Regenerate.
14510 * Makefile.am (LIBDL): New variable.
14511 (CCFILES): Add plugin.cc.
14512 (HFILES): Add plugin.h.
14513 (ldadd_var): Add LIBDL.
14514 * Makefile.in: Regenerate.
14515
14516 * archive.cc: Include "plugin.h".
14517 (Archive::setup): Don't preread archive symbols when using a plugin.
14518 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14519 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14520 files.
14521 (Archive::include_member): Add symbols from plugin objects.
14522 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14523 * descriptors.cc (Descriptors::open): Check for file descriptors
14524 abandoned by plugins.
14525 (Descriptors::claim_for_plugin): New function.
14526 * descriptors.h (Descriptors::claim_for_plugin): New function.
14527 (Open_descriptor::is_claimed): New field.
14528 (claim_descriptor_for_plugin): New function.
14529 * fileread.cc (File_read::claim_for_plugin): New function.
14530 * fileread.h (File_read::claim_for_plugin): New function.
14531 (File_read::descriptor): New function.
14532 * gold.cc: Include "plugin.h".
14533 (queue_initial_tasks): Add task to call plugin hooks for generating
14534 new object files.
14535 * main.cc: Include "plugin.h".
14536 (main): Load plugin libraries.
14537 * object.h (Pluginobj): Declare.
14538 (Object::pluginobj): New function.
14539 (Object::do_pluginobj): New function.
14540 (Object::set_target): New function.
14541 * options.cc: Include "plugin.h".
14542 (General_options::parse_plugin): New function.
14543 (General_options::General_options): Initialize plugins_ field.
14544 (General_options::add_plugin): New function.
14545 * options.h (Plugin_manager): Declare.
14546 (General_options): Add --plugin option.
14547 (General_options::has_plugins): New function.
14548 (General_options::plugins): New function.
14549 (General_options::add_plugin): New function.
14550 (General_options::plugins_): New field.
14551 * plugin.cc: New file.
14552 * plugin.h: New file.
14553 * readsyms.cc: Include "plugin.h".
14554 (Read_symbols::do_read_symbols): Check for archive before checking
14555 for ELF file. Call plugin hooks to claim files.
14556 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14557 from a real object file; force override when processing replacement
14558 files.
14559 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14560 (Symbol::init_base_object): Likewise.
14561 (Symbol::init_base_output_data): Likewise.
14562 (Symbol::init_base_output_segment): Likewise.
14563 (Symbol::init_base_constant): Likewise.
14564 (Symbol::init_base_undefined): Likewise.
14565 (Symbol::output_section): Assert that object is not a plugin.
14566 (Symbol_table::add_from_pluginobj): New function.
14567 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14568 undefined.
14569 (Symbol_table::sized_write_globals): Likewise.
14570 (Symbol_table::add_from_pluginobj): Instantiate template.
14571 * symtab.h (Sized_pluginobj): Declare.
14572 (Symbol::in_real_elf): New function.
14573 (Symbol::set_in_real_elf): New function.
14574 (Symbol::in_real_elf_): New field.
14575 (Symbol_table::add_from_pluginobj): New function.
14576
14577 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14578 (LIBDL): New variable.
14579 (LDADD): Add LIBDL.
14580 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14581 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14582 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14583 (MOSTLYCLEANFILES): Likewise.
14584 * testsuite/Makefile.in: Regenerate.
14585 * testsuite/plugin_test.c: New file.
14586 * testsuite/plugin_test_1.sh: New file.
14587 * testsuite/plugin_test_2.sh: New file.
14588
de31bda5
ILT
145892008-09-16 Ian Lance Taylor <iant@google.com>
14590
9c2d0ef9
ILT
14591 * target-reloc.h (relocate_section): Check whether a symbol is
14592 defined by the ABI before reporting an undefined symbol error.
14593 * target.h (Target::is_defined_by_abi): Make parameter const.
14594 (Target::do_is_defined_by_abi): Likewise.
14595 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14596 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14597 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14598 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14599 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14600 * testsuite/Makefile.in: Rebuild.
14601
de31bda5
ILT
14602 * fileread.cc (make_view): Add casts to avoid warning.
14603
9fa33bee
AO
146042008-09-16 Alexandre Oliva <aoliva@redhat.com>
14605
14606 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14607 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14608
183fd0e3
AO
146092008-09-16 Alexandre Oliva <aoliva@redhat.com>
14610
14611 * options.h (General_options::output_is_executable): New.
14612 (General_options::output_is_pie): New.
14613 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14614 for shared libraries.
14615 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14616
7be8330a
CD
146172008-09-11 Chris Demetriou <cgd@google.com>
14618
14619 * options.h (origin): New -z option.
14620 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14621 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14622 in DT_FLAGS_1.
14623
a9caad02
CC
146242008-09-05 Cary Coutant <ccoutant@google.com>
14625
14626 * fileread.cc (File_read::make_view): Add check for attempt to map
14627 beyond end of file.
14628
ae6dce4d
CC
146292008-09-05 Cary Coutant <ccoutant@google.com>
14630
14631 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14632 explicit instantiations.
14633
d7ab2a47
KVH
146342008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14635
14636 PR gold/6858
14637 * options.cc (General_options::finalize): Allow undefined symbols
14638 in shlibs if linking -shared.
14639
14640 PR gold/6859
14641 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14642 symbols as not needing a dynsym entry.
14643
1e52a9c1
CS
146442008-08-20 Craig Silverstein <csilvers@google.com>
14645
14646 * fileread.cc (File_read::open): Do not lock the file unless it
14647 was successfully opened.
14648
d85c80a3
CC
146492008-08-14 Cary Coutant <ccoutant@google.com>
14650
14651 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14652 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14653 * testsuite/tls_test.cc (struct int128): 128-bit struct
14654 for testing TLS relocs with non-zero addend.
14655 (v12): New TLS variable.
14656 (t12): New test.
14657 (t_last): Add check for v12.
14658 * testsuite/tls_test.h (t12): New function.
14659 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14660
2d924fd9
ILT
146612008-08-13 Ian Lance Taylor <iant@google.com>
14662
14663 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14664 set tls_segment_ or relro_segment_.
14665 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14666 when appropriate.
14667 * output.h (Output_section::clear_is_relro): New function.
14668 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14669 sections specially even when output_data_ is empty.
14670 (Output_segment::maximum_alignment): When first section is relro,
14671 only force alignment for PT_LOAD segments.
14672 * script.cc (script_data_segment_align): New function.
14673 (script_data_segment_relro_end): New function.
14674 * script-c.h (script_data_segment_align): Declare.
14675 (script_data_segment_relro_end): Declare.
14676 * script-sections.h (class Script_sections): Declare
14677 data_segment_align and data_segment_relro_end. Add fields
14678 segment_align_index_ and saw_relro_end_.
14679 * script-sections.cc (class Sections_element): Add set_is_relro
14680 virtual function. Add new bool* parameter to place_orphan_here.
14681 Add get_output_section virtual function.
14682 (class Output_section_definition): Add set_is_relro. Add new
14683 bool* parameter to place_orphan_here. Add get_output_section.
14684 Add is_relro_ field.
14685 (Output_section_definition::Output_section_definition): Initialize
14686 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14687 and is_relro_ fields.
14688 (Output_section_definition::place_orphan_here): Add is_relro
14689 parameter.
14690 (Output_section_definition::set_section_addresses): Set relro for
14691 output section.
14692 (Output_section_definition::alternate_constraint): Likewise.
14693 (class Orphan_output_section): Add new bool* parameter to
14694 place_orphan_here. Add get_output_section.
14695 (Orphan_output_section::place_orphan_here): Add is_relro
14696 parameter.
14697 (Script_sections::Script_sections): Initialize
14698 data_segment_align_index_ and saw_relro_end_.
14699 (Script_sections::data_segment_align): New function.
14700 (Script_sections::data_segment_relro_end): New function.
14701 (Script_sections::place_orphan): Set or clear is_relro.
14702 (Script_sections::set_section_addresses): Force alignment of first
14703 TLS section.
14704 * yyscript.y (exp): Call script_data_segment_align and
14705 script_data_segment_relro_end.
14706 * testsuite/relro_script_test.t: New file.
14707 * testsuite/relro_test.cc (using_script): Declare.
14708 (t1, t2): Test using_script.
14709 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14710 (relro_script_test_SOURCES): Define.
14711 (relro_script_test_DEPENDENCIES): Define.
14712 (relro_script_test_LDFLAGS): Define.
14713 (relro_script_test_LDADD): Define.
14714 (relro_script_test.so): New target.
14715 * testsuite/Makefile.in: Rebuild.
14716
f827c9a9
CC
147172008-08-06 Cary Coutant <ccoutant@google.com>
14718
14719 * archive.cc (Archive::total_archives, Archive::total_members)
14720 (Archive::total_members_loaded): New variables.
14721 (Archive::setup): Add parameter. Add option to preread
14722 archive symbols.
14723 (Archive::read_armap): Add counter.
14724 (Archive::get_file_and_offset): New function.
14725 (Archive::get_elf_object_for_member): New function.
14726 (Archive::read_all_symbols): New function.
14727 (Archive::read_symbols): New function.
14728 (Archive::add_symbols): Add counters.
14729 (Archive::include_all_members): Use armap to find members if it's
14730 already built.
14731 (Archive::include_member): Skip reading symbols if already read.
14732 Factored code into Archive::get_file_and_offset and
14733 Archive::get_elf_object_for_member. Changed call to
14734 Mapfile::report_include_archive_member.
14735 (Archive::print_stats): New function.
14736 * archive.h: Declare Object and Read_symbols_data classes.
14737 (Archive::Archive): Add initializers for new members.
14738 (Archive::setup): Add parameter.
14739 (Archive::print_stats): New function.
14740 (Archive::total_archives, Archive::total_members)
14741 (Archive::total_members_loaded): New variables.
14742 (Archive::get_file_and_offset): New function.
14743 (Archive::get_elf_object_for_member): New function.
14744 (Archive::read_all_symbols): New function.
14745 (Archive::read_symbols): New function.
14746 (Archive::Archive_member): New class.
14747 (Archive::members_): New member.
14748 (Archive::num_members_): New member.
14749 * main.cc: Include archive.h.
14750 (main): Call Archive::print_stats.
14751 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14752 archive parameter; member_name is now the fully-decorated name.
14753 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14754 * options.h: (General_options): Add --preread-archive-symbols option.
14755 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14756 Archive::setup.
14757
de4c45bd
ILT
147582008-08-04 Ian Lance Taylor <iant@google.com>
14759
14760 * symtab.h (Symbol::use_plt_offset): New function.
14761 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14762 * powerpc.cc (Relocate::relocate): Likewise.
14763 * sparc.cc (Relocate::relocate): Likewise.
14764 * x86_64.cc (Relocate::relocate): Likewise.
14765 * testsuite/weak_plt.sh: New test.
14766 * testsuite/weak_plt_main.cc: New test.
14767 * testsuite/weak_plt_shared.cc: New test.
14768 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14769 (check_PROGRAMS): Add weak_plt.
14770 (check_DATA): Add weak_plt_shared.so.
14771 (weak_plt_main_pic.o, weak_plt): New targets.
14772 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14773 * testsuite/Makefile.in: Rebuild.
14774
14775 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14776 gcctestdir/ld.
14777 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14778 * testsuite/Makefile.in: Rebuild.
14779
323ee3f4
AM
147802008-08-04 Alan Modra <amodra@bigpond.net.au>
14781
14782 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14783 * Makefile.in: Regenerate.
14784 * po/POTFILES.in: Regenerate.
14785
7c07ecec
ILT
147862008-07-29 Ian Lance Taylor <iant@google.com>
14787
14788 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14789 symbols before other symbols.
14790 * testsuite/script_test_2.cc (test_addr): Declare.
14791 (test_addr_alias): Declare.
14792 (main): Check that test_addr and test_addr_alias have the right
cd536b21 14793 values.
7c07ecec
ILT
14794 * testsuite/script_test_2.t: Define test_addr_alias and
14795 test_addr.
14796
5778530e
ILT
147972008-07-24 Ian Lance Taylor <iant@google.com>
14798
2a00e4fb
ILT
14799 PR 5990
14800 * descriptors.cc: New file.
14801 * descriptors.h: New file.
14802 * gold-threads.h (class Hold_optional_lock): New class.
14803 * fileread.cc: Include "descriptors.h".
14804 (File_read::~File_read): Release descriptor rather than closing
14805 it.
14806 (File_read::open) [file]: Call open_descriptor rather than open.
14807 Set is_descriptor_opened_.
14808 (File_read::open) [memory]: Assert that descriptor is not open.
14809 (File_read::reopen_descriptor): New function.
14810 (File_read::release): Release descriptor.
14811 (File_read::do_read): Make non-const. Reopen descriptor.
14812 (File_read::read): Make non-const.
14813 (File_read::make_view): Reopen descriptor.
14814 (File_read::do_readv): Likewise.
14815 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14816 Update declarations.
14817 * layout.cc: Include "descriptors.h".
14818 (Layout::create_build_id): Use open_descriptor rather than open.
14819 * output.cc: Include "descriptors.h".
14820 (Output_file::open): Use open_descriptor rather than open.
14821 * archive.cc (Archive::const_iterator): Change Archive to be
14822 non-const.
14823 (Archive::begin, Archive::end): Make non-const.
14824 (Archive::count_members): Likewise.
14825 * archive.h (class Archive): Update declarations.
14826 * object.h (Object::read): Make non-const.
14827 * Makefile.am (CCFILES): Add descriptors.cc.
14828 (HFILES): Add descriptors.h.
14829 * Makefile.in: Rebuild.
14830
801647d1
ILT
14831 PR 6716
14832 * gold.h: Always include <clocale>. Add Solaris workarounds
14833 following code in binutils/sysdep.h.
14834
5edd166e
ILT
14835 PR 6048
14836 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14837 this->eh_frame_hdr_ is NULL before using it.
14838
c89ad728
ILT
14839 * dynobj.cc (Versions::Versions): Update comment.
14840
aa86f06b
ILT
14841 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14842 the base version name.
14843
5778530e
ILT
14844 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14845 array size plus one.
14846 (Stringpool_template::set_string_offsets): Subtract one from key
14847 before using it as an array index.
14848 (Stringpool_template::get_offset_with_length): Likewise.
14849 (Stringpool_template::write_to_buffer): Likewise.
14850 * stringpool.h (Stringpool_template::get_offset_from_key):
14851 Likewise.
14852
057ead22
ILT
148532008-07-23 Ian Lance Taylor <iant@google.com>
14854
7f649c59
ILT
14855 PR 6658
14856 * object.h (Merged_symbol_value::value): Do our best to handle a
14857 negative addend.
14858
057ead22
ILT
14859 PR 6647
14860 * script.cc (Version_script_info::get_versions): Don't add empty
14861 version tag to return value.
14862 (Version_script_info::get_symbol_version_helper): Change return
14863 type to bool. Add pversion parameter. Change all callers.
14864 (script_register_vers_node): Don't require a non-NULL tag.
14865 * script.h (class Version_script_info): Update declarations.
14866 (Version_script_info::get_symbol_version): Change return type to
14867 bool. Add version parameter. Change all callers.
14868 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14869 handling. Handle an empty version from a version script.
14870 (Symbol_table::define_special_symbol): Likewise.
14871 * testsuite/ver_test_10.script: New file.
14872 * testsuite/ver_test_10.sh: New file.
14873 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14874 (check_DATA): Add ver_test_10.syms.
14875 (ver_test_10.syms, ver_test_10.so): New target.
14876 * testsuite/Makefile.in: Rebuild.
14877
58e54ac2
CD
148782008-07-23 Simon Baldwin <simonb@google.com>
14879
14880 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14881 to zero for undefined symbols from dynamic libraries.
14882
95d14cd3
ILT
148832008-07-23 Ian Lance Taylor <iant@google.com>
14884
14885 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14886 Change all callers.
14887 * symtab.h (class Symbol_table): Update declaration.
14888 * testsuite/ver_test_9.cc: New file.
14889 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14890 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14891 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14892 (ver_test_9.so, ver_test_9.o): New targets.
14893 * testsuite/Makefile.in: Rebuild.
14894
92de84a6
ILT
148952008-07-22 Ian Lance Taylor <iant@google.com>
14896
34810851
ILT
14897 * options.h (class General_options): Define --check-sections.
14898 * layout.cc (Layout::set_segment_offsets): Handle
14899 --check-sections.
14900
af6156ef
ILT
14901 * options.h (class General_options): Define -n/--nmagic and
14902 -N/--omagic.
14903 * options.cc (General_options::finalize): For -n/--nmagic or
14904 -N/--omagic, set -static.
14905 * layout.cc (Layout::attach_allocated_section_to_segment): If
14906 -N/--omagic, don't put read-only and read-write sections in
14907 different segments.
14908 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14909 finding a read-only segment.
14910 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14911 don't set the minimum segment alignment to the common page size,
14912 and don't set the file offset to the address modulo the page size.
14913 * script-sections.cc (Script_sections::create_segments): If
14914 -n/--omagic, don't put read-only and read-write sections in
14915 different segments.
14916
92de84a6
ILT
14917 * cref.cc: New file.
14918 * cref.h: New file.
14919 * options.h (class General_options): Add --print-symbol-counts.
14920 * main.cc (main): Issue defined symbol report if requested.
14921 * archive.cc (Archive::interpret_header): Make into a const member
14922 function.
14923 (Archive::add_symbols): Call Input_objects::archive_start and
14924 archive_stop.
14925 (Archive::const_iterator): Define new class.
14926 (Archive::begin, Archive::end): New functions.
14927 (Archive::include_all_members): Rewrite to use iterator.
14928 (Archive::count_members): New function.
14929 * archive.h (class Archive): Update declarations.
14930 (Archive::filename): New function.
14931 * object.cc: Include "cref.h".
14932 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14933 (Sized_relobj::do_get_global_symbol_counts): New function.
14934 (Input_objects::add_object): Add object to cross-referencer.
14935 (Input_objects::archive_start): New function.
14936 (Input_objects::archive_stop): New function.
14937 (Input_objects::print_symbol_counts): New function.
14938 * object.h: Declare Cref and Archive.
14939 (Object::get_global_symbol_counts): New function.
14940 (Object::do_get_global_symbol_counts): New pure virtual function.
14941 (class Sized_relobj): Add defined_count_ field. Update
14942 declarations.
14943 (class Input_objects): Add cref_ field. Update constructor.
14944 Update declarations.
14945 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14946 defined_count_.
14947 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14948 symbol counts.
14949 (Sized_dynobj::do_get_global_symbol_counts): New function.
14950 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14951 defined_count_. Update declarations. Define Symbols typedef.
14952 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14953 parameter. Change all callers.
14954 (Symbol_table::add_from_dynobj): Add sympointers and defined
14955 parameters. Change all callers.
14956 * symtab.h (class Symbol_table): Update declarations.
14957 * Makefile.am (CCFILES): Add cref.cc.
14958 (HFILES): Add cref.h.
14959 * Makefile.in: Rebuild.
14960
3f7c5e1d
CD
149612008-07-22 Simon Baldwin <simonb@google.com>
14962
14963 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14964 to zero when writing undefined symbols.
14965
e0b64032
ILT
149662008-07-22 Ian Lance Taylor <iant@google.com>
14967
14968 * output.cc (Output_section::add_input_section): Don't try to
14969 merge empty merge sections.
14970
096b02cf
CS
149712008-07-21 Craig Silverstein <csilvers@google.com>
14972
14973 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14974 Include symbol version in error message.
cd536b21 14975
1d1f116d
CD
149762008-07-20 Chris Demetriou <cgd@google.com>
14977
cd536b21 14978 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
14979 (RANDOM_SEED_CFLAGS): New substituted variable.
14980 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14981 * configure: Rebuild.
14982 * Makefile.in: Likewise.
14983 * testsuite/Makefile.in: Likewise.
14984
a18f591e
ILT
149852008-07-18 Ian Lance Taylor <iant@google.com>
14986
14987 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14988 where we see NAME/NULL and NAME/VERSION as separate symbols.
14989 * testsuite/ver_test_main.cc (main): Call t4.
14990 (t4, t4_2a): Define.
14991 * testsuite/ver_test_2.cc (t4_2): Define.
14992 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14993 * testsuite/ver_test_4.cc (t4_2a): Define.
14994 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14995 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14996
c6e3f6ed
ILT
149972008-07-17 Ian Lance Taylor <iant@google.com>
14998
14999 * dynobj.cc (Versions::add_def): If we give an error about a
15000 missing version, go ahead and create the version anyhow.
15001
ef9beddf
ILT
150022008-07-10 Ian Lance Taylor <iant@google.com>
15003
15004 Handle output sections with more than 0x7fffffff bytes.
15005 * object.h (class Relobj): Change map_to_output_ to
15006 output_sections_, and just keep a section pointer. Change all
15007 uses. Move comdat group support to Sized_relobj.
15008 (Relobj::is_section_specially_mapped): Remove.
15009 (Relobj::output_section): Remove poff parameter. Change all
15010 callers.
15011 (Relobj::output_section_offset): New function.
15012 (Relobj::set_section_offset): Rewrite.
15013 (Relobj::map_to_output): Remove.
15014 (Relobj::output_sections): New function.
15015 (Relobj::do_output_section_offset): New pure virtual function.
15016 (Relobj::do_set_section_offset): Likewise.
15017 (class Sized_relobj): Add section_offsets_ field. Add comdat
15018 group support from Relobj. Update declarations.
15019 (Sized_relobj::get_output_section_offset): New function.
15020 (Sized_relobj::do_output_section_offset): New function.
15021 (Sized_relobj::do_set_section_offset): New function.
15022 * object.cc (Relobj::output_section_address): Remove.
15023 (Sized_relobj::Sized_relobj): Initialize new fields.
15024 (Sized_relobj::include_section_group): Cast find_kept_object to
15025 Sized_relobj.
15026 (Sized_relobj::include_linkonce_section): Likewise.
15027 (Sized_relobj::do_layout): Use separate arrays for output section
15028 and output offset.
15029 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15030 output_sections.
15031 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15032 output_sections and section_offsets.
15033 (Sized_relobj::write_local_symbols): Likewise.
15034 (map_to_kept_section): Compute output address directly.
15035 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15036 output_sections and section_offsets.
15037 (Sized_relobj::write_sections): Likewise.
15038 (Sized_relobj::relocate_sections): Likewise.
15039 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15040 * output.h (class Output_reloc): Update declarations. Change
15041 u2_.relobj to Sized_relobj*.
15042 (class Output_data_reloc): Change add functions to use
15043 Sized_relobj*.
15044 * output.cc (Output_reloc::Output_reloc): Change relobj to
15045 Sized_relobj*.
15046 (Output_reloc::local_section_offset): Change return type to
15047 Elf_Addr. Use get_output_section_offset.
15048 (Output_reloc::get_address): Likewise.
15049 (Output_section::is_input_address_mapped): Don't call
15050 is_section_specially_mapped.
15051 (Output_section::output_offset): Likewise.
15052 (Output_section::output_address): Likewise.
15053 (Output_section::starting_output_address): Likewise.
15054 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15055 parameter to Sized_relobj*.
15056 (Copy_relocs::need_copy_reloc): Likewise.
15057 (Copy_relocs::save): Likewise.
15058 * copy-relocs.h (class Copy_relocs): Update declarations.
15059 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15060 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15061 * target-reloc.h (relocate_for_relocatable): Change
15062 offset_in_output_section type to Elf_Addr. Change code that uses
15063 it as well.
15064 * layout.cc (Layout::layout): Always set *off.
15065 * mapfile.cc (Mapfile::print_input_section): Use
15066 output_section_offset.
15067 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15068 Sized_relobj*.
15069 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15070 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15071 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15072
5cb66f97
ILT
150732008-07-03 Ian Lance Taylor <iant@google.com>
15074
15075 * layout.cc (Layout::include_section): Do not discard unrecognized
15076 SHT_STRTAB sections.
15077
afe47622
CS
150782008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15079
15080 * script.cc (Lex::can_continue_name): Make '?' allowable in
15081 version-script names.
15082 * testsuite/version_script.map: Change glob pattern to use '?'
15083
5adf9721
ILT
150842008-06-30 Manish Singh <yosh@gimp.org>
15085
15086 PR 6585
15087 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
15088 Correct typo.
15089
e6fde208
ILT
150902008-06-30 Ian Lance Taylor <iant@google.com>
15091
15092 PR 6660
15093 PR 6682
15094 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
15095 versions]: Don't try to read the value in the contents, since we
15096 don't use it. Use the template endianness when writing.
15097
3f2e6a2d
CC
150982008-06-25 Cary Coutant <ccoutant@google.com>
15099
15100 * fileread.cc (File_read::make_view): Assert on zero-length view.
15101 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
15102 symbol table when there are no symbols to read.
15103
c43d3a48
CS
151042008-06-23 Craig Silverstein <csilvers@google.com>
15105
15106 * version.cc (version_string): Bump to 1.7
15107
5f494ea0
CS
151082008-06-18 Craig Silverstein <csilvers@google.com>
15109
15110 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
15111 constant 0xFFFF to type Valtype.
15112 (Powerpc_relocate_functions::rel16_ha): Likewise.
15113
c42e122e
ILT
151142008-06-17 Ian Lance Taylor <iant@google.com>
15115
f34787f8
ILT
15116 * output.h (Output_section::Input_section): Initialize p2align_ to
15117 zero for Output_section_data constructors.
15118 (Output_section::Input_section::addralign): If not an input
15119 section, return the alignment of the Output_section_data.
15120 * testsuite/copy_test.cc: New file.
15121 * testsuite/copy_test_1.cc: New file.
15122 * testsuite/copy_test_2.cc: New file.
15123 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15124 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15125 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15126 (copy_test_1_pic.o, copy_test_1.so): New targets.
15127 (copy_test_2_pic.o, copy_test_2.so): New targets.
15128 * testsuite/Makefile.in: Rebuild.
15129
c42e122e
ILT
15130 * script-sections.cc (Script_sections::place_orphan): Initialize
15131 local variable exact.
15132
ce3ac18a
DE
151332008-06-13 David Edelsohn <edelsohn@gnu.org>
15134
15135 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15136
42cacb20
DE
151372008-06-12 David Edelsohn <edelsohn@gnu.org>
15138 David S. Miller <davem@davemloft.net>
15139
15140 * powerpc.cc: New file.
15141 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15142 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15143 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15144 * Makefile.in: Rebuild.
15145
7b308235
ILT
151462008-06-09 Ian Lance Taylor <iant@google.com>
15147
15148 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15149 <exception>.
15150 (throwing, orig_terminate): New static variables.
15151 (terminate_handler): New static function.
15152 (t2): Set terminate handler.
15153
f0b886e3
ILT
151542008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15155
15156 PR 6584
cd536b21 15157 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
15158 alignment.
15159
3e90f135
CC
151602008-05-30 Cary Coutant <ccoutant@google.com>
15161
15162 * archive.cc (Archive::include_all_members) Correct to step
15163 over symbol table and extended name table in thin archives.
15164
e09ad04a
ILT
151652008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15166
15167 PR 6407
15168 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15169 calculation.
15170
62b01cb5
ILT
151712008-05-28 Caleb Howe <cshowe@google.com>
15172
15173 * reduced_debug_output.cc: New file.
15174 * reduced_debug_output.h: New file.
92de84a6 15175 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
15176 * options.cc (General_options::finalize): Add strip_debug_non_line
15177 to the strip heirarchy.
15178 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15179 fields.
15180 * layout.cc: Include "reduced_debug_output.h".
15181 (Layout::Layout): Initialize new fields.
15182 (line_only_debug_sections): New static array.
15183 (is_lines_only_debug_sections): New static inline function.
15184 (Layout::include_section): Handle --strip-debug-non-line.
15185 (Layout::make_output_section): If --strip-debug-non-line, build
15186 new output sections for .debug_abbrev and .debug_info.
15187 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15188 gold. Warn about possible overflow.
15189 (read_signed_LEB_128): Likewise.
15190 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15191 (read_signed_LEB_128): Declare.
15192 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15193 (HFILES): Add reduced_debug_output.h.
15194 * Makefile.in: Rebuild.
15195
7d9e3d98
ILT
151962008-05-21 Ian Lance Taylor <iant@google.com>
15197
15198 * mapfile.cc: New file.
15199 * mapfile.h: New file.
15200 * options.h (class General_options): Add -M/--print-map and -Map.
15201 * options.cc (General_options::finalize): Make -M equivalent to
15202 -Map -.
15203 * main.cc: Include <cstdio> and "mapfile.h".
15204 (main): Open mapfile if requested.
15205 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15206 constructor. Change caller.
15207 (queue_initial_tasks): Add mapfile parameter. Change caller.
15208 (queue_middle_tasks): Likewise.
15209 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15210 declarations.
15211 * archive.cc: Include "mapfile.h".
15212 (Archive::add_symbols): Add mapfile parameter. Change all
15213 callers. Pass mapfile, symbol, and reason to include_member.
15214 (Archive::include_all_members): Add mapfile parameter. Change all
15215 callers.
15216 (Archive::include_member): Add mapfile, sym, and why parameters.
15217 Change all callers. Report inclusion to map file.
15218 * archive.h: Include "fileread.h".
15219 (class Archive): Update declarations.
15220 (Archive::file): New const method.
15221 (class Add_archive_symbols): Add mapfile_ field. Update
15222 constructor. Change all callers.
15223 * readsyms.h (class Read_symbols): Likewise.
15224 (class Finish_group): Likewise.
15225 (class Read_script): Likewise.
15226 * common.cc: Include "mapfile.h".
15227 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15228 all callers.
15229 (Symbol_table::do_allocate_commons): Likewise.
15230 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15231 symbol allocation to mapfile.
15232 * common.h (class Allocate_commons_task): Add mapfile_ field.
15233 Update constructor. Change all callers.
15234 * symtab.h (class Symbol_table): Update declarations.
15235 * layout.cc: Include "mapfile.h".
15236 (Layout_task_runner::run): Print information to mapfile.
15237 (Layout::create_gold_note): Change Output_data_fixed_space to
15238 Output_data_zero_fill.
15239 (Layout::create_build_id): Likewise.
15240 (Layout::print_to_mapfile): New function.
15241 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15242 constructor. Change caller.
15243 (class Layout): Declare print_to_mapfile.
15244 * output.cc (Output_section::Input_section::print_to_mapfile): New
15245 function.
15246 (Output_section::add_input_section): If producing a map, always
15247 add to input_sections_ list.
15248 (Output_section::do_print_to_mapfile): New function.
15249 (Output_segment::print_sections_to_mapfile): New function.
15250 (Output_segment::print_section_list_to_mapfile): New function.
15251 * output.h: Include "mapfile.h".
15252 (Output_data::print_to_mapfile): New function.
15253 (Output_data::do_print_to_mapfile): New virtual function.
15254 (Output_segment_headers::do_print_to_mapfile): New function.
15255 (Output_file_header::do_print_to_mapfile): New function.
15256 (Output_data_const::do_print_to_mapfile): New function.
15257 (class Output_data_const_buffer): Add map_name_ field. Update
15258 constructor. Change all callers. Add do_print_to_mapfile
15259 function.
15260 (class Output_data_fixed_space): Likewise.
15261 (class Output_data_space): Likewise.
15262 (class Output_data_zero_fill): New class.
15263 (Output_data_strtab::do_print_to_mapfile): New function.
15264 (Output_data_reloc_base::do_print_to_mapfile): New function.
15265 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15266 (Output_data_group::do_print_to_mapfile): New function.
15267 (Output_data_got::do_print_to_mapfile): New function.
15268 (Output_data_dynamic::do_print_to_mapfile): New function.
15269 (Output_symtab_xindex::do_print_to_mapfile): New function.
15270 (class Output_section): Declare do_print_to_mapflie. Declare
15271 print_to_mapfile in Input_section.
15272 (class Output_segment): Declare new functions.
15273 * object.h (Sized_relobj::symbol_count): New function.
15274 * script-sections.cc
15275 (Output_section_element_dot_assignment::set_section_addresses):
15276 Change Output_data_fixed_space to Output_data_zero_fill.
15277 (Output_data_expression::do_print_to_mapfile): New function.
15278 * script.cc (read_input_script): Add mapfile parameter. Change
15279 all callers.
15280 * script.h (read_input_script): Update declaration.
15281 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15282 (Eh_frame::do_print_to_mapfile): New function.
15283 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15284 (Output_merge_string::do_print_to_mapfile): New function.
15285 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15286 function.
15287 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15288 function.
15289 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15290 function.
15291 * Makefile.am (CCFILES): Add mapfile.cc.
15292 (HFILES): Add mapfile.h.
15293 * Makefile.in: Rebuild.
15294
9f1d377b
ILT
152952008-05-19 Ian Lance Taylor <iant@google.com>
15296
15297 * options.h (class General_options): Add -z relro.
15298 * layout.cc (Layout::Layout): Initialize relro_segment_.
15299 (Layout::add_output_section_data): Return the output section.
15300 (Layout::make_output_section): Rcognize relro sections and mark
15301 them appropriately.
15302 (Layout::attach_allocated_section_to_segment): Put relro sections
15303 in a PT_GNU_RELRO segment.
15304 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15305 section as relro.
15306 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15307 PT_TLS segments.
15308 (Layout::linkonce_mapping): Map d.rel.ro.local to
15309 .data.rel.ro.local.
15310 (Layout::output_section_name): Us .data.rel.ro.local for any
15311 section which begins with that.
15312 * layout.h (class Layout): Update add_output_section_data
15313 declaration. Add relro_segment_ field.
15314 * output.cc (Output_section::Output_section): Initialize is_relro_
15315 and is_relro_local_ fields.
15316 (Output_segment::add_output_section): Group relro sections.
15317 (Output_segment::is_first_section_relro): New function.
15318 (Output_segment::maximum_alignment): If there is a relro section,
15319 align the segment to the common page size.
15320 (Output_segment::set_section_addresses): Track whether we are
15321 looking at relro sections. If the last section is a relro
15322 section, align to the common page size.
15323 (Output_segment::set_section_list_addresses): Add in_relro
15324 parameter. Change all callers. Align to the page size when
15325 moving from relro to non-relro section.
15326 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15327 segment.
15328 * output.h (class Output_section): Add is_relro_ and
15329 is_relro_local_ fields.
15330 (Output_section::is_relro): New function.
15331 (Output_section::set_is_relro): New function.
15332 (Output_section::is_relro_local): New function.
15333 (Output_section::set_is_relro_local): New function.
15334 (class Output_segment): Update declarations.
15335 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15336 * sparc.cc (Target_sparc::got_section): Likewise.
15337 * x86_64.cc (Target_x86_64::got_section): Likewise.
15338 * testsuite/relro_test_main.cc: New file.
15339 * testsuite/relro_test.cc: New file.
15340 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15341 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15342 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15343 (relro_test.so, relro_test_pic.o): New targets.
15344 * testsuite/Makefile.in: Rebuild.
15345
a984ee1d
ILT
153462008-05-16 Ian Lance Taylor <iant@google.com>
15347
01676dcd
ILT
15348 * output.cc (Output_segment::add_output_section): Remove front
15349 parameter.
15350 * output.h (class Output_segment): Remove
15351 add_initial_output_section and overloaded add_output_section.
15352 Update declaration of remaining add_output_section.
15353 * layout.cc (Layout::create_interp): Call add_output_section
15354 rather than add_initial_output_section.
15355 (Layout::finish_dynamic_section): Likewise.
15356
497897f9
ILT
15357 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15358 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15359 know the dynamic type.
15360 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15361 field. Initialize it in constructor.
15362 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15363 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15364 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15365 reloc.
15366
a984ee1d
ILT
15367 * output.cc (Output_reloc::get_address): Change return type to
15368 Elf_Addr.
15369 * output.h (class Output_reloc): Update get_address declaration.
15370 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15371 for section addresses.
15372
55ba0940
ILT
153732008-05-09 Ian Lance Taylor <iant@google.com>
15374
15375 PR 6493
15376 * gold.cc (gold_nomem): Use return value of write.
15377
75517b77
ILT
153782008-05-08 Ian Lance Taylor <iant@google.com>
15379
15380 * symtab.c (Symbol::init_base_output_data): Add version
15381 parameter. Change all callers.
15382 (Symbol::init_base_output_segment): Likewise.
15383 (Symbol::init_base_constant): Likewise.
15384 (Symbol::init_base_undefined): Likewise.
15385 (Sized_symbol::init_output_data): Likewise.
15386 (Sized_symbol::init_output_segment): Likewise.
15387 (Sized_symbol::init_constant): Likewise.
15388 (Sized_symbol::init_undefined): Likewise.
15389 (Symbol_table::do_define_in_output_data): If the new symbol has a
15390 version, mark it as the default.
15391 (Symbol_table::do_define_in_output_segment): Likewise.
15392 (Symbol_table::do_define_as_constant): Likewise.
15393 * symtab.h (class Symbol): Update declarations.
15394 (class Sized_symbol): Likewise.
15395 * resolve.cc (Symbol::override_version): New function.
c42e122e 15396 (Symbol::override_base): Call override_version.
75517b77
ILT
15397 (Symbol::override_base_with_special): Likewise.
15398 * testsuite/ver_script_8.script: New file.
15399 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15400 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15401 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15402 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15403
f1f70eae
ILT
154042008-05-06 Ian Lance Taylor <iant@google.com>
15405
f3e9c5c5
ILT
15406 PR 6049
15407 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15408 functions.
15409 (class General_options): Remove existing --undefined, and add
15410 --no-undefined instead. Add new --undefined as synonym for -u.
15411 * archive.cc (Archive::add_symbols): Check whether symbol was
15412 named with -u.
15413 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15414 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15415 all uses. Add IS_UNDEFINED. Update declarations to split
15416 different versions of init_base. Declare init_base_undefined.
15417 (Symbol::is_defined): Handle IS_UNDEFINED.
15418 (Symbol::is_undefined): Likewise.
15419 (Symbol::is_weak_undefined): Call is_undefined.
15420 (Symbol::is_absolute): Handle IS_CONSTANT.
15421 (class Sized_symbol): Update declarations to split different
15422 versions of init. Declare init_undefined.
15423 (class Symbol_table): Declare new functions.
15424 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15425 Change all callers.
15426 (Symbol::init_base_output_data): Likewise.
15427 (Symbol::init_base_output_segment): Likewise.
15428 (Symbol::init_base_constant): Likewise.
15429 (Symbol::init_base_undefined): New function.
15430 (Sized_symbol::init_object): Rename from init. Change all
15431 callers.
15432 (Sized_symbol::init_output_data): Likewise.
15433 (Sized_symbol::init_output_segment): Likewise.
15434 (Sized_symbol::init_constant): Likewise.
15435 (Sized_symbol::init_undefined): New function.
15436 (Symbol_table::add_undefined_symbols_from_command_line): New
15437 function.
15438 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15439 function.
15440 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15441 (Symbol::output_section): Likewise.
15442 (Symbol::set_output_section): Likewise.
15443 (Symbol_table::sized_finalize_symbol): Likewise.
15444 (Symbol_table::sized_write_globals): Likewise.
15445 * resolve.cc (Symbol_table::should_override): Likewise.
15446 (Symbol::override_base_with_special): Likewise.
15447
8bdcdf2c
ILT
15448 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15449 symbol, change it to have default visibility.
15450 * testsuite/protected_1.cc: New file.
15451 * testsuite/protected_2.cc: New file.
15452 * testsuite/protected_3.cc: New file.
15453 * testsuite/protected_main_1.cc: New file.
15454 * testsuite/protected_main_2.cc: New file.
15455 * testsuite/protected_main_3.cc: New file.
15456 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15457 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15458 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15459 (protected_1.so): New target.
15460 (protected_1_pic.o, protected_2_pic.o): New targets.
15461 (protected_3_pic.o): New target.
15462 (check_PROGRAMS): Add protected_2.
15463 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15464 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15465 * testsuite/Makefile.in: Rebuild.
15466
2b706932
ILT
15467 * options.h (DEFINE_var): Add set_user_set_##varname__.
15468 (DEFINE_bool_alias): New macro.
15469 (class General_options): Define -Bstatic using DEFINE_bool_alias
15470 rather than DEFINE_special. Add --undefined as an alias for -z
15471 defs.
15472 * options.cc (General_options::parse_Bstatic): Remove.
15473
d82a5bcc
ILT
15474 * options.h (class General_options): Add --fatal-warnings.
15475 * main.cc (main): Implement --fatal-warnings.
15476 * errors.h (Errors::warning_count): New function.
15477
f1f70eae
ILT
15478 * options.h (class General_options): Add -Bsymbolic-functions.
15479 * symtab.h (Symbol::is_preemptible): Check for
15480 -Bsymbolic-functions.
15481
8825ac63
ILT
154822008-05-05 Ian Lance Taylor <iant@google.com>
15483
d98bc257
ILT
15484 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15485 as noVARNAME rather than no-VARNAME.
15486 (class General_options): Add option -z combreloc.
15487 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15488 get_address.
15489 (Output_reloc::sort_before) [SHT_REL]: New function.
15490 (Output_reloc::sort_before) [SHT_RELA]: New function.
15491 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15492 Sort_relocs_comparison.
15493 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15494 parameter. Change all callers.
15495 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15496 sort_relocs parameter. Change all callers.
15497 * output.cc (Output_reloc::get_address): New function, broken out
15498 of write_rel.
15499 (Output_reloc::write_rel): Call it.
15500 (Output_reloc::compare): New function.
15501 (Output_data_reloc_base::do_write): Optionally sort relocs.
15502
60b2b4e7
ILT
15503 * configure.ac: If targ_extra_obj is set, link it in.
15504 * configure.tgt: Initialize all variables.
15505 (x86_64*): Set targ_extra_obj and targ_extra_size.
15506 * configure: Rebuild.
15507
8825ac63
ILT
15508 * object.cc (Sized_relobj::include_section_group): Adjust section
15509 indexes read from group data. Build vector to pass to
15510 layout_group.
15511 * layout.cc (Layout::layout_group): Add flags and shndxes
15512 parameters. Remove contents parameter. Change caller. Update
15513 explicit instantiations.
15514 * layout.h (class Layout): Update layout_group declaration.
15515 * output.cc (Output_data_group::Output_data_group): Add flags and
15516 input_shndxes parameters. Remove contents parameter. Change
15517 caller.
15518 (Output_data_group::do_write): Change input_sections_ to
15519 input_shndxes_.
15520 * output.h (class Output_data_group): Update constructor
15521 declaration. Rename input_sections_ to input_shndxes_.
15522 * testsuite/many_sections_test.cc: Add template.
15523
e94cf127
CC
155242008-04-30 Cary Coutant <ccoutant@google.com>
15525
4418b2d5
CC
15526 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15527
e94cf127
CC
15528 * layout.cc (Layout::include_section): Refactored check for debug
15529 info section.
15530 (Layout::add_comdat): Add new parameters. Change type
15531 of signature parameter. Add object and shndx to signatures table.
15532 (Layout::find_kept_object): New function.
15533 * layout.h: Include <cstring>.
15534 (Layout::is_debug_info_section): New function.
15535 (Layout::add_comdat): Add new parameters.
15536 (Layout::find_kept_object): New function.
15537 (Layout::Kept_section): New struct.
15538 (Layout::Signatures): Change type of map range.
15539 * object.cc (Relobj::output_section_address): New function.
15540 (Sized_relobj::include_section_group): Add new parameters. Change
15541 calls to Layout::add_comdat. Change to build table of kept comdat
15542 groups and table mapping discarded sections to kept sections.
15543 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15544 (Sized_relobj::do_layout): Change calls to include_section_group and
15545 include_linkonce_section.
15546 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15547 value to zero when section is discarded.
15548 (Sized_relobj::map_to_kept_section): New function.
15549 * object.h (Relobj::output_section_address): New function.
15550 (Relobj::Comdat_group): New type.
15551 (Relobj::find_comdat_group): New function.
15552 (Relobj::Comdat_group_table): New type.
15553 (Relobj::Kept_comdat_section): New type.
15554 (Relobj::Kept_comdat_section_table): New type.
15555 (Relobj::add_comdat_group): New function.
15556 (Relobj::set_kept_comdat_section): New function.
15557 (Relobj::get_kept_comdat_section): New function.
15558 (Relobj::comdat_groups_): New field.
15559 (Relobj::kept_comdat_sections_): New field.
15560 (Symbol_value::input_value): Update comment.
15561 (Sized_relobj::map_to_kept_section) New function.
15562 (Sized_relobj::include_linkonce_section): Add new parameter.
15563 * target-reloc.h (Comdat_behavior): New type.
15564 (get_comdat_behavior): New function.
15565 (relocate_section): Add code to map a discarded section to the
15566 corresponding kept section when applying a relocation.
15567
e4e5049b
CS
155682008-04-30 Craig Silverstein <csilvers@google.com>
15569
15570 * dwarf_reader.cc (next_generation_count): New static var.
15571 (Addr2line_cache_entry): New struct.
15572 (addr2line_cache): New static var.
15573 (Dwarf_line_info::one_addr2line): Added caching.
15574 (Dwarf_line_info::clear_addr2line_cache): New function.
15575 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15576 cache-size parameter.
15577 (Dwarf_line_info::one_addr2line_cache): New function.
15578 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15579 new cache-size argument to one_addr2line(), and clear cache.
15580
d09e9154
CC
155812008-04-28 Cary Coutant <ccoutant@google.com>
15582
15583 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15584 R_386_PC8 relocations.
15585
7ef73768
ILT
155862008-04-23 Ian Lance Taylor <iant@google.com>
15587
55438702
ILT
15588 * object.cc (Sized_relobj::include_section_group): Check for
15589 invalid section group.
15590
c165fb93
ILT
15591 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15592 header size.
15593
7ef73768
ILT
15594 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15595 than read for file header.
15596 * archive.cc (Archive::include_member): Likewise.
15597
6194aaab
L
155982008-04-23 Paolo Bonzini <bonzini@gnu.org>
15599
15600 * aclocal.m4: Regenerate.
15601 * configure: Regenerate.
15602
d491d34e
ILT
156032008-04-19 Ian Lance Taylor <iant@google.com>
15604
5ea2bac6
ILT
15605 * version.cc (version_string): Bump to 1.6.
15606
7bc3e21a
ILT
15607 * testsuite/Makefile.am (many_sections_r_test): New target.
15608 (many_sections_r_test_SOURCES): Remove.
15609 (many_sections_r_test_DEPENDENCIES): Remove.
15610 (many_sections_r_test_LDFLAGS): Remove.
15611 (many_sections_r_test_LDADD): Remove.
15612
7fcd3aa9
ILT
15613 * object.cc (Sized_relobj::do_add_symbols): Always pass
15614 local_symbol_count_ to add_from_relobj.
15615
4c94d6ae
ILT
15616 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15617 every thousand variables.
15618 * testsuite/Makefile.in: Rebuild.
15619
d491d34e
ILT
15620 * object.cc (Xindex::initialize_symtab_xindex): New function.
15621 (Xindex::read_symtab_xindex): New function.
15622 (Xindex::sym_xindex_to_shndx): New function.
15623 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15624 available.
15625 (Sized_relobj::do_initialize_xindex): New function.
15626 (Sized_relobj::do_read_symbols): Adjust section links.
15627 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15628 parameter. Change all callers.
15629 (Sized_relobj::include_section_group): Adjust section links and
15630 symbol section indexes.
15631 (Sized_relobj::do_layout): Adjust section links.
15632 (Sized_relobj::do_count_local_symbols): Adjust section links and
15633 symbol section indexes.
15634 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15635 ordinary and special symbols.
15636 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15637 dynsym_xindex parameters. Change all callers. Adjust section
15638 links. Use SHN_XINDEX when needed.
15639 (Sized_relobj::get_symbol_location_info): Adjust section links.
15640 Don't get fooled by special symbols.
15641 * object.h (class Xindex): Define.
15642 (class Object): Add xindex_ parameter. Declare virtual functoin
15643 do_initialize_xindex.
15644 (Object::adjust_sym_shndx): New function.
15645 (Object::set_xindex): New protected function.
15646 (class Symbol_value): Add is_ordinary_shndx_ field.
15647 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15648 (Symbol_value::value): Assert ordinary section.
15649 (Symbol_value::initialize_input_to_output_map): Likewise.
15650 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15651 Change all callers.
15652 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15653 all callers.
15654 (class Sized_relobj): Update declarations.
15655 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15656 parameter. Change all callers.
15657 (Sized_relobj::adjust_shndx): New function.
15658 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15659 field.
15660 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15661 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15662 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15663 (Sized_dynobj::read_dynsym_section): Adjust section links.
15664 (Sized_dynobj::read_dynamic): Likewise.
15665 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15666 section links.
15667 (Sized_dynobj::do_initialize_xindex): New function.
15668 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15669 do_initialize_xindex.
15670 (Sized_dynobj::adjust_shndx): New function.
15671 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15672 dynsym_xindex_ fields.
15673 (Layout::finalize): Add a call to set_section_indexes before
15674 creating the symtab sections.
15675 (Layout::set_section_indexes): Don't do anything if the section
15676 already has a section index.
15677 (Layout::create_symtab_sections): Add shnum parameter. Change
15678 caller. Create .symtab_shndx section if needed.
15679 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15680 caller.
15681 (Layout::allocated_output_section_count): New function.
15682 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15683 needed.
15684 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15685 fields. Update declarations.
15686 (Layout::symtab_xindex): New function.
15687 (Layout::dynsym_xindex): New function.
15688 (class Write_symbols_task): Add layout_ field.
15689 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15690 Change caller.
15691 * output.cc (Output_section_headers::Output_section_headers): Add
15692 shstrtab_section parameter. Change all callers.
15693 (Output_section_headers::do_sized_write): Store overflow values
15694 for section count and section string table section index in
15695 section header zero.
15696 (Output_file_header::do_sized_write): Check for overflow of
15697 section count and section string table section index.
15698 (Output_symtab_xindex::do_write): New function.
15699 (Output_symtab_xindex::endian_do_write): New function.
15700 * output.h (class Output_section_headers): Add shstrtab_section_.
15701 Update declarations.
15702 (class Output_symtab_xindex): Define.
15703 (Output_section::has_out_shndx): New function.
15704 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15705 field.
15706 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15707 Change all callers.
15708 (Sized_symbol::init): Likewise.
15709 (Symbol::output_section): Check for ordinary symbol.
15710 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15711 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15712 callers.
15713 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15714 Change all callers. Simplify handling of symbols from sections
15715 not included in the link.
15716 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15717 distinction.
15718 (Weak_alias_sorter::operator()): Assert that symbols are
15719 ordinary.
15720 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15721 distinction.
15722 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15723 parameters. Change all callers.
15724 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15725 symbol distinction. Use SHN_XINDEX when needed.
15726 (Symbol_table::write_section_symbol): Add symtab_xindex
15727 parameter. Change all callers.
15728 (Symbol_table::sized_write_section_symbol): Likewise. Use
15729 SHN_XINDEX when needed.
15730 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15731 declarations.
15732 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15733 (Symbol::is_defined): Check is_ordinary.
15734 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15735 (Symbol::is_absolute, Symbol::is_common): Likewise.
15736 (class Sized_symbol): Update declarations.
15737 (class Symbol_table): Update declarations.
15738 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15739 parameters. Change all callers.
15740 (Sized_symbol::override): Likewise.
15741 (Symbol_table::override): Likewise.
15742 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15743 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15744 is_ordinary, and orig_st_shndx parameters. Change all callers.
15745 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15746 to be in an ordinary section.
15747 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15748 object and is_ordinary parameters. Change all callers.
15749 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15750 Change all callers. Don't add undefined or non-ordinary symbols
15751 to reloc_map_.
15752 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15753 Change all callers.
15754 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15755 declarations.
15756 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15757 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15758 (Sized_relobj::relocate_sections): Likewise.
15759 * target-reloc.h (scan_relocs): Adjust section symbol index.
15760 (scan_relocatable_relocs): Likewise.
15761 * i386.cc (Scan::local): Check for ordinary symbols.
15762 * sparc.cc (Scan::local): Likewise.
15763 * x86_64.cc (Scan::local): Likewise.
15764 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15765 to symbol_section_and_value.
15766 * testsuite/many_sections_test.cc: New file.
15767 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15768 (check_PROGRAMS): Add many_sections_test.
15769 (many_sections_test_SOURCES): Define.
15770 (many_sections_test_DEPENDENCIES): Define.
15771 (many_sections_test_LDFLAGS): Define.
15772 (BUILT_SOURCES): Add many_sections_define.h.
15773 (many_sections_define.h): New target.
15774 (BUILT_SOURCES): Add many_sections_check.h.
15775 (many_sections_check.h): New target.
15776 (check_PROGRAMS): Add many_sections_r_test.
15777 (many_sections_r_test_SOURCES): Define.
15778 (many_sections_r_test_DEPENDENCIES): Define.
15779 (many_sections_r_test_LDFLAGS): Define.
15780 (many_sections_r_test_LDADD): Define.
15781 (many_sections_r_test.o): New target.
15782 * testsuite/Makefile.in: Rebuild.
15783
c5818ff1
CC
157842008-04-17 Cary Coutant <ccoutant@google.com>
15785
15786 * errors.cc (Errors::info): New function.
15787 (gold_info): New function.
15788 * errors.h (Errors::info): New function.
15789 * gold.h (gold_info): New function.
15790 * object.cc (Input_objects::add_object): Print trace output.
15791 * options.cc (options::parse_set): New function.
15792 (General_options::parse_wrap): Deleted.
15793 (General_options::General_options): Deleted initializer.
15794 * options.h (options::String_set): New typedef.
15795 (options::parse_set): New function.
15796 (DEFINE_set): New macro.
15797 (General_options::wrap): Changed to use DEFINE_set. Changed
15798 callers of any_wrap_symbols and is_wrap_symbol.
15799 (General_options::trace, General_options::trace_symbol):
15800 New options.
15801 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15802 (General_options::wrap_symbols_): Deleted.
15803 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15804
b5be4a7c
DM
158052008-04-17 David S. Miller <davem@davemloft.net>
15806
15807 * options.cc (General_options::parse_V): New function.
15808 * options.h: Add entries for -V and -Qy.
15809
155a0dd7
ILT
158102008-04-17 Ian Lance Taylor <iant@google.com>
15811
15812 * common.cc (Symbol_table::allocate_commons): Remove options
15813 parameter. Change caller.
15814 (Symbol_table::do_allocate_commons): Remove options parameter.
15815 Change caller. Just call do_allocate_commons_list twice.
15816 (Symbol_table::do_allocate_commons_list): New function, broken out
15817 of do_allocate_commons.
15818 * common.h (class Allocate_commons_task): Remove options_ field.
15819 Update constructor.
15820 * symtab.cc (Symbol_table::Symbol_table): Initialize
15821 tls_commons_.
15822 (Symbol_table::add_from_object): Put TLS common symbols on
15823 tls_commons_ list.
15824 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15825 which are IN_OUTPUT_DATA.
15826 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15827 allocate_commons and do_allocate_commons declarations. Declare
15828 do_allocate_commons_list.
15829 * gold.cc (queue_middle_tasks): Update creation of
15830 Allocate_commons_task to not pass options.
15831 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15832 (TLS_TEST_C_FLAGS): New variable.
15833 (tls_test_c_pic.o): New target.
15834 (tls_test_shared.so): Link in tls_test_c_pic.o.
15835 (tls_test_c_pic_ie.o): New target.
15836 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15837 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15838 (tls_test_c.o): New target.
15839 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15840 (tls_pic_test_LDADD): Likewise.
15841 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15842 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15843 (tls_test_c_gnu2.o): New target.
15844 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15845 tls_test_c_gnu2.o.
15846 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15847 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15848 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15849 * testsuite/tls_test.cc: Include "config.h".
15850 (t_last): Call t11_last.
15851 * testsuite/tls_test.h (t11, t11_last): Declare.
15852 * testsuite/tls_test_c.c: New file.
15853 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15854 * configure.ac: Check for OpenMP support.
15855 * configure, config.in, Makefile.in: Rebuild.
15856 * testsuite/Makefile.in: Rebuild.
15857
edfbb029
CC
158582008-04-16 Cary Coutant <ccoutant@google.com>
15859
15860 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15861 (Target_i386::tls_base_symbol_defined_): New field.
15862 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15863 (Target_i386::Scan::global): Likewise.
15864 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15865 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15866 (Target_x86_64::tls_base_symbol_defined_): New field.
15867 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15868 (Target_x86_64::Scan::global): Likewise.
15869
f3c69fca
CC
158702008-04-16 Cary Coutant <ccoutant@google.com>
15871
15872 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15873 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15874 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15875 building shared libraries.
15876 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15877 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15878 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15879 * testsuite/Makefile.in: Rebuild.
15880 * testsuite/weak_undef.h: New file.
15881 * testsuite/weak_undef_file1.cc: Add extra test cases.
15882 * testsuite/weak_undef_file2.cc: Likewise.
15883 * testsuite/weak_undef_test.cc: Likewise.
15884
7c414435
DM
158852008-04-16 David S. Miller <davem@davemloft.net>
15886
32b769e1
DM
15887 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15888 Add issued_non_pic_error_ field. Declare check_non_pic.
15889 (Target_sparc::Scan::check_non_pic): New function.
15890 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15891 (Target_sparc::Scan::global): Likewise.
15892
11936fb1
DM
15893 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15894 * configure: Rebuild.
15895
7c414435
DM
15896 * options.h (DEFINE_enable): New macro.
15897 (new_dtags): New enable option.
15898 (initfirst, interpose, loadfltr, nodefaultlib,
15899 nodelete, nodlopen, nodump): New -z options.
15900 * layout.cc (Layout:finish_dynamic_section): If new
15901 dtags enabled, emit DT_RUNPATH. Also, emit a
15902 DT_FLAGS_1 containing any specified -z flags.
15903
85c7bf8b
ILT
159042008-04-16 Ian Lance Taylor <iant@google.com>
15905
12c0daef
ILT
15906 * copy-relocs.cc: New file.
15907 * copy-relocs.h: New file.
15908 * reloc.cc: Remove Copy_relocs code.
15909 * reloc.h: Likewise.
15910 * reloc-types.h (struct Reloc_types) [both versions]: Add
15911 get_reloc_addend_noerror.
15912 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15913 variants of add_global which take an addend which must be zero.
15914 * i386.cc: Include "copy-relocs.h".
15915 (class Target_i386): Change type of copy_relocs_ to variable,
15916 update initializer.
15917 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15918 Change all callers.
15919 (Target_i386::do_finalize_sections): Change handling of
15920 copy_relocs_.
15921 * sparc.cc: Include "copy-relocs.h".
15922 (class Target_sparc): Change type of copy_relocs_ to variable,
15923 update initializer.
15924 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15925 Change all callers.
15926 (Target_sparc::do_finalize_sections): Change handling of
15927 copy_relocs_.
15928 * x86_64.cc: Include "copy-relocs.h".
15929 (class Target_x86_64): Change type of copy_relocs_ to variable,
15930 update initializer.
15931 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15932 class. Change all callers.
15933 (Target_x86_64::do_finalize_sections): Change handling of
15934 copy_relocs_.
15935 * Makefile.am (CCFILES): Add copy-relocs.cc.
15936 (HFILES): Add copy-relocs.h.
15937
4f4995b6
ILT
15938 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15939
85c7bf8b
ILT
15940 * testsuite/script_test_4.sh: Permit leading zeroes.
15941
4f2a9edd
ILT
159422008-04-15 Ian Lance Taylor <iant@google.com>
15943
e6188289
ILT
15944 * script-sections.cc (Script_sections::create_segments): Use
15945 header_size_adjustment even when there is enough room for the
15946 headers.
15947 * testsuite/script_test_4.sh: New file.
15948 * testsuite/script_test_4.t: New file.
15949 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15950 (check_DATA): Add script_test_4.stdout.
15951 (MOSTLYCLEANFILES): Likewise.
15952 (script_test_4): New target.
15953 (script_test_4.stdout): New target.
15954 * testsuite/Makefile.in: Rebuild.
15955
4f2a9edd
ILT
15956 * sparc.cc: Add definitions for Output_data_plt_sparc class
15957 constants.
15958
f5314dd5
DM
159592008-04-14 David S. Miller <davem@davemloft.net>
15960
15961 * sparc.cc: New file.
15962 * Makefile.am (TARGETSOURCES): Add sparc.cc
15963 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15964 * configure.tgt: Document targ_extra_size and
15965 targ_extra_big_endian. Add entries for sparc-* and
15966 sparc64-*.
15967 * configure.ac: Handle targ_extra_size and
15968 targ_extra_big_endian.
15969 * Makefile.in: Rebuild.
15970 * configure: Likewise.
15971 * po/POTFILES.in: Likewise.
15972 * po/gold.pot: Likewise.
15973
154e0e9a
ILT
159742008-04-14 Ian Lance Taylor <iant@google.com>
15975
15976 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15977 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15978 in the name/type/flags to section mapping. Don't call
15979 allocate_output_section.
15980 (Layout::choose_output_section): Change parameter from adjust_name
15981 to is_input_section. Don't permit input sections after sections
15982 are attached to segments. Don't call allocate_output_section.
15983 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15984 not write_enable_output_section.
15985 (Layout::make_output_section): Don't push to
15986 unattached_section_list_ nor call attach_to_segment. Call
15987 attach_section_to_segment if sections are attached.
15988 (Layout::attach_sections_to_segments): New function.
15989 (Layout::attach_section_to_segment): New function.
15990 (Layout::attach_allocated_section_to_segment): Rename from
15991 attach_to_segment. Remove flags parameter.
15992 (Layout::allocate_output_section): Remove function.
15993 (Layout::write_enable_output_section): Remove function.
15994 * layout.h (class Layout): Update for above changes. Add new
15995 field sections_are_attached_.
15996 * output.h (Output_section::update_flags_for_input_section): New
15997 function.
15998 * output.cc (Output_section::add_input_section): Call
15999 update_flags_for_input_section.
16000 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16001
009a67a2
CC
160022008-04-11 Cary Coutant <ccoutant@google.com>
16003
16004 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16005 thought unnecessary.
16006 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16007
759b1a24
ILT
160082008-04-11 Ian Lance Taylor <iant@google.com>
16009
16010 * output.h (class Output_section_data): Remove inline definition
16011 of set_addralign.
16012 * output.cc (Output_section_data::set_addralign): New function.
16013
c2b45e22
CC
160142008-04-11 Cary Coutant <ccoutant@google.com>
16015
16016 Add support for TLS descriptors for i386 and x86_64.
16017 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16018 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16019 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16020 GOT_TYPE_TLS_DESC.
16021 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16022 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16023 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16024 relocations.
16025 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16026 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16027 Fix problem with initial-exec relocations.
16028 (Target_i386::Relocate::relocate_tls): Likewise.
16029 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16030 relaxation.
16031 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16032 support for section-plus-offset dynamic table entries.
16033 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16034 (Output_data_dynamic::Dynamic_entry): Add support for
16035 section-plus-offset dynamic table entries.
16036 (Output_data_dynamic::Classification): Likewise.
16037 (Output_data_dynamic::classification_): Renamed offset_.
16038 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16039 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16040 (Target_x86_64::make_plt_section): New function.
16041 (Target_x86_64::reserve_tlsdesc_entries): New function.
16042 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
16043 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
16044 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
16045 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
16046 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
16047 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
16048 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
16049 add extra PLT entry for TLS descriptors.
16050 (Output_data_plt_x86_64::got_): New field.
16051 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16052 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16053 fields.
16054 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16055 descriptors.
16056 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16057 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16058 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16059 R_386_TLS_DESC_CALL relocations.
16060 (Target_x86_64::Scan::global): Likewise.
16061 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16062 for TLS descriptors.
16063 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16064 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16065 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16066 GD-to-IE relaxation.
16067 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16068 and TLS_DESCRIPTORS.
16069 * Makefile.in: Rebuild.
16070 * configure: Rebuild.
16071 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16072 (tls_test_shared2.so): New target.
16073 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16074 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16075 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16076 (tls_shared_gd_to_ie_test_LDADD): New variable.
16077 (tls_shared_gnu2_gd_to_ie_test): New target.
16078 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16079 New targets.
16080 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16081 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16082 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16083 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16084 (tls_shared_gnu2_test): New target.
16085 (tls_test_gnu2_shared.so): New target.
16086 (tls_shared_gnu2_test_SOURCES): New variable.
16087 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
16088 (tls_shared_gnu2_test_LDFLAGS): New variable.
16089 (tls_shared_gnu2_test_LDADD): New variable.
16090 * testsuite/Makefile.in: Rebuild.
16091 * testsuite/Makefile.
16092
83bfb6b7
ILT
160932008-04-11 Ian Lance Taylor <iant@google.com>
16094
16095 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
16096 justsyms.t.
16097 * testsuite/Makefile.in: Rebuild.
16098
16099 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
16100 long.
16101 * testsuite/script_test_2.cc (main): Adjust test.
16102
706e1f5e
ILT
161032008-04-11 David S. Miller <davem@davemloft.net>
16104 Ian Lance Taylor <iant@google.com>
16105
16106 * options.h (General_options): Add entries for '-Y' and
16107 '-relax'.
16108 * options.cc (General_options:finalize): If -Y was used, add those
16109 entries to the library path instead of the default "/lib" and
16110 "/usr/lib".
16111
7c98e6bb
DM
161122008-04-11 David S. Miller <davem@davemloft.net>
16113
16114 * testsuite/justsyms.t: Start at 0x100.
16115 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
16116 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16117 long.
16118 * testsuite/script_test_2.cc: Adjust string and section length
16119 checks.
7c98e6bb 16120
99a37bfd
ILT
161212008-04-09 Ian Lance Taylor <iant@google.com>
16122
2cefc357
ILT
16123 PR gold/5996
16124 * script-sections.cc (Sections_element::allocate_to_segment): Add
16125 orphan parameter.
16126 (Output_section_definition::allocate_to_segment): Likewise.
16127 (Orphan_output_section::allocate_to_segment): Likewise.
16128 (Script_sections::attach_sections_using_phdrs_clause): Don't
16129 propagate non-PT_LOAD segments to orphan sections.
16130 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16131 readelf rather than objdump.
16132 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16133 .interp section and PT_INTERP segment are the same size.
16134 * testsuite/Makefile.in: Rebuild.
16135
99a37bfd
ILT
16136 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16137 aliases for symbols defined in the same object.
16138 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16139 (weak_alias_test_SOURCES): New variable.
16140 (weak_alias_test_DEPENDENCIES): New variable.
16141 (weak_alias_test_LDFLAGS): New variable.
16142 (weak_alias_test_LDADD): New variable.
16143 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16144 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16145 (weak_alias_test_3.o): New target.
16146 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16147 * testsuite/weak_alias_test_main.cc: New file.
16148 * testsuite/weak_alias_test_1.cc: New file.
16149 * testsuite/weak_alias_test_2.cc: New file.
16150 * testsuite/weak_alias_test_3.cc: New file.
16151
780e49c5
ILT
161522008-04-08 Ian Lance Taylor <iant@google.com>
16153
cdb0b8f5
ILT
16154 * options.h (class General_options): Add --noinhibit-exec option.
16155 * main.cc (main): Check --noinhibit-exec.
16156
0864d551
ILT
16157 * options.h (class General_options): Define --wrap as a special
16158 option. Add wrap_symbols_ field.
16159 (General_options::any_wrap_symbols): New function.
16160 (General_options::is_wrap_symbol): New function.
16161 * options.cc (General_options::parse_wrap): New function.
16162 (General_options::General_options): Initialize wrap_symbols_.
16163 * symtab.cc (Symbol_table::wrap_symbol): New function.
16164 (Symbol_table::add_from_object): Handle --wrap.
16165 * symtab.h (class Symbol_table): Declare wrap_symbol.
16166 * target.h (Target::wrap_char): New function.
16167 (Target::Target_info): Add wrap_char field.
16168 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16169 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16170 * testsuite/testfile.cc (Target_test::test_target_info):
16171 Likewise.
16172
789aa6de
ILT
16173 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16174 there is one.
16175
2c38906f
ILT
16176 * layout.h (class Layout): Add added_eh_frame_data_ field.
16177 * layout.cc (Layout::Layout): Initialize new field.
16178 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16179 output section until we find a section we merged successfully.
16180 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16181 that the size be non-zero.
16182
780e49c5
ILT
16183 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16184 qualifier.
16185
7fcd0256
ILT
161862008-04-08 Craig Silverstein <csilvers@google.com>
16187
16188 * configure.ac: Export new conditional variable HAVE_ZLIB.
16189 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16190 on HAVE_ZLIB.
16191 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16192 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16193
6835af53
ILT
161942008-04-07 Ian Lance Taylor <iant@google.com>
16195
e24f324c
ILT
16196 * version.cc (version_string): Set to "1.5".
16197
a036edd8
ILT
16198 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16199 Add issued_non_pic_error_ field. Declare check_non_pic.
16200 (Target_x86_64::Scan::check_non_pic): New function.
16201 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16202 (Target_x86_64::Scan::global): Likewise.
16203
624f8810
ILT
16204 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16205 addend parameter. Change caller. Handle merge sections.
16206 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16207 Address to Addend. Don't add in the result of
16208 local_section_offset, pass down the addend and use the returned
16209 value.
16210 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16211 Update declarations of local_section_offset and symbol_value.
16212 * testsuite/two_file_test_1.cc (t18): New function.
16213 * testsuite/two_file_test_2.cc (f18): New function.
16214 * testsuite/two_file_test_main.cc (main): Call t18.
16215 * testsuite/two_file_test.h (t18, f18): Declare.
16216
6835af53
ILT
16217 * configure.ac: Don't test for objdump, c++filt, or readelf.
16218 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16219 conditionals.
16220 (TEST_READELF): New variable.
16221 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16222 (check_PROGRAMS): Add two_file_strip_test.
16223 (two_file_strip_test): New target.
16224 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16225 (two_file_same_shared_strip_test_SOURCES): New variable.
16226 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16227 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16228 (two_file_same_shared_strip_test_LDADD): New variable.
16229 (two_file_shared_strip.so): New target.
16230 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16231 (ver_test_5.syms, ver_test_7.syms): Likewise.
16232 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16233 (strip_test_3.stdout): Use TEST_OBJDUMP.
16234 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16235
86925eef
CC
162362008-04-04 Cary Coutant <ccoutant@google.com>
16237
16238 * symtab.h (Symbol::is_weak_undefined): New function.
16239 (Symbol::is_strong_undefined): New function.
16240 (Symbol::is_absolute): New function.
16241 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16242 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16243 absolute symbols.
16244 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16245 (weak_undef_test): New target.
16246 * testsuite/Makefile.in: Rebuild.
16247 * testsuite/weak_undef_file1.cc: New file.
16248 * testsuite/weak_undef_file2.cc: New file.
16249 * testsuite/weak_undef_test.cc: New file.
16250
126f3ece
ILT
162512008-04-03 Craig Silverstein <csilvers@google.com>
16252
16253 * compressed_output.h (class Output_compressed_section): Use
16254 unsigned buffer.
16255 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16256 add zlib header.
16257 (zlib_compressed_suffix): Removed.
16258 (Output_compressed_section::set_final_data_size): Use unsigned
16259 buffers.
16260 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16261 Fix linker invocation.
16262 (flagstest_o_specialfile_and_compress_debug_sections):
16263 Likewise.
16264 * testsuite/Makefile.in: Regenerated.
16265
deae2a14
DM
162662008-04-02 David S. Miller <davem@davemloft.net>
16267
16268 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16269 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16270
70752818
ILT
162712008-04-02 Craig Silverstein <csilvers@google.com>
16272
16273 * TODO: New file.
16274
39d0cb0e
ILT
162752008-04-02 Ian Lance Taylor <iant@google.com>
16276
16277 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16278 parameters. Update for new key type to views_. Change all
16279 callers.
16280 (File_read::read): Adjust for byteshift in returned view.
16281 (File_read::add_view): New function, broken out of
16282 find_and_make_view.
16283 (File_read::make_view): New function, broken out of
16284 find_and_make_view.
16285 (File_read::find_or_make_view): Add offset and aligned
16286 parameters. Rewrite accordingly. Change all callers.
16287 (File_read::get_view): Add offset and aligned parameters. Adjust
16288 for byteshift in return value.
16289 (File_read::get_lasting_view): Likewise.
16290 * fileread.h (class File_read): Update declarations.
16291 (class File_read::View): Add byteshift_ field. Add byteshift to
16292 constructor. Add byteshift method.
16293 * archive.h (Archive::clear_uncached_views): New function.
16294 (Archive::get_view): Add aligned parameter. Change all callers.
16295 * object.h (Object::get_view): Add aligned parameter. Change all
16296 callers.
16297 (Object::get_lasting_view): Likewise.
16298
16299 * fileread.cc (File_read::release): Don't call clear_views if
16300 there are multiple objects.
16301 * fileread.h (File_read::clear_uncached_views): New function.
16302 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16303 on the archive.
16304
a1207466
CC
163052008-03-31 Cary Coutant <ccoutant@google.com>
16306
16307 Add thin archive support.
16308 * archive.cc (Archive::armagt): New const.
16309 (Archive::setup): Remove task parameter and calls to unlock.
16310 (Archive::unlock_nested_archives): New function.
16311 (Archive::read_header): Add nested_off parameter. Change
16312 all callers.
16313 (Archive::interpret_header): Likewise.
16314 (Archive::include_all_members): Change to handle thin
16315 archives.
16316 (Archive::include_member): Likewise.
16317 * archive.h (Archive::Archive): Add new parameters and
16318 initializers.
16319 (Archive::armagt): New const.
16320 (Archive::setup): Remove task parameter.
16321 (Archive::unlock_nested_archives): New function.
16322 (Archive::read_header): Add nested_off parameter.
16323 (Archive::interpret_header): Likewise.
16324 (Archive::Nested_archive_table): New typedef.
16325 (Archive::is_thin_archive_): New field.
16326 (Archive::nested_archives_): New field.
16327 (Archive::options_): New field.
16328 (Archive::dirpath_): New field.
16329 (Archive::task_): New field.
16330 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16331 for thin archives. Pass additional parameters to
16332 Archive::Archive. Unlock the archive file after calling
16333 Archive::setup.
cd536b21 16334
479f6503
ILT
163352008-03-29 Ian Lance Taylor <iant@google.com>
16336
686c8caf
ILT
16337 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16338 version symbol to be local.
16339 * testsuite/ver_test_4.sh: New file.
16340 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16341 (check_DATA): Add ver_test_4.syms.
16342 (ver_test_4.syms): New target.
16343 * testsuite/Makefile.in: Rebuild.
16344
ab794b6b
ILT
16345 * output.cc
16346 (Output_section::Input_section_sort_entry::has_priority): New
16347 function.
16348 (Output_section::Input_section_sort_entry::match_file_name): New
16349 function.
16350 (Output_section::Input_section_sort_entry::match_section_name):
16351 Remove.
16352 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16353 Remove.
16354 (Output_section::Input_section_sort_entry::match_section_file):
16355 Remove.
16356 (Output_section::Input_section_sort_compare::operator()): Rewrite
16357 using new Input_section_sort_entry functions. Sort crtbegin and
16358 crtend first. Sort sections with no priority before sections with
16359 a priority.
16360 * testsuite/initpri1.c (d3): Check j != 4.
16361 (cd5): New constructor/destructor function.
16362 (main): Check j != 2.
16363
479f6503
ILT
16364 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16365 new symbol when resolving, don't call set_is_default.
16366 * testsuite/ver_test_7.cc: New file.
16367 * testsuite/ver_test_7.sh: New file.
16368 * testsuite/Makefile.am (ver_test_7.so): New target.
16369 (ver_test_7.o): New target.
16370 (check_SCRIPTS): Add ver_test_7.sh.
16371 (check_DATA): Add ver_test_7.syms.
16372 (ver_test_7.syms): New target.
16373
2fd32231
ILT
163742008-03-28 Ian Lance Taylor <iant@google.com>
16375
16376 * layout.cc (Layout::layout): If we see an input section with a
16377 name that needs sorting, set the must_sort flag for the output
16378 section.
16379 (Layout::make_output_section): If the name of the output section
16380 indicates that it might require sorting, set the may_sort flag.
16381 * output.h (Output_section::may_sort_attached_input_sections): New
16382 function.
16383 (Output_section::set_may_sort_attached_input_sections): New
16384 function.
16385 (Output_section::must_sort_attached_input_sections): New
16386 function.
16387 (Output_section::set_must_sort_attached_input_sections): New
16388 function.
16389 (class Output_section): Declare Input_section_sort_entry. Define
16390 Input_section_sort_compare. Declare
16391 sort_attached_input_sections. Add new fields:
16392 may_sort_attached_input_sections_,
16393 must_sort_attached_input_sections_,
16394 attached_input_sections_are_sorted_.
16395 * output.cc (Output_section::Output_section): Initialize new
16396 fields.
16397 (Output_section::add_input_section): Add an entry to
16398 input_sections_ if may_sort or must_sort are true.
16399 (Output_section::set_final_data_size): Call
16400 sort_attached_input_sections if necessary.
16401 (Output_section::Input_section_sort_entry): Define new class.
16402 (Output_section::Input_section_sort_compare::operator()): New
16403 function.
16404 (Output_section::sort_attached_input_sections): New function.
16405 * configure.ac: Check whether the compiler supports constructor
16406 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16407 * testsuite/initpri1.c: New file.
16408 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16409 CONSTRUCTOR_PRIORITY.
16410 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16411 (initpri1_LDFLAGS): New variable.
16412 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16413
18e6b24e
ILT
164142008-03-27 Ian Lance Taylor <iant@google.com>
16415
49bdd526
ILT
16416 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16417 * testsuite/common_test_1.c: New file.
16418 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16419 (common_test_1_SOURCES): New variable.
16420 (common_test_1_DEPENDENCIES): New variable.
16421 (common_test_1_LDFLAGS): New variable.
16422
18e6b24e
ILT
16423 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16424 and commons_ correctly when NAME/VERSION does not override
16425 NAME/NULL.
16426 * testsuite/ver_test_6.c: New file.
16427 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16428 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16429 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16430
04bf7072
ILT
164312008-03-26 Ian Lance Taylor <iant@google.com>
16432
5871526f
ILT
16433 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16434 of an undefined symbol from a version script.
16435 * testsuite/Makefile.am (ver_test_5.so): New target.
16436 (ver_test_5.o): New target.
16437 (check_SCRIPTS): Add ver_test_5.sh.
16438 (check_DATA): Add ver_test_5.syms.
16439 (ver_test_5.syms): New target.
16440 * testsuite/ver_test_5.cc: New file.
16441 * testsuite/ver_test_5.script: New file.
16442 * testsuite/ver_test_5.sh: New file.
16443 * Makefile.in, testsuite/Makefile.in: Rebuild.
16444
04bf7072
ILT
16445 PR gold/5986
16446 Fix problems building gold with gcc 4.3.0.
16447 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16448 (gold_error_at_location, gold_warning_at_location): Use it.
16449 * configure.ac: Check whether we can compile and use a template
16450 function with a printf attribute.
16451 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16452 when jumping over bytes.
16453 * object.cc: Instantiate Object::read_section_data.
16454 * debug.h: Include <cstring>
16455 * dwarf_reader.cc: Include <algorithm>
16456 * main.cc: Include <cstring>.
16457 * options.cc: Include <cstring>.
16458 * output.cc: Include <cstring>.
16459 * script.cc: Include <cstring>.
16460 * script.h: Include <string>.
16461 * symtab.cc: Include <cstring> and <algorithm>.
16462 * target-select.cc: Include <cstring>.
16463 * version.cc: Include <string>.
16464 * testsuite/testmain.cc: Include <cstdlib>.
16465 * configure, config.in: Rebuild.
16466
874c5b28
ILT
164672008-03-25 Ian Lance Taylor <iant@google.com>
16468
819d6c3a
ILT
16469 * options.cc: Include "../bfd/bfdver.h".
16470 (options::help): Print bug reporting address.
16471
f4b2c6f5
ILT
16472 * version.cc (print_version): Adjust output for current value of
16473 BFD_VERSION_STRING.
16474
16475 * NEWS: New file.
16476
e96caa79
ILT
16477 * options.cc (options::help): Print list of supported targets.
16478 * target-select.h: Include <vector>.
16479 (class Target_selector): Make machine_, size_, and is_big_endian_
16480 fields const. Add bfd_name_ and instantiated_target_ fields.
16481 (Target_selector::Target_selector): Add bfd_name parameter.
16482 (Target_selector::recognize): Make non-virtual, call
16483 do_recognize.
16484 (Target_selector::recognize_by_name): Make non-virtual, call
16485 do_recognize_by_name.
16486 (Target_selector::supported_names): New function.
16487 (Target_selector::bfd_name): New function.
16488 (Target_selector::do_instantiate_target): New pure virtual
16489 function.
16490 (Target_selector::do_recognize): New virtual function.
16491 (Target_selector::do_recognize_by_name): New virtual function.
16492 (Target_selector::instantiate_target): New private function.
16493 (supported_target_names): Declare.
16494 * target-select.cc (Target_selector::Target_selector): Update for
16495 new parameter and fields.
16496 (select_target_by_name): Check that the name matches before
16497 calling recognize_by_name.
16498 (supported_target_names): New function.
16499 * i386.cc (class Target_selector_i386): Update Target_selector
16500 constructor call. Remove recognize and recognize_by_name. Add
16501 do_instantiate_target.
16502 * x86_64.cc (class Target_selector_x86_64): Likewise.
16503 * testsuite/testfile.cc (class Target_selector_test): Update for
16504 changes to Target_selector.
16505
874c5b28
ILT
16506 * README: Rewrite, with some notes on unsupported features.
16507
0a65a3a7
CC
165082008-03-24 Cary Coutant <ccoutant@google.com>
16509
16510 * i386.cc (Target_i386::Got_type): New enum declaration.
16511 (Target_i386::Scan::local): Updated callers of Output_data_got
16512 member functions.
16513 (Target_i386::Scan::global): Likewise.
16514 (Target_i386::Relocate::relocate): Likewise.
16515 (Target_i386::Relocate::relocate_tls): Likewise.
16516 * object.h (Got_offset_list): New class.
16517 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16518 (Sized_relobj::local_got_offset): Likewise.
16519 (Sized_relobj::set_local_got_offset): Likewise.
16520 (Sized_relobj::local_has_tls_got_offset): Removed.
16521 (Sized_relobj::local_tls_got_offset): Removed.
16522 (Sized_relobj::set_local_tls_got_offset): Removed.
16523 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16524 * output.cc (Output_data_got::add_global): Added got_type parameter.
16525 (Output_data_got::add_global_with_rel): Likewise.
16526 (Output_data_got::add_global_with_rela): Likewise.
16527 (Output_data_got::add_global_pair_with_rel): New function.
16528 (Output_data_got::add_global_pair_with_rela): New function.
16529 (Output_data_got::add_local): Added got_type parameter.
16530 (Output_data_got::add_local_with_rel): Likewise.
16531 (Output_data_got::add_local_with_rela): Likewise.
16532 (Output_data_got::add_local_pair_with_rel): New function.
16533 (Output_data_got::add_local_pair_with_rela): New function.
16534 (Output_data_got::add_global_tls): Removed.
16535 (Output_data_got::add_global_tls_with_rel): Removed.
16536 (Output_data_got::add_global_tls_with_rela): Removed.
16537 (Output_data_got::add_local_tls): Removed.
16538 (Output_data_got::add_local_tls_with_rel): Removed.
16539 (Output_data_got::add_local_tls_with_rela): Removed.
16540 * output.h (Output_data_got::add_global): Added got_type parameter.
16541 (Output_data_got::add_global_with_rel): Likewise.
16542 (Output_data_got::add_global_with_rela): Likewise.
16543 (Output_data_got::add_global_pair_with_rel): New function.
16544 (Output_data_got::add_global_pair_with_rela): New function.
16545 (Output_data_got::add_local): Added got_type parameter.
16546 (Output_data_got::add_local_with_rel): Likewise.
16547 (Output_data_got::add_local_with_rela): Likewise.
16548 (Output_data_got::add_local_pair_with_rel): New function.
16549 (Output_data_got::add_local_pair_with_rela): New function.
16550 (Output_data_got::add_global_tls): Removed.
16551 (Output_data_got::add_global_tls_with_rel): Removed.
16552 (Output_data_got::add_global_tls_with_rela): Removed.
16553 (Output_data_got::add_local_tls): Removed.
16554 (Output_data_got::add_local_tls_with_rel): Removed.
16555 (Output_data_got::add_local_tls_with_rela): Removed.
16556 * resolve.cc (Symbol::override_base_with_special): Removed
16557 reference to has_got_offset_ field.
16558 * symtab.cc (Symbol::init_fields): Replaced initialization
16559 of got_offset_ with got_offsets_. Removed initialization
16560 of has_got_offset_
53fcba31 16561 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16562 (Symbol::got_offset): Likewise.
16563 (Symbol::set_got_offset): Likewise.
16564 (Symbol::has_tls_got_offset): Removed.
16565 (Symbol::tls_got_offset): Removed.
16566 (Symbol::set_tls_got_offset): Removed.
16567 (Symbol::got_offset_): Removed.
16568 (Symbol::tls_mod_got_offset_): Removed.
16569 (Symbol::tls_pair_got_offset_): Removed.
16570 (Symbol::got_offsets_): New field.
16571 (Symbol::has_got_offset): Removed.
16572 (Symbol::has_tls_mod_got_offset): Removed.
16573 (Symbol::has_tls_pair_got_offset): Removed.
16574 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16575 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16576 member functions.
16577 (Target_x86_64::Scan::global): Likewise.
16578 (Target_x86_64::Relocate::relocate): Likewise.
16579 (Target_x86_64::Relocate::relocate_tls): Likewise.
16580
bd52eafb
BE
165812008-03-25 Ben Elliston <bje@au.ibm.com>
16582
16583 * yyscript.y: Fix spelling error in comment.
16584
8b105e34
ILT
165852008-03-24 Ian Lance Taylor <iant@google.com>
16586
8ed814a9
ILT
16587 * options.h (class General_options): Define build_id option.
16588 * layout.h (class Layout): Declare write_build_id, create_note,
16589 create_build_id. Add build_id_note_ member.
16590 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16591 "libiberty.h", "md5.h", "sha1.h".
16592 (Layout::Layout): Initialize eh_frame_data_,
16593 eh_frame_hdr_section_, and build_id_note_.
16594 (Layout::finalize): Call create_build_id.
16595 (Layout::create_note): New function, broken out of
16596 Layout::create_gold_note.
16597 (Layout::create_gold_note): Call create_note.
16598 (Layout::create_build_id): New function.
16599 (Layout::write_build_id): New function.
16600 (Close_task_runner::run): Call write_build_id.
16601
8b105e34
ILT
16602 * x86_64.cc: Correct license to GPLv3.
16603
086a1841
ILT
166042008-03-23 Ian Lance Taylor <iant@google.com>
16605
16606 * options.cc: Include "demangle.h".
16607 (parse_optional_string): New function.
16608 (parse_long_option): Handle takes_optional_argument.
16609 (parse_short_option): Update dash_z initializer. Handle
16610 takes_optional_argument.
16611 (General_options::General_options): Initialize do_demangle_.
16612 (General_options::finalize): Set do_demangle_. Handle demangling
16613 style.
16614 * options.h (parse_optional_string): Declare.
16615 (struct One_option): Add optional_arg field. Update constructor.
16616 Update call constructor calls. Add takes_optional_argument
16617 function.
16618 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16619 (DEFINE_optional_string): Define.
16620 (General_options::demangle): Change from DEFINE_bool to
16621 DEFINE_optional_string.
16622 (General_options::no_demangle): New function.
16623 (General_options::do_demangle): New function.
16624 (General_options::set_do_demangle): New function.
16625 (General_options::execstack_status_): Move definition to end of
16626 class definition.
16627 (General_options::static_): Likewise.
16628 (General_options::do_demangle_): New field.
16629 * object.cc (big_endian>::get_symbol_location_info): Call
16630 Options::do_demangle, not Options::demangle.
16631 * symtab.cc (demangle): Likewise.
16632
cbb93e63
ILT
166332008-03-22 Ian Lance Taylor <iant@google.com>
16634
16635 * gold.h: Include <cstddef> and <sys/types.h>
16636 * options.h: Include <cstring>.
16637
ec531623
ILT
166382008-03-21 Ian Lance Taylor <iant@google.com>
16639
16640 * Added source code to GNU binutils.
752937aa 16641\f
b90efa5b 16642Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
16643
16644Copying and distribution of this file, with or without modification,
16645are permitted in any medium without royalty provided the copyright
16646notice and this notice are preserved.
16647
16648Local Variables:
16649mode: change-log
16650left-margin: 8
16651fill-column: 74
16652version-control: never
16653End:
This page took 1.162026 seconds and 4 git commands to generate.