Fix a file descriptor leak in gold.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
24dd5808
CC
12015-02-02 Cary Coutant <ccoutant@google.com>
2
3 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
4 executable output file.
5
fa89cc82
HS
62015-01-22 Han Shen <shenhan@google.com>
7
8 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
9 (Target_arm::do_plt_address_for_global): New method.
10 (Target_arm::do_plt_address_for_local): New method.
11 (Target_arm::rel_irelative_section): New method.
12 (Target_arm::make_data_plt): Add more parameters for plt ctor.
13 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
14 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
15 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
16 (Target_arm::Scan::check_non_pic): Add ifunc support.
17 (Target_arm::Scan::local): Add ifunc support.
18 (Target_arm::Scan::global): Add ifunc support.
19 (Target_arm::make_plt_section): New method.
20 (Target_arm::make_plt_entry): Change to call to make_plt_section.
21 (Target_arm::make_local_ifunc_plt_entry): New method.
22 (Target_arm::got_irelative_): New member.
23 (Target_arm::rel_irelative_): New member.
24 (Target_arm::got_section): Add creation for got_irelative_.
25 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
26 (Target_arm::Relocate::relocate): Properly set local ifunc address.
27 (Target_arm::do_dynsym_value): Properly set global ifunc address.
28 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
29 (Output_data_plt_arm::IRelative_data): New type.
30 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
31 (Output_data_plt_arm::add_entry): Add more parameters.
32 (Output_data_plt_arm::add_relocation): New method.
33 (Output_data_plt_arm::add_local_ifunc_entry): New method.
34 (Output_data_plt_arm::rel_irelative): New method.
35 (Output_data_plt_arm::entry_count): Modified.
36 (Output_data_plt_arm::address_for_global): New method.
37 (Output_data_plt_arm::address_for_local): New method.
38 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
39 (Output_data_plt_arm::insert_irelative_data): New method.
40 (Output_data_plt_arm::irelative_rel_): New member.
41 (Output_data_plt_arm::got_): New member.
42 (Output_data_plt_arm::got_irelative_): New member.
43 (Output_data_plt_arm::irelative_count_): New member.
44 (Output_data_plt_arm::IRelative_data_vec): New typedef.
45 (Output_data_plt_arm::irelative_data_vec_): New member.
46 (Output_data_plt_arm::do_write): Write out irelative entries.
47 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
48 more parameters to ctor.
49 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
50 more parameters to ctor.
51 * output.h (Output_data_reloc::add_local_relative): New method.
52 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
53
0f81d3f0
AM
542015-01-29 Alan Modra <amodra@gmail.com>
55
56 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
57 and GOT_TLSGD to LE optimization.
58
65d92137
CC
592015-01-28 Cary Coutant <ccoutant@google.com>
60
61 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
62 for undef TLS symbols.
63 (Target_x86_64::Relocate::relocate_tls): Likewise.
64 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
65
5485698a
CC
662015-01-25 Cary Coutant <ccoutant@google.com>
67
68 * output.cc (Output_segment::set_section_addresses): Fix calculation
69 of size of relro segment.
70
b01a4b04
AM
712015-01-22 Alan Modra <amodra@gmail.com>
72
73 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
74 condition for need of ifunc plt entry.
75 (Target_powerpc::Scan::global <got relocs>): Likewise.
76
3d0064a9
CC
772015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
78
79 * mips.cc (reloc_high): Add r_sym.
80 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
81 reloc_high constructor.
82 (Mips_relocate_functions::relgot16_local): Likewise.
83 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
84 r_type to decide whether LO16 matches HI16.
85 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
86 rello16 and relgot16_local.
87
a5cd8f05
CC
882015-01-09 Cary Coutant <ccoutant@google.com>
89
90 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
91 unless alignment is larger than page size.
92
4fc1b9d4
L
932015-01-06 H.J. Lu <hongjiu.lu@intel.com>
94 Cary Coutant <ccoutant@google.com>
95
96 PR gold/17729
97 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
98 (DEFAULT_TARGET_X32): Set for x32.
99 * x86_64.cc (cmp_insn_32): New.
100 (lea_r10_insn_32): Likewise.
101 (lea_r11_insn_32): Likewise.
102 (cmp_insn_64): Likewise.
103 (lea_r10_insn_64): Likewise.
104 (lea_r11_insn_64): Likewise.
105 (Target_x86_64<size>::do_calls_non_split): Handle x32.
106 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
107 (check_DATA): Add split_x32 files.
108 (split_x32_[1234n].o): New targets.
109 (split_x32_[124]): New targets.
110 (split_x32_[1234r].stdout): New targets.
111 * testsuite/split_x32.sh: New file.
112 * testsuite/split_x32_1.s: Likewise.
113 * testsuite/split_x32_2.s: Likewise.
114 * testsuite/split_x32_3.s: Likewise.
115 * testsuite/split_x32_4.s: Likewise.
116 * testsuite/split_x32_n.s: Likewise.
117 * configure: Regenerated.
118 * testsuite/Makefile.in: Likewise.
119
e749cab8
L
1202015-01-06 H.J. Lu <hongjiu.lu@intel.com>
121
122 PR gold/17809
123 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
124 x32.
125
af759df0
AM
1262015-01-02 Alan Modra <amodra@gmail.com>
127
128 * version.cc (print_version): Just print current year.
129 * dwp.cc (print_version): Likewise.
130
b90efa5b
AM
1312015-01-01 Alan Modra <amodra@gmail.com>
132
133 Update year range in copyright notice of all files.
134
f12d1e8a
AM
1352014-12-25 Alan Modra <amodra@gmail.com>
136
137 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
138 new enums.
139 (Target_arm::merge_object_attributes, ): Likewise.
140
5c294fee
TG
1412014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
142
143 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
144 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
145 AEABI_VFP_args_vfp to check that.
146 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
147 value and replace hardcoded values by enum values.
148
e30880c2
CC
1492014-12-22 Cary Coutant <ccoutant@google.com>
150
151 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
152
bd040da1
L
1532014-12-20 H.J. Lu <hongjiu.lu@intel.com>
154
155 PR gold/14608
156 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
157 to "return i * i * 3;".
158
e02a4046
CC
1592014-12-16 Cary Coutant <ccoutant@google.com>
160
161 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
162 (Mapfile::print_output_data): Use current_data_size() to avoid
163 assert for sections requiring postprocessing; if address is not valid,
164 print 0.
165 (Mapfile::print_output_section): Use current_data_size(); print note
166 that addresses and sizes are before compression.
167
add6016b
L
1682014-12-14 H.J. Lu <hongjiu.lu@intel.com>
169
170 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
171 Cast current_group_size to unsigned long when reporting error.
172
0bf32ea9
JY
1732014-12-10 Jing Yu <jingyu@google.com>
174
175 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
176 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
177 Update error message.
178 (Target_aarch64::do_relax): Use absolute value of option
179 stub_group_size. Replace local variable with class member
180 stub_group_size_.
181
cbcb23fa
AM
1822014-12-04 Alan Modra <amodra@gmail.com>
183
184 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
185 addend of PLTREL24 reloc when not generating a plt stub. Make
186 max_branch_offset an "Address".
fbad6518 187 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
188 (Target_powerpc::Relocate::relocate): Likewise.
189
1611bc4a
AM
1902014-12-04 Alan Modra <amodra@gmail.com>
191
192 PR 17670
193 * symtab.cc (Symbol::set_undefined): Remove assertion.
194 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
195 on symbols defined in discarded sections, instead return false.
196 Rearrange params, update all callers.
197 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
198 branches to syms in discarded sections.
199 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
200 undefined and flag as discarded.
201 (Target_powerpc::Relocate::relocate): Localize variable.
202
4759c34e
L
2032014-12-03 H.J. Lu <hongjiu.lu@intel.com>
204
205 PR gold/17675
206 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
207 * testsuite/Makefile.in: Regenerated.
208
1f98a074
AM
2092014-12-03 Alan Modra <amodra@gmail.com>
210
211 PR 17566
212 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
213 when adding dynamic relocations against section symbols.
214
fb257835
DI
2152014-12-01 Dimitry Ivanov <dimitry@google.com>
216
217 * layout.cc (Layout::finish_dynamic_section): When '-z global'
218 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
219 * options.h (General_options): New -z option (global).
220
d8e60314
CC
2212014-12-01 Cary Coutant <ccoutant@google.com>
222
223 PR gold/17578
224 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
225 is given.
226 (Layout::create_executable_stack_info): Warn when -z noexecstack is
227 given but some inputs require executable stack.
228
982bbd97
CC
2292014-11-26 Cary Coutant <ccoutant@google.com>
230
231 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
232 .debug_str_offsets; strip .debug_gnu_pubnames and
233 .debug_gnu_pubtypes.
234 (lines_only_debug_sections): Strip all four new sections.
235
bb779192
HS
2362014-11-26 Jing Yu <jingyu@google.com>
237
238 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
239 register to be x0 when to relax TLSDESC_LD64_LO12.
240
a3e60ddb
AM
2412014-11-26 Alan Modra <amodra@gmail.com>
242
243 * powerpc.cc (struct Stub_table_owner): New.
244 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
245 unsigned int vector. Update all references.
246 (powerpc_relobj::set_stub_table): Take an unsigned int param
247 rather than a Stub_table. Update callers.
248 (Powerpc_relobj::clear_stub_table): New function.
249 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
250 stub_group_size_ vars.
251 (Target_powerpc::new_stub_table): Delete.
252 (max_branch_delta): New function, extracted from..
253 (Target_powerpc::Relocate::relocate): ..here..
254 (Target_powerpc::Branch_info::make_stub): ..and here. Return
255 status on whether stub created successfully.
256 (Stub_control::Stub_control): Add "no_size_errors" param. Move
257 default sizing to..
258 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
259 reduce on relax failure.
260 (Target_powerpc::group_sections): Add "no_size_errors" param.
261 Use stub_group_size_. Set up group info in a temp vector,
262 before building Stub_table vector. Account for input sections
263 possibly already converted to relaxed sections.
264 (Stub_table::init): Delete. Merge into..
265 (Stub_table::Stub_table): ..here.
266 (Stub_table::can_reach_stub): New function.
267 (Stub_table::add_plt_call_entry): Add "from" parameter and
268 return true iff stub could be reached.
269 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
270 param too.
271 (Stub_table::clear_stubs): Add "all" param.
272
a20605cf
AM
2732014-11-26 Alan Modra <amodra@gmail.com>
274
275 * powerpc.cc (Stub_control::set_output_and_owner): New function.
276 (Target_powerpc::group_sections): Use it.
277
43b64deb
CC
2782014-11-25 Cary Coutant <ccoutant@google.com>
279
280 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
281 (Binary_to_elf::write_symbol): Add st_size parameter.
282 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
283
c924eb67
CC
2842014-11-25 Cary Coutant <ccoutant@google.com>
285
286 PR gold/17639
287 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
288 (Sized_relobj_file::do_layout): Handle deferred sections properly
289 during GC pass 1. Don't add reloc sections to deferred list twice.
290 * object.h (Sized_relobj_file::is_deferred_layout): New function.
291 (Sized_relobj_file::is_deferred_layout_): New data member.
292
9d585188
L
2932014-11-21 H.J. Lu <hongjiu.lu@intel.com>
294
295 PR gold/17619
296 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
297 Check PC-relative offset overflow in PLT entry.
298
3ffaac20
AM
2992014-11-21 Alan Modra <amodra@gmail.com>
300
301 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
302 for undefined weaks.
303
0cfb0717
AM
3042014-11-20 Alan Modra <amodra@gmail.com>
305
306 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
307 from --stub-group-size parameter divided by 1024.
308 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
309 template parameter. Update all uses.
310 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
311 has_stub_value. Set for long branches. Don't report overflow for
312 branch to undefined weak symbols. Print info message on
313 overflowing branch to stub.
314
f9dffbf0
AM
3152014-11-20 Alan Modra <amodra@gmail.com>
316
317 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
318
e88ba8d5
L
3192014-11-13 H.J. Lu <hongjiu.lu@intel.com>
320
321 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
322 entry for R_X86_64_GOTPLT64.
323 (Target_x86_64<size>::Relocate::relocate): Update comments for
324 R_X86_64_GOTPLT64.
325
d37ffe25
ED
3262014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
327
328 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
329 * plugin.h: add lock definition
330
9726c3c1
HS
3312014-10-29 Han Shen <shenhan@google.com>
332 Jing Yu <jingyu@google.com>
333
334 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
335 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
336 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
337 Symbol::TLS_REF.
338 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
339 method.
340 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
341 (Target_aarch64::tls_ld_to_le): New method.
342 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
343 for 64bit targets.
344 (Output_data_plt_aarch64::irelative_rel_): New data member.
345 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
346 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
347 (Output_data_plt_aarch64::add_relocation): New method.
348 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
349 offset. Add got_irelative size to got size.
350 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
351 type string with the new typename.
352 (AArch64_relocate_functions::update_adr): Replace parameter x with
353 immed.
354 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
355 (AArch64_relocate_functions::reloc_common): New method.
356 (AArch64_relocate_funcsions::rela_general): Extract common part out
357 into reloc_common method.
358 (AArch64_relocate_functions::rela_general): Likewise.
359 (AArch64_relocate_functions::pcrela_general): Likewise.
360 (AArch64_relocate_functions::adr): New method.
361 (AArch64_relocate_functions::adrp): Calculate immed before calling
362 update_adr.
363 (AArch64_relocate_functions::adrp): Likewise.
364 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
365 comparing x to 0. Calculate immed from ~x when x < 0.
366 (Target_aarch64::optimize_tls_reloc): Add new cases for
367 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
368 TLSLD_MOVW_DTPREL_G0_NC.
369 (Target_aarch64::possible_function_pointer_reloc): Implement this
370 method.
371 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
372 comment.
373 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
374 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
375 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
376 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
377 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
378 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
379 (Target_aarch64::make_plt_entry): Call add_entry with two more
380 parameters.
381 (Target_aarch64::make_local_ifunc_plt_entry): New method.
382 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
383 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
384 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
385 (Target_aarch64::Relocate::relocate_tls): Add cases for
386 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
387 TLSLD_MOVW_DTPREL_G0_NC.
388 * testsuite/icf_safe_so_test.cc: Correct test comment.
389 * testsuite/icf_safe_test.sh: Add AArch64 arch.
390
80272b8c
AM
3912014-10-22 Alan Modra <amodra@gmail.com>
392
393 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
394 thread_starter.
395
998a69f4
AS
3962014-10-18 Andreas Schwab <schwab@linux-m68k.org>
397
398 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
399
aed56ec5
CC
4002014-10-17 Cary Coutant <ccoutant@google.com>
401
402 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
403 Add "typename" keyword.
404
bb779192 4052014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
406 Jing Yu <jingyu@google.com>
407
408 Patch for gold aarch64 backend to support relaxation.
409 * aarch64-reloc.def: Change format.
410 * aarch64.cc (class Reloc_stub): New class.
411 (class Stub_table): New class.
412 (class AArch64_relobj): New class.
413 (class AArch64_input_section): New class.
414 (class AArch64_output_section): New class.
415 (Target_aarch64::new_stub_table): New method.
416 (Target_aarch64::new_aarch64_input_section): New method.
417 (Target_aarch64::find_aarch64_input_section): New method.
418 (Target_aarch64::scan_section_for_stubs): New method.
419 (Target_aarch64::scan_reloc_section_for_stubs): New method.
420 (Target_aarch64::relocate_stub): New method.
421 (Target_aarch64::current_target): New method.
422 (Target_aarch64::do_make_elf_object): New method.
423 (Target_aarch64::do_may_relax): New method.
424 (Target_aarch64::do_relax): New method.
425 (Target_aarch64::group_sections): New method.
426 (Target_aarch64::scan_reloc_for_stub): New method.
427 (Target_aarch64::do_make_output_section): New method.
428 (Target_aarch64::stub_tables_): New data member.
429 (Target_aarch64::aarch64_input_section_map_): New data member.
430 (AArch64_relocate_functions::maybe_apply_stub): New method.
431
db4c9594
CC
4322014-09-30 Cary Coutant <ccoutant@google.com>
433
434 PR gold/17432
435 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
436
cd6da036
KC
4372014-09-30 Kito Cheng <kito@0xlab.org>
438
439 PR gold/13597
440 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
441 hash table before sysv-style hash table.
442
5f772412
ST
4432014-09-29 Sriraman Tallam <tmsriram@google.com>
444
445 * options.h (--pic-executable): Add negative to alias to -no-pie.
446
5efeedf6
CC
4472014-09-26 Cary Coutant <ccoutant@google.com>
448
449 PR gold/16773
450 * object.cc (Sized_relobj_file): Compute value of section symbols
451 for TLS sections the same as TLS symbols.
452
1707f183
CC
4532014-09-25 Cary Coutant <ccoutant@google.com>
454
455 PR gold/17432
456 * resolve.cc (Symbol_table::resolve): Override common placeholder
457 symbols, but adjust sizes.
458 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
459 symbols to common lists.
460
00cac886
AM
4612014-09-24 Alan Modra <amodra@gmail.com>
462
463 * po/POTFILES.in: Regenerate.
464
635aa30e
CC
4652014-09-23 Taiju Tsuiki <tzik@google.com>
466 Cary Coutant <ccoutant@google.com>
467
71b9b91b 468 PR gold/14860
635aa30e
CC
469 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
470 on input_sections_blocker.
471 * layout.cc (Write_sections_task::locks): Unblock
472 input_sections_blocker_.
473 * layout.h (Write_sections_task::Write_sections_task): Add
474 input_sections_blocker.
475 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
476 to DEPENDENCIES.
477 * testsuite/Makefile.in: Regenerate.
478
c0c71592
RÁE
4792014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
480
481 * testsuite/Makefile.am (plugin_test_10): New test.
482 * testsuite/Makefile.in: Regenerate
483 * testsuite/plugin_common_test_2.c (c1): Align to 8.
484 * testsuite/plugin_test_10.sh: New file.
485
6168c2a1
RÁE
4862014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
487
488 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
489 * resolve.cc (Symbol_table::resolve): Don't override common symbols
490 during the replacement phase.
491
3a531937
JY
4922014-09-17 Han Shen <shenhan@google.com>
493 Jing Yu <jingyu@google.com>
494
495 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
496 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
497 * aarch64.cc (Target_aarch64): Add data members
498 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
499 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
500 constructor.
501 (Target_aarch64::do_reloc_symbol_index): New method.
502 (Target_aarch64::do_reloc_addend): New method.
503 (Target_aarch64::add_tlsdesc_info): New method.
504 (Target_aarch64::do_dynsym_value): New method.
505 (Target_aarch64::do_make_data_plt): Add new parameters: got,
506 got_irelative. Pass them to Output_data_plt_aarch64_standard.
507 (Target_aarch64::make_data_plt): Add new parameters: got,
508 got_irelative. Pass them to do_make_data_plt.
509 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
510 (Target_aarch64::Relocate:tls_gd_to_le): New method.
511 (Target_aarch64::Relocate:tls_ie_to_le): New method.
512 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
513 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
514 (Target_aarch64::got_tlsdesc_section): New method.
515 (Target_aarch64::make_local_ifunc_plt_entry): New method.
516 (Target_aarch64::define_tls_base_symbol): New method.
517 (Target_aarch64::reserve_tlsdesc_entries): New method.
518 (Target_aarch64::got_mod_index_entry): New method.
519 (Target_aarch64::rela_tlsdesc_section): New method.
520 (Target_aarch64::rela_irelative_section): New method.
521 (Target_aarch64::Tlsdesc_info): New struct.
522 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
523 relocations and tlsdesc relocations.
524 (Target_aarch64::optimize_tls_reloc): Implement method.
525 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
526 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
527 in constructor.
528 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
529 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
530 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
531 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
532 (Output_data_plt_aarch64::rela_tlsdesc): New method.
533 (Output_data_plt_aarch64::rela_irelative): New method.
534 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
535 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
536 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
537 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
538 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
539 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
540 (Output_data_plt_aarch64_standard): New member variables:
541 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
542 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
543 New parameter: got, got_irelative.
544 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
545 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
546 (Output_data_plt_aarch64::do_write): Replace got_address with
547 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
548 (AArch64_relocate_functions::update_movnz): New method.
549 (AArch64_relocate_functions): Correct format.
550 (AArch64_relocate_functions::movnz): New method.
551 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
552 before the switch. Add new cases to switch.
00cac886 553 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
554 tlsgd tlsdesc cases.
555 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
556 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
557 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
558 Call reloc_name_in_error_message to print unsupported reloc.
559 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
560 make_data_plt.
561 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
562 relocs. Fill in some more dynamic tags.
563 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
564 Skip call tls_get_addr when tlsgd is relaxed.
565 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
566 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
567 tlsdesc->ie relaxation.
568
62661c93
SS
5692014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
570
571 * mips.cc (Target_mips_nacl): New class.
572 (Target_selector_mips_nacl): New class.
573 (target_selector_mips32): Rename from target_selector_mips32be and use
574 Target_selector_mips_nacl instead of Target_selector_mips.
575 (target_selector_mips32el): Rename from target_selector_mips32 and use
576 Target_selector_mips_nacl instead of Target_selector_mips.
577 (target_selector_mips64): Rename from target_selector_mips64be and use
578 Target_selector_mips_nacl instead of Target_selector_mips.
579 (target_selector_mips64el): Rename from target_selector_mips64 and use
580 Target_selector_mips_nacl instead of Target_selector_mips.
581 (Target_mips::mips_info): Add const attribute.
582
54674d38
CC
5832014-09-02 Cary Coutant <ccoutant@google.com>
584
585 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
586 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
587 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
588 (Sized_incr_dynobj::do_section_name): Likewise.
589 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
590 (Sized_incr_dynobj::do_section_name): Likewise.
591 * object.h (Object::section_name): Likewise.
592 (Object::do_section_name): Likewise.
593 (Sized_relobj_file::do_section_name): Likewise.
594 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
595 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
596
9860cbcf
CC
5972014-09-02 Cary Coutant <ccoutant@google.com>
598
599 PR gold/17005
600 * ehframe.cc (Fde::write): Add output_offset parameter.
601 (Cie::write): Likewise.
602 (Eh_frame::set_final_data_size): Account for offset within output
603 section.
604 (Eh_frame::do_sized_write): Likewise.
605 * ehframe.h (Fde::write): Add output_offset parameter.
606 (Cie::write): Likewise.
607 * output.cc (Output_section::Input_section_sort_entry): Remove
608 section_has_name_; add output_section_name parameter. Use
609 output section name for non-input sections.
610 (Output_section::Input_section_sort_entry::section_has_name): Remove.
611 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
612 (Output_section::Input_section_sort_compare): Remove logic for
613 sections without names.
614 (Output_section::Input_section_sort_init_fini_compare): Likewise.
615 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
616 Likewise.
617 (Output_section::Input_section_sort_section_name_compare): Likewise.
618
8e33481e
HS
6192014-08-29 Han Shen <shenhan@google.com>
620 Jing Yu <jingyu@google.com>
621
622 * aarch64-reloc-property.cc
623 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
624 reference reloc property in the table.
625 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
626 3 other entries.
627 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
628 2 new overloaded methods.
629 (Output_data_got_aarch64::do_write): Add code to write out
630 static relocs.
631 (class Output_data_got_aarch64::Static_reloc): New class to wrap
632 static relocs.
633 (Output_data_got_aarch64::static_relocs): New vector to
634 hold static relocs.
635 (Target_aarch64::TCB_SIZE): New const static memeber.
636 (Target_aarch64::tcb_size): New method.
637 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
638 (Target_aarch64::Relocate::relocate_tls): New method.
639 (Target_aarch64::Scan::local): Add code handling new reloc types.
640 (Target_aarch64::Scan::global): Add code handling new reloc types.
641
81233653
ST
6422014-08-13 Sriraman Tallam <tmsriram@google.com>
643
644 * options.h (-no-pie): Add option.
645
9363c7c3
JY
6462014-08-08 Jing Yu <jingyu@google.com>
647 Han Shen <shenhan@google.com>
648
649 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
650 (DEFFILES): add aarch64-reloc.def.
651 (TARGETSOURCES): Add aarch64-reloc-property.cc.
652 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
653 * Makefile.in: Regenerate.
654 * aarch64-reloc-property.cc: New file.
655 * aarch64-reloc-property.h: New file.
656 * aarch64-reloc.def: New file.
657 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
658 with tab to make the format consistent.
659 (Output_data_got_aarch64::symbol_table_): New method.
660 (Target_aarch64::do_plt_address_for_global): New method.
661 (Target_aarch64::do_plt_address_for_local): New method.
662 (Target_aarch64::do_select_as_default_target): New method.
663 (Target_aarch64::do_make_data_plt): New method.
664 (Target_aarch64::make_data_plt): New method.
665 (Output_data_plt_aarch64::has_irelative_section): New method.
666 (Output_data_plt_aarch64::address_for_global): New method.
667 (Output_data_plt_aarch64::address_for_local): New method.
668 (Output_data_plt_aarch64::irelative_rel_): New parameter.
669 (Output_data_plt_aarch64::add_entry): Implement contents.
670 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
671 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
672 the got_pov entry to plt0.
673 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
674 Implement contents.
675 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
676 (AArch64_howto): New struct.
677 (aarch64_howto[]): New static const array.
678 (AArch64_relocate_functions): New class.
679 (Target_aarch64::Scan::get_reference_flags): Remove method.
680 (Target_aarch64::Scan::local): Implement to support a few relocations.
681 (Target_aarch64::Scan::global): Implement to support a few relocations.
682 (Target_aarch64::make_plt_section): Implement contents.
683 (Target_aarch64::make_plt_entry): Implement contents.
684 (Target_aarch64::do_finalize_sections): Implement contents.
685 (Target_aarch64::Relocate::relocate): Implement a few relocations.
686 (Target_aarch64::relocate_section): Implement contents.
687
ad9fe6c1
AM
6882014-08-06 Alan Modra <amodra@gmail.com>
689
690 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
691
7cd4e5b7
AM
6922014-08-06 Alan Modra <amodra@gmail.com>
693
694 PR 13227
695 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
696
5ad9b0a7
ST
6972014-07-21 Sriraman Tallam <tmsriram@google.com>
698
699 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 700 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 701
e051745c
CC
7022014-07-08 Cary Coutant <ccoutant@google.com>
703
704 * expression.cc (struct Expression::Expression_eval_info): Add
705 new fields type_pointer, vis_pointer, and nonvis_pointer.
706 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
707 nonvis_pointer parameters. Adjust all calls.
708 (Symbol_expression::value): Update type, visibility, and nonvis bits
709 in caller.
710 * script.cc (Symbol_assignment::sized_finalize): Update type,
711 visibility, and remaining st_other bits for new symbol.
712 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
713 vis_pointer, and nonvis_pointer parameters.
714 * symtab.h (Symbol::set_type): New method.
715
716 * testsuite/Makefile.am (defsym_test): New test.
717 * testsuite/Makefile.in: Regenerate.
718 * testsuite/defsym_test.c: New file.
719 * testsuite/defsym_test.sh: New file.
720
f35c4853
CC
7212014-07-08 Cary Coutant <ccoutant@google.com>
722
723 PR gold/15639
724 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
725 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
726 (Sized_dynobj::base_read_symbols): ...new method.
727 * object.h (Sized_relobj_file::base_read_symbols): New method.
728 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
729 (Sized_relobj_file::base_read_symbols): ...new method.
730 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
731 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
732 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
733
2900af2d
AM
7342014-07-04 Alan Modra <amodra@gmail.com>
735
736 * po/POTFILES.in: Regenerate.
737
053a4d68
JY
7382014-07-02 Jing Yu <jingyu@google.com>
739
740 * aarch64.cc: New file
741 * Makefile.am (TARGETSOURCES): Add aarch64.cc
742 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
743 * Makefile.in: Regenerate.
744 * configure.tgt: Add entries for aarch64*.
745 * configure.ac: Likewise.
746 * configure: Likewise.
747
7b549045
AM
7482014-06-27 Alan Modra <amodra@gmail.com>
749
750 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
751
cb818dbf
CC
7522014-06-24 Cary Coutant <ccoutant@google.com>
753
754 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
755 sections.
756 (Dwo_file::sized_read_unit_index): Likewise.
757
9810d34d
SS
7582014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
759
760 * mips.cc: New file.
761 * Makefile.am (TARGETSOURCES): Add mips.cc
762 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
763 * configure.tgt: Add entries for mips*.
764 * configure.ac: Likewise.
765 * Makefile.in: Regenerate.
766 * configure: Likewise.
767
9baa787b
CC
7682014-06-09 Cary Coutant <ccoutant@google.com>
769
770 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
771 unit_length is within section bounds.
772
8f89af0a
CC
7732014-06-09 Cary Coutant <ccoutant@google.com>
774
775 PR gold/16980
776 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
777 map.
778
a47622ac
AM
7792014-06-07 Alan Modra <amodra@gmail.com>
780
781 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
782
4320c691
CC
7832014-06-06 Cary Coutant <ccoutant@google.com>
784
785 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
786 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
787 (Dwarf_pubnames_table::read_header): Likewise.
788 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
789 .debug_gnu_pubtypes.
790
270c9937
JB
7912014-06-05 Joel Brobecker <brobecker@adacore.com>
792
793 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
794 * Makefile.in, configure: Regenerate.
795
397998fc
AM
7962014-06-03 Alan Modra <amodra@gmail.com>
797
798 * powerpc.cc (addis_12_2): Define.
799 (Stub_table::do_write): Support fusion on ELFv2 stubs.
800
61f5c66f
AM
8012014-06-03 Alan Modra <amodra@gmail.com>
802
803 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
804 st_other output.
805
f6971787
AM
8062014-06-02 Alan Modra <amodra@gmail.com>
807
808 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
809 Only ignore relocs on ELFv1.
810 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
811
f6fb8322
CC
8122014-05-30 Cary Coutant <ccoutant@google.com>
813
814 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
815 * testsuite/Makefile.in: Regenerate.
816 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
817
c23dd342
L
8182014-05-27 H.J. Lu <hongjiu.lu@intel.com>
819
820 PR gold/16945
821 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
822 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
823
5fe7ffdc
AM
8242014-05-15 Alan Modra <amodra@gmail.com>
825
826 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
827 Compare FDE contents with DW_CFA_nop rather than 0.
828
a82bef93
ST
8292014-05-13 Sriraman Tallam <tmsriram@google.com>
830
831 * symtab.h (may_need_copy_reloc): Remove check for position independent
832 code.
833 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
834 position independence before pc absolute may_need_copy_reloc call.
835 Add check for executable output befor pc relative may_need_copy_reloc
836 call.
837 * i386.cc: Ditto.
838 * arm.cc: Ditto.
839 * sparc.cc: Ditto.
840 * tilegx.cc: Ditto.
841 * powerpc.cc: Add check for no position independence before
842 may_need_copy_reloc calls.
843 * testsuite/pie_copyrelocs_test.cc: New file.
844 * testsuite/pie_copyrelocs_shared_test.cc: New file.
845 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 846 * Makefile.in: Regenerate.
a82bef93 847
53c66605
ML
8482014-05-08 Martin Liška <mliska@suse.cz>
849
850 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
851
57b2284c
CC
8522014-05-06 Cary Coutant <ccoutant@google.com>
853
854 PR gold/16900
855 * i386.cc (Output_data_got_plt_i386): New class.
856 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
857 parameter. Change all callers.
858 (Output_data_plt_i386::layout_): Remove.
859 (Output_data_plt_i386::got_plt_): Change type.
860 (Target_i386::got_plt_): Change type. Change all references.
861 (Target_i386::got_section): Create instance of new class.
862 (Output_data_got_plt_i386::do_write): New function.
863 * x86_64.cc (Output_data_got_plt_x86_64): New class.
864 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
865 parameter. Change all callers.
866 (Output_data_plt_x86_64::layout_): Remove.
867 (Output_data_plt_x86_64::got_plt_): Change type.
868 (Target_x86_64::got_plt_): Change type. Change all references.
869 (Target_x86_64::got_section): Create instance of new class.
870 (Output_data_got_plt_x86_64::do_write): New function.
871 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
872 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
873 class.
874
6b97515d 8752014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 876
6b97515d
CC
877 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
878 if we have pubnames/pubtypes.
879
d1bddd3c
CC
8802014-05-02 Cary Coutant <ccoutant@google.com>
881
5fe7ffdc
AM
882 * defstd.cc (in_segment): Define __ehdr_start here...
883 * layout.cc (Layout::finalize): ...Instead of here. Set the
884 output segment when known.
885 * resolve.cc (Symbol::override_base_with_special): Remember
886 the original binding.
887 * symtab.cc (Symbol::set_output_segment): New function.
888 (Symbol::set_undefined): New function.
889 * symtab.h (Symbol::is_weak_undefined): Check original undef
890 binding.
891 (Symbol::is_strong_undefined): New function.
892 (Symbol::set_output_segment): New function.
893 (Symbol::set_undefined): New function.
894 * target-reloc.h (is_strong_undefined): Remove.
895 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
896 Check for hidden undefs.
897 (relocate_section): Call Symbol::is_strong_undefined.
898
899 * testsuite/Makefile.am (ehdr_start_test_1)
900 (ehdr_start_test_2, ehdr_start_test_3)
901 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
902 * testsuite/Makefile.in: Regenerate.
903 * testsuite/ehdr_start_def.cc: New source file.
904 * testsuite/ehdr_start_test.cc: New source file.
905 * testsuite/ehdr_start_test.t: New linker script.
906 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 907
7849f6d8
CC
9082014-04-23 Cary Coutant <ccoutant@google.com>
909
bf2cc635 910 PR gold/16870
7849f6d8
CC
911 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
912
99fd8cff
CC
9132014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
914
915 * layout.cc (Layout::include_section): Allow a target to decide
916 whether to include a section.
917 * target.h (Target::should_include_section): New function.
918 (Target::do_should_include_section): New function.
919
91f43acd
CC
9202014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
921
922 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
923 inline into ...
924 (Copy_relocs::emit): ... here.
925 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
926 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
927 (Copy_reloc_entry::entries_): Change from private to protected.
928
c4eb27e1
ST
9292014-04-02 Sriraman Tallam <tmsriram@google.com>
930
931 * icf.cc (get_section_contents): Replace copies of reloc
932 vectors with const references.
933
ae447ddd
CC
9342014-04-02 Cary Coutant <ccoutant@google.com>
935
936 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
937 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
938 * configure: Regenerate.
939 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
940 -fno-use-linker-plugin.
941 (LINK1, CXXLINK1): Add it to the link command.
942 * testsuite/Makefile.in: Regenerate.
943
fa47fa92
AM
9442014-03-12 Alan Modra <amodra@gmail.com>
945
946 * Makefile.in: Regenerate.
947
9b12c500
CC
9482014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
949
950 * symtab.h (Symbol::set_nonvis): New function.
951
beacaa96
CC
9522014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
953
954 * symtab.cc (Sized_symbol<32>::init_output_data):
955 Instantiate the template.
956 (Sized_symbol<64>::init_output_data): Likewise.
957
800d9823
CC
9582014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
959
960 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
961 adjust dynamic symbol value.
962 * target.h (Target::adjust_dyn_symbol): New function.
963 (Target::do_adjust_dyn_symbol): New function.
964
918fc1f8 9652014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 966
918fc1f8
CC
967 * output.cc (Output_data_dynamic::Dynamic_entry::write):
968 Get the value of DYNAMIC_CUSTOM dynamic entry.
969 * output.h (Output_data_dynamic::add_custom): New function.
970 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
971 dynamic entry.
972 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
973 * target.h (Target::dynamic_tag_custom_value): New function.
974 (Target::do_dynamic_tag_custom_value): New function.
975
98ff9231
CC
9762014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
977
978 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
979 dynsym indexes.
980 * target.h (Target::has_custom_set_dynsym_indexes): New function.
981 (Target::do_has_custom_set_dynsym_indexes): New function.
982 (Target::set_dynsym_indexes): New function.
983 (Target::do_set_dynsym_indexes): New function.
984
b80eed39
AM
9852014-03-07 Alan Modra <amodra@gmail.com>
986
987 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
988 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
989 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
990 (Powerpc_relocate_functions::has_overflow_bitfield,
991 overflowed): Use the above.
992 (Target_powerpc::Relocate::relocate): Correct overflow checking
993 for a number of relocations. Modify overflow test for 16-bit
994 fields in instructions to signed/unsigned according to whether
995 the field takes a signed or unsigned value.
996
4b95cf5c
AM
9972014-03-05 Alan Modra <amodra@gmail.com>
998
999 Update copyright years.
1000
45965137
AM
10012014-03-05 Alan Modra <amodra@gmail.com>
1002
1003 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1004 R_PPC64_ADDR64_LOCAL.
1005 (Target_powerpc::Relocate::relocate): Likewise.
1006
2c80b753
AM
10072014-03-03 Alan Modra <amodra@gmail.com>
1008
1009 * dwp.cc (print_version): Update copyright year to current.
1010
c1c69e83
AM
10112014-02-10 Alan Modra <amodra@gmail.com>
1012
1013 * po/gold.pot: Regenerate.
1014
dd0c4e70
CC
10152014-02-06 Cary Coutant <ccoutant@google.com>
1016
1017 Fix problem where -u is ignored when a weak undef is seen.
1018
1019 * archive.cc (Library_base::should_include_member): Reorder
1020 code to check for -u option if a weak undef has already been seen.
1021 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1022 * testsuite/Makefile.in: Regenerate.
1023 * testsuite/weak_undef_file3.cc: New file.
1024 * testsuite/weak_undef_file4.cc: New file.
1025 * testsuite/weak_undef_test_2.cc: New file.
1026
1a221d3d
CC
10272014-02-05 Cary Coutant <ccoutant@google.com>
1028
1029 Fix issues with gold undefined symbol diagnostics.
1030
1031 PR binutils/15435
1032 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1033 check to here.
1034 * target-reloc.h (is_strong_undefined): New function.
1035 (relocate_section): Move undef vtable symbol check from here.
1036 Check for is_strong_undefined.
1037
e889f0a4 10382014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1039
e889f0a4
CC
1040 Fix problems with the --dynamic-list option.
1041
1042 PR gold/13577
1043 * options.cc (General_options::parse_dynamic_list):
1044 Set have_dynamic_list_.
1045 (General_options::General_options): Initialize have_dynamic_list_.
1046 (General_options::finalize): Turn off -Bsymbolic and
1047 -Bsymbolic-functions if --dynamic-list provided.
1048 * options.h (General_options::have_dynamic_list): New function.
1049 (General_options::have_dynamic_list_): New data member.
1050 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
1051 correctly.
5fe7ffdc 1052
e889f0a4
CC
1053 PR gold/16530
1054 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
1055 in --dynamic-list, mark it.
5fe7ffdc 1056
e889f0a4
CC
1057 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
1058 (dynamic_list_2): New test case.
1059 * testsuite/Makefile.in: Regenerate.
1060 * testsuite/dynamic_list_2.cc: New file.
1061 * testsuite/dynamic_list_2.t: New file.
1062 * testsuite/dynamic_list_lib1.cc: New file.
1063 * testsuite/dynamic_list_lib2.cc: New file.
1064 * testsuite/gc_dynamic_list_test.c: New file.
1065 * testsuite/gc_dynamic_list_test.sh: New file.
1066 * testsuite/gc_dynamic_list_test.t: New file.
1067
ec673e64
CC
10682014-01-28 Cary Coutant <ccoutant@google.com>
1069
1070 Add .gdb_index version 7 support.
1071
1072 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1073 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1074 debug sections.
1075 (Dwarf_ranges_table::read_ranges_table): Likewise.
1076 (Dwarf_pubnames_table::read_section): Check for GNU-style
1077 sections, and for compressed debug sections.
1078 (Dwarf_pubnames_table::read_header): Compute end address of table.
1079 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1080 for end of list by offset, not by offset == 0.
1081 (Dwarf_info_reader::do_read_string_table): Check for compressed
1082 debug sections.
1083 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1084 Initialize new data members.
1085 (Dwarf_pubnames_table::next_name): return flag_byte.
1086 (Dwarf_pubnames_table::end_of_table_): New data member.
1087 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1088 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1089 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1090 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1091 read skeleton type unit DIEs.
1092 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1093 (Gdb_index::do_write): Write flag_byte.
1094 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1095 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1096 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1097 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1098
221fd5d5
L
10992014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1100
1101 * version.cc (print_version): Update copyright year to 2014.
1102
6c09fb0b
ILT
11032013-12-19 Dimitry Andric <dimitry@andric.com>
1104
1105 * stringpool.cc (Stringpool_template::reserve): Add
1106 HAVE_UNORDERED_MAP case.
1107 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1108
8356f2d0
CC
11092013-12-18 Cary Coutant <ccoutant@google.com>
1110
1111 * configure.ac: Check for <unordered_set> and <unordered_map>.
1112 * config.in: Regenerate.
1113 * configure: Regenerate.
1114 * system.h: Use <unordered_set> and <unordered_map> if available.
1115
f2c7d7ee
RM
11162013-12-10 Roland McGrath <mcgrathr@google.com>
1117
1118 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1119 with $(INSTALL_PROGRAM_ENV).
1120 * Makefile.in: Regenerate.
1121
6632e8cc
CC
11222013-11-22 Cary Coutant <ccoutant@google.com>
1123
1124 * configure.ac: Add check for which library is needed for
1125 dlopen.
1126 * configure: Regenerate.
1127
0c075858
CC
11282013-11-22 Cary Coutant <ccoutant@google.com>
1129
1130 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1131 assembler.
1132 * testsuite/Makefile.in: Regenerate.
1133
f49fe902
L
11342013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1135
1136 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1137 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1138 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1139 (Target_x86_64<size>::Scan::local): Likewise.
1140 (Target_x86_64<size>::Scan::global): Likewise.
1141 (Target_x86_64<size>::Relocate::relocate): Likewise.
1142 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1143 Likewise.
1144 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1145 R_X86_64_PC32_BND.
1146
1147 * testsuite/Makefile.am (check_PROGRAMS): Add
1148 exception_x86_64_bnd_test.
1149 (exception_x86_64_bnd_test_SOURCES): New macro.
1150 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1151 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1152 (exception_x86_64_bnd_test_LDADD): Likewise.
1153 (exception_x86_64_bnd_1.o): New rule.
1154 (exception_x86_64_bnd_2.o): Likewise.
1155 * testsuite/Makefile.in: Regenerated.
1156
9055360d
AM
11572013-11-15 Alan Modra <amodra@gmail.com>
1158
1159 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1160 accessor.
1161 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1162 Only call ppc64_local_entry_offset for 64-bit. Restrict
1163 symval_for_branch lookup to ELFv1.
1164 (Stub_table::add_plt_call_entry): Use unsigned int off.
1165 (Output_data_glink::Address, invalid_address): New.
1166 (Output_data_glink::add_eh_frame): Move out of line. Add
1167 support for ELFv2.
1168 (Output_data_glink::add_global_entry, find_global_entry,
1169 global_entry_address): New functions.
1170 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1171 ge_size): New variables.
1172 (Output_data_glink::set_final_data_size): Add global entry
1173 stub sizing.
1174 (Output_data_glink::do_write): Write global entry stubs.
1175 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1176 parameter. Return true for ELFv2. Adjust callers.
1177 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1178 ELFv1. Similarly for ifunc and dynamic relocation processing
1179 specific to ELFv1. Recognize that symbols are defined on
1180 their plt entries for ELFv2.
1181 (Target_powerpc::symval_for_branch): Assert if called for
1182 ELFv2 or ppc32.
1183 (Target_powerpc::Relocate::relocate): Use global entry plt
1184 stub for symbol value if such exists on ELFv2.
1185 (Target_powerpc::Relocate::relocate): Don't call
1186 symval_for_branch when ELFv2. Do adjust for local entry
1187 offset when ELFv2.
1188 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1189 plt stub for ELFv2.
1190 (Target_powerpc::do_plt_address_for_global): Similarly.
1191
cafdd569
CC
11922013-11-14 Cary Coutant <ccoutant@google.com>
1193
1194 Revert patch -- this did not fix the problem, and there is
1195 no race there.
1196
1197 2013-11-14 Cary Coutant <ccoutant@google.com>
1198
1199 PR gold/14860
1200 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1201 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1202 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1203 updating fde_offsets_.
1204 (Eh_frame_hdr::lock_): New data member.
1205
94e49e16
CC
12062013-11-14 Cary Coutant <ccoutant@google.com>
1207
1208 * dwp.cc (Dwo_file_entry): New type.
1209 (File_list): Use Dwo_file_entry.
1210 (Dwo_file::verify): New function.
1211 (Dwo_file::verify_dwo_list): New function.
1212 (Dwo_file::sized_verify_dwo_list): New function.
1213 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1214 list.
1215 (Dwp_options): New enum type.
1216 (dwp_options): Add --verify-only.
1217 (usage): Likewise.
1218 (main): Likewise.
1219 * dwp.h (gold_info): Add declaration.
1220
7cdd7d57
CC
12212013-11-14 Cary Coutant <ccoutant@google.com>
1222
1223 PR gold/14860
1224 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1225 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1226 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1227 updating fde_offsets_.
1228 (Eh_frame_hdr::lock_): New data member.
1229
1d946cb3
CC
12302013-11-06 Cary Coutant <ccoutant@google.com>
1231
1232 PR gold/15758
1233 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1234 before reloc sections.
1235
4f65b40e
AM
12362013-11-04 Alan Modra <amodra@gmail.com>
1237
1238 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1239 (Symbol::needs_dynamic_reloc): Test new flag.
1240 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1241 (Target_powerpc::Scan::get_reference_flags): Add target param.
1242 Return FUNC_DESC_ABI for 64-bit ELFv1.
1243 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1244 call.
1245 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1246 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1247
908794a9
CC
12482013-10-31 Cary Coutant <ccoutant@google.com>
1249
1250 Restore support for dwp v2 DWARF package file format.
1251
1252 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1253 tu_length parameter. Adjust all callers.
1254 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1255 * dwp.cc: Include dwarf.h.
1256 (Section_bounds): New struct type.
1257 (Unit_set): New struct type.
1258 (Dwo_file::Dwo_file): Initialize new data member.
1259 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1260 Combine and rename to...
1261 (Dwo_file::read_unit_index): ...this.
1262 (Dwo_file::sized_read_compunit_index)
1263 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1264 (Dwo_file::sized_read_unit_index): ...this.
1265 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1266 parameters; add section_id parameter.
1267 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1268 (Dwo_file::add_unit_set): ...this.
1269 (Dwo_file::shndx_map_): Remove.
1270 (Dwo_file::sect_offsets_): New data member.
1271 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1272 (Dwp_output_file::add_section): Rename to...
1273 (Dwp_output_file::add_contribution): ...this.
1274 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1275 (Dwp_output_file::add_tu_set): Likewise.
1276 (Dwp_output_file::Contribution): New type.
1277 (Dwp_output_file::Section::contributions): New data member.
1278 (Dwp_output_file::Cu_or_tu_set): Remove.
1279 (Dwp_output_file::Section::Section): New ctor.
1280 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1281 (Dwp_output_file::Dwp_index::Section_table): New type.
1282 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1283 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1284 parameter.
1285 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1286 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1287 (Dwp_output_file::Dwp_index::section_table): New member function.
1288 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1289 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1290 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1291 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1292 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1293 (Dwp_output_file::Dwp_index::section_table_): New data member.
1294 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1295 (Dwp_output_file::add_output_section): New member function.
1296 (Dwp_output_file::write_new_section): New member function.
1297 (Dwp_output_file::write_contributions): New member function.
1298 (Dwp_output_file::section_id_map_): New data member.
1299 (class Dwo_id_info_reader): Remove.
1300 (class Unit_reader): New class.
1301 (get_dwarf_section_name): New function.
1302 (Dwo_file::read_executable): Adjust initializations of class data.
1303 (Dwo_file::read): Add support for v2 package file format.
1304 (Dwo_file::read_unit_index): Likewise.
1305 (Dwo_file::sized_read_unit_index): Likewise.
1306 (Dwo_file::copy_section): Likewise.
1307 (Dwo_file::add_unit_set): Likewise.
1308 (Dwp_output_file::add_output_section): Likewise.
1309 (Dwp_output_file::add_contribution): Likewise.
1310 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1311 for empty slot.
1312 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1313 file format.
1314 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1315 slot.
1316 (Dwp_output_file::initialize): Remove unused function.
1317 (Dwp_output_file::finalize): Add support for v2 package file format.
1318 (Dwp_output_file::write_index): Likewise.
1319 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1320 function prototype.
1321
2500c017
CC
13222013-10-31 Cary Coutant <ccoutant@google.com>
1323
1324 * configure.ac: Fix check for -fmerge-constants.
1325 * configure.ac: Regenerate.
1326
dd0845d7
RM
13272013-10-30 Roland McGrath <mcgrathr@google.com>
1328
1329 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1330 Correct 9-byte nop sequence to match what the assembler generates.
1331
b4f7960d
AM
13322013-10-30 Alan Modra <amodra@gmail.com>
1333
1334 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1335 ppc64_local_entry_offset, ppc64_local_entry_offset,
1336 do_read_symbols): New functions.
1337 (Powerpc_relobj::e_flags_, st_other_): New vars.
1338 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1339 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1340 (Powerpc_relobj::e_flags_): New var.
1341 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1342 and adjust for ELFv2.
1343 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1344 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1345 (Powerpc_dynobj::do_find_special_sections): Likewise.
1346 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1347 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1348 to ELFv2 local entry.
1349 (Target_powerpc::do_relax): No thread safe barriers needed for
1350 ELFv2.
1351 (Output_data_plt_powerpc::initial_plt_entry_size_,
1352 plt_entry_size): Delete. Replace all uses with
1353 first_plt_entry_offset() and plt_entry_size().
1354 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1355 reserved_size parm. Update callers.
1356 (Output_data_plt_powerpc::entry_count): Update.
1357 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1358 and use Target_powerpc::first_plt_entry_offset().
1359 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1360 rename to plt_entry_size.
1361 (Output_data_plt_powerpc::add_ifunc_entry,
1362 add_local_ifunc_entry): Adjust reloc for ELFv2.
1363 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1364 (glink_eh_frame_fde_64v2): New.
1365 (Stub_table::plt_call_size): Support ELFv2 sizing.
1366 (Output_data_glink::add_eh_frame): Use the new FDE.
1367 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1368 (Stub_table::do_write): Write ELFv2 stubs and glink.
1369 (Target_powerpc::Relocate::relocate): Replaces nop after call
1370 with ld 2,24(1) and adjust local offset destination for ELFv2.
1371
f9c6b907
AM
13722013-10-30 Alan Modra <amodra@gmail.com>
1373
1374 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1375 (Target_powerpc::Scan::global, local): Likewise.
1376 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1377 on all ppc64 @h and @ha relocs.
1378
e84fe78f
AM
13792013-10-14 Alan Modra <amodra@gmail.com>
1380
1381 * output.h (Output_data_got::add_constant): Tidy.
1382 (Output_data_got::add_constant_pair): New function.
1383 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1384 methods used so as to first call reserve_ent().
1385
679e4abf
RM
13862013-10-11 Roland McGrath <mcgrathr@google.com>
1387
44dcb735
RM
1388 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1389 add_got_entry and add_got_entry_pair.
1390
13323c49
RM
1391 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1392 (HAVE_PUBNAMES): Likewise.
1393 * configure: Regenerate.
1394
1496b446
RM
1395 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1396 * testsuite/Makefile.in: Regenerate.
1397
cc84c10b
RM
1398 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1399 Remove const from declaration.
1400 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1401 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1402 * output.h (Output_file_header): Remove const from member target_
1403 and corresponding constructor argument.
1404 * output.cc (Output_file_header::Output_file_header): Update prototype.
1405 (Output_file_header::do_sized_write): Use this->target_ in place
1406 of parameters()->target().
1407
52f66a2c
RM
1408 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1409
2b64b551
RM
1410 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1411 * configure: Regenerate.
1412 * Makefile.in: Regenerate.
1413 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1414 * testsuite/merge_string_literals_2.c: Likewise.
1415 * testsuite/Makefile.am
1416 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1417 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1418 literal -fmerge-constants.
1419 * testsuite/Makefile.in: Regenerate.
1420
43819297
RM
1421 * i386.cc (Target_i386): Remove unused member dynbss_.
1422 * arm.cc (Target_arm): Likewise.
1423 * powerpc.cc (Target_powerpc): Likewise.
1424 * sparc.cc (Target_sparc): Likewise.
1425 * tilegx.cc (Target_tilegx): Likewise.
1426 * x86_64.cc (Target_x86_64): Likewise.
1427 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1428 type_signature_, type_offset_.
1429 * plugin.h (Plugin_hook): Remove unused member layout_.
1430 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1431 mapfile_.
1432 (Read_member): Remove unused members input_objects_, symtab_,
1433 mapfile_, layout_.
1434 (Check_library): Remove unused member symtab_.
1435 * archive.h (Lib_group): Remove unused member lib_.
1436 * archive.cc (Lib_group::Lib_group): Update initializer.
1437 * incremental.h (Incremental_binary): Remove unused member target_.
1438 (Incremental_script_entry): Removed unused member script_.
1439 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1440 * icf.h (Icf): Remove unused member num_tracked_relocs.
1441
39d9ead7
RM
1442 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1443 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1444 its only use.
1445 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1446
679e4abf
RM
1447 * archive.h: Use struct rather than class for forward declaration
1448 of Read_symbols_data.
1449
54de2ea6
CC
14502013-10-07 Cary Coutant <ccoutant@google.com>
1451
1452 PR gold/16010
1453 * testsuite/Makefile.am (icf_test): Fix dependencies.
1454 (icf_safe_test): Likewise.
1455 (icf_safe_so_test): Likewise.
1456 (large_symbol_alignment): Add empty _LDADD rule.
1457 * testsuite/Makefile.in: Regenerate.
1458
b14016f0
L
14592013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1460
1461 PR gold/15927
1462 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1463 relocation for R_X86_64_32 on x32.
1464
eb426534
RM
14652013-08-27 Roland McGrath <mcgrathr@google.com>
1466
1467 * output.cc (Output_segment::set_section_addresses): Take new
1468 Target* argument. If target->isolate_execinstr() and the segment
1469 is executable and starts at a target->abi_pagesize() boundary,
1470 pad its end out to a target->abi_pagesize() boundary with code fill.
1471 * output.h (Output_segment::set_section_addresses): Update decl.
1472 * layout.h (Layout::check_output_data_for_reset_values): Take new
1473 argument RELAX_OUTPUTS.
1474 (Layout): New member relax_output_list_.
1475 (Layout::add_relax_output): New method.
1476 * layout.cc (Layout::Layout): Update constructor.
1477 (Layout::reset_relax_output): New method.
1478 (Layout::clean_up_after_relaxation): Call it.
1479 (Layout::prepare_for_relaxation): Update caller.
1480 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1481 Call reset_relax_output before re-processing segments for
1482 isolate_execinstr case.
1483 (Layout::write_data): Handle relax_output_list_.
1484 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1485 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1486
9aff4b7a
NC
14872013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1488
1489 PR binutils/15834
1490 * object.h: Fix typos.
1491
93f8221c
RM
14922013-08-16 Roland McGrath <mcgrathr@google.com>
1493
1494 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1495 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1496
e44c3715
CC
14972013-08-07 Cary Coutant <ccoutant@google.com>
1498
1499 Revert support for v2 DWP files:
1500
1501 2013-03-01 Cary Coutant <ccoutant@google.com>
1502
1503 Add dwp support for v2 DWARF package file format.
1504 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1505 tu_length parameter. Adjust all callers.
1506 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1507 * dwp.cc: Include dwarf.h.
1508 (Section_bounds): New struct type.
1509 (Unit_set): New struct type.
1510 (Dwo_file::Dwo_file): Initialize new data member.
1511 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1512 Combine and rename to...
1513 (Dwo_file::read_unit_index): ...this.
1514 (Dwo_file::sized_read_compunit_index)
1515 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1516 (Dwo_file::sized_read_unit_index): ...this.
1517 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1518 parameters; add section_id parameter.
1519 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1520 (Dwo_file::add_unit_set): ...this.
1521 (Dwo_file::shndx_map_): Remove.
1522 (Dwo_file::sect_offsets_): New data member.
1523 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1524 (Dwp_output_file::add_section): Rename to...
1525 (Dwp_output_file::add_contribution): ...this.
1526 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1527 (Dwp_output_file::add_tu_set): Likewise.
1528 (Dwp_output_file::Contribution): New type.
1529 (Dwp_output_file::Section::contributions): New data member.
1530 (Dwp_output_file::Cu_or_tu_set): Remove.
1531 (Dwp_output_file::Section::Section): New ctor.
1532 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1533 (Dwp_output_file::Dwp_index::Section_table): New type.
1534 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1535 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1536 parameter.
1537 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1538 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1539 (Dwp_output_file::Dwp_index::section_table): New member function.
1540 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1541 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1542 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1543 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1544 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1545 (Dwp_output_file::Dwp_index::section_table_): New data member.
1546 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1547 (Dwp_output_file::add_output_section): New member function.
1548 (Dwp_output_file::write_new_section): New member function.
1549 (Dwp_output_file::write_contributions): New member function.
1550 (Dwp_output_file::section_id_map_): New data member.
1551 (class Dwo_id_info_reader): Remove.
1552 (class Unit_reader): New class.
1553 (get_dwarf_section_name): New function.
1554 (Dwo_file::read_executable): Adjust initializations of class data.
1555 (Dwo_file::read): Add support for v2 package file format.
1556 (Dwo_file::read_unit_index): Likewise.
1557 (Dwo_file::sized_read_unit_index): Likewise.
1558 (Dwo_file::copy_section): Likewise.
1559 (Dwo_file::add_unit_set): Likewise.
1560 (Dwp_output_file::add_output_section): Likewise.
1561 (Dwp_output_file::add_contribution): Likewise.
1562 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1563 for empty slot.
1564 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1565 file format.
1566 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1567 slot.
1568 (Dwp_output_file::initialize): Remove unused function.
1569 (Dwp_output_file::finalize): Add support for v2 package file format.
1570 (Dwp_output_file::write_index): Likewise.
1571 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1572 function prototype.
1573
c6905c28
CC
15742013-07-31 Cary Coutant <ccoutant@google.com>
1575
1576 * object.cc (Sized_relobj::do_output_section_address): New function.
1577 (Sized_relobj): Instantiate explicitly.
1578 * object.h (Object::output_section_address): New function.
1579 (Object::do_output_section_address): New function.
1580 (Sized_relobj::do_output_section_address): New function.
1581 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1582
15832013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 1584 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
1585
1586 * parameters.cc (Parameters::entry): Return target-specific entry
1587 symbol name.
1588 * target.h (Target::entry_symbol_name): New function.
1589 (Target_info::entry_symbol_name): New data member.
1590
1591 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1592 * i386.cc (Target_i386::i386_info): Likewise.
1593 (Target_i386_nacl::i386_nacl_info): Likewise.
1594 * sparc.cc (Target_sparc::sparc_info): Likewise.
1595 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1596 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1597 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1598 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1599
234d4ab8
SA
16002013-07-22 Sterling Augustine <saugustine@google.com>
1601
1602 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1603 Convert parameter shndx to local variable. Add parameters symtab
1604 and symtab_size. Scan over section names. Find relocation
1605 section corresponding to current section. Create and initialize
1606 reloc_mapper_ and reloc_type_.
1607 (Dwarf_pubnames_table::read_header): Add assertion. Change
1608 unit_length to off_t. Initialize member unit_length_. Fill in field
1609 cu_offset_.
1610 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1611 Initialize new fields unit_length_ and cu_offset_.
1612 (Dwarf_pubnames_table::read_section): Update prototype.
1613 (Dwarf_pubnames_table::cu_offset): New member function.
1614 (Dwarf_pubnames_table::subsection_size): Likewise.
1615 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1616 New fields.
1617 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1618 member functions public.
1619 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1620 Update comment. Rework logic. Move repeated parts to...
1621 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1622 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1623 pubtypes_table_, and stmt_list_offset.
1624 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1625 Gdb_index::find_pubtype_offset,
1626 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1627 (Gdb_index::pubnames_read): Update prototype and rework logic.
1628 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1629 Forward declare.
1630 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1631 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1632 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1633 Gdb_index::map_pubtable_to_dies):
1634 Declare functions.
1635 (Gdb_index::pubnames_read): Update declaration.
1636 (Gdb_index::Pubname_offset_map): New type.
1637 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1638 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1639 Gdb_index::stmt_list_offset): Declare.
1640 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1641 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1642 Gdb_index::pubtypes_offset_): Remove.
1643
a3ed37d8
RM
16442013-07-19 Roland McGrath <mcgrathr@google.com>
1645
1646 * options.h (General_options): Add -Trodata-segment option.
1647 * parameters.cc (Parameters::check_rodata_segment): New function.
1648 (Parameters::set_target_once): Call it.
1649 * parameters.h (Parameters): Declare it (private member function).
1650 * layout.cc (load_seg_unusable_for_headers): New function, broken
1651 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1652 then validate rodata segment rather than text segment.
1653 (relaxation_loop_body): Call that.
1654 (is_text_segment): New function. Don't admit a non-executable
1655 segment if TARGET->isolate_execinstr().
1656 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1657
eb5b4ded
CC
16582013-07-15 Shawn Landden <shawnlandden@gmail.com>
1659
1660 PR gold/15070
1661 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1662 * nacl.h (Sniff_file::View::View): Request aligned view.
1663
4d5effb9
CC
16642013-07-11 Cary Coutant <ccoutant@google.com>
1665
1666 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1667 correct BRLT entry size.
1668
ba8ca3e7
AM
16692013-07-03 Alan Modra <amodra@gmail.com>
1670
1671 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1672 comment.
1673
267257d2
CC
16742013-07-01 Cary Coutant <ccoutant@google.com>
1675
1676 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1677 reloc_type_.
1678 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1679 (Dwarf_ranges_table::lookup_reloc): New function.
1680 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1681 reloc_type_.
1682 (Dwarf_ranges_table::lookup_reloc): New function.
1683 (Dwarf_ranges_table::reloc_type_): New data member.
1684
06f30c9d
CC
16852013-06-27 Jing Yu <jingyu@google.com>
1686
1687 PR gold/15662
1688 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1689 function.
1690 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1691 (Target_powerpc::do_relax): Call the above.
1692
a2d7bf59
AM
16932013-06-27 Cary Coutant <ccoutant@google.com>
1694
1695 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1696 on garbage collected .opd section.
1697
16982013-06-27 Alan Modra <amodra@gmail.com>
1699
1700 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1701 is non-zero.
1702 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1703 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1704
32364e50
CC
17052013-06-14 Cary Coutant <ccoutant@google.com>
1706
1707 * resolve.cc (Symbol::override_base): Don't override st_type
1708 from plugin placeholder symbols.
1709 (Symbol_table::resolve): Likewise.
1710 (Symbol_table::should_override): Don't complain about TLS mismatch
1711 if the TO symbol is a plugin placeholder.
1712 * testsuite/Makefile.am (plugin_test_tls): New test.
1713 * testsuite/Makefile.in: Regenerate.
1714 * testsuite/plugin_test_tls.sh: New test script.
1715 * testsuite/two_file_test_2_tls.cc: New test source.
1716 * testsuite/two_file_test_tls.cc: New test source.
1717
7fb47cc9
CC
17182013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1719
1720 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1721 the maximum segment alignment is larger than the page size.
1722 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1723 correctly aligns the symbols with large alignemnt.
1724 * testsuite/Makefile.in: Regenerate.
1725 * testsuite/large_symbol_alignment.cc: New file.
1726
6934001a
CC
17272013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1728 Sriraman Tallam <tmsriram@google.com>
1729
1730 * options.h (sort_section): New option.
1731 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1732 Rename from Input_section_sort_section_name_special_ordering_compare.
1733 (Input_section_sort_section_name_compare): New struct.
1734 * output.cc (Output_section::Input_section_sort_section_name_compare::
1735 operator()): New function.
1736 (Output_section::sort_attached_input_sections): Use new sort function
1737 for .text if --sort-section=name is specified.
1738 * layout.cc (Layout::make_output_section):
1739 Add sorting by name when --sort-section=name is specified.
1740 * testsuite/Makefile.am (text_section_grouping): Test option
1741 --sort-section=name.
1742 * testsuite/Makefile.in: Regenerate.
1743 * testsuite/section_sorting_name.cc: New file.
1744 * testsuite/section_sorting_name.sh: New file.
1745
93acabad
CC
17462013-05-21 Cary Coutant <ccoutant@google.com>
1747
1748 * symtab.h (Symbol::is_cxx_vtable): New function.
1749 * target-reloc.h (relocate_section): Check for vtable symbol.
1750 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1751 * testsuite/Makefile.in: Regenerate.
1752 * testsuite/missing_key_func.cc: New test source.
1753 * testsuite/missing_key_func.sh: New test script.
1754
60e8b3fc
CC
17552013-05-21 Cary Coutant <ccoutant@google.com>
1756
2b64b551
RM
1757 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1758 type of enclosing symbol.
1759 (Relocate_info::location): Check symbol type when describing symbol.
1760 * object.h (Symbol_location_info): Remove unused line_number;
1761 add enclosing_symbol_type.
1762 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 1763
9df9de2c
CC
17642013-05-13 Cary Coutant <ccoutant@google.com>
1765
2b64b551
RM
1766 * configure.ac: Export DEFAULT_TARGET.
1767 * configure: Regenerate.
1768 * Makefile.in: Regenerate.
1769 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1770 * testsuite/Makefile.in: Regenerate.
1771 * testsuite/debug_msg.sh: Delete duplicate tests.
1772 Don't check undef_int error message match for powerpc where the
1773 source file and line number aren't available.
9df9de2c 1774
bbc5ae17
RM
17752013-05-10 Roland McGrath <mcgrathr@google.com>
1776
1777 * options.h (General_options): Add --rosegment-gap option.
1778 * options.cc (finalize): --rosegment-gap implies --rosegment.
1779 * layout.cc (set_segment_offsets): Let user option override
1780 target->rosegment_gap().
1781
0c6e6c39
RM
17822013-05-10 Roland McGrath <mcgrathr@google.com>
1783
1784 * options.h (General_options): Remove leading space from help
1785 messages for -nostdlib and --rosegment.
1786
cde7cb01
MR
17872013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1788
1789 PR ld/15365
1790 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1791
f31ae5b8
AM
17922013-05-03 Alan Modra <amodra@gmail.com>
1793
1794 * merge.cc (Output_merge_string::do_add_input_section): Correct
1795 scan for number of strings. Rename vars to avoid shadowing.
1796 Include missing terminator in input_size_.
1797
d3a7cd45
L
17982013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1799
1800 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1801 Restore empty string handling.
1802
6ad3daba
CC
18032013-05-01 Cary Coutant <ccoutant@google.com>
1804
1805 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1806 uninitialized warning.
1807
e31908b6
CC
18082013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1809
1810 * output.cc (Output_section::add_merge_input_section): Allow
1811 to merge sections if the alignment is more than character size.
1812 * merge.h (Output_merge_string::Output_merge_string): Remove
1813 assert.
1814 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1815 only not-null strings. Check the alignment of strings.
1816 * stringpool.h
1817 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1818 alignment as the argument.
1819 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1820 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1821 Align non-zero length strings according to the addralign_.
1822 (Stringpool_template<Stringpool_char>::set_string_offsets):
1823 Updating offsets according to the given alignment.
1824 * testsuite/Makefile.am (text_section_grouping): Test if string
1825 literals are getting merged.
1826 * testsuite/Makefile.in: Regenerate.
1827 * testsuite/merge_string_literals_1.c: New file.
1828 * testsuite/merge_string_literals_2.c: Ditto.
1829 * testsuite/merge_string_literals.sh: Ditto.
1830
0e804863
ILT
18312013-04-26 Ian Lance Taylor <iant@google.com>
1832
1833 * target-reloc.h (relocate_section): If the reloc offset is out of
1834 range, pass VIEW as NULL to relocate.relocate.
1835 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1836 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1837 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1838 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1839 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1840 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1841
e7c5ea40
CC
18422013-04-26 Geoff Pike <gpike@chromium.org>
1843
1844 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1845 * layout.cc (Hash_task): New class.
1846 (Layout::queue_build_id_tasks): New function.
1847 (Layout::write_build_id): Handle single-thread portion of build ID
1848 computation. (In some cases, all of it is single-threaded.) Replace
1849 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1850 functionality in fewer lines of code.
1851 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1852 * options.h (General_options): make "--build-id" default to tree
1853 rather than sha1. Add two new options related to --build-id=tree:
1854 --build-id-chunk-size-for-treehash and
1855 --build-id-min-file-size-for-treehash.
1856 * Makefile.am: add testing of --build-id=tree and related new options
1857 (these tests will be invoked by "make check").
1858 * Makefile.in: Regenerate.
1859
49926cd0
AM
18602013-04-25 Alan Modra <amodra@gmail.com>
1861
1862 * configure.tgt: Add powerpcle and powerpc64le.
1863
a4034750
AM
18642013-04-22 Alan Modra <amodra@gmail.com>
1865
1866 PR gold/15355
1867 * layout.cc (Layout::segment_precedes): Allow more than one
1868 segment with the same type and flags.
1869
e79c84aa
CC
18702013-04-15 Cary Coutant <ccoutant@google.com>
1871
1872 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1873 allocate space in file for BSS sections.
1874
2199fbe7
CC
18752013-04-15 Cary Coutant <ccoutant@google.com>
1876
1877 * script-sections.cc (Orphan_output_section): Reset address
1878 to zero after each orphaned section for relocatable links.
1879
502e8a84
CC
18802013-04-15 Cary Coutant <ccoutant@google.com>
1881
a4034750
AM
1882 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1883 section starting address for relocatable link.
1884 * testsuite/Makefile.am (script_test_11): New test.
1885 * testsuite/Makefile.in: Regenerate.
1886 * testsuite/script_test_11.c: New source file.
1887 * testsuite/script_test_11.t: New linker script.
502e8a84 1888
0cfdc767
AM
18892013-04-13 Alan Modra <amodra@gmail.com>
1890
1891 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1892 owner when sections are not adjacent and exceed group size.
1893 (Target_powerpc::group_sections): Handle corner case.
1894 (Target_powerpc::Branch_info::make_stub): Handle case where
1895 stub table doesn't exist due to branches in non-exec sections.
1896 (Target_powerpc::Relocate::relocate): Likewise.
1897
6830ee24
AM
18982013-04-11 Alan Modra <amodra@gmail.com>
1899
1900 PR gold/15354
1901 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1902 .branch_lt to match bfd ld. Adjust comments throughout file.
1903
54a3d865
ILT
19042013-04-04 Ian Lance Taylor <iant@google.com>
1905
1906 GCC PR c++/56840
1907 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1908 sections before checking whether they are included in the link.
1909
9993ba11
ST
19102013-03-29 Sriraman Tallam <tmsriram@google.com>
1911
1912 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1913 object before calling the plugin claim_file handler. Pass the elf
1914 object of the archive to the plugin. Delete the elf object if the
1915 plugin claims the file.
1916
ebacd51e
AM
19172013-03-21 Alan Modra <amodra@gmail.com>
1918
1919 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1920 segment when omagic.
1921
117be58f
AM
19222013-03-21 Alan Modra <amodra@gmail.com>
1923
1924 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1925 comparison warning.
1926 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1927 uninitialized" warning.
1928
32e2b61d
AM
19292013-03-20 Alan Modra <amodra@gmail.com>
1930
1931 * symtab.h (Symbol::clear_version): New function.
1932 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1933 is_needed by weak references. Clear version for symbols defined
1934 in as-needed objects that are not needed.
1935
b3ccdeb5
AM
19362013-03-15 Alan Modra <amodra@gmail.com>
1937
1938 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1939 static and public. Add report_err param. Return false for data refs.
1940 (Target_powerpc::rela_dyn_section): New overloaded function.
1941 (Target_powerpc::plt_, iplt_): Elucidate.
1942 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1943 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1944 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1945 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1946 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1947 push_branch and make_plt_entry for ifunc syms when
1948 reloc_needs_plt_for_ifunc.
1949 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1950 for ifunc unless reloc_needs_plt_for_ifunc.
1951
ad3d8a2f
AM
19522013-03-15 Alan Modra <amodra@gmail.com>
1953
1954 * gc.h (gc_process_relocs): Don't look through function descriptors.
1955 * icf.cc (get_section_contents): Do so here instead.
1956
4d9aa155
AM
19572013-03-13 Alan Modra <amodra@gmail.com>
1958
1959 * powerpc.cc (is_branch_reloc): Forward declare.
1960 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
1961 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
1962 false for 64-bit, true for 32-bit non-branch relocs.
1963 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
1964 * testsuite/Makefile.am (icf_test): Use linker map file instead of
1965 nm output.
1966 (icf_safe_test): Generate linker map file as well as nm output.
1967 (icf_safe_so_test): Likewise.
1968 * testsuite/Makefile.in: Regenerate.
1969 * testsuite/icf_test.sh: Parse linker map file to determine
1970 section folding.
1971 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
1972 * testsuite/icf_safe_so_test.sh: Likewise.
1973 (X86_32_or_ARM_specific_safe_fold): Merge into..
1974 (arch_specific_safe_fold): ..this.
1975 (X86_64_specific_safe_fold): Delete unused function.
1976
57420c20
AM
19772013-03-12 Alan Modra <amodra@gmail.com>
1978
1979 * gc.h (gc_process_relocs): Look through function descriptors
1980 to determine shndx, symvalue and addend used by ICF. Tidy
1981 variable duplication.
1982
dc3714f3
AM
19832013-03-11 Alan Modra <amodra@gmail.com>
1984
1985 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
1986 * layout.cc (Layout_task_runner::run): ..to here.
1987 * symtab.h (struct Symbol_location): Extract from..
1988 (class Symbol_table): ..here.
1989 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
1990 * target.h (class Target): Add function_location and
1991 do_function_location functions.
1992 (class Sized_target): Add do_function_location.
1993 * object.h (class Sized_relobj_file): Move find_shdr..
1994 (class Object): ..to here.
1995 * object.cc: Likewise. Update to suit. Instantiate.
1996 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
1997 * powerpc.cc (class Powerpc_dynobj): New.
1998 (Target_powerpc::do_function_location): New function.
1999 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2000 (Powerpc_dynobj::do_read_symbols): New function.
2001 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2002
956b03bb
ILT
20032013-03-08 Ian Lance Taylor <iant@google.com>
2004
2005 * options.cc (General_options::string_to_object_format): Accept
2006 "default".
2007
4bead2d5
AM
20082013-03-08 Alan Modra <amodra@gmail.com>
2009
2010 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2011 pointer to Post_fde.
2012 (struct Post_fde): Move definition to here..
2013 * ehframe.cc (struct Post_fde): ..from here.
2014 (Cie::write): Don't alloc Post_fde.
2015 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2016
02e60bf7
AM
20172013-03-07 Alan Modra <amodra@gmail.com>
2018
2019 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2020 relocation referencing .LC0.
2021 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2022
8343f03a
AM
20232013-03-07 Alan Modra <amodra@gmail.com>
2024
2025 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2026 always_inline. Add assembly for powerpc to avoid GOT.
2027
3366d57c
AM
20282013-03-07 Alan Modra <amodra@gmail.com>
2029
2030 * testsuite/script_test_10.sh: Don't test .bss section
2031 header number.
2032
6c77229c
AM
20332013-03-06 Alan Modra <amodra@gmail.com>
2034
2035 * powerpc.cc (class Powerpc_relobj): Move some member functions.
2036 (Target_powerpc::symval_for_branch): Add symtab param. Update
2037 all callers. Handle folded sections.
2038 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
2039 to Powerpc_relobj.
2040 (Global_symbol_visitor_opd::operator()): Likewise.
2041
a39e4af6
AM
20422013-03-04 Alan Modra <amodra@gmail.com>
2043
2044 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
2045 * testsuite/Makefile.in: Regenerate.
2046
d5834edb
CC
20472013-03-01 Cary Coutant <ccoutant@google.com>
2048
2049 Add dwp support for v2 DWARF package file format.
2050 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2051 tu_length parameter. Adjust all callers.
2052 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2053 * dwp.cc: Include dwarf.h.
2054 (Section_bounds): New struct type.
2055 (Unit_set): New struct type.
2056 (Dwo_file::Dwo_file): Initialize new data member.
2057 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2058 Combine and rename to...
2059 (Dwo_file::read_unit_index): ...this.
2060 (Dwo_file::sized_read_compunit_index)
2061 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2062 (Dwo_file::sized_read_unit_index): ...this.
2063 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2064 parameters; add section_id parameter.
2065 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2066 (Dwo_file::add_unit_set): ...this.
2067 (Dwo_file::shndx_map_): Remove.
2068 (Dwo_file::sect_offsets_): New data member.
2069 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2070 (Dwp_output_file::add_section): Rename to...
2071 (Dwp_output_file::add_contribution): ...this.
2072 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2073 (Dwp_output_file::add_tu_set): Likewise.
2074 (Dwp_output_file::Contribution): New type.
2075 (Dwp_output_file::Section::contributions): New data member.
2076 (Dwp_output_file::Cu_or_tu_set): Remove.
2077 (Dwp_output_file::Section::Section): New ctor.
2078 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2079 (Dwp_output_file::Dwp_index::Section_table): New type.
2080 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2081 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2082 parameter.
2083 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2084 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2085 (Dwp_output_file::Dwp_index::section_table): New member function.
2086 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2087 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2088 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2089 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2090 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2091 (Dwp_output_file::Dwp_index::section_table_): New data member.
2092 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2093 (Dwp_output_file::add_output_section): New member function.
2094 (Dwp_output_file::write_new_section): New member function.
2095 (Dwp_output_file::write_contributions): New member function.
2096 (Dwp_output_file::section_id_map_): New data member.
2097 (class Dwo_id_info_reader): Remove.
2098 (class Unit_reader): New class.
2099 (get_dwarf_section_name): New function.
2100 (Dwo_file::read_executable): Adjust initializations of class data.
2101 (Dwo_file::read): Add support for v2 package file format.
2102 (Dwo_file::read_unit_index): Likewise.
2103 (Dwo_file::sized_read_unit_index): Likewise.
2104 (Dwo_file::copy_section): Likewise.
2105 (Dwo_file::add_unit_set): Likewise.
2106 (Dwp_output_file::add_output_section): Likewise.
2107 (Dwp_output_file::add_contribution): Likewise.
2108 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2109 for empty slot.
2110 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2111 file format.
2112 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2113 slot.
2114 (Dwp_output_file::initialize): Remove unused function.
2115 (Dwp_output_file::finalize): Add support for v2 package file format.
2116 (Dwp_output_file::write_index): Likewise.
2117 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2118 function prototype.
2119
a68a081d
CC
21202013-03-01 Cary Coutant <ccoutant@google.com>
2121
2122 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2123 function into class definition in header file.
2124 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2125 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2126 New function.
2127 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2128
9d5781f8
AM
21292013-02-28 Alan Modra <amodra@gmail.com>
2130
2131 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2132 * target.cc (Target::do_plt_fde_location): New function.
2133 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2134 accessor function, and constructor param.
2135 (struct Post_fde, Post_fdes): Declare.
2136 (Cie::write): Add post_fdes param.
2137 * ehframe.cc (Fde::write): Use plt_fde_location.
2138 (struct Post_fde): Define.
2139 (Cie::write): Stash FDEs added post merge mapping.
2140 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2141 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2142 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2143 other FDEs.
2144 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2145 (Target_powerpc::has_glink): New function.
2146 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2147 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2148 glink_eh_frame_fde_32, default_fde): New data.
2149 (Stub_table::eh_frame_added_): New var.
2150 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2151 Make const.
2152 (Stub_table::add_eh_frame): New function.
2153 (Output_data_glink::add_eh_frame): New function.
2154 (Target_powerpc::make_glink_section): Call add_eh_frame.
2155
214383dd
ILT
21562013-02-15 Ian Lance Taylor <iant@google.com>
2157
2158 * options.h (DEFINE_uint64_alias): Define.
2159 (class General_options): Add -Ttext-segment as an alias for
2160 -Ttext.
2161
91c2b899
AM
21622013-02-15 Alan Modra <amodra@gmail.com>
2163
2164 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2165 (Stub_table::do_write): ..here, two places.
2166 (Stub_table::plt_call_size): Use it here too.
2167
20e2a8aa
ILT
21682013-02-11 Ian Lance Taylor <iant@google.com>
2169
2170 * descriptors.cc (Descriptors::close_all): New function.
2171 * descriptors.h (class Descriptors): Declare close_all.
2172 (close_all_descriptors): New inline function.
2173 * plugin.cc: Include "descriptors.h".
2174 (Plugin_manager::cleanup): Call close_all_descriptors.
2175
8952bc69
AM
21762013-02-06 Alan Modra <amodra@gmail.com>
2177
2178 * README: Update coding style link.
2179
29bd8b6b
CC
21802013-01-28 Cary Coutant <ccoutant@google.com>
2181
a4034750
AM
2182 * dwp.cc (File_list): New typedef.
2183 (Dwo_name_info_reader): New class.
2184 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2185 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2186 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2187 (Dwo_file::read_executable): New function.
2188 (Dwo_file::read): Move common setup code to ...
2189 (Dwo_file::make_object): ... here.
2190 (dwp_options): Add --exec/-e.
2191 (usage): Likewise.
2192 (main): Likewise.
29bd8b6b 2193
c6ac678d
ST
21942013-01-24 Sriraman Tallam <tmsriram@google.com>
2195
2196 * layout.cc (Layout::layout): Check for option text_reorder.
2197 (Layout::make_output_section): Ditto.
2198 * options.h (text_reorder): New option.
2199 * output.cc (Input_section_sort_compare): Remove special ordering
2200 of section names.
2201 (Output_section::
2202 Input_section_sort_section_name_special_ordering_compare::
2203 operator()): New function.
2204 (Output_section::sort_attached_input_sections): Use new sort function
2205 for .text.
2206 * output.h (Input_section_sort_section_name_special_ordering_compare):
2207 New struct.
2208 * testsuite/Makefile.am (text_section_grouping): Test option
2209 --no-text-reorder
2210 * testsuite/Makefile.in: Regenerate.
2211 * testsuite/text_section_grouping.sh: Check order of functions without
2212 default text reordering.
2213
50701cc1
MF
22142013-01-18 Mike Frysinger <vapier@gentoo.org>
2215
2216 * options.h (General_options): Change default to true for new_dtags.
2217
b1b00fcc
MF
22182013-01-18 Mike Frysinger <vapier@gentoo.org>
2219
2220 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2221 when enable_new_dtags is false. Only add DT_RUNPATH when
2222 enable_new_dtags is true.
2223
ec5b8187
AM
22242013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2225
2226 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2227 used in declaration and definition consistent.
2228 (Target_powerpc::symval_for_branch): Ditto.
2229
a880d4c4
ST
22302013-01-16 Sriraman Tallam <tmsriram@google.com>
2231
2232 * testsuite/plugin_final_layout.cc: Fix comment.
2233
7c381248
ST
22342013-01-16 Sriraman Tallam <tmsriram@google.com>
2235
2236 * layout.cc (Layout::layout): Do not do default sorting for
2237 text sections when section ordering is specified.
2238 (make_output_section): Ditto.
2239 * testsuite/plugin_final_layout.cc: Name the function sections
2240 to catch reordering issues.
2241
e2458743
AM
22422013-01-15 Alan Modra <amodra@gmail.com>
2243
2244 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2245 plt-thread-safe.
2246
431ed302
AM
22472013-01-15 Alan Modra <amodra@gmail.com>
2248
2249 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2250 * testsuite/Makefile.in: Regenerate.
2251
0ec6429b
AM
22522013-01-14 Alan Modra <amodra@gmail.com>
2253
2254 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2255 * testsuite/Makefile.in: Regenerate.
2256
0bf402d5
ILT
22572013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2258
36af3926 2259 PR bfd/14430
0bf402d5
ILT
2260 Fix mingw gold build with plugins enabled
2261 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2262 * configure.ac: Export DLOPEN_LIBS and add headers check.
2263 * plugin.cc: Handle non-dlfcn case.
2264 * Makefile.in: Regenerate.
2265 * config.in: Regenerate.
2266 * configure: Regenerate.
2267 * testsuite/Makefile.in: Regenerate.
2268
9e9143bc
ST
22692013-01-09 Sriraman Tallam <tmsriram@google.com>
2270
2271 * output.h (sort_attached_input_sections): Change to be public.
2272 * script-sections.cc
2273 (Output_section_definition::set_section_addresses): Sort
2274 attached input sections according to section order before linker
2275 script assigns section addresses.
2276 (Orphan_output_section::set_section_addresses): Sort
2277 attached input sections according to section order before linker
2278 script assigns section addresses.
2279 * Makefile.am (final_layout.sh): Use a simple linker script to
2280 check if section ordering still works.
2281 * Makefile.in: Regenerate.
2282
679af368
ILT
22832013-01-09 Ben Cheng <bccheng@google.com>
2284
2285 * arm.cc (Target_arm::attributes_accept_div): New function.
2286 (Target_arm::attributes_forbid_div): New function.
2287 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2288 attribute using the same new functions as what bfd/elf32_arm.c
2289 does.
2290
3136a00e
CC
22912013-01-07 Cary Coutant <ccoutant@google.com>
2292
2293 PR gold/14993
2294 * output.cc (Output_section::add_input_section): For incremental
2295 updates, don't track input sections that are allocated from patch
2296 space.
2297
f2a6224b
L
22982013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2299 Ian Lance Taylor <iant@google.com>
2300
2301 PR gold/14897
2302 * configure.ac (--enable-ld): Removed.
2303 (install_as_default): Set to yes only for --enable-gold=default
2304 or --disable-ld.
2305 * configure: Regenerated.
2306
4f46f626
L
23072013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2308
2309 * options.h (General_options): Add -fuse-ld= for GCC linker
2310 option compatibility.
2311
26e4ef59
CC
23122013-01-04 Cary Coutant <ccoutant@google.com>
2313
2314 * configure.ac: Fix typo restoring CXXFLAGS.
2315 * configure: Regenerate.
2316
3d587466
CC
23172013-01-04 Cary Coutant <ccoutant@google.com>
2318
4f46f626
L
2319 * testsuite/Makefile.am (CXXLINK_S): New macro.
2320 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2321 * testsuite/Makefile.in: Regenerate.
3d587466 2322
44db6695
L
23232013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2324
2325 * version.cc (print_version): Update copyright year to 2013.
2326
edcac0c1
ILT
23272012-12-20 Ian Lance Taylor <iant@google.com>
2328
2329 * layout.cc (Layout::special_ordering_of_input_section): New
2330 function.
2331 (Layout::layout): If input section requires special ordering, must
2332 sort input sections.
2333 (Layout::make_output_section): May sort .text input sections.
2334 (Layout::is_section_name_prefix_grouped): Remove.
2335 * layout.h (class Layout): Declare
2336 special_ordering_of_input_section. Don't declare
2337 is_section_name_prefix_grouped.
2338 * output.cc (Output_section::add_input_section): Revert last
2339 change.
2340 (Output_section::Input_section_sort::match_file_name): Don't crash
2341 if called on output section data.
2342 (Output_section::Input_section_sort_compare): Sort based on
2343 special ordering.
2344 (Output_section::Input_section_sort_section_order_index_compare):
2345 Revert last patch.
2346 (Output_section::sort_attached_input_sections): Likewise.
2347
28f2a4ac
ST
23482012-12-18 Sriraman Tallam <tmsriram@google.com>
2349
edcac0c1 2350 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2351 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2352 * output.cc (Output_section::add_input_section): Check if section
2353 name contains special prefix. Keep input sections to sort such
2354 sections.
2355 (Output_section::Input_section_sort_section_order_index_compare
2356 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2357 (Output_section::sort_attached_input_sections): Add condition to
2358 Input_section_entry constructor call.
28f2a4ac
ST
2359 * testsuite/Makefile.am (text_section_grouping): New test.
2360 * testsuite/Makefile.in: Regenerate.
2361 * testsuite/text_section_grouping.cc: New file.
2362 * testsuite/text_section_grouping.sh: New file.
2363
5bf135a7
NC
23642012-12-17 Nick Clifton <nickc@redhat.com>
2365
2366 * Makefile.am: Add copyright notice.
2367 * NEWS: Likewise.
2368 * README: Likewise.
2369 * configure.ac: Likewise.
2370 * ftruncate.c: Likewise.
2371 * Makefile.in: Regenerate.
2372
59965708
CC
23732012-12-14 Cary Coutant <ccoutant@google.com>
2374
a4034750
AM
2375 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2376 --no-as-needed flag.
2377 (exception_separate_shared_12_test): Likewise.
2378 (incremental_copy_test): Likewise.
2379 * testsuite/Makefile.in: Regenerate.
59965708 2380
2a77e2ab
CC
23812012-12-14 Cary Coutant <ccoutant@google.com>
2382
2383 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2384 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2385
e3deeb9c
AM
23862012-12-12 Alan Modra <amodra@gmail.com>
2387
2388 * powerpc.cc (class Track_tls): New.
2389 (class Relocate, class Scan): Inherit Track_tls.
2390 (Target_powerpc::Scan::local, global): Track tls optimization
2391 and avoid creating plt entry for __tls_get_addr if all uses
2392 are optimized away.
2393 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2394
d8f5a274
AM
23952012-12-12 Alan Modra <amodra@gmail.com>
2396
2397 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2398 Replace no_toc_optimize with toc_optimize.
2399 * output.h (Output_section::input_sections): Provide non-const variant.
2400 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2401 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2402 accessors.
2403 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2404 (class Sort_toc_sections): New.
2405 (Target_powerpc::do_finalize_sections): Sort toc sections.
2406 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2407
4c8a1de1
RM
24082012-12-10 Roland McGrath <mcgrathr@google.com>
2409
2410 * testsuite/binary_unittest.cc (read_all): New function.
2411 (Sized_binary_test): Use it instead of ::read.
2412 * fileread.cc (do_read): Don't assume pread always reads the whole
2413 amount in a single call.
2414
edc27beb
AM
24152012-12-10 Alan Modra <amodra@gmail.com>
2416
2417 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2418 Set EM_PPC64 or EM_PPC here.
2419 (Target_selector_powerpc::do_recognize): Delete.
2420
906b9150
AM
24212012-12-10 Alan Modra <amodra@gmail.com>
2422
2423 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2424 stub_table_.
2425 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2426
418c15ae
RM
24272012-12-07 Roland McGrath <mcgrathr@google.com>
2428
2429 * testsuite/binary_unittest.cc (Sized_binary_test):
2430 Use open_descriptor rather than ::open.
2431
decdd3bc
AM
24322012-12-07 Alan Modra <amodra@gmail.com>
2433
2434 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2435 typedef and invalid_address constant.
2436 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2437 instantiate constants.
2438
db399005
ILT
24392012-12-06 Roland McGrath <mcgrathr@google.com>
2440
2441 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2442 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2443 * aclocal.m4: Regenerate.
2444 * configure: Regenerate.
2445 * Makefile.in: Regenerate.
2446 * testsuite/Makefile.in: Regenerate.
2447
aba6bc71
AM
24482012-12-07 Alan Modra <amodra@gmail.com>
2449
2450 * options.h (General_options): Add no_toc_optimize.
2451 * powerpc.cc (ok_lo_toc_insn): New function.
2452 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2453
9e69ed50
AM
24542012-12-06 Alan Modra <amodra@gmail.com>
2455
2456 * options.h (General_options): Add plt_align, plt_static_chain,
2457 plt_thread_safe. Update stub_group_size help text.
2458 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2459 for new plt_thread_safe_ var.
2460 (use_plt_offset): Correct comments.
2461 (Target_powerpc::do_relax): Look for thread creation symbols to
2462 determine default plt_thread_safe value. Clear plt call stubs
2463 as well as branch stubs each iteration.
2464 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2465 insn constants.
2466 (l, hi, ha, write_insn): Move earlier.
2467 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2468 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2469 plt stubs too.
2470 (Stub_table::update_size): Adjust.
2471 (Stub_table::prev_size, set_prev_size): Delete.
2472 (Stub_table::stub_align): Let --plt-align affect result.
2473 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2474 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2475 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2476 (Stub_table::do_write): Support more stub variants.
2477
f43ba157
AM
24782012-12-04 Alan Modra <amodra@gmail.com>
2479
2480 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2481 (Target_powerpc::do_define_standard_symbols): New function.
2482
34171bc5
AM
24832012-12-03 Alan Modra <amodra@gmail.com>
2484
2485 * output.h: Formatting, whitespace.
2486
dc9589e9 24872012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2488
2489 * layout.h (Layout::get_executable_sections): Declare.
2490 * layout.cc (Layout::get_executable_sections): New function.
2491 * arm.cc (Target_arm::group_sections): Use it.
2492 (Arm_output_section::group_sections): Delete now redundant test.
2493 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2494 param to handle relative relocs.
2495 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2496 (Output_data_reloc::add_absolute): Adjust.
2497 (Output_data_reloc::add_relative): New function.
2498 (Output_data::reset_data_size): New function.
2499 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2500 (Output_section::set_addralign): New function.
2501 (Output_section::checkpoint_set_addralign): New function.
2502 (Output_section::clear_section_offsets_need_adjustment): New function.
2503 (Output_section::input_sections): Make public.
2504 * powerpc.cc (class Output_data_brlt_powerpc): New.
2505 (class Stub_table, class Stub_control): New.
2506 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2507 stub_table_, set_stub_table, stub_table): New vectors and accessor
2508 functions.
2509 (Target_powerpc::do_may_relax, do_relax, push_branch,
2510 new_stub_table, stub_tables, brlt_section, group_sections,
2511 add_branch_lookup_table, find_branch_lookup_table,
2512 write_branch_lookup_table, make_brlt_section): New functions.
2513 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2514 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2515 branch_info_): New vars.
2516 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2517 make call stubs here.
2518 (Output_data_glink): Remove all call stub handling from this class.
2519 (Target_powerpc::Scan::local, global): Save interesting branch
2520 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2521 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2522 functions on final link.
2523 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2524 Handle long branch destinations too.
2525 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2526 do_plt_address_for_local): Adjust lookup of plt call stubs.
2527
627b30b7
AM
25282012-11-30 Alan Modra <amodra@gmail.com>
2529
2530 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2531 relocs against protected symbols when building 32-bit shared libs.
2532
40b469d7
AM
25332012-11-30 Alan Modra <amodra@gmail.com>
2534
2535 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2536 param. Call got_section() to make .got. Update all callers
2537 and their callers and so on.
2538
bb66a627
AM
25392012-11-30 Alan Modra <amodra@gmail.com>
2540
2541 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2542 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2543 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2544 value if it already exists.
2545
d2cf1c6c
L
25462012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2547
2548 PR gold/14858
2549 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2550
edccdf7c
RM
25512012-11-14 Roland McGrath <mcgrathr@google.com>
2552
2553 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2554 than bfc instruction for data sandboxing.
2555
6febeb74
AM
25562012-11-08 Alan Modra <amodra@gmail.com>
2557
2558 * po/POTFILES.in: Regenerate.
2559
0a6f1bf2
AM
25602012-11-05 Alan Modra <amodra@gmail.com>
2561
2562 * configure.ac: Apply 2012-09-10 change to config.in here.
2563 * configure: Regenerate.
2564
26a4e9cb
AM
25652012-11-05 Alan Modra <amodra@gmail.com>
2566
2567 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2568 (struct Opd_ent): Use "Address" rather than "Offset".
2569 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2570 (Target_powerpc::got_section): Make public.
2571 (Target_powerpc::scan_relocs): Move code setting symbols..
2572 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2573 Create _SDA_BASE_ only when referenced.
2574
cc928013
RM
25752012-11-02 Roland McGrath <mcgrathr@google.com>
2576
2577 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2578 from last change.
2579
50ed5eb1
RM
25802012-11-01 Roland McGrath <mcgrathr@google.com>
2581
62fe925a
RM
2582 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2583 for offset_in_output_section parameter.
2584 (Sized_target::relocate_special_relocatable): Likewise.
2585 * arm.cc (Target_arm::relocate_relocs): Likewise.
2586 (Target_arm::relocate_special_relocatable): Likewise.
2587 * i386.cc (Target_i386::relocate_relocs): Likewise.
2588 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2589 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2590 * target-reloc.h (relocate_relocs): Likewise.
2591 * testsuite/testfile.cc (Target_test): Likewise.
2592 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2593 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2594
2595 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2596 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2597
2598 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2599 parameter, which is unused in the [!F_SETFD] case.
2600
50ed5eb1
RM
2601 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2602 SYMNDX to off_t before comparing it to this->data_size().
2603 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2604 * incremental.cc (Output_section_incremental_inputs::do_write):
2605 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2606
2cadc0bf
RM
2607 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2608
3bfcb652
NC
26092012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2610
2611 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2612 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2613 in EABI_VER5.
2614
c1a8d56e
CC
26152012-10-29 Cary Coutant <ccoutant@google.com>
2616
2617 * dwp.cc (usage): Add file and exit status parameters;
2618 add --help and --version options.
2619 (print_version): New function.
2620 (main): Add --help and --version options.
2621
b2490a7b
L
26222012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2623
2624 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2625 final_layout_sequence.txt.
2626 * testsuite/Makefile.in: Regenerated.
2627
aa543512
L
26282012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2629
2630 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2631 COMPILE generated by automake.
2632 (LINK1): Likewise.
2633 (CXXCOMPILE1): Likewise.
2634 (CXXLINK1): Likewise.
2635 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2636 (LINK): Likewise.
2637 (CXXCOMPILE): Likewise.
2638 (CXXLINK): Likewise.
2639 * testsuite/Makefile.in: Regenerated.
2640
d361fafb
L
26412012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2642
2643 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2644 on bad fwrite return.
2645
598c7410
L
26462012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2647
2648 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2649 on val.
2650
35c813e2
CC
26512012-10-23 Cary Coutant <ccoutant@google.com>
2652
2653 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2654 * testsuite/Makefile.in: Regenerate.
2655 * testsuite/dwp_test.h: New source file.
2656 * testsuite/dwp_test_1.cc: New source file.
2657 * testsuite/dwp_test_1.s: New source file.
2658 * testsuite/dwp_test_1.sh: New source file.
2659 * testsuite/dwp_test_1b.cc: New source file.
2660 * testsuite/dwp_test_1b.s: New source file.
2661 * testsuite/dwp_test_2.cc: New source file.
2662 * testsuite/dwp_test_2.s: New source file.
2663 * testsuite/dwp_test_2.sh: New source file.
2664 * testsuite/dwp_test_main.cc: New source file.
2665 * testsuite/dwp_test_main.s: New source file.
2666
77429909
CC
26672012-10-23 Cary Coutant <ccoutant@google.com>
2668
2669 * dwp.h: New header file.
2670 * dwp.cc: New source file.
2671 * gold.h: Move shared declarations to system.h.
2672 * system.h: New header file.
2673 * Makefile.am: Add dwp.
2674 * Makefile.in: Regenerate.
2675
ed5d6712
CC
26762012-10-23 Cary Coutant <ccoutant@google.com>
2677
2678 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2679 Dwarf_info_reader::read_from_pointer.
2680 (Dwarf_pubnames_table::read_header): Likewise.
2681 (Dwarf_pubnames_table::next_name): Likewise.
2682 (Dwarf_die::read_attributes): Likewise.
2683 (Dwarf_die::skip_attributes): Likewise.
2684 (Dwarf_info_reader::read_from_pointer): New function template.
2685 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2686 (Dwarf_pubnames_table): Likewise.
2687 (Dwarf_info_reader::read_from_pointer): New function template.
2688 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2689 Dwarf_pubnames_table ctor.
2690
8787852d
CC
26912012-10-23 Cary Coutant <ccoutant@google.com>
2692
2693 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2694 abbrev_shndx.
2695 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2696 abbrev_shndx_.
2697 (Dwarf_info_reader::set_abbrev_shndx): New method.
2698 (Dwarf_info_reader::abbrev_shndx_): New data member.
2699
9fc236f3
CC
27002012-10-23 Cary Coutant <ccoutant@google.com>
2701
2702 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2703 from object, not parameters.
2704 (Dwarf_info_reader::parse): Likewise.
2705 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2706 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2707 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2708 methods.
2709
effe8365
CC
27102012-10-23 Cary Coutant <ccoutant@google.com>
2711
2712 * fileread.cc (Input_file::Input_file): New constructor.
2713 * fileread.h (class Input_file): Add new constructor.
2714
1698990d
AM
27152012-10-18 Alan Modra <amodra@gmail.com>
2716
2717 PR gold/14727
2718 * object.cc (Relobj::is_section_name_included): Also match
2719 .sdata personality section.
2720
168a4726
AM
27212012-10-18 Alan Modra <amodra@gmail.com>
2722
2723 * target-reloc.h (class Default_comdat_behavior): New, package up..
2724 (get_comdat_behaviour): ..this.
2725 (relocate_section): Add Relocate_comdat_behavior template arg,
2726 adjust code to suit.
2727 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2728 (Target_arm::scan_reloc_section): Likewise.
2729 * i386.cc (Target_i386::relocate_section): Likewise.
2730 * sparc.cc (Target_sparc::relocate_section): Likewise.
2731 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2732 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2733 * powerpc.cc (class Relocate_comdat_behavior): New.
2734 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2735 gold::relocate_section with new template arg.
2736
acc276d8
AM
27372012-10-18 Alan Modra <amodra@gmail.com>
2738
2739 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2740 dynamic relocs for GOT_TPREL got entries, without symbol if
2741 resolving locally.
2742 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2743 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2744 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2745
e10f9870
AM
27462012-10-17 Alan Modra <amodra@gmail.com>
2747
2748 PR gold/14726
2749 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2750
ae034989
ST
27512012-10-16 Sriraman Tallam <tmsriram@google.com>
2752
2753 * layout.cc (Layout::include_section): Keep sections marked
2754 SHF_EXCLUDE when doing relocatable links.
2755
f3a0ed29
AM
27562012-10-16 Alan Modra <amodra@gmail.com>
2757
2758 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2759 (Target_powerpc::do_finalize_sections): Call it.
2760 (Output_data_save_res): New class and supporting functions.
2761 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2762 normal symbols defined in object files.
2763
c6de8ed4
AM
27642012-10-12 Alan Modra <amodra@gmail.com>
2765
2766 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2767 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2768 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2769 section if scan_opd_relocs not yet called.
2770 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2771
03e25981
AM
27722012-10-12 Alan Modra <amodra@gmail.com>
2773
2774 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2775 add_local_ifunc_entry): Revert last change.
2776 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2777
c9824451
AM
27782012-10-05 Alan Modra <amodra@gmail.com>
2779
2780 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2781 do_plt_address_for_global): New functions.
2782 (Output_data_got_powerpc::do_write): Don't segfault when linking
2783 statically.
2784 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2785 add_local_ifunc_entry): Return true on adding entry..
2786 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2787 glink->add_entry call. Remove unused symtab param. Adjust calls.
2788 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2789 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2790 set up symbols here.
2791 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2792 syms here. Do so even when no .iplt. Don't segfault when linking
2793 statically.
2794 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2795 new variants without reloc param.
2796 (Glink_sym_ent::Glink_sym_ent): Likewise.
2797 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2798 reloc when refs will resolve to plt call stub.
2799 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2800 R_PPC_PLTREL24 to resolve locally.
2801 (Target_powerpc::Scan::global): Correct ifunc handling.
2802 (Target_powerpc::Relocate::relocate): Correct local sym glink
2803 lookup. Don't destroy "value" when we have a plt call stub,
2804 and when checking plt call validity.
2805 (Target_powerpc::do_dynsym_value): Simplify.
2806
19fec8c1
AM
28072012-10-05 Alan Modra <amodra@gmail.com>
2808
2809 * i386.cc (Output_data_plt_i386::address_for_global,
2810 address_for_local): Add plt offset to returned value. Adjust uses.
2811 * sparc.cc (Output_data_plt_sparc::address_for_global,
2812 address_for_local): Likewise.
2813 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2814 address_for_local): Likewise.
2815 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2816 address_for_local): Likewise.
2817 * target.h (Target::plt_address_for_global, plt_address_for_local):
2818 Update comment.
2819 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2820 (Output_data_got::Got_entry::write): Nor here.
2821 * output.h: Comment fix.
2822
e867b647
WL
28232012-10-02 Jiong Wang <jiwang@tilera.com>
2824
2825 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2826 global_offset_table_ value for larget got.
2827 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2828
e5d5f5ed
AM
28292012-09-29 Alan Modra <amodra@gmail.com>
2830
2831 * powerpc.cc (Target_powerpc::iplt_): New output section.
2832 (Target_powerpc::iplt_section, make_iplt_section,
2833 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2834 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2835 Target_powerpc::plt_entry_count): Count iplt entries too.
2836 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2837 reloc section in constructor. New params.
2838 (Target_powerpc::make_plt_section): Create reloc section here instead.
2839 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2840 functions.
2841 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2842 (Output_data_glink::add_entry, find_entry): New functions to
2843 deal with local syms.
2844 (Glink_sym_ent): Add support for local syms.
2845 (Output_data_glink::do_write): Handle ifunc plt entries.
2846 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2847 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2848 (Target_powerpc::Relocate::relocate): Likewise.
2849 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2850
ec4dbad3
AM
28512012-09-25 Alan Modra <amodra@gmail.com>
2852
2853 * object.h (Sized_relobj_file::adjust_local_symbol,
2854 do_adjust_local_symbol): New functions.
2855 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2856 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2857 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2858 and irregular opd entry spacing.
2859 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2860 (Global_symbol_visitor_opd): New functor.
2861 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2862 on deleted opd entries.
2863
5c0b3823
WL
28642012-09-15 Jiong Wang <jiwang@tilera.com>
2865
2866 * tilegx.cc: New file.
2867 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2868 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2869 * configure.tgt: Add entries for tilegx*.
2870 * configure.ac: Likewise.
2871 * Makefile.in: Rebuild.
2872 * configure: Likewise.
2873 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2874 tilegx.
2875
bfdfa4cd
AM
28762012-09-13 Alan Modra <amodra@gmail.com>
2877
2878 * target-reloc.h (scan_relocs): Call scan.local for relocs
2879 against symbols in discarded sections. Pass is_discarded
2880 param.
2881 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2882 Add is_discarded param.
2883 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2884 is_discarded to flag opd entry as discarded. Don't emit dyn
2885 relocs on such entries.
2886 (Target_powerpc::Scan::global): Similarly detect and handle
2887 such opd entries.
2888 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2889 opd_ent_. Update all uses.
2890 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2891 (Target_powerpc::relocate_section): Zero out discarded opd
2892 entry relocs.
2893
d77a0555
ILT
28942012-09-12 Ian Lance Taylor <iant@google.com>
2895
2896 PR gold/14570
2897 * output.cc: Rename Output_data_got template parameter from size
2898 to got_size for all functions. Compile all variants of
2899 Output_data_got.
2900 (Output_data_got::Got_entry::write): Correct use of size for
2901 symbol value. Use local_is_tls rather than casting to
2902 Sized_relobj_file.
2903 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2904 (class Sized_relobj_file): Add do_local_is_tls.
2905 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2906
815a1205
AM
29072012-09-11 Alan Modra <amodra@gmail.com>
2908
2909 PR gold/14566
2910 * layout.cc (Layout::set_segment_offsets): When using
2911 common-page-size alignment, ensure we are on a new max-page-size
2912 page.
2913 * output.cc (Output_segment::set_section_addresses): Use
2914 abi_pagesize, not common_pagesize for relro boundary.
2915 (Output_segment::set_offset): Likewise.
2916
bd73a62d
AM
29172012-09-11 Alan Modra <amodra@gmail.com>
2918
2919 * output.h (Output_data_got::add_global_tls, add_local_tls,
2920 add_local_tls_pair): New functions.
2921 (Output_data_got::add_local_pair_with_rel): Remove second
2922 reloc param. Expand comment.
2923 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2924 use_plt_or_tls_offset_, similarly for constructor param.
2925 (Output_data_got::Got_entry::write): Add got_index param.
2926 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2927 add_local_tls_pair): New functions.
2928 (Output_data_got::Got_entry::write): Handle tls symbols
2929 with use_plt_or_tls_offset_ set specially.
2930 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2931 (Output_data_got::do_write): Replace iterator with index, pass
2932 index to entry write function.
2933 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2934 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2935 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2936 call.
2937 * i386.cc (Target_i386::Scan::local): Likewise.
2938 * sparc.cc (Target_sparc::Scan::local): Likewise.
2939 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2940 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2941 do_tls_offset_for_global): New functions.
2942 (Target_powerpc::Scan::local): Correct TLS relocations and got
2943 entry values.
2944 (Target_powerpc::Scan::global): Don't emit unnecessary
2945 dynamic relocations on TLS GOT entries.
2946
00716ab1
AM
29472012-09-10 Matthias Klose <doko@ubuntu.com>
2948
2949 * config.in: Disable sanity check for kfreebsd.
2950
c891b3f9
SA
29512012-09-10 Sterling Augustine <saugustine@google.com>
2952
2953 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2954 (Gdb_index::pubtypes_read): New parameter.
2955 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2956 to calls.
2957 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2958 pubtypes_object_.
2959
e81fea4d
AM
29602012-09-09 Alan Modra <amodra@gmail.com>
2961
2962 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
2963 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
2964 * gc.h (gc_process_relocs): Call target gc_add_reference.
2965 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
2966 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
2967 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
2968 unnecessary cast.
2969 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
2970 to cater for when we don't need code offset. Update use.
2971 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
2972 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
2973 set_opd_valid): New functions.
2974 (Target_powerpc::do_gc_add_reference): New function.
2975 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
2976 stashed refs.
2977 (Target_powerpc::do_gc_mark_symbol): New function.
2978
d2d60eef
CC
29792012-09-06 Cary Coutant <ccoutant@google.com>
2980
2981 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
2982 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
2983 (Dwarf_die::skip_attributes): Likewise.
2984 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
2985 * testsuite/gdb_index_test.cc (inline_func_1): New function.
2986 (main): Call it.
2987 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
2988
32ed4573
L
29892012-09-05 H.J. Lu <hongjiu.lu@intel.com>
2990
2991 * testsuite/script_test_3.t: Add .got.plt output section
2992 statement.
2993 * testsuite/script_test_4.t: Likewise.
2994
f4baf0d4
AM
29952012-09-05 Alan Modra <amodra@gmail.com>
2996
2997 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
2998 update all uses and lose "enum" when using type.
2999
864a1b56
AM
30002012-09-05 Alan Modra <amodra@gmail.com>
3001
3002 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3003 * configure: Regenerate.
3004 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3005 (plugin_final_layout.stdout): Likewise.
3006 (memory_test): Set page sizes to 0x1000.
3007 * testsuite/Makefile.in: Regenerate.
3008 * testsuite/discard_locals_test.sh: Add FIXME comment.
3009 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3010 * testsuite/pr14265.t: Add .got output section statement.
3011 * testsuite/script_test_2.t: Likewise.
3012 * testsuite/script_test_3.t: Likewise.
3013 * testsuite/script_test_4.t: Likewise.
3014 * testsuite/script_test_5.t: Likewise.
3015 * testsuite/script_test_6.t: Likewise.
3016 * testsuite/script_test_7.t: Likewise.
3017 * testsuite/script_test_9.t: Likewise.
3018
3ea0a085
AM
30192012-09-05 Alan Modra <amodra@gmail.com>
3020
3021 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3022 (Powerpc_relocate_functions::Status): New typedef.
3023 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3024 (Target_powerpc::Scan::local): Handle REL64.
3025 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3026 for REL32 and REL64.
3027 (Target_powerpc::symval_for_branch): New function, extracted from..
3028 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3029 checks. Report overflow errors.
3030
7404fe1b
AM
30312012-09-05 Alan Modra <amodra@gmail.com>
3032
3033 * object.h (Sized_relobj_file::emit_relocs): Delete.
3034 (Sized_relobj_file::emit_relocs_reltype): Delete.
3035 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
3036 relocate_relocs for --emit-relocs.
3037 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
3038 * output.h: Update comment.
3039 (Output_segment::first_section): New function.
3040 (Output_segment::first_section_load_address): Use first_section.
3041 * output.cc (Output_segment::first_section): New function extracted..
3042 (Output_segment::first_section_load_address): ..from here. Delete.
3043 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
3044 * target.h (Sized_target::relocate_for_relocatable): Likewise.
3045 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
3046 adjust call to target.h function.
3047 * i386.cc (Target_i386): Likewise.
3048 * sparc.cc (Target_sparc): Likewise.
3049 * x86_64.cc (Target_x86_64): Likewise.
3050 * powerpc.cc (Target_powerpc): Likewise.
3051 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
3052 first tls section has section symbol for optimised local dynamic
3053 output relocs.
3054 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
3055 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
3056 optimised tls code.
3057 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
3058 Rename to relocate_relocs. Update error message.
3059
957564c9
AS
30602012-09-04 Andreas Schwab <schwab@linux-m68k.org>
3061
3062 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
3063 --just-symbols.
3064
dd93cd0a
AM
30652012-08-31 Alan Modra <amodra@gmail.com>
3066
3067 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3068 (Powerpc_relobj::toc_base_offset): New stub function.
3069 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3070 got_mod_index_offset to tlsld_got_offset. Update all refs.
3071 (Target_powerpc::Relocate::enum skip_tls): New.
3072 (Target_powerpc::call_tls_get_addr_): New var.
3073 (Target_powerpc::is_branch_reloc): Move to file scope.
3074 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3075 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3076 New functions.
3077 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3078 (powerpc_info): Correct common_pagesize for ppc64.
3079 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3080 (Powerpc_relocate_functions): Add overflow check enums and functions.
3081 Add non-shift version of rela, rela_ua. Delete all rel public
3082 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3083 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3084 addr16_ha3, addr14 functions.
3085 (Output_data_got_powerpc::add_constant_pair): New function.
3086 (Output_data_got_powerpc::got_base_offset): Likewise.
3087 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3088 (instruction constants): Sort, add some more.
3089 (Output_data_glink::do_write): Add and use Address typedef. Use
3090 object->toc_base_offset() stub for 64-bit.
3091 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3092 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3093 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3094 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3095 Always treat .opd relocs as against locally defined symbol.
3096 Correct condition for RELATIVE relocs.
3097 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3098 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3099 for 32-bit syms with a plt entry. Correct ppc64 toc base
3100 calculations. Handle TLS relocs, and more. Add overflow
3101 checking and adjust for Powerpc_relocate_functions changes.
3102 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3103 Reinstate --emit-relocs code with FIXME.
3104
a1373b60
AM
31052012-08-30 Alan Modra <amodra@gmail.com>
3106
3107 * layout.cc (Layout::set_segment_offsets): Set p_align to
3108 abi_pagesize, not common_pagesize.
3109 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3110 to determine whether file header can go in segment.
3111
703d02da
AM
31122012-08-30 Alan Modra <amodra@gmail.com>
3113
3114 * output.h (Output_reloc::Output_reloc <output section>): Add
3115 is_relative param. Adjust calls.
3116 (Output_reloc::add_output_section_relative): New functions.
3117 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3118 is_relative.
3119 (Output_reloc::symbol_value): Handle SECTION_CODE.
3120
16164a6b
ST
31212012-08-24 Sriraman Tallam <tmsriram@google.com>
3122
3123 * gold.cc (queue_middle_tasks): Call layout again when unique
3124 segments for sections is desired.
3125 * layout.cc (Layout::Layout): Initialize new members.
3126 (Layout::get_output_section_flags): New function.
3127 (Layout::choose_output_section): Call get_output_section_flags.
3128 (Layout::layout): Make output section for mapping to a unique segment.
3129 (Layout::insert_section_segment_map): New function.
3130 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 3131 output sections marked so.
16164a6b
ST
3132 (Layout::segment_precedes): Check for unique segments when sorting.
3133 * layout.h (Layout::Unique_segment_info): New struct.
3134 (Layout::Section_segment_map): New typedef.
3135 (Layout::insert_section_segment_map): New function.
3136 (Layout::get_output_section_flags): New function.
3137 (Layout::is_unique_segment_for_sections_specified): New function.
3138 (Layout::set_unique_segment_for_sections_specified): New function.
3139 (Layout::unique_segment_for_sections_specified_): New member.
3140 (Layout::section_segment_map_): New member.
3141 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3142 Rename is_gc_pass_one to is_pass_one.
3143 Rename is_gc_pass_two to is_pass_two.
3144 Rename is_gc_or_icf to is_two_pass.
3145 Check for which pass based on whether symbols data is present.
3146 Make it two pass when unique segments for sections is desired.
3147 * output.cc (Output_section::Output_section): Initialize new
3148 members.
3149 * output.h (Output_section::is_unique_segment): New function.
3150 (Output_section::set_is_unique_segment): New function.
3151 (Output_section::is_unique_segment_): New member.
3152 (Output_section::extra_segment_flags): New function.
3153 (Output_section::set_extra_segment_flags): New function.
3154 (Output_section::extra_segment_flags_): New member.
3155 (Output_section::segment_alignment): New function.
3156 (Output_section::set_segment_alignment): New function.
3157 (Output_section::segment_alignment_): New member.
3158 (Output_segment::Output_segment): Initialize is_unique_segment_.
3159 (Output_segment::is_unique_segment): New function.
3160 (Output_segment::set_is_unique_segment): New function.
3161 (Output_segment::is_unique_segment_): New member.
3162 * plugin.cc (allow_unique_segment_for_sections): New function.
3163 (unique_segment_for_sections): New function.
3164 (Plugin::load): Add new functions to transfer vector.
3165 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3166 * Makefile.in: Regenerate.
3167 * testsuite/plugin_final_layout.sh: Check if unique segment
3168 functionality works.
3169 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3170 are available.
3171 (allow_unique_segment_for_sections): New global.
3172 (unique_segment_for_sections): New global.
3173 (claim_file_hook): Call allow_unique_segment_for_sections.
3174 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 3175
1e2bee4f
CC
31762012-08-22 Cary Coutant <ccoutant@google.com>
3177
3178 * layout.cc (Layout::include_section): Don't assert on GROUP
3179 sections with --emit-relocs.
3180
1d5dfe78
CC
31812012-08-21 Cary Coutant <ccoutant@google.com>
3182
3183 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3184 if --export-dynamic-symbol names an undef symbol.
3185
c9269dff
AM
31862012-08-18 Alan Modra <amodra@gmail.com>
3187
3188 * powerpc.cc: Formatting and white space.
3189 (Powerpc_relobj): Rename got2_section_ to special_.
3190 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3191 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3192 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3193 (Target_powerpc): Add Address typedef and invalid_address. Use
3194 throughout.
3195 (Target_powerpc::is_branch_reloc): New function.
3196 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3197 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3198 for dst_mask, value and addend.
3199 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3200 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3201 (Output_data_glink::do_write): Correct toc base. Don't try to use
3202 uint16_t for 24-bit offset. Use get_output_section_offset and
3203 check return.
3204 (Target_powerpc::Scan::local): Handle more relocs.
3205 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3206 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3207 Plug in toc restoring insn after plt calls. Translate branches
3208 to function descriptor symbols to corresponding entry point.
3209 (Target_powerpc::relocate_for_relocatable): Check return from
3210 get_output_section_offset.
3211 * symtab.h: Comment typo.
3212
b1759dce
ILT
32132012-08-14 Ian Lance Taylor <iant@google.com>
3214
3215 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3216 unsupported_relocal_local to call unsupported_reloc_global.
3217
b9b2ae8b
NC
32182012-08-14 Nick Clifton <nickc@redhat.com>
3219
3220 PR ld/14265
3221 * script-sections.cc (Sections_element::output_section_name): Add
3222 keep return parameter.
3223 (Output_section_element::match_name): Add keep return parameter.
3224 Return the value of the keep_ member.
3225 * script-sections.h (class Output_section): Update
3226 output_section_name prototype.
3227 * layout.cc (Layout::keep_input_section): New public member
3228 function.
3229 (Layout::choose_output_section): Pass keep parameter to
3230 output_section_name.
3231 * layout.h (class Layout): Add keep_input_section.
3232 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3233 sections.
3234 * testsuite/Makefile.am: Add a test.
3235 * testsuite/Makefile.in: Regenerate.
3236 * testsuite/pr14265.c: Source file for the test.
3237 * testsuite/pr14265.t: Linker script for the test.
3238 * testsuite/pr14265.sh: Shell script for the test.
3239
921b5322
AM
32402012-08-14 Alan Modra <amodra@gmail.com>
3241
3242 * target.h (Target::output_section_name): New function.
3243 (Target::do_output_section_name): New function.
3244 * layout.cc (Layout::choose_output_section): Call the above.
3245 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3246
6ce78956
AM
32472012-08-14 Alan Modra <amodra@gmail.com>
3248
3249 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3250 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3251 for replace_constant call.
3252 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3253 (Output_data_glink::do_print_to_mapfile): New function.
3254 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3255 (Target_powerpc::Relocate::relocate): Likewise.
3256
d1a8cabd
AM
32572012-08-14 Alan Modra <amodra@gmail.com>
3258
3259 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3260 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3261 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3262 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3263 all references to shndx_. Handle special case for R_PPC_PLTREL24
3264 here.
3265 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3266 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3267 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3268 here.
3269 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3270 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3271
d83ce4e3
AM
32722012-08-12 Alan Modra <amodra@gmail.com>
3273
3274 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3275 (glink insn constants): Use uint32_t.
3276 (Output_data_glink::add_entry): Use insert, not [] operator.
3277
cf43a2fe
AM
32782012-08-11 Alan Modra <amodra@gmail.com>
3279
3280 * object.h (Sized_relobj_file::find_shdr): New function.
3281 (Sized_relobj_file::find_special_sections): New function.
3282 * object.cc (Sized_relobj_file::find_shdr): New function.
3283 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3284 (Sized_relobj_file::find_special_sections): New function, split out..
3285 (Sized_relobj_file::do_read_symbols): ..from here.
3286 * output.h (Output_data_got::replace_constant): New function.
3287 (Output_data_got::num_entries): New function.
3288 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3289 (Output_data_got::got_offset): Protected rather than private.
3290 (Output_data_got::replace_got_entry): New function.
3291 * output.cc (Output_data_got::replace_got_entry): New function.
3292 * powerpc.cc (class Powerpc_relobj): New.
3293 (class Powerpc_relocate_functions): Delete all psymval variants or
3294 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3295 Implement _ha functions using corresponding _hi function.
3296 (Powerpc_relobj::find_special_sections): New function.
3297 (Target_powerpc::do_make_elf_object): New function.
3298 (class Output_data_got_powerpc): New.
3299 (class Output_data_glink): New.
3300 (class Powerpc_scan_relocatable_reloc): New.
3301 Many more changes througout file.
3302
3c892704
NC
33032012-08-09 Nick Clifton <nickc@redhat.com>
3304
3305 * po/vi.po: Updated Vietnamese translation.
3306
82435b3b
ILT
33072012-08-07 Ian Lance Taylor <iant@google.com>
3308
3309 * layout.cc (Layout::add_target_dynamic_tags): If
3310 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3311 plt_rel.
3312
a6dc81d2
NC
33132012-07-30 Nick Clifton <nickc@redhat.com>
3314
3315 * po/gold.pot: Updated template.
3316 * po/es.po: Updated Spanish translation.
3317
f1415016
CC
33182012-07-18 Cary Coutant <ccoutant@google.com>
3319
3320 PR gold/14344
3321 * configure.ac: Add check for -gpubnames support.
3322 * configure: Regenerate.
3323 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3324 support; force -gno-pubnames.
3325 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3326 support.
3327 (gdb_index_test_4): New test.
3328 * testsuite/Makefile.in: Regenerate.
3329 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3330 * testsuite/gdb_index_test_2.sh: Likewise.
3331 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3332 * testsuite/gdb_index_test_4.sh: New script.
3333 * testsuite/gdb_index_test_comm.sh: New script with common code;
3334 don't look for space after colon.
3335
b7fd7c37
ST
33362012-07-16 Sriraman Tallam <tmsriram@google.com>
3337
3338 * gold.cc (queue_middle_tasks): Update function order only after
3339 deferred objects due to plugins are processed.
3340
1f3212db
ILT
33412012-07-11 Ian Lance Taylor <iant@google.com>
3342
3343 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3344 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3345 (Target_arm::scan_reloc_for_stub): Likewise.
3346 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3347 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3348 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3349 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3350 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3351
81c82a68
ILT
33522012-07-10 Dodji Seketeli <dodji@redhat.com>
3353 Ian Lance Taylor <iant@google.com>
3354
3355 PR gold/14309
3356 * configure.ac: Test whether std::tr1::hash<off_t> works.
3357 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3358 needed.
3359 * output.h (class Output_fill): Add virtual destructor.
3360 * configure, config.in: Rebuild.
3361
eabc84f4
RM
33622012-06-22 Roland McGrath <mcgrathr@google.com>
3363
3364 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3365
370e30b6
RÁE
33662012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3367
3368 * plugin.cc (Plugin::load): Handle position independent executables.
3369
fb1b895d
CC
33702012-06-06 Cary Coutant <ccoutant@google.com>
3371
3372 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3373 add .debug_macro.
3374 (lines_only_debug_sections): Likewise.
3375 (gdb_fast_lookup_sections): New static array.
3376 (is_gdb_debug_section): Rename formal parameter.
3377 (is_lines_only_debug_section): Likewise.
3378 (is_gdb_fast_lookup_section): New function.
3379 (Layout::include_section): Check for ".zdebug_" prefix; pass
3380 section name suffix to is_gdb_debug_section, et al.; check for
3381 fast-lookup sections when building .gdb_index.
3382 * options.h (--strip-debug-gdb): Update GDB version number.
3383
7c0640fa
CC
33842012-06-06 Cary Coutant <ccoutant@google.com>
3385
3386 * configure.ac: Add check for fallocate.
3387 * configure: Regenerate.
3388 * config.in: Regenerate.
3389
3390 * options.h (class General_options): Add --mmap-output-file and
3391 --posix-fallocate options.
3392 * output.cc: (posix_fallocate): Remove; replace with...
3393 (gold_fallocate): New function.
3394 (Output_file::map_no_anonymous): Call gold_fallocate.
3395 (Output_file::map): Check --mmap-output-file option.
3396
2a49eb69
DK
33972012-06-05 Jing Yu <jingyu@google.com>
3398
3399 * gold.h (textdomain): Add do {} to empty while(0).
3400 (bindtextdomain): Likewise.
3401
fad072ac
CC
34022012-06-04 Cary Coutant <ccoutant@google.com>
3403
3404 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3405 has_dynsym_index.
3406
8cc69fb6
ST
34072012-05-25 Sriraman Tallam <tmsriram@google.com>
3408
3409 * symtab.cc (Symbol_table::define_special_symbol):
3410 Initialize *poldsym to prevent uninitialized variable errors.
3411
1be75daa
CC
34122012-05-23 Cary Coutant <ccoutant@google.com>
3413
3414 * layout.cc (Layout::section_name_mapping): Add rules to handle
3415 exact match on .data.rel.ro.local or .data.rel.ro.
3416 (Layout::output_section_name): Check for exact matches.
3417
9b689de0
CC
34182012-05-23 Cary Coutant <ccoutant@google.com>
3419
3420 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3421 more carefully.
3422
b24fdbf5
CC
34232012-05-22 Cary Coutant <ccoutant@google.com>
3424
3425 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3426 object before exporting symbol.
3427
e550e1a2
L
34282012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3429
3430 * testsuite/tls_test.cc: Include "config.h" first.
3431 * testsuite/tls_test_c.c: Likewise.
3432
df7b86aa
NC
34332012-05-17 Daniel Richard G. <skunk@iskunk.org>
3434 Nick Clifton <nickc@redhat.com>
3435
3436 PR 14072
3437 * configure.in: Add check that sysdep.h has been included before
3438 any system header files.
3439 * configure: Regenerate.
3440 * config.in: Regenerate.
3441
1007b503
CC
34422012-05-14 Cary Coutant <ccoutant@google.com>
3443
3444 * layout.cc (Layout::make_output_section): Mark .tdata section
3445 as RELRO.
3446 * testsuite/relro_test.cc: Add a TLS variable.
3447
fd885f3a
L
34482012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3449
3450 PR gold/14091
3451 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3452 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3453 R_X86_64_64.
3454
80f5885c
CC
34552012-05-08 Cary Coutant <ccoutant@google.com>
3456
3457 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3458 (lines_only_debug_sections): Likewise.
3459
2e702c99
RM
34602012-05-02 Roland McGrath <mcgrathr@google.com>
3461
3462 * nacl.cc: New file.
3463 * nacl.h: New file.
3464 * Makefile.am (CCFILES, HFILES): Add them.
3465 * Makefile.in: Regenerate.
3466 * i386.cc (Output_data_plt_i386_nacl): New class.
3467 (Output_data_plt_i386_nacl_exec): New class.
3468 (Output_data_plt_i386_nacl_dyn): New class.
3469 (Target_i386_nacl): New class.
3470 (Target_selector_i386_nacl): New class.
3471 (target_selector_i386): Use it instead of Target_selector_i386.
3472 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3473 (Target_x86_64_nacl): New class.
3474 (Target_selector_x86_64_nacl): New class.
3475 (target_selector_x86_64, target_selector_x32): Use it instead of
3476 Target_selector_x86_64.
3477 * arm.cc (Output_data_plt_arm_nacl): New class.
3478 (Target_arm_nacl): New class.
3479 (Target_selector_arm_nacl): New class.
3480 (target_selector_arm, target_selector_armbe): Use it instead of
3481 Target_selector_arm.
3482
3483 * target-select.cc (select_target): Take new Input_file* and off_t
3484 arguments, pass them on to recognize method of selector.
3485 * object.cc (make_elf_sized_object): Update caller.
3486 * parameters.cc (parameters_force_valid_target): Likewise.
3487 * incremental.cc (make_sized_incremental_binary): Likewise.
3488 * target-select.h: Update decl.
3489 (Target_selector::recognize): Take new Input_file* argument,
3490 pass it on to do_recognize.
3491 (Target_selector::do_recognize): Take new Input_file* argument.
3492 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3493 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3494 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3495 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3496
3497 * target.h (Target::Target_info): New members isolate_execinstr
3498 and rosegment_gap.
3499 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3500 * arm.cc (Target_arm::arm_info): Update initializer.
3501 * i386.cc (Target_i386::i386_info): Likewise.
3502 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3503 * sparc.cc (Target_sparc::sparc_info): Likewise.
3504 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3505 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3506 * layout.cc (Layout::attach_allocated_section_to_segment):
3507 Take new const Target* argument. If target->isolate_execinstr(), act
3508 like --rosegment.
3509 (Layout::find_first_load_seg): Take new const Target* argument;
3510 if target->isolate_execinstr(), reject PF_X segments.
3511 (Layout::relaxation_loop_body): Update caller.
3512 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3513 reset file offset to zero when we hit LOAD_SEG, and then do a second
3514 loop over the segments before LOAD_SEG to reassign offsets after
3515 addresses have been determined. Handle target->rosegment_gap().
3516 (Layout::attach_section_to_segment): Take new const Target* argument;
3517 pass it to attach_allocated_section_to_segment.
3518 (Layout::make_output_section): Update caller.
3519 (Layout::attach_sections_to_segments): Take new const Target* argument;
3520 pass it to attach_section_to_segment.
3521 * gold.cc (queue_middle_tasks): Update caller.
3522 * layout.h (Layout): Update method decls with new arguments.
3523
3524 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3525 Target_info pointer to use.
3526 (Target_arm::do_make_data_plt): New virtual method.
3527 (Target_arm::make_data_plt): New method that calls it.
3528 (Target_arm::make_plt_entry): Use it.
3529 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3530 for the section alignment.
3531 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3532 method.
3533 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3534 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3535 method.
3536 (Output_data_plt_arm::get_plt_entry_size): Call it.
3537 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3538 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3539 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3540 method.
3541 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3542 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3543 method instead of sizeof(plt_entry).
3544 (Output_data_plt_arm::add_entry): Likewise.
3545 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3546 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3547 than static method.
3548 (Target_arm::plt_entry_size): Likewise.
3549 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3550 Move to ...
3551 (Output_data_plt_arm_standard): ... here, new class.
3552 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3553 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3554 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3555
3556 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3557 Take additional argument for the PLT entry size.
3558 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3559 Use get_plt_entry_size method rather than plt_entry_size variable.
3560 (Output_data_plt_x86_64::reserve_slot): Likewise.
3561 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3562 (Output_data_plt_x86_64::add_entry): Likewise.
3563 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3564 (Output_data_plt_x86_64::address_for_global): Likewise.
3565 (Output_data_plt_x86_64::address_for_local): Likewise.
3566 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3567 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3568 Make method non-static.
3569 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3570 method.
3571 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3572 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3573 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3574 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3575 virtual method.
3576 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3577 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3578 virtual method.
3579 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3580 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3581 virtual method.
3582 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3583 (Output_data_plt_x86_64::plt_entry_size)
3584 (Output_data_plt_x86_64::first_plt_entry)
3585 (Output_data_plt_x86_64::plt_entry)
3586 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3587 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3588 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3589 (Output_data_plt_x86_64_standard): ... here, new class.
3590 (Target_x86_64::Target_x86_64): Take optional argument for the
3591 Target_info pointer to use.
3592 (Target_x86_64::do_make_data_plt): New virtual method.
3593 (Target_x86_64::make_data_plt): New method to call it.
3594 (Target_x86_64::init_got_plt_for_update): Use that.
3595 Call this->plt_->add_eh_frame method here.
3596 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3597 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3598 rather than static method.
3599 (Target_x86_64::plt_entry_size): Likewise.
3600 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3601 rather than plt_entry_size variable. Move guts of PLT filling to...
3602 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3603 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3604 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3605
3606 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3607 additional argument for the section alignment.
3608 Don't do add_eh_frame_for_plt here.
3609 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3610 non-static. Use get_plt_entry_size method rather than plt_entry_size
3611 variable.
3612 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3613 method.
3614 (Output_data_plt_i386::get_plt_entry_size): Call it.
3615 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3616 (Output_data_plt_i386::add_eh_frame): New method to call it.
3617 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3618 method.
3619 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3620 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3621 method.
3622 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3623 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3624 method instead of plt_entry_size.
3625 (Output_data_plt_i386::plt_entry_size)
3626 (Output_data_plt_i386::plt_eh_frame_fde_size)
3627 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3628 (Output_data_plt_i386_standard): ... here, new class.
3629 (Output_data_plt_i386_exec): New class.
3630 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3631 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3632 (Output_data_plt_i386::exec_plt_entry): Move to ...
3633 (Output_data_plt_i386_exec::plt_entry): ... here.
3634 (Output_data_plt_i386_dyn): New class.
3635 (Output_data_plt_i386::first_plt_entry): Move to ...
3636 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3637 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3638 (Output_data_plt_i386_dyn::plt_entry): ... here.
3639 (Target_i386::Target_i386): Take optional argument for the Target_info
3640 pointer to use.
3641 (Target_i386::do_make_data_plt): New virtual method.
3642 (Target_i386::make_data_plt): New method to call it.
3643 (Target_i386::make_plt_section): Use that.
3644 Call this->plt_->add_eh_frame method here.
3645 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3646 rather than plt_entry_size variable.
3647 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3648 (Output_data_plt_i386::address_for_local): Likewise.
3649 (Output_data_plt_i386::do_write): Likewise.
3650 Move guts of PLT filling to...
3651 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3652 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3653 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3654 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3655
b9b9f2ee
CC
36562012-05-01 Cary Coutant <ccoutant@google.com>
3657
3658 * dwarf_reader.cc (Dwarf_die::read_attributes)
3659 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3660 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3661 * reduced_debug_output.cc
3662 (Output_reduced_debug_info_section::get_die_end): Remove
3663 DW_FORM_GNU_ref_index. Add default case.
3664
57923f48
MW
36652012-04-26 Mark Wielaard <mjw@redhat.com>
3666
3667 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3668 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3669 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3670 DW_AT_high_pc as offset from DW_AT_low_pc.
3671
3672 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3673 * testsuite/Makefile.in: Regenerate.
3674 * testsuite/gdb_index_test_3.c: New test source file.
3675 * testsuite/gdb_index_test_3.sh: New test source file.
3676
2c54b4f4
ILT
36772012-04-25 Ian Lance Taylor <iant@google.com>
3678
3679 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3680 pointer.
3681 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3682 as a class, not a struct.
3683 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3684 (Target_arm::apply_cortex_a8_workaround): Likewise.
3685 * gc.h: Declare Reloc_types as a struct, not a class.
3686 * object.h: Declare Symbols_data as a struct.
3687 * reloc.h: Declare Read_relocs_data as a struct.
3688 * target.h: Declare Relocate_info as a struct.
3689
a5a5f7a3
DM
36902012-04-24 David S. Miller <davem@davemloft.net>
3691
3692 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3693 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3694 and R_SPARC_WPLT30.
3695
f038d496
CC
36962012-04-24 Cary Coutant <ccoutant@google.com>
3697
3698 * incremental-dump.cc (find_input_containing_global): Replace
3699 magic number with symbolic constant.
3700 (dump_incremental_inputs): Update version number.
3701 * incremental.cc (Output_section_incremental_inputs): Update version
3702 number; import symbolic constants from Incremental_inputs_reader.
3703 (Incremental_inputs::create_data_sections): Align relocations
3704 section correctly for 64-bit targets.
3705 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3706 constants; add padding.
3707 (Output_section_incremental_inputs::write_header): Add assert for
3708 header_size.
3709 (Output_section_incremental_inputs::write_input_files): Add assert
3710 for input_entry_size.
3711 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3712 add assert for object_info_size, input_section_entry_size,
3713 global_sym_entry_size.
3714 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3715 for data structure sizes; use them.
3716 (Incremental_input_entry_reader): Import symbolic constants from
3717 Incremental_inputs_reader; use them.
3718
a4d85145
DM
37192012-04-23 David S. Miller <davem@davemloft.net>
3720
3721 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3722 and elf_flags_set_.
3723 (Target_sparc::Target_sparc): Initialize new fields.
3724 (Target_sparc::do_make_elf_object): New function.
3725 (Target_sparc::do_adjust_elf_header): New function.
3726
1d509098
CC
37272012-04-23 Cary Coutant <ccoutant@google.com>
3728
3729 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3730 CU range table of gdb index.
3731
7ebeff7f
DM
37322012-04-20 David S. Miller <davem@davemloft.net>
3733
3734 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3735 instead of false.
3736
13cf9988
DM
37372012-04-16 David S. Miller <davem@davemloft.net>
3738
2a1079e8
DM
3739 * sparc.cc (Target_sparc::got_address): New function.
3740 (Sparc_relocate_functions::gdop_hix22): New function.
3741 (Sparc_relocate_functions::gdop_lox10): New function.
3742 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3743 relocs.
3744 (Target_sparc::Scan::local): Likewise if the global symbol is not
3745 preemptible and is not IFUNC.
3746 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3747 transformations for local and non-preemptible non-IFUNC global
3748 symbols.
3749
0bc964fc
DM
3750 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3751 writing out 64-bit part of ranges.
3752
661d7a80
DM
3753 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3754 -fpic and -fpie respectively.
3755 * Makefile.in: Regenerate.
3756
8c2bf391
DM
3757 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3758 (Target_sparc::Target_sparc): Initialize new field.
3759 (Target_sparc::do_plt_section_for_global): New function.
3760 (Target_sparc::do_plt_section_for_local): New function.
3761 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3762 (Target_sparc::make_plt_section): New function, broken out of
3763 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3764 (Target_sparc::make_plt_entry): Call make_plt_section.
3765 (Target_sparc::make_local_ifunc_plt_entry): New function.
3766 (Target_sparc::rela_ifunc_section): New function.
3767 (Target_sparc::plt_section): Remove const.
3768 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3769 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3770 and ifunc_count_ fields.
3771 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3772 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3773 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3774 (Output_data_plt_sparc::rela_ifunc): New function.
3775 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3776 (Output_data_plt_sparc::has_ifunc_section): New function.
3777 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3778 (Output_data_plt_sparc::address_for_global): New function.
3779 (Output_data_plt_sparc::address_for_local): New function.
3780 (Output_data_plt_sparc::plt_index_to_offset): New function.
3781 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3782 and entry_count.
3783 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3784 entry_count.
3785 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3786 R_SPARC_JMP_IREL to switch.
3787 (Target_sparc::Scan::check_non_pic): Likewise.
3788 (Target_sparc::Scan::local): Handle IFUNC symbols.
3789 (Target_sparc::Scan::local): Likewise.
3790 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3791 and plt_address_for_local.
3792 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3793 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3794
13cf9988
DM
3795 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3796 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3797 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3798 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3799 global relocs too.
3800 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3801 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3802 calls.
3803 * sparc.cc (Target_sparc::Scan::global): Likewise.
3804 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3805
31821be0
CC
38062012-04-16 Cary Coutant <ccoutant@google.com>
3807
3808 * archive.cc (Library_base::should_include_member): Check for
3809 --export-dynamic-symbol.
3810 * options.h (class General_options): Add --export-dynamic-symbol.
3811 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3812 --export-dynamic-symbol.
3813 (Symbol_table::gc_mark_undef_symbols): Likewise.
3814 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3815
2615994e
DM
38162012-04-12 David S. Miller <davem@davemloft.net>
3817
3818 * sparc.cc (Reloc::wdisp10): New relocation method.
3819 (Reloc::h34): Likewise.
3820 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3821 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3822 R_SPARC_WDISP10.
3823 (Target_sparc::Scan::local): Likewise.
3824 (Target_sparc::Scan::global): Likewise.
3825 (Target_sparc::Relocate::relocate): Likewise.
3826
6782735d
CC
38272012-04-09 Cary Coutant <ccoutant@google.com>
3828
3829 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3830 low_pc == 0.
3831
8c7a0b00
ILT
38322012-04-06 Ian Lance Taylor <iant@google.com>
3833
3834 * timer.cc: #include <unistd.h>.
3835
58797674
RM
38362012-04-06 Roland McGrath <mcgrathr@google.com>
3837
3838 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3839 * config.in: Regenerate.
3840 * configure: Regenerate.
3841
44350750
NC
38422012-04-05 Nick Clifton <nickc@redhat.com>
3843
3844 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3845 (AM_LC_MESSAGES): Add.
3846 * aclocal.m4: Regenerate.
3847 * config.in: Regenerate.
3848 * configure: Regenerate.
3849
c1027032
CC
38502012-03-21 Cary Coutant <ccoutant@google.com>
3851
3852 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3853 * Makefile.in: Regenerate.
3854 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3855 (Sized_elf_reloc_mapper::symbol_section): New function.
3856 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3857 (make_elf_reloc_mapper): New function.
3858 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3859 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3860 (Dwarf_abbrev_table::do_get_abbrev): New function.
3861 (Dwarf_ranges_table::read_ranges_table): New function.
3862 (Dwarf_ranges_table::read_range_list): New function.
3863 (Dwarf_pubnames_table::read_section): New function.
3864 (Dwarf_pubnames_table::read_header): New function.
3865 (Dwarf_pubnames_table::next_name): New function.
3866 (Dwarf_die::Dwarf_die): New function.
3867 (Dwarf_die::read_attributes): New function.
3868 (Dwarf_die::skip_attributes): New function.
3869 (Dwarf_die::set_name): New function.
3870 (Dwarf_die::set_linkage_name): New function.
3871 (Dwarf_die::attribute): New function.
3872 (Dwarf_die::string_attribute): New function.
3873 (Dwarf_die::int_attribute): New function.
3874 (Dwarf_die::uint_attribute): New function.
3875 (Dwarf_die::ref_attribute): New function.
3876 (Dwarf_die::child_offset): New function.
3877 (Dwarf_die::sibling_offset): New function.
3878 (Dwarf_info_reader::check_buffer): New function.
3879 (Dwarf_info_reader::parse): New function.
3880 (Dwarf_info_reader::do_parse): New function.
3881 (Dwarf_info_reader::do_read_string_table): New function.
3882 (Dwarf_info_reader::lookup_reloc): New function.
3883 (Dwarf_info_reader::get_string): New function.
3884 (Dwarf_info_reader::visit_compilation_unit): New function.
3885 (Dwarf_info_reader::visit_type_unit): New function.
3886 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3887 Sized_elf_reloc_mapper.
3888 (Sized_dwarf_line_info::symbol_section): Remove function.
3889 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3890 (Sized_dwarf_line_info::read_line_mappings): Remove object
3891 parameter, adjust callers.
3892 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3893 * dwarf_reader.h: Include <sys/types.h>.
3894 (class Track_relocs): Remove forward declaration.
3895 (class Elf_reloc_mapper): New class.
3896 (class Sized_elf_reloc_mapper): New class.
3897 (class Dwarf_abbrev_table): New class.
3898 (class Dwarf_range_list): New class.
3899 (class Dwarf_ranges_table): New class.
3900 (class Dwarf_pubnames_table): New class.
3901 (class Dwarf_die): New class.
3902 (class Dwarf_info_reader): New class.
3903 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3904 (Sized_dwarf_line_info::symbol_section): Remove member function.
3905 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3906 base class.
3907 * gdb-index.cc: New source file.
3908 * gdb-index.h: New source file.
3909 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3910 and .debug_types sections, call Layout::add_to_gdb_index.
3911 (Sized_relobj_incr::do_section_name): Implement.
3912 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3913 return type; Implement.
3914 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3915 return type.
3916 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3917 parameter list and return type.
3918 (Sized_incr_dynobj::do_section_contents): Likewise.
3919 * layout.cc: Include gdb-index.h.
3920 (Layout::Layout): Initialize gdb_index_data_.
3921 (Layout::init_fixed_output_section): Check for .gdb_index section.
3922 (Layout::add_to_gdb_index): New function. Instantiate.
3923 * layout.h: Add forward declaration for class Gdb_index.
3924 (Layout::add_to_gdb_index): New member function.
3925 (Layout::gdb_index_data_): New data member.
3926 * main.cc: Include gdb-index.h.
3927 (main): Print statistics for gdb index.
3928 * object.cc (Object::section_contents): Move code into
3929 do_section_contents.
3930 (need_decompressed_section): Check for sections needed when building
3931 gdb index.
3932 (build_compressed_section_map): Likewise.
3933 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3934 gdb index.
3935 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3936 sections; call Layout::add_to_gdb_index.
3937 (Sized_relobj_file::do_decompressed_section_contents): Call
3938 do_section_contents directly.
3939 * object.h (Object::do_section_contents): Adjust parameter list and
3940 return type.
3941 (Object::do_decompressed_section_contents): Call do_section_contents
3942 directly.
3943 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3944 return type.
3945 * options.h (class General_options): Add --gdb-index option.
3946 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3947 list and return type.
3948 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3949 * reloc.h (Track_relocs::checkpoint): New function.
3950 (Track_relocs::reset): New function.
3951
3952 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3953 New test cases.
3954 * testsuite/Makefile.in: Regenerate.
3955 * testsuite/gdb_index_test.cc: New test source file.
3956 * testsuite/gdb_index_test_1.sh: New test source file.
3957 * testsuite/gdb_index_test_2.sh: New test source file.
3958
647f1574
DK
39592012-03-19 Doug Kwan <dougkwan@google.com>
3960
3961 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 3962 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
3963 __exidx_start and __exidx_end. Make symbol table parameter
3964 anonymous as it is not used.
3965 * gold.cc (queue_middle_tasks): Call target hook to define any
3966 target-specific symbols.
3967 * target.h (Target::define_standard_symbols): New method.
3968 (Target::do_define_standard_symbols): Same.
3969 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
3970 * testsuite/Makefile.in: Regenerate.
3971 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
3972 and __exidx_end.
3973 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
3974 relocations are generated for __exidx_start and __exidx_end.
3975
7c6109da
DK
39762012-03-16 Doug Kwan <dougkwan@google.com>
3977
3978 * testsuite/Makefile.am: Disable test initpri3b.
3979 * testsuite/Makefile.in: Regenerate.
3980
7b8957f8
DK
39812012-03-15 Doug Kwan <dougkwan@google.com>
3982
3983 * arm.cc (Target_arm::got_section): Make .got section read-only
3984 if -z now is given.
3985
14dc9ef7
ILT
39862012-03-15 Ian Lance Taylor <iant@google.com>
3987
3988 PR gold/13850
3989 * layout.cc (Layout::make_output_section): Correctly mark
3990 SHT_INIT_ARRAY, et. al., as relro.
3991
fa40b62a
DK
39922012-03-14 Doug Kwan <dougkwan@google.com>
3993
3994 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
3995 dynamic relocations for protected symbols in shared objects.
3996
fd325007
ILT
39972012-03-13 Ian Lance Taylor <iant@google.com>
3998
3999 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4000 keep the larger alignment.
4001
e8dd54e1
CC
40022012-03-12 Cary Coutant <ccoutant@google.com>
4003
4004 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4005 handling of DW_LNE_define_file.
4006
feb5f3b0
CC
40072012-03-12 Cary Coutant <ccoutant@google.com>
4008
4009 * reduced_debug_output.cc
4010 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4011 codes to switch.
4012
a1fb4256
CC
40132012-02-29 Cary Coutant <ccoutant@google.com>
4014
4015 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4016
5dd8762a
CC
40172012-02-29 Cary Coutant <ccoutant@google.com>
4018
4019 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4020 Call Object::decompressed_section_contents.
4021 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4022 New dtor.
4023 (Sized_dwarf_line_info::buffer_start_): New data member.
4024 * merge.cc (Output_merge_data::do_add_input_section): Call
4025 Object::decompressed_section_contents.
4026 (Output_merge_string::do_add_input_section): Likewise.
4027 * object.cc (need_decompressed_section): New function.
4028 (build_compressed_section_map): Decompress sections needed later.
4029 (Sized_relobj_file::do_decompressed_section_contents): New function.
4030 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4031 * object.h (Object::decompressed_section_contents): New function.
4032 (Object::discard_decompressed_sections): New function.
4033 (Object::do_decompressed_section_contents): New function.
4034 (Object::do_discard_decompressed_sections): New function.
4035 (Compressed_section_info): New type.
4036 (Compressed_section_map): Include decompressed section contents.
4037 (Sized_relobj_file::do_decompressed_section_contents): New function.
4038 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4039
7b5de7ee
CC
40402012-02-16 Cary Coutant <ccoutant@google.com>
4041
4042 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
4043 * testsuite/Makefile.in: Regenerate.
4044
f9fa4a63
CC
40452012-02-14 Cary Coutant <ccoutant@google.com>
4046
4047 * options.cc (General_options::finalize): Disallow -pie and -static.
4048
2c175ebc
DK
40492012-02-03 Doug Kwan <dougkwan@google.com>
4050
4051 * arm.cc (Arm_relocate_functions::abs8,
4052 Arm_relocate_functions::abs16): Use
4053 Bits::has_signed_unsigned_overflow32.
4054 (Arm_relocate_functions::thm_abs8): Correct range of
4055 overflow check.
4056 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
4057 in assertions.
4058
90cff06f
DK
40592012-02-02 Doug Kwan <dougkwan@google.com>
4060
4061 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
4062 position independent outputs, not just shared objects.
4063
63887f3d
L
40642012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4065
4066 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4067 * configure: Regenerated.
4068
bef2b434
ILT
40692012-01-27 Ian Lance Taylor <iant@google.com>
4070
4071 * reloc.h (Bits): New class with static functions, copied from
4072 namespace utils in arm.cc.
4073 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4074 instead.
4075
c335b55d
L
40762012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4077
4078 * incremental.cc (write_info_blocks): Correct relocation offset.
4079
41194d9f
L
40802012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4081
4082 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4083 (Relocate::tls_gd_to_le): Likewise.
4084
1bae613c
L
40852012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4086
4087 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4088
24482ca0
L
40892012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4090
4091 * configure.ac: Check if -mcmodel=medium works.
4092 * configure: Regenerated.
4093
c2c7840a
CC
40942012-01-24 Cary Coutant <ccoutant@google.com>
4095
4096 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4097 definition and ...
4098 (read_unsigned_LEB_128_x): ... this new function.
4099 (read_signed_LEB_128): Replaced with inline definition and ...
4100 (read_signed_LEB_128_x): ... this new function.
4101 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4102 (read_unsigned_LEB_128): Add inline definition.
4103 (read_signed_LEB_128_x): New function.
4104 (read_signed_LEB_128): Add inline definition.
4105 * testsuite/Makefile.am (leb128_unittest): New unit test.
4106 * testsuite/Makefile.in: Regenerate.
4107 * testsuite/leb128_unittest.cc: New unit test.
4108
833de760 41092012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
4110
4111 PR gold/13617
4112 * i386.cc (Target_i386::do_code_fill): When using a jmp
4113 instruction, pad with nop instructions.
4114 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4115
618d6666
L
41162012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4117
4118 * x86_64.cc (gc_process_relocs): Add typename on types used in
4119 template.
4120 (scan_relocs): Likewise.
4121 (relocate_section): Likewise.
4122 (apply_relocation): Likewise.
4123
3660ff06
L
41242012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4125
4126 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4127 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4128 under x32.
4129
fc51264f
L
41302012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4131
4132 * x86_64.cc: Initial support for x32.
4133
dd74ae06
CC
41342012-01-03 Cary Coutant <ccoutant@google.com>
4135
4136 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4137 Use abstract base class for GOT.
4138 * gold/output.h (class Output_data_got_base): New abstract base class.
4139 (class Output_data_got): Derive from new base class, adjust ctors.
4140 (Output_data_got::reserve_slot): Make virtual; rename to
4141 do_reserve_slot; Adjust callers.
4142 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4143 pointer to abstract base class.
4144 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4145
83896202
ILT
41462011-12-18 Ian Lance Taylor <iant@google.com>
4147
4148 * object.h (Relobj::local_symbol_value): New function.
4149 (Relobj::local_plt_offset): New function.
4150 (Relobj::local_has_got_offset): New function.
4151 (Relobj::local_got_offset): New function.
4152 (Relobj::set_local_got_offset): New function.
4153 (Relobj::do_local_symbol_value): New pure virtual function.
4154 (Relobj::do_local_plt_offset): Likewise.
4155 (Relobj::do_local_has_got_offset): Likewise.
4156 (Relobj::do_local_got_offset): Likewise.
4157 (Relobj::do_set_local_got_offset): Likewise.
4158 (Sized_relobj::do_local_has_got_offset): Rename from
4159 local_has_got_offset.
4160 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4161 (Sized_relobj::do_set_local_got_offset): Rename from
4162 set_local_got_offset.
4163 (Sized_relobj_file::do_local_plt_offset): Rename from
4164 local_plt_offset.
4165 (Sized_relobj_file::do_local_symbol_value): New function.
4166 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4167 local_plt_offset.
4168 * output.cc (Output_data_got::Got_entry::write): Change object to
4169 Relobj. Use local_symbol_value.
4170 (Output_data_got::add_global_with_rel): Change rel_dyn to
4171 Output_data_reloc_generic*. Use add_global_generic.
4172 (Output_data_got::add_global_with_rela): Remove. Change all
4173 callers to use add_global_with_rel.
4174 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4175 Output_data_reloc_generic*. Use add_global_generic.
4176 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4177 callers to use add_global_pair_with_rel.
4178 (Output_data_got::add_local): Change object to Relobj*.
4179 (Output_data_got::add_local_plt): Likewise.
4180 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4181 change rel_dyn to Output_data_reloc_generic*. Use
4182 add_local_generic.
4183 (Output_data_got::add_local_with_rela): Remove. Change all
4184 callers to use all_local_with_rel.
4185 (Output_data_got::add_local_pair_with_rel): Change object to
4186 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4187 add_output_section_generic.
4188 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4189 callers to use add_local_pair_with_rel.
4190 (Output_data_got::reserve_local): Change object to Relobj*.
4191 * output.h: (class Output_data_reloc_generic): Add pure virtual
4192 declarations for add_global_generic, add_local_generic,
4193 add_output_section_generic.
4194 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4195 functions for Output_data_reloc_generic. Update declarations for
4196 changes listed in output.cc.
4197 (class Output_data_got): Change template parameter to got_size.
4198 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4199 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4200 function.
4201 (Sized_relobj_incr::do_local_plt_offset): New function.
4202 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4203 add_global_generic.
4204
76677ad0
CC
42052011-12-17 Cary Coutant <ccoutant@google.com>
4206
4207 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4208 * resolve.cc (Symbol_table::resolve): Likewise.
4209 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4210 arrays.
4211 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4212
8b8dd8d5
ILT
42132011-12-16 Ian Lance Taylor <iant@google.com>
4214
4215 * output.h (Output_data_reloc_generic::add): Only call
4216 add_dynamic_reloc if this is a dynamic reloc section.
4217
d55525b9
L
42182011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4219
4220 PR gold/13505
4221 * target-reloc.h (apply_relocation): Replace <64, false> with
4222 <size, big_endian>.
4223
ff81c7c1
NC
42242011-11-25 Nick Clifton <nickc@redhat.com>
4225
4226 * po/it.po: New Italian translation.
4227
628f39be
SA
42282011-11-17 Sterling Augustine <saugustine@google.com>
4229
4230 * script.cc (script_include_directive): Implement.
4231 (read_script_file): New local variables name and search_path. Update
4232 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4233 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4234 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4235
98ef3ea4
SA
42362011-11-11 Sterling Augustine <saugustine@google.com>
4237
4238 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4239 (file_or_sections_cmd): Likewise.
4240
f4a8b6d7
DK
42412011-11-11 Doug Kwan <dougkwan@google.com>
4242
4243 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4244 if --just-symbols is given.
4245
29ab395d
DK
42462011-11-10 Doug Kwan <dougkwan@google.com>
4247
4248 PR gold/13362
4249 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4250 when processing data relocs.
4251 * reloc.h (Relocate_functions::rel_unaligned): New method.
4252 (Relocate_functions::pcrel_unaligned): Ditto.
4253 (Relocate_functions::rel32_unaligned): Ditto.
4254 (Relocate_functions::pcrel32_unaligned): Ditto.
4255
2c339f71
DK
42562011-11-09 Doug Kwan <dougkwan@google.com>
4257
4258 PR gold/13362
4259 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4260 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4261 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4262 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4263 (Relocate_functions::rel_unaligned): New.
4264 (Relocate_functions::rel32_unaligned): New.
4265 * target-reloc.h (relocate_for_relocatable): Add code to handle
4266 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4267 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4268 arm_unaligned_reloc_r): New targets.
4269 * testsuite/Makefile.in: Regenerate.
4270 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4271 linking.
4272
3f3cddf1
ILT
42732011-11-02 Ian Lance Taylor <iant@google.com>
4274
4275 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4276 NATIVE_LINKER.
4277 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4278 * options.cc (General_options::finalize): Use library search path
4279 from configure script if specified. If not native and no sysroot,
4280 only search TOOLLIBDIR.
4281 * options.h (Search_directory::Search_directory): Change name to
4282 const std::string&.
4283 (General_options::add_to_library_path_with_sysroot): Change arg to
4284 const std::string&.
4285 * configure, Makefile.in, config.in: Rebuild.
4286
a8e2273b
ILT
42872011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4288
4289 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4290 we are working around the ARM1176 Erratum.
4291 * options.h (General_options::fix_arm1176): Add option.
4292 * testsuite/Makefile.am: Add testcases, and keep current ones
4293 working.
4294 * testsuite/Makefile.in: Regenerate.
4295 * testsuite/arm_fix_1176.s: New file.
4296 * testsuite/arm_fix_1176.sh: Likewise.
4297
cd6eab1c
ILT
42982011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4299
4300 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4301 may_use_blx_.
4302 (Target_arm::may_use_blx): Remove method.
4303 (Target_arm::set_may_use_blx): Likewise.
4304 (Target_arm::may_use_v4t_interworking): New method.
4305 (Target_arm::may_use_v5t_interworking): Likewise.
4306 (Target_arm::may_use_blx_): Remove member variable.
4307 (Arm_relocate_functions::arm_branch_common): Check for v5T
4308 interworking.
4309 (Arm_relocate_functions::thumb_branch_common): Likewise.
4310 (Reloc_stub::stub_type_for_reloc): Likewise.
4311 (Target_arm::do_finalize_sections): Correct interworking checks.
4312 * testsuite/Makefile.am: Add new tests.
4313 * testsuite/Makefile.in: Regenerate.
4314 * testsuite/arm_farcall_arm_arm.s: New test.
4315 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4316 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4317 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4318 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4319 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4320 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4321 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4322
286adcf4
CC
43232011-10-31 Cary Coutant <ccoutant@google.com>
4324
4325 PR gold/13023
4326 * expression.cc (Expression::eval_with_dot): Add
4327 is_section_dot_assignment parameter.
4328 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4329 absolute and assigning to dot within a section.
4330 * script-sections.cc
4331 (Output_section_element_assignment::set_section_addresses): Pass
4332 dot_section to set_if_absolute.
4333 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4334 as is_section_dot_assignment flag to eval_with_dot.
4335 (Output_section_element_dot_assignment::set_section_addresses):
4336 Likewise.
4337 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4338 parameter. Also set value if relative to dot_section; set the
4339 symbol's output_section.
4340 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4341 parameter. Adjust all callers.
4342 (Expression::eval_maybe_dot): Likewise.
4343 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4344 Adjust all callers.
4345 * testsuite/script_test_2.t: Test assignment of an absolute value
4346 to dot within an output section element.
4347
9634ed06
CC
43482011-10-31 Cary Coutant <ccoutant@google.com>
4349
4350 * options.h (class General_options): Add --[no-]gnu-unique options.
4351 * symtab.cc (Symbol_table::sized_write_globals): Convert
4352 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4353
de4101c7
CC
43542011-10-31 Cary Coutant <ccoutant@google.com>
4355
4356 PR gold/13359
4357 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4358 unnecessary assertion.
4359 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4360
7257cc92
ST
43612011-10-31 Sriraman Tallam <tmsriram@google.com>
4362
4363 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4364 gc_mark_symbol.
4365 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4366 gc_mark_symbol.
4367 Change to just keep the section associated with symbol.
4368 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4369 they are externally visible and --export-dynamic is turned on.
4370 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4371
bfc34b3f
ILT
43722011-10-19 Ian Lance Taylor <iant@google.com>
4373
4374 PR gold/13163
4375 * script-sections.cc
4376 (Output_section_element_dot_assignment::needs_output_section): New
4377 function.
4378
ea0d8c47
ILT
43792011-10-19 Ian Lance Taylor <iant@google.com>
4380
4381 PR gold/13204
4382 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4383 --section-start option was seen.
4384 * options.h (General_options::any_section_start): New function.
4385
abd242a9
DM
43862011-10-18 David S. Miller <davem@davemloft.net>
4387
4388 PR binutils/13301
4389 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4390 member to track relocation locations that have moved during TLS
4391 reloc optimizations.
4392 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4393 (Target_sparc::Relocate::relocate): Adjust view down by 4
4394 bytes if it matches reloc_adjust_addr_.
4395 (Target_sparc::Relocate::relocate_tls): Always move the
4396 __tls_get_addr call delay slot instruction forward 4 bytes when
4397 performing relaxation.
4398
bab9090f
CC
43992011-10-18 Cary Coutant <ccoutant@google.com>
4400
4401 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4402 (Output_file::map_no_anonymous): Check for non-zero
4403 return code from posix_fallocate.
4404
f7c5b166
CC
44052011-10-17 Cary Coutant <ccoutant@google.com>
4406
4407 PR gold/13245
4408 * plugin.cc (is_visible_from_outside): Check for symbols
4409 referenced from dynamic objects.
4410 * resolve.cc (Symbol_table::resolve): Don't count references
4411 from dynamic objects as references from real ELF files.
4412 * testsuite/plugin_test_2.sh: Adjust expected result.
4413
b490c0bb
CC
44142011-10-17 Cary Coutant <ccoutant@google.com>
4415
4416 * gold.cc: Include timer.h.
4417 (queue_middle_tasks): Stamp time.
4418 (queue_final_tasks): Likewise.
4419 * main.cc (main): Store timer in parameters. Print timers
4420 for each pass.
4421 * parameters.cc (Parameters::Parameters): Initialize timer_.
4422 (Parameters::set_timer): New function.
4423 (set_parameters_timer): New function.
4424 * parameters.h (Parameters::set_timer): New function.
4425 (Parameters::timer): New function.
4426 (Parameters::timer_): New data member.
4427 (set_parameters_timer): New function.
4428 * timer.cc (Timer::stamp): New function.
4429 (Timer::get_pass_time): New function.
4430 * timer.h (Timer::stamp): New function.
4431 (Timer::get_pass_time): New function.
4432 (Timer::pass_times_): New data member.
4433
f475cf7b
CC
44342011-10-17 Cary Coutant <ccoutant@google.com>
4435
4436 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4437 task for members of lib groups.
4438
cdd7e244
CC
44392011-10-17 Cary Coutant <ccoutant@google.com>
4440
4441 PR gold/13288
4f95c8b4 4442 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
4443 (File_read::make_view): Move bounds check (replace with assert)...
4444 (File_read::find_or_make_view): ... to here.
4445
dfb45471
CC
44462011-10-12 Cary Coutant <ccoutant@google.com>
4447
4f95c8b4 4448 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
4449 ::read returns less than requested size.
4450
53bbcc1b
CC
44512011-10-10 Cary Coutant <ccoutant@google.com>
4452
4f95c8b4 4453 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
4454 Initialize defined_count_.
4455 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4456 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4457 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4458 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4459 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4460 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4461 member.
4462 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4463 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4464 Return zeroes instead of internal error.
4465
397b129b
CC
44662011-10-10 Cary Coutant <ccoutant@google.com>
4467
4468 PR gold/13249
4f95c8b4 4469 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4470 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4471 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4472 (Output_reloc::type_): Adjust size of bit field.
4473 (Output_reloc::use_plt_offset_): New bit field.
4474 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4475 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4476 flag. Adjust all callers.
4f95c8b4 4477 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4478 creating RELATIVE relocations.
4479
d5698657
NC
44802011-10-10 Nick Clifton <nickc@redhat.com>
4481
4482 * po/es.po: Updated Spanish translation.
4483 * po/fi.po: Updated Finnish translation.
4484
6a59a5c2
DN
44852011-10-03 Diego Novillo <dnovillo@google.com>
4486
4487 * options.cc (parse_uint): Fix dereference of RETVAL.
4488
f0558624
ST
44892011-09-29 Sriraman Tallam <tmsriram@google.com>
4490
4491 * layout.h (section_order_map_): New member.
4492 (get_section_order_map): New member function.
4493 * output.cc (Output_section::add_input_section): Check for patterns
4494 only when --section-ordering-file is specified.
4495 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4496 output_sections have been formed.
4497 * layout.cc (Layout_Layout): Initialize section_order_map_.
4498 * plugin.cc (update_section_order): Store order in order_map. Do not
4499 update the order.
4500 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4501 * testsuite/Makefile.in: Regenerate.
4502 * testsuite/plugin_section_order.c: New file.
4503 * testsuite/plugin_final_layout.cc: New file.
4504 * testsuite/plugin_final_layout.sh: New file.
4505
a7dac153
CC
45062011-09-29 Cary Coutant <ccoutant@google.com>
4507
4f95c8b4 4508 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4509 Check for NULL.
4f95c8b4 4510 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4511 symbols during incremental update.
4512 (Symbol_table::add_from_dynobj): Likewise.
4513
eebd87a5
ILT
45142011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4515 Ian Lance Taylor <iant@google.com>
4516
4517 * symtab.cc (Symbol_table::define_special_symbol): Always
4518 canonicalize version string.
4519
403a3331
CC
45202011-09-26 Cary Coutant <ccoutant@google.com>
4521
4f95c8b4
CC
4522 * gold.cc (queue_initial_tasks): Move option checks ...
4523 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
4524 some options; make others fatal.
4525
235061c2
CC
45262011-09-26 Cary Coutant <ccoutant@google.com>
4527
4528 gcc PR lto/47247
4529 * plugin.cc (get_symbols_v2): New function.
4530 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4531 (is_referenced_from_outside): New function.
4532 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4533 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4534 (get_symbols): Pass version parameter.
4535 (get_symbols_v2): New function.
4536 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4537 parameter.
4538 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4539 (onload): Add LDPT_GET_SYMBOLS_V2.
4540 (all_symbols_read_hook): Use get_symbols_v2; check for
4541 LDPR_PREVAILING_DEF_IRONLY_EXP.
4542 * testsuite/plugin_test_3.sh: Update expected results.
4543
dc87f620
ILT
45442011-09-23 Simon Baldwin <simonb@google.com>
4545
4546 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4547 configuration options.
4548 * configure: Regenerate.
4549 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4550 * Makefile.in: Regenerate.
4551 * testsuite/Makefile.in: Regenerate.
4552
a8279f82
ST
45532011-09-19 Sriraman Tallam <tmsriram@google.com>
4554
4555 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4556
0c9350c8
CC
45572011-09-19 Cary Coutant <ccoutant@google.com>
4558
4559 * incremental.cc (can_incremental_update): Fix typo in comment.
4560 * incremental.h (can_incremental_update): Likewise.
4561
aa06ae28
CC
45622011-09-18 Cary Coutant <ccoutant@google.com>
4563
4564 * incremental.cc (can_incremental_update): New function.
4565 * incremental.h (can_incremental_update): New function.
4566 * layout.cc (Layout::init_fixed_output_section): Call it.
4567 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4568 * object.cc (Sized_relobj_file::do_layout): Call
4569 can_incremental_update.
4570
ebb300b2
CC
45712011-09-13 Cary Coutant <ccoutant@google.com>
4572
4573 * configure.ac: Check for glibc support for gnu_indirect_function
4574 support with static linking, setting automake conditional
4575 IFUNC_STATIC.
4576 * Makefile.in: Regenerate.
4577 * configure: Regenerate.
4578
4579 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4580 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4581 for IFUNC_STATIC.
4582 * testsuite/Makefile.in: Regenerate.
4583
1206d0d5
CC
45842011-09-13 Cary Coutant <ccoutant@google.com>
4585
4586 * incremental.cc (Sized_relobj_incr::do_layout): Call
4587 report_comdat_group for kept comdat sections.
4588 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4589 * testsuite/Makefile.in: Regenerate.
4590 * testsuite/incr_comdat_test_1.cc: New source file.
4591 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4592 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4593 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4594
40b29874
ILT
45952011-09-13 Ian Lance Taylor <iant@google.com>
4596
4597 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4598 variable external_symbols_offset.
4599
1b045aac
ILT
46002011-09-12 Ian Lance Taylor <iant@google.com>
4601
4602 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4603 triggered if object has no symbols.
4604
24c6c55a
DM
46052011-09-09 David S. Miller <davem@davemloft.net>
4606
4607 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4608 (Output_fill_debug_line::do_write): Likewise.
4609
66570254
CC
46102011-08-29 Cary Coutant <ccoutant@google.com>
4611
4612 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4613 casts to match formatting specs.
4614 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4615
8ea8cd50
CC
46162011-08-26 Cary Coutant <ccoutant@google.com>
4617
4618 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4619 remaining hole size when allocating.
4620 (Layout::make_output_section): Set fill methods for debug sections.
4621 * layout.h (Free_list::Free_list_node): Move from private to
4622 public.
4623 (Free_list::set_min_hole_size): New function.
4624 (Free_list::begin, Free_list::end): New functions.
4625 (Free_list::min_hole_): New data member.
4626 * output.cc: Include dwarf.h.
4627 (Output_fill_debug_info::do_minimum_hole_size): New function.
4628 (Output_fill_debug_info::do_write): New function.
4629 (Output_fill_debug_line::do_minimum_hole_size): New function.
4630 (Output_fill_debug_line::do_write): New function.
4631 (Output_section::Output_section): Initialize new data member.
4632 (Output_section::set_final_data_size): Ensure patch space is larger
4633 than minimum hole size.
4634 (Output_section::do_write): Fill holes in debug sections.
4635 * output.h (Output_fill): New class.
4636 (Output_fill_debug_info): New class.
4637 (Output_fill_debug_line): New class.
4638 (Output_section::set_free_space_fill): New function.
4639 (Output_section::free_space_fill_): New data member.
4640 * testsuite/Makefile.am (incremental_test_3): Add
4641 --incremental-patch option.
4642 (incremental_test_4): Likewise.
4643 (incremental_test_5): Likewise.
4644 (incremental_test_6): Likewise.
4645 (incremental_copy_test): Likewise.
4646 (incremental_common_test_1): Likewise.
4647 * testsuite/Makefile.in: Regenerate.
4648
7cf80422
NC
46492011-08-26 Nick Clifton <nickc@redhat.com>
4650
4651 * po/es.po: Updated Spanish translation.
4652
c3f7b0e5
CC
46532011-08-01 Cary Coutant <ccoutant@google.com>
4654
4655 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4656 * gold/testsuite/Makefile.in: Regenerate.
4657 * gold/testsuite/justsyms_exec.c: New source file.
4658 * gold/testsuite/justsyms_lib.c: New source file.
4659
9590bf25
CC
46602011-08-01 Cary Coutant <ccoutant@google.com>
4661
4662 * layout.cc (Layout::set_segment_offsets): Don't realign text
4663 segment if -Ttext was specified.
4664 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4665 file type.
4666 * object.h (Sized_relobj_file::e_type): New function.
4667 (Sized_relobj_file::e_type_): New data member.
4668 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4669 base address for ET_EXEC files.
4670 * target.cc (Target::do_make_elf_object_implementation): Allow
4671 ET_EXEC files with --just-symbols option.
4672
dcd8d12e
CC
46732011-07-28 Cary Coutant <ccoutant@google.com>
4674
4675 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4676 Add thread_number parameter.
4677 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4678 * workqueue-threads.cc
4679 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4680 current thread if its thread number is greater than desired thread
4681 count.
4682 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4683 Add thread_number parameter.
4684 (Workqueue::should_cancel_thread): Likewise.
4685 (Workqueue::find_runnable_or_wait): Pass thread_number to
4686 should_cancel_thread.
4687 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4688 parameter.
4689
804eb480
ST
46902011-07-22 Sriraman Tallam <tmsriram@google.com>
4691
4692 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4693 only after checking if it cannot be forced local.
4694 * symtab.h (is_externally_visible): Check if the symbol is not forced
4695 local.
4696
f1ddb600
ILT
46972011-07-15 Ian Lance Taylor <iant@google.com>
4698
4699 * options.h (class General_options): Add --print-output-format.
4700 Move -EL next to -EB, for better --help output.
4701 * target-select.cc: Include <cstdio>, "options.h", and
4702 "parameters.h".
4703 (Target_selector::do_target_bfd_name): New function.
4704 (print_output_format): New function.
4705 * target-select.h (class Target_selector): Update declarations.
4706 (Target_selector::target_bfd_name): New function.
4707 (print_output_format): Declare.
4708 * main.cc: Include "target-select.h".
4709 (main): Handle --print-output-format.
4710 * gold.cc: Include "target-select.h".
4711 (queue_initial_tasks): Handle --print-output-format when there are
4712 no input files.
4713 * parameters.cc (parameters_force_valid_target): Give a better
4714 error message if -EB/-EL does not match target.
4715 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4716 function.
4717
7d172687
ILT
47182011-07-15 Ian Lance Taylor <iant@google.com>
4719
4720 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4721 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4722 (Output_data_plt_i386::do_write): Write address of .dynamic
4723 section to first entry in .got.plt section.
4724 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4725 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4726 Initialize layout_.
4727 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4728 section to first entry in .got.plt section.
4729 * layout.h (Layout::dynamic_section): New function.
4730
e9552f7e
ST
47312011-07-13 Sriraman Tallam <tmsriram@google.com>
4732
4733 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4734 to claim_file call.
4735 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4736 input_section_position_, and input_section_glob_.
4737 (read_layout_from_file): Call function section_ordering_specified.
4738 * layout.h (is_section_ordering_specified): New function.
4739 (section_ordering_specified): New function.
4740 (section_ordering_specified_): New boolean member.
4741 * main.cc(main): Call load_plugins after layout object is defined.
4742 * output.cc (Output_section::add_input_section): Use
4743 function section_ordering_specified to check if section ordering is
4744 needed.
4745 * output.cc (Output_section::add_relaxed_input_section): Use
4746 function section_ordering_specified to check if section ordering is
4747 needed.
4748 (Output_section::update_section_layout): New function.
4749 (Output_section::sort_attached_input_sections): Check if input section
4750 must be reordered.
4751 * output.h (Output_section::update_section_layout): New function.
4752 * plugin.cc (get_section_count): New function.
4753 (get_section_type): New function.
4754 (get_section_name): New function.
4755 (get_section_contents): New function.
4756 (update_section_order): New function.
58797674 4757 (allow_section_ordering): New function.
e9552f7e
ST
4758 (Plugin::load): Add the new interfaces to the transfer vector.
4759 (Plugin_manager::load_plugins): New parameter.
4760 (Plugin_manager::all_symbols_read): New parameter.
4761 (Plugin_manager::claim_file): New parameter. Save the elf object for
4762 unclaimed objects.
4763 (Plugin_manager::get_elf_object): New function.
4764 (Plugin_manager::get_view): Change to directly use the bool to check
4765 if get_view is called from claim_file_hook.
4766 * plugin.h (input_objects): New function
4767 (Plugin__manager::load_plugins): New parameter.
4768 (Plugin_manager::claim_file): New parameter.
4769 (Plugin_manager::get_elf_object): New function.
4770 (Plugin_manager::in_claim_file_handler): New function.
4771 (Plugin_manager::in_claim_file_handler_): New member.
4772 (layout): New function.
4773 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4774 handler with an extra parameter. Make the elf object before calling
4775 claim_file handler.
4776 * testsuite/plugin_test.c (get_section_count): New function pointer.
4777 (get_section_type): New function pointer.
4778 (get_section_name): New function pointer.
4779 (get_section_contents): New function pointer.
4780 (update_section_order): New function pointer.
4781 (allow_section_ordering): New function pointer.
4782 (onload): Check if the new interfaces exist.
4783
9446efde
ILT
47842011-07-13 Ian Lance Taylor <iant@google.com>
4785
4786 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4787 relro section.
4788 * x86_64.cc (Target_x86_64::got_section): Likewise.
4789 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4790 (relro_now_test_SOURCES): New variable.
4791 (relro_now_test_DEPENDENCIES): New variable.
4792 (relro_now_test_LDFLAGS): New variable.
4793 (relro_now_test_LDADD): New variable.
4794 (relro_now_test.so): New target.
4795 * testsuite/Makefile.in: Rebuild.
4796
07aa62f2
ILT
47972011-07-12 Ian Lance Taylor <iant@google.com>
4798
4799 PR gold/12980
4800 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4801 GLOB_DAT relocation rather than a RELATIVE relocation for a
4802 protected symbol when creating a shared library.
4803 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4804 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4805 * testsuite/protected_main_1.cc (main): Test that protected
4806 function has same address.
4807
e2153196
ILT
48082011-07-11 Ian Lance Taylor <iant@google.com>
4809
4810 PR gold/12979
4811 * options.h (class General_options): Add -Bgroup.
4812 * options.cc (General_options::finalize): If -Bgroup is set,
4813 default to --unresolved-symbols=report-all.
4814 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4815 * target-reloc.h (issue_undefined_symbol_error): Handle
4816 --unresolved-symbols=report-all.
4817
6daf5215
ILT
48182011-07-08 Ian Lance Taylor <iant@google.com>
4819
4820 PR gold/11985
4821 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4822 if linker script discards key sections.
4823 (Layout::create_dynamic_symtab): Likewise.
4824 (Layout::assign_local_dynsym_offsets): Likewise.
4825 (Layout::sized_create_version_sections): Likewise.
4826 (Layout::create_interp): Likewise.
4827 (Layout::finish_dynamic_section): Likewise.
4828 (Layout::set_dynamic_symbol_size): Likewise.
4829
beabb2c6
ILT
48302011-07-08 Ian Lance Taylor <iant@google.com>
4831
4832 PR gold/12386
4833 * options.h (class General_options): Add --unresolved-symbols.
4834 * target-reloc.h (issue_undefined_symbol_error): Check
4835 --unresolved-symbols. Add comments.
4836
9c16daf1
ILT
48372011-07-08 Ian Lance Taylor <iant@google.com>
4838
4839 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4840 expression more complex.
4841
191f1a2d
ILT
48422011-07-08 Ian Lance Taylor <iant@google.com>
4843
4844 PR gold/11317
4845 * target-reloc.h (issue_undefined_symbol_error): New inline
4846 function, broken out of relocate_section.
4847 (relocate_section): Call issue_undefined_symbol_error.
4848 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4849 there is no TLS segment if we are about to issue an undefined
4850 symbol error.
4851 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4852
62855347
ILT
48532011-07-08 Ian Lance Taylor <iant@google.com>
4854
4855 PR gold/12279
4856 * resolve.cc (Symbol_table::should_override): Add fromtype
4857 parameter. Change all callers. Give error when linking together
4858 TLS and non-TLS symbol.
4859 (Symbol_table::should_override_with_special): Add fromtype
4860 parameter. Change all callers.
4861 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4862 there is no TLS segment if we have reported some errors.
4863 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4864
67181c72
ILT
48652011-07-08 Ian Lance Taylor <iant@google.com>
4866
4867 PR gold/12372
4868 * target.h (Target::plt_address_for_global): New function.
4869 (Target::plt_address_for_local): New function.
4870 (Target::plt_section_for_global): Remove.
4871 (Target::plt_section_for_local): Remove.
4872 (Target::do_plt_address_for_global): New virtual function.
4873 (Target::do_plt_address_for_local): New virtual function.
4874 (Target::do_plt_section_for_global): Remove.
4875 (Target::do_plt_section_for_local): Remove.
4876 (Target::register_global_plt_entry): Add Symbol_table and Layout
4877 parameters.
4878 * output.cc (Output_data_got::Got_entry::write): Use
4879 plt_address_for_global and plt_address_for_local.
4880 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4881 address of output section.
4882 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4883 got_irelative_, and irelative_count_ fields. Update
4884 declarations.
4885 (Output_data_plt_i386::has_irelative_section): New function.
4886 (Output_data_plt_i386::entry_count): Add irelative_count_.
4887 (Output_data_plt_i386::set_final_data_size): Likewise.
4888 (class Target_i386): Add got_irelative_ and rel_irelative_
4889 fields. Update declarations.
4890 (Target_i386::Target_i386): Initialize new fields.
4891 (Target_i386::do_plt_address_for_global): New function replacing
4892 do_plt_section_for_global.
4893 (Target_i386::do_plt_address_for_local): New function replacing
4894 do_plt_section_for_local.
4895 (Target_i386::got_section): Create got_irelative_.
4896 (Target_i386::rel_irelative_section): New function.
4897 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4898 fields. Don't define __rel_iplt_{start,end}.
4899 (Output_data_plt_i386::add_entry): Add symtab and layout
4900 parameters. Change all callers. Use different PLT and GOT for
4901 IFUNC symbols.
4902 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4903 layout parameters. Change all callers. Use different PLT and
4904 GOT.
4905 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4906 (Output_data_plt_i386::rel_irelative): New function.
4907 (Output_data_plt_i386::address_for_global): New function.
4908 (Output_data_plt_i386::address_for_local): New function.
4909 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4910 IRELATIVE GOT when changing IFUNC GOT entries.
4911 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4912 reloc.
4913 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4914 if we didn't create an IRELATIVE GOT.
4915 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4916 plt_address_for_local.
4917 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4918 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4919 got_irelative_, and irelative_count_ fields. Update
4920 declarations.
4921 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4922 Initialize new fields. Remove symtab parameter. Change all
4923 callers.
4924 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4925 irelative_count_.
4926 (Output_data_plt_x86_64::has_irelative_section): New function.
4927 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4928 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4929 fields. Update declarations.
4930 (Target_x86_64::Target_x86_64): Initialize new fields.
4931 (Target_x86_64::do_plt_address_for_global): New function replacing
4932 do_plt_section_for_global.
4933 (Target_x86_64::do_plt_address_for_local): New function replacing
4934 do_plt_section_for_local.
4935 (Target_x86_64::got_section): Create got_irelative_.
4936 (Target_x86_64::rela_irelative_section): New function.
4937 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4938 all callers. Don't create __rel_iplt_{start,end}.
4939 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4940 parameters. Change all callers. Use different PLT and GOT for
4941 IFUNC symbols.
4942 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4943 layout parameters. Change all callers. Use different PLT and
4944 GOT.
4945 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4946 parameters. Change all callers. Use different PLT and GOT for
4947 IFUNC symbols.
4948 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4949 (Output_data_plt_x86_64::rela_irelative): New function.
4950 (Output_data_plt_x86_64::address_for_global): New function.
4951 (Output_data_plt_x86_64::address_for_local): New function.
4952 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4953 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4954 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4955 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4956 parameters.
4957 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4958 reloc.
4959 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4960 symbols if we didn't create an IRELATIVE GOT.
4961 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
4962 plt_address_for_local.
4963 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
4964 * testsuite/ifuncvar1.c: New test file.
4965 * testsuite/ifuncvar2.c: New test file.
4966 * testsuite/ifuncvar3.c: New test file.
4967 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
4968 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
4969 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
4970 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
4971 * testsuite/Makefile.in: Rebuild.
4972
33c15b45
CC
49732011-07-07 Cary Coutant <ccoutant@google.com>
4974
4975 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
4976 (two_file_test_1_ndebug.o): Likewise.
4977 (two_file_test_1b_ndebug.o): Likewise.
4978 (two_file_test_2_ndebug.o): Likewise.
4979 (two_file_test_main_ndebug.o): Likewise.
4980 (incremental_test_2): Link with no-debug versions.
4981
f48b5fb7
CC
49822011-07-06 Cary Coutant <ccoutant@google.com>
4983
4984 * gold/incremental.cc
4985 (Output_section_incremental_inputs::write_info_blocks): Check for
4986 hidden and internal symbols.
4987
221597a5
CC
49882011-07-06 Cary Coutant <ccoutant@google.com>
4989
4990 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
4991 Check disposition for startup file.
4992 (Incremental_inputs::report_command_line): Ignore
4993 --incremental-startup-unchanged option.
4994 * options.cc (General_options::parse_incremental_startup_unchanged):
4995 New function.
4996 (General_options::General_options): Initialize new data member.
4997 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
4998 (General_options): Add --incremental-startup-unchanged option.
4999 (General_options::incremental_startup_disposition): New function.
5000 (General_options::incremental_startup_disposition_): New data member.
5001
e24719f6
CC
50022011-07-06 Cary Coutant <ccoutant@google.com>
5003
5004 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5005 input file index to Script_info ctor.
5006 (Sized_incremental_binary::do_file_has_changed): Find the
5007 command-line argument for files named in scripts.
5008 * incremental.h (Script_info::Script_info): New ctor
5009 with input file index.
5010 (Script_info::input_file_index): New function.
5011 (Script_info::input_file_index_): New data member.
5012 (Incremental_binary::get_library): Add const.
5013 (Incremental_binary::get_script_info): Add const.
5014 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5015 * testsuite/Makefile.am (incremental_test_5): New test case.
5016 (incremental_test_6): New test case.
5017 * testsuite/Makefile.in: Regenerate.
5018
8f7c81e8
CC
50192011-07-06 Cary Coutant <ccoutant@google.com>
5020
5021 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5022 debug output when command lines differ.
5023
9fbd3822
CC
50242011-07-06 Cary Coutant <ccoutant@google.com>
5025
5026 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5027 --incremental-patch option.
5028 * layout.cc (Free_list::allocate): Extend allocation beyond original
5029 end if enabled.
5030 (Layout::make_output_section): Mark sections that should get
5031 patch space.
5032 * options.cc (parse_percent): New function.
5033 * options.h (parse_percent): New function.
5034 (DEFINE_percent): New macro.
5035 (General_options): Add --incremental-patch option.
5036 * output.cc (Output_section::Output_section): Initialize new data
5037 members.
5038 (Output_section::add_input_section): Print section name when out
5039 of patch space.
5040 (Output_section::add_output_section_data): Likewise.
5041 (Output_section::set_final_data_size): Add patch space when
5042 doing --incremental-full.
5043 (Output_section::do_reset_address_and_file_offset): Remove patch
5044 space.
5045 (Output_segment::set_section_list_addresses): Print debug output
5046 only if --incremental-update.
5047 * output.h (Output_section::set_is_patch_space_allowed): New function.
5048 (Output_section::is_patch_space_allowed_): New data member.
5049 (Output_section::patch_space_): New data member.
5050 * parameters.cc (Parameters::incremental_full): New function.
5051 * parameters.h (Parameters::incremental_full): New function
5052 * testsuite/Makefile.am (incremental_test_2): Add test for
5053 --incremental-patch option.
5054 * testsuite/Makefile.in: Regenerate.
5055 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
5056 (t18): Remove function body.
5057
f6cccc2c
DK
50582011-07-05 Doug Kwan <dougkwan@google.com>
5059
5060 PR gold/12771
5061 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
5062 Arm_Address type for relocation result.
5063 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
5064 overflow check.
5065 (Arm_relocate_functions::abs32): Use unaligned access.
5066 (Arm_relocate_functions::rel32): Ditto.
5067 (Arm_relocate_functions::prel31): Ditto.
5068 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5069 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5070 static data relocations.
5071 * testsuite/Makefile.in: Regnerate.
5072 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5073
28a13fec
ILT
50742011-07-05 Ian Lance Taylor <iant@google.com>
5075
5076 PR gold/12392
5077 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5078 symbols if necessary.
5079 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5080
24d47b34
ILT
50812011-07-05 Ian Lance Taylor <iant@google.com>
5082
5083 PR gold/12952
5084 * resolve.cc (Symbol::override_base_with_special): Simply override
5085 version with special symbol version, ignoring previous version.
5086
41f9cbbe
ILT
50872011-07-05 Ian Lance Taylor <iant@google.com>
5088
5089 * object.cc (Sized_relobj_file::include_section_group): Add
5090 information to comment about signature location.
5091
886288f1
ILT
50922011-07-02 Ian Lance Taylor <iant@google.com>
5093
5094 PR gold/12957
5095 * options.h (class General_options): Add -f and -F.
5096 * options.cc (General_options::finalize): Fatal error if -f/-F
5097 are used without -shared.
5098 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5099
ae3a6d4f
ILT
51002011-07-02 Ian Lance Taylor <iant@google.com>
5101
5102 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5103
21131061
ILT
51042011-07-01 Ian Lance Taylor <iant@google.com>
5105
5106 PR gold/12525
5107 PR gold/12952
5108 * resolve.cc (Symbol::override_base_with_special): Don't override
5109 the version if the overriding symbol has a different name.
5110 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5111 all callers. If we give an error about an undefined version,
5112 define the base version if necessary.
5113 * dynobj.h (class Versions): Update declaration.
5114 * testsuite/weak_alias_test_5.cc: New file.
5115 * testsuite/weak_alias_test.script: New file.
5116 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5117 and versioned_alias have the right value, and call t2.
5118 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5119 weak_alias_test_5.so.
5120 (weak_alias_test_LDADD): Likewise.
5121 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5122 * testsuite/Makefile.in: Rebuild.
5123
611062c0
ILT
51242011-07-01 Ian Lance Taylor <iant@google.com>
5125
5126 PR gold/12525
5127 * options.h (class General_options): Support -z notext.
5128 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5129 -Wl,-z,notext.
5130 (two_file_shared_nonpic.so): Likewise.
5131 (two_file_shared_mixed.so): Likewise.
5132 (two_file_shared_mixed_1.so): Likewise.
5133 (weak_undef_lib_nonpic.so): Likewise.
5134 (alt/weak_undef_lib_nonpic.so): Likewise.
5135 (tls_test_shared_nonpic.so): Likewise.
5136 * testsuite/Makefile.in: Rebuild.
5137
328c7c2f
ILT
51382011-07-01 Ian Lance Taylor <iant@google.com>
5139
5140 PR gold/12525
5141 * configure.ac: Test whether static linking works, setting
5142 the automake conditional HAVE_STATIC.
5143 * testsuite/Makefile.am: Disable tests using -static if
5144 HAVE_STATIC is not true.
5145 * configure, testsuite/Makefile.in: Rebuild.
5146
02d7cd44
ILT
51472011-07-01 Ian Lance Taylor <iant@google.com>
5148
5149 PR gold/12525
5150 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5151 Assert if we see DW_EH_PE_indirect.
5152 * target.h (Target::ehframe_datarel_base): New function.
5153 (Target::do_ehframe_datarel_base): New target function.
5154 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5155 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5156 function.
5157
07a60597
ILT
51582011-07-01 Ian Lance Taylor <iant@google.com>
5159
5160 PR gold/12571
5161 * options.h (class General_options): Add
5162 --ld-generated-unwind-info.
5163 * ehframe.cc (Fde::write): Add address parameter. Change all
5164 callers. If associated with PLT, fill in address and size.
5165 (Cie::set_output_offset): Only add merge mapping if there is an
5166 object.
5167 (Cie::write): Add address parameter. Change all callers.
5168 (Eh_frame::add_ehframe_for_plt): New function.
5169 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5170 input_offset_ fields into union u_, with new plt field.
5171 (Fde::Fde): Adjust for new union field.
5172 (Fde::Fde) [Output_data version]: New constructor.
5173 (Fde::add_mapping): Only add merge mapping if there is an object.
5174 (class Cie): Update declarations.
5175 (class Eh_frame): Declare add_ehframe_for_plt.
5176 * layout.cc (Layout::layout_eh_frame): Break out code into
5177 make_eh_frame_section, and call it.
5178 (Layout::make_eh_frame_section): New function.
5179 (Layout::add_eh_frame_for_plt): New function.
5180 * layout.h (class Layout): Update declarations.
5181 * merge.cc (Merge_map::add_mapping): Add assertion.
5182 * i386.cc: Include "dwarf.h".
5183 (class Output_data_plt_i386): Make first_plt_entry,
5184 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5185 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5186 and plt_eh_frame_fde.
5187 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5188 boundary. Call add_eh_frame_for_plt if appropriate.
5189 * x86_64.cc: Include "dwarf.h".
5190 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5191 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5192 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5193 and plt_eh_frame_fde.
5194 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5195 appropriate.
5196
14788a3f
ILT
51972011-06-29 Ian Lance Taylor <iant@google.com>
5198
5199 PR gold/12629
5200 * object.cc (Sized_relobj_file::layout_section): Change shdr
5201 parameter to be const.
5202 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5203 out of do_layout.
5204 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5205 appropriate. Call layout_eh_frame_section.
5206 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5207 sections.
5208 * object.h (class Sized_relobj_file): Update declarations.
5209
6c21fce1
ILT
52102011-06-29 Ian Lance Taylor <iant@google.com>
5211
37e41b03 5212 PR gold/12652
6c21fce1
ILT
5213 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5214 modifier.
5215 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5216
4d5e4e62
ILT
52172011-06-29 Ian Lance Taylor <iant@google.com>
5218
5219 PR gold/12675
5220 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5221 SHT_X86_64_UNWIND.
5222 * layout.cc (Layout::layout_eh_frame): Likewise.
5223
886f533a
ILT
52242011-06-29 Ian Lance Taylor <iant@google.com>
5225
5226 PR gold/12695
5227 * layout.cc (Layout::symtab_section_shndx): New function.
5228 * layout.h (class Layout): Declare symtab_section_shndx.
5229 * output.cc (Output_section::write_header): Call it.
5230
f3ae1b28
ILT
52312011-06-29 Ian Lance Taylor <iant@google.com>
5232
5233 PR gold/12818
5234 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5235 symbols which are not used in a relocation.
5236
aecf301f
ILT
52372011-06-28 Ian Lance Taylor <iant@google.com>
5238
5239 PR gold/12898
5240 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5241 script create indistinguishable segments.
5242 (Layout::set_segment_offsets): Use stable_sort when sorting
5243 segments. Pass this to Compare_segments constructor.
5244 * layout.h (class Layout): Make segment_precedes non-static.
5245 (class Compare_segments): Change from struct to class. Add
5246 layout_ field. Add constructor.
5247 * script-sections.cc
5248 (Script_sections::attach_sections_using_phdrs_clause): Rename
5249 local orphan to is_orphan. Don't report failure to put empty
5250 section in segment. On attachment failure, report name of
5251 section, and attach to first PT_LOAD segment.
5252
03ef7571
ILT
52532011-06-28 Ian Lance Taylor <iant@google.com>
5254
5255 PR gold/12934
5256 * target-select.cc (Target_selector::Target_selector): Add
5257 emulation parameter. Change all callers.
5258 (select_target_by_bfd_name): Rename from select_target_by_name.
5259 Change all callers.
5260 (select_target_by_emulation): New function.
5261 (supported_emulation_names): New function.
5262 * target-select.h (class Target_selector): Add emulation_ field.
5263 Update declarations.
5264 (Target_selector::recognize_by_bfd_name): Rename from
5265 recognize_by_name. Change all callers.
5266 (Target_selector::supported_bfd_names): Rename from
5267 supported_names. Change all callers.
5268 (Target_selector::recognize_by_emulation): New function.
5269 (Target_selector::supported_emulations): New function.
5270 (Target_selector::emulation): New function.
5271 (Target_selector::do_recognize_by_bfd_name): Rename from
5272 do_recognize_by_name. Change all callers.
5273 (Target_selector::do_supported_bfd_names): Rename from
5274 do_supported_names. Change all callers.
5275 (Target_selector::do_recognize_by_emulation): New function.
5276 (Target_selector::do_supported_emulations): New function.
5277 (select_target_by_bfd_name): Change name in declaration.
5278 (select_target_by_emulation): Declare.
5279 (supported_emulation_names): Declare.
5280 * parameters.cc (parameters_force_valid_target): Try to find
5281 target based on emulation from -m option.
5282 * options.h (class General_options): Change doc string for -m.
5283 * options.cc (help): Print emulations.
5284 (General_options::parse_V): Likewise.
5285 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5286 Add emulation parameter. Change all callers.
5287
200b2bb9
ILT
52882011-06-28 Ian Lance Taylor <iant@google.com>
5289
5290 * target.h (class Target): Add osabi_ field.
5291 (Target::osabi): New function.
5292 (Target::set_osabi): New function.
5293 (Target::Target): Initialize osabi_.
5294 (Target::do_adjust_elf_header): Make pure virtual.
5295 (Sized_target::do_adjust_elf_header): Declare.
5296 * target.cc (Sized_target::do_adjust_elf_header): New function.
5297 (class Sized_target): Instantiate all versions.
5298 * freebsd.h (class Target_freebsd): Remove.
5299 (Target_selector_freebsd::do_recognize): Call set_osabi on
5300 Target.
5301 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5302 (Target_selector_freebsd::set_osabi): Remove.
5303 * i386.cc (class Target_i386): Inherit from Sized_target rather
5304 than Target_freebsd.
5305 * x86_64.cc (class Target_x86_64): Likewise.
5306
b3ce541e
ILT
53072011-06-28 Ian Lance Taylor <iant@google.com>
5308
5309 * target.h (Target::can_check_for_function_pointers): Rewrite.
5310 Make non-virtual.
5311 (Target::can_icf_inline_merge_sections): Likewise.
5312 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5313 (Target::Target_info): Add can_icf_inline_merge_sections field.
5314 (Target::do_can_check_for_function_pointers): New virtual
5315 function.
5316 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5317 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5318 from can_check_for_function_pointers, move in file.
5319 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5320 section_may_have_icf_unsafe_poineters, move in file.
5321 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5322 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5323 Rename from can_check_for_function_pointers, move in file.
5324 (Target_i386::can_icf_inline_merge_sections): Remove.
5325 (Target_i386::i386_info): Initialize
5326 can_icf_inline_merge_sections.
5327 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5328 Initialize can_icf_inline_merge_sections.
5329 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5330 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5331 Rename from can_check_for_function_pointers, move in file.
5332 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5333 (Target_x86_64::x86_64_info): Initialize
5334 can_icf_inline_merge_sections.
5335 * testsuite/testfile.cc (Target_test::test_target_info):
5336 Likewise.
5337 * icf.cc (get_section_contents): Correct formatting.
5338
6d1c4efb
ILT
53392011-06-27 Ian Lance Taylor <iant@google.com>
5340
5341 * symtab.cc (Symbol::versioned_name): New function.
5342 (Symbol_table::add_to_final_symtab): Use versioned_name when
5343 appropriate.
5344 (Symbol_table::sized_write_symbol): Likewise.
5345 * symtab.h (class Symbol): Declare versioned_name.
5346 * stringpool.h (class Stringpool_template): Add variant of add
5347 which takes a std::basic_string.
5348 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5349 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5350 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5351 (ver_test_12.o): New target.
5352 * testsuite/Makefile.in: Rebuild.
5353
57eb9b50
DK
53542011-06-27 Doug Kwan <dougkwan@google.com>
5355
5356 * arm.cc (Arm_relocate_functions::thm_jump8,
5357 Arm_relocate_functions::thm_jump11): Use a wider signed
5358 type to compute offset.
5359 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5360 arm_thm_jump8.
5361 * testsuite/Makefile.in: Regenerate.
5362 * testsuite/arm_branch_in_range.sh: Check test results of
5363 arm_thm_jump11 and arm_thm_jump8.
5364 * testsuite/arm_thm_jump11.s: New test source file.
5365 * testsuite/arm_thm_jump11.t: New linker script.
5366 * testsuite/arm_thm_jump8.s: New test source file.
5367 * testsuite/arm_thm_jump8.t: New linker script.
5368
487b39df
ILT
53692011-06-24 Ian Lance Taylor <iant@google.com>
5370
5371 * layout.cc: Include "object.h".
5372 (ctors_sections_in_init_array): New static variable.
5373 (Layout::is_ctors_in_init_array): New function.
5374 (Layout::layout): Add entry to ctors_sections_in_init_array if
5375 appropriate.
5376 * layout.h (class Layout): Declare is_ctors_in_init_array.
5377 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5378 is_ctors_reverse_view is set.
5379 (Sized_relobj_file::write_sections): Add layout parameter. Change
5380 all callers. Set is_ctors_reverse_view field of View_size.
5381 (Sized_relobj_file::reverse_words): New function.
5382 * object.h (Sized_relobj_file::View_size): Add
5383 is_ctors_reverse_view field.
5384 (class Sized_relobj_file): Update declarations.
5385 * testsuite/initpri3.c: New test.
5386 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5387 initpri3b.
5388 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5389 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5390 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5391 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5392 * testsuite/Makefile.in: Rebuild.
5393
472076e4
CC
53942011-06-24 Cary Coutant <ccoutant@google.com>
5395
5396 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5397 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5398 (debug_msg_cdebug.err): New targets.
5399 * testsuite/Makefile.in: Regenerate.
5400 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5401 Fix checks for link with shared library.
5402
a60af0db
DK
54032011-06-24 Doug Kwan <dougkwan@google.com>
5404
5405 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5406 skip empty text sections.
5407 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5408
5393d741
ILT
54092011-06-22 Ian Lance Taylor <iant@google.com>
5410
5411 PR gold/12910
5412 * options.h (class General_options): Add --ctors-in-init-array.
5413 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5414 friends as SHT_PROGBITS for merging sections.
5415 (Layout::layout): Remove special handling of .init_array and
5416 friends. Don't sort if doing relocatable link. Sort for .ctors
5417 and .dtors if ctors_in_init_array.
5418 (Layout::make_output_section): Force correct section types for
5419 .init_array and friends. Don't sort if doing relocatable link,
5420 Don't sort .ctors and .dtors if ctors_in_init_array.
5421 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5422 (Layout::output_section_name): Add relobj parameter. Change all
5423 callers. Handle .ctors. and .dtors. in code rather than table.
5424 Handle .ctors and .dtors if ctors_in_init_array.
5425 (Layout::match_file_name): New function, moved from output.cc.
5426 * layout.h (class Layout): Update declarations.
5427 * output.cc: Include "layout.h".
5428 (Input_section_sort_entry::get_priority): New function.
5429 (Input_section_sort_entry::match_file_name): Just call
5430 Layout::match_file_name.
5431 (Output_section::Input_section_sort_init_fini_compare::operator()):
5432 Handle .ctors and .dtors. Sort by explicit priority rather than
5433 by name.
5434 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5435 * testsuite/initpri2.c: New test.
5436 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5437 (check_PROGRAMS): Add initpri2.
5438 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5439 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5440 * configure, testsuite/Makefile.in: Rebuild.
5441
e1f74f98
ILT
54422011-06-19 Ian Lance Taylor <iant@google.com>
5443
5444 PR gold/12880
5445 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5446 .interp section to a PT_INTERP segment even if we have seen a
5447 --dynamic-linker option. Don't do it if we have seen a PHDRS
5448 clause in a linker script.
5449 (Layout::finalize): Don't create a .interp section if we've
5450 already create a PT_INTERP segment.
5451 (Layout::create_interp): Always call choose_output_section (revert
5452 patch of 2011-06-17). Don't create PT_INTERP segment.
5453 * script-sections.cc
5454 (Script_sections::create_note_and_tls_segments): Add a .interp
5455 section to a PT_INTERP segment even if we have seen a
5456 --dynamic-linker option.
5457
766f91bb
ILT
54582011-06-18 Ian Lance Taylor <iant@google.com>
5459
5460 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5461 merely because a non-PT_LOAD segment has a dynamic reloc.
5462
0d212c3a
ILT
54632011-06-18 Ian Lance Taylor <iant@google.com>
5464
5465 * layout.cc (Layout::finish_dynamic_section): Don't create
5466 DT_FLAGS entry if not needed.
5467
911a5072
ILT
54682011-06-18 Ian Lance Taylor <iant@google.com>
5469
5470 PR gold/12745
5471 * layout.cc (Layout::layout_eh_frame): Correct handling of
5472 writable .eh_frame section.
5473
534b4e5f
ILT
54742011-06-17 Ian Lance Taylor <iant@google.com>
5475
5476 PR gold/12893
5477 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5478 symbol is redefined with the exact same object and value.
5479
10b4f102
ILT
54802011-06-17 Ian Lance Taylor <iant@google.com>
5481
5482 PR gold/12880
5483 * layout.h (class Layout): Add interp_segment_ field.
5484 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5485 (Layout::attach_allocated_section_to_segment): If making shared
5486 library, put .interp section in PT_INTERP segment.
5487 (Layout::finalize): Also call create_interp if -dynamic-linker
5488 option was used.
5489 (Layout::create_interp): Assert that there is no PT_INTERP
5490 segment. If not using a SECTIONS clause, use make_output_section.
5491 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5492 * script-sections.cc
5493 (Script_sections::create_note_and_tls_segments): If making shared
5494 library, put .interp section in PT_INTERP segment.
5495
a29b0dad
ILT
54962011-06-17 Ian Lance Taylor <iant@google.com>
5497
e588ea8d
ILT
5498 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5499 when making a shared library.
5500
55012011-06-17 Ian Lance Taylor <iant@google.com>
5502
5503 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5504 parameter. Change all callers. Don't issue warning about PC32
5505 against locally defined symbol.
a29b0dad 5506
9d3b0698
ILT
55072011-06-16 Ian Lance Taylor <iant@google.com>
5508
5509 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5510 occurs in same object.
5511
85b0f90c
AM
55122011-06-14 Alan Modra <amodra@gmail.com>
5513
5514 * po/POTFILES.in: Regenerate.
5515
a94907d9
ILT
55162011-06-09 Ian Lance Taylor <iant@google.com>
5517
5518 * script-sections.cc
5519 (Orphan_output_section::set_section_addresses): For a relocatable
5520 link set address to 0.
5521
4fb3a1c3
CC
55222011-06-09 Cary Coutant <ccoutant@google.com>
5523
5524 PR gold/12804
5525 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5526 used with --compress-debug-sections.
5527 * gold/object.cc (Sized_relobj_file::do_layout): Report
5528 uncompressed size of compressed input sections.
5529
61220854
CC
55302011-06-08 Cary Coutant <ccoutant@google.com>
5531
5532 PR gold/12804
5533 * testsuite/two_file_test_2_v1.cc: Change initialization of
5534 v2 to keep it in .data.
5535
e6455dfb
CC
55362011-06-07 Cary Coutant <ccoutant@google.com>
5537
5538 * common.cc (Symbol_table::do_allocate_commons_list): Call
5539 gold_fallback.
5540 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5541 (Errors::fallback): New function.
5542 (gold_fallback): New function.
5543 * errors.h (Errors::fallback): New function.
5544 * gold.cc (gold_exit): Change status parameter to enum; adjust
5545 all callers.
5546 (queue_initial_tasks): Call gold_fallback.
5547 * gold.h: Include cstdlib.
5548 (Exit_status): New enum type.
5549 (gold_exit): Change status parameter to enum.
5550 (gold_fallback): New function.
5551 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5552 (Layout::create_symtab_sections): Likewise.
5553 (Layout::create_shdrs): Likewise.
5554 * main.cc (main): Adjust call to gold_exit.
5555 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5556 (Output_data_got::add_got_entry_pair): Likewise.
5557 (Output_section::add_input_section): Likewise.
5558 (Output_section::add_output_section_data): Likewise.
5559 (Output_segment::set_section_list_addresses): Likewise.
5560 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5561
fb0e076f
CC
55622011-06-07 Cary Coutant <ccoutant@google.com>
5563
5564 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5565 for incremental links.
5566 * output.cc (Output_segment::set_section_list_addresses): Remove
5567 FIXME and test for TLS or BSS.
5568
a5ee4d5d
CC
55692011-06-07 Cary Coutant <ccoutant@google.com>
5570
5571 * testsuite/Makefile.am: Add incremental_copy_test,
5572 incremental_common_test_1.
5573 * testsuite/Makefile.in: Regenerate.
5574 * testsuite/common_test_1_v1.c: New source file.
5575 * testsuite/common_test_1_v2.c: New source file.
5576 * testsuite/copy_test_v1.cc: New source file.
5577
5146f448
CC
55782011-06-07 Cary Coutant <ccoutant@google.com>
5579
5580 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5581 update, allocate common from bss section's free list.
5582 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5583 linker-defined symbols.
5584 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5585 Skip GOT and PLT entries that are no longer referenced.
5586 (Output_section_incremental_inputs::write_info_blocks): Mark
5587 linker-defined symbols.
5588 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5589 * output.cc (Output_section::allocate): New function.
5590 * output.h (Output_section::allocate): New function.
5591 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5592 linker-defined symbols.
5593 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5594 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5595 (Symbol::init_base_output_data): Likewise.
5596 (Symbol::init_base_output_segment): Likewise.
5597 (Symbol::init_base_constant): Likewise.
5598 (Sized_symbol::init_output_data): Likewise.
5599 (Sized_symbol::init_output_segment): Likewise.
5600 (Sized_symbol::init_constant): Likewise.
5601 (Symbol_table::do_define_in_output_data): Likewise.
5602 (Symbol_table::do_define_in_output_segment): Likewise.
5603 (Symbol_table::do_define_as_constant): Likewise.
5604 * symtab.h (Symbol::is_predefined): New function.
5605 (Symbol::init_base_output_data): Add is_predefined parameter.
5606 (Symbol::init_base_output_segment): Likewise.
5607 (Symbol::init_base_constant): Likewise.
5608 (Symbol::is_predefined_): New data member.
5609 (Sized_symbol::init_output_data): Add is_predefined parameter.
5610 (Sized_symbol::init_output_segment): Likewise.
5611 (Sized_symbol::init_constant): Likewise.
5612 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5613
26d3c67d
CC
56142011-06-07 Cary Coutant <ccoutant@google.com>
5615
5616 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5617 instead of emit_copy_reloc.
5618 (Copy_relocs::emit_copy_reloc): Refactor.
5619 (Copy_relocs::make_copy_reloc): New function.
5620 (Copy_relocs::add_copy_reloc): Remove.
5621 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5622 section.
5623 (Copy_relocs::make_copy_reloc): New function.
5624 (Copy_relocs::add_copy_reloc): Remove.
5625 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5626 unchanged input files.
5627 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5628 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5629 Reserve BSS space for COPY relocations.
5630 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5631 (Output_section_incremental_inputs::write_info_blocks): Record
5632 whether a symbol is copied from a shared object.
5633 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5634 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5635 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5636 (Incremental_input_entry_reader::get_output_symbol_index): Add
5637 is_copy parameter.
5638 (Incremental_binary::emit_copy_relocs): New function.
5639 (Incremental_binary::do_emit_copy_relocs): New function.
5640 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5641 new data member.
5642 (Sized_incremental_binary::add_copy_reloc): New function.
5643 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5644 (Sized_incremental_binary::Copy_reloc): New struct.
5645 (Sized_incremental_binary::Copy_relocs): New typedef.
5646 (Sized_incremental_binary::copy_relocs_): New data member.
5647 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5648 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5649 * target.h (Sized_target::emit_copy_reloc): New function.
5650 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5651
7cdb37d9
CC
56522011-06-02 Cary Coutant <ccoutant@google.com>
5653
5654 PR gold/12163
5655 * gold/archive.cc (Archive::Archive): Initialize new data member.
5656 (Archive::include_all_members): Return if archive has already been
5657 included.
5658 * gold/archive.h (Archive::include_all_members_): New data member.
5659
cc643b88
NC
56602011-06-02 Nick Clifton <nickc@redhat.com>
5661
5662 * dynobj.h: Fix spelling mistake in comment.
5663 * output.cc: Likewise.
5664
f62a3ca7 56652011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 5666 Asier Llano
f62a3ca7
DK
5667
5668 PR gold/12826
cc643b88 5669 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
5670 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5671 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5672 redundant arm_exidx_test.so.
5673 * testsuite/Makefile.in: Regenerate.
5674 (check_SCRIPTS): Add pr12826.sh
5675 (check_DATA): Add pr12826.stdout
5676 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5677 * testsuite/pr12826.sh: New file.
5678 * testsuite/pr12826_1.s: Ditto.
5679 * testsuite/pr12826_1.s: Ditto.
5680
8dbe1edc
ILT
56812011-05-30 Ian Lance Taylor <iant@google.com>
5682
5683 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5684 sections.
5685
c49875be
ILT
56862011-05-29 Ian Lance Taylor <iant@google.com>
5687
5688 PR gold/12804
5689 * testsuite/Makefile.am: Use different file name for two_file_test
5690 temporary file for each incremental test.
5691 * testsuite/Makefile.in: Rebuild.
5692
69d53f7a
ILT
56932011-05-29 Ian Lance Taylor <iant@google.com>
5694
5695 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5696 binary input file is empty.
5697
41d0ab5f
ILT
56982011-05-27 Ian Lance Taylor <iant@google.com>
5699
5700 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5701 (ver_test_9.so): Likewise.
5702 * testsuite/Makefile.in: Rebuild.
5703
89d8a36b
CC
57042011-05-26 Cary Coutant <ccoutant@google.com>
5705
5706 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5707 * incremental.cc (Incremental_inputs::report_input_section): Fix
5708 comment, indentation.
5709 (Incremental_inputs::report_comdat_group): New function.
5710 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5711 of data for incremental input file entry.
5712 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5713 group count, COMDAT group signatures.
5714 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5715 an unchanged input file.
5716 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5717 Initialize new data member.
5718 (Incremental_object_entry::add_comdat_group): New function.
5719 (Incremental_object_entry::get_comdat_group_count): New function.
5720 (Incremental_object_entry::get_comdat_signature_key): New function.
5721 (Incremental_object_entry::groups_): New data member.
5722 (Incremental_inputs::report_comdat_group): New function.
5723 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5724 data for incremental input file entry.
5725 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5726 (Incremental_input_entry_reader::get_input_section): Adjust size of
5727 data for incremental input file entry.
5728 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5729 (Incremental_input_entry_reader::get_comdat_group_signature): New
5730 function.
5731 * object.cc (Sized_relobj::include_section_group): Report kept
5732 COMDAT groups for incremental links.
5733
1706a06f
ILT
57342011-05-24 David Meyer <pdox@google.com>
5735
5736 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5737 with name parameter. Add found_name parameter.
5738 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5739 * dirsearch.h (class Dirsearch): Update declaration.
5740
a10ae760
ILT
57412011-05-24 Ian Lance Taylor <iant@google.com>
5742
5743 * archive.cc (Library_base::should_include_member): Pull in object
5744 from archive if it defines the entry symbol.
5745 * parameters.cc (Parameters::entry): New function.
5746 * parameters.h (class Parameters): Declare entry.
5747 * output.h (class Output_file_header): Remove entry_ field.
5748 * output.cc (Output_file_header::Output_file_header): Remove entry
5749 parameter. Change all callers.
5750 (Output_file_header::entry): Use parameters->entry.
5751 * gold.cc (queue_middle_tasks): Likewise.
5752 * plugin.cc (Plugin_hook::run): Likewise.
5753
aa92d6ed
CC
57542011-05-24 Cary Coutant <ccoutant@google.com>
5755
5756 * gold.cc (queue_initial_tasks): Pass incremental base filename
5757 to Output_file::open_base_file; don't print error message.
5758 * incremental-dump.cc (main): Adjust call to
5759 Output_file::open_for_modification.
5760 * incremental-dump.cc (main): Likewise.
5761 * incremental.cc (Incremental_inputs::report_command_line):
5762 Ignore --incremental-base option when comparing command lines.
5763 Ignore parameter when given as separate argument.
5764 * options.h (class General_options): Add --incremental-base.
5765 * output.cc (Output_file::Output_file):
5766 (Output_file::open_base_file): Add base_name and writable parameters;
5767 read base file into new file; print error message here.
5768 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5769 callers.
5770 * output.h (Output_file::open_for_modification): Rename to...
5771 (Output_file::open_base_file): ...this; add base_name and
5772 writable parameters; adjust all callers.
5773 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5774 callers.
5775 * testsuite/Makefile.am (incremental_test_4): Test
5776 --incremental-base.
5777 * testsuite/Makefile.in: Regenerate.
5778
2eedd706
CC
57792011-05-24 Cary Coutant <ccoutant@google.com>
5780
5781 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5782 incremental_test_4.
5783 * testsuite/Makefile.in: Regenerate.
5784 * testsuite/two_file_test_1_v1.cc: New test source file.
5785 * testsuite/two_file_test_1b_v1.cc: New test source file.
5786 * testsuite/two_file_test_2_v1.cc: New test source file.
5787
0f1c85a6
CC
57882011-05-24 Cary Coutant <ccoutant@google.com>
5789
5790 * dynobj.h (Dynobj::do_dynobj): New function.
5791 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5792 flag and soname for shared objects.
5793 * incremental.cc (Incremental_inputs::report_object): Make
5794 either Incremental_object_entry or Incremental_dynobj_entry; add
5795 soname to string table.
5796 (Incremental_inputs::report_input_section): Add assertion.
5797 (Output_section_incremental_inputs::set_final_data_size): Adjust
5798 type of input file entry for shared libraries; adjust size of
5799 shared library info entry.
5800 (Output_section_incremental_inputs::write_input_files): Write
5801 as_needed flag for shared libraries.
5802 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5803 of input file entry for shared libraries; write soname.
5804 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5805 soname from incremental info.
5806 * incremental.h (enum Incremental_input_flags): Add
5807 INCREMENTAL_INPUT_AS_NEEDED.
5808 (Incremental_input_entry::Incremental_input_entry): Initialize new
5809 data member.
5810 (Incremental_input_entry::set_as_needed): New function.
5811 (Incremental_input_entry::as_needed): New function.
5812 (Incremental_input_entry::do_dynobj_entry): New function.
5813 (Incremental_input_entry::as_needed_): New data member.
5814 (Incremental_object_entry::Incremental_object_entry): Don't check
5815 for shared library.
5816 (Incremental_object_entry::do_type): Likewise.
5817 (class Incremental_dynobj_entry): New class.
5818 (Incremental_input_entry_reader::as_needed): New function.
5819 (Incremental_input_entry_reader::get_soname): New function.
5820 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5821 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5822 size of shared library info entry.
58797674 5823 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
5824 incremental link when adding DT_NEEDED entries.
5825 * object.h (Object::Object): Initialize new data member.
5826 (Object::dynobj): New function.
5827 (Object::set_as_needed): New function.
5828 (Object::as_needed): New function.
5829 (Object::do_dynobj): New function.
5830 (Object::as_needed_): New data member.
5831
6fa2a40b
CC
58322011-05-24 Cary Coutant <ccoutant@google.com>
5833
5834 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5835 info; adjust display of GOT entries.
5836 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5837 vector of input objects; remove file_status_.
5838 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5839 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5840 got_plt reader; call target hooks to reserve GOT entries.
5841 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5842 of input file info header and GOT info entry.
5843 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5844 relocation info.
5845 (Got_plt_view_info::got_descriptor): Remove.
5846 (Got_plt_view_info::sym_index): New data member.
5847 (Got_plt_view_info::input_index): New data member.
5848 (Local_got_offset_visitor::visit): Write input file index.
5849 (Global_got_offset_visitor::visit): Write 0 for input file index.
5850 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5851 with sym_index and input_index.
5852 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5853 incremental info GOT entry; replace got_descriptor with input_index.
5854 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5855 map from input file index to object.
5856 (Sized_relobj_incr::do_layout): Replace direct data member reference
5857 with accessor function.
5858 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5859 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5860 Adjust size of input file info header.
5861 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5862 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5863 (Incremental_input_entry_reader::get_input_section): Adjust size of
5864 input file info header.
5865 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5866 of incremental info GOT entry.
5867 (Incremental_got_plt_reader::get_got_desc): Remove.
5868 (Incremental_got_plt_reader::get_got_symndx): New function.
5869 (Incremental_got_plt_reader::get_got_input_index): New function.
5870 (Sized_incremental_binary::Sized_incremental_binary): Remove
5871 file_status_; add input_objects_.
5872 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5873 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5874 (Sized_incremental_binary::file_is_unchanged): Remove.
5875 (Sized_incremental_binary::set_input_object): New function.
5876 (Sized_incremental_binary::input_object): New function.
5877 (Sized_incremental_binary::file_status_): Remove.
5878 (Sized_incremental_binary::input_objects_): New data member.
5879 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5880 references.
5881 (Sized_relobj_incr::invalid_address): Move to base class.
5882 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5883 class.
5884 (Sized_relobj_incr::do_output_section_offset): Likewise.
5885 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5886 (Sized_relobj_incr::section_offsets_): Likewise.
5887 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5888 function.
5889 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5890 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5891 with accessor function.
5892 (Sized_relobj_file::do_layout): Likewise.
5893 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5894 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5895 (Sized_relobj_file::compute_final_local_value): Replace refs to
5896 section_offsets_ with accessor function.
5897 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5898 * object.h (Relobj::Relobj): Initialize new data members.
5899 (Relobj::add_dyn_reloc): New function.
5900 (Relobj::first_dyn_reloc): New function.
5901 (Relobj::dyn_reloc_count): New function.
5902 (Relobj::first_dyn_reloc_): New data member.
5903 (Relobj::dyn_reloc_count_): New data member.
5904 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5905 references.
5906 (Sized_relobj::Address): New typedef.
5907 (Sized_relobj::invalid_address): Move here from child class.
5908 (Sized_relobj::Sized_relobj): Initialize new data members.
5909 (Sized_relobj::sized_relobj): New function.
5910 (Sized_relobj::is_output_section_offset_invalid): Move here from
5911 child class.
5912 (Sized_relobj::get_output_section_offset): Likewise.
5913 (Sized_relobj::local_has_got_offset): Likewise.
5914 (Sized_relobj::local_got_offset): Likewise.
5915 (Sized_relobj::set_local_got_offset): Likewise.
5916 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5917 (Sized_relobj::clear_got_offsets): New function.
5918 (Sized_relobj::section_offsets): Move here from child class.
5919 (Sized_relobj::do_output_section_offset): Likewise.
5920 (Sized_relobj::do_set_section_offset): Likewise.
5921 (Sized_relobj::Local_got_offsets): Likewise.
5922 (Sized_relobj::local_got_offsets_): Likewise.
5923 (Sized_relobj::section_offsets_): Likewise.
5924 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5925 references.
5926 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5927 class.
5928 (Sized_relobj_file::sized_relobj): New function
5929 (Sized_relobj_file::local_has_got_offset): Move to base class.
5930 (Sized_relobj_file::local_got_offset): Likewise.
5931 (Sized_relobj_file::set_local_got_offset): Likewise.
5932 (Sized_relobj_file::get_output_section_offset): Likewise.
5933 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5934 (Sized_relobj_file::do_output_section_offset): Likewise.
5935 (Sized_relobj_file::do_set_section_offset): Likewise.
5936 (Sized_relobj_file::Local_got_offsets): Likewise.
5937 (Sized_relobj_file::local_got_offsets_): Likewise.
5938 (Sized_relobj_file::section_offsets_): Likewise.
5939 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5940 (all constructors).
5941 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5942 (Output_reloc::get_symbol_index): Likewise.
5943 (Output_reloc::local_section_offset): Likewise.
5944 (Output_reloc::get_address): Likewise.
5945 (Output_reloc::symbol_value): Likewise.
5946 (Output_data_got::reserve_slot): Move to class definition.
5947 (Output_data_got::reserve_local): New function.
5948 (Output_data_got::reserve_slot_for_global): Remove.
5949 (Output_data_got::reserve_global): New function.
5950 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5951 (all constructors, two instantiations).
5952 (Output_reloc::get_relobj): New function (two instantiations).
5953 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5954 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5955 (Output_data_reloc::add_global): Adjust type of relobj.
5956 (Output_data_reloc::add_global_relative): Likewise.
5957 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5958 (Output_data_reloc::add_local): Likewise.
5959 (Output_data_reloc::add_local_relative): Likewise.
5960 (Output_data_reloc::add_symbolless_local_addend): Likewise.
5961 (Output_data_reloc::add_local_section): Likewise.
5962 (Output_data_reloc::add_output_section): Likewise.
5963 (Output_data_reloc::add_absolute): Likewise.
5964 (Output_data_reloc::add_target_specific): Likewise.
5965 (Output_data_got::reserve_slot): Move definition here.
5966 (Output_data_got::reserve_local): New function.
5967 (Output_data_got::reserve_global): New function.
5968 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
5969 section_offsets_ with accessor function.
5970 (Sized_relobj_file::write_sections): Likewise.
5971 (Sized_relobj_file::do_relocate_sections): Likewise.
5972 * target.h (Sized_target::reserve_local_got_entry): New function.
5973 (Sized_target::reserve_global_got_entry): New function.
5974 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
5975 (Target_x86_64::reserve_global_got_entry): New function.
5976 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
5977
4829d394
CC
59782011-05-23 Cary Coutant <ccoutant@google.com>
5979
5980 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
5981 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
5982 bit when checking got_type.
5983 * incremental.cc (Sized_incremental_binary::setup_readers):
5984 Store symbol table and string table locations; initialize bit vector
5985 of file status flags.
5986 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
5987 unchanged files.
5988 (Sized_incremental_binary::do_process_got_plt): New function.
5989 (Sized_incremental_binary::get_symtab_view): Use stored locations.
5990 (Output_section_incremental_inputs::set_final_data_size): Record
5991 file index for each input file.
5992 (Output_section_incremental_inputs::write_got_plt): Store file index
5993 instead of input entry offset for each GOT entry.
5994 * incremental.h
5995 (Incremental_input_entry::Incremental_input_entry): Initialize new
5996 data member.
5997 (Incremental_input_entry::set_offset): Store file index.
5998 (Incremental_input_entry::get_file_index): New function.
5999 (Incremental_input_entry::file_index_): New data member.
6000 (Incremental_binary::process_got_plt): New function.
6001 (Incremental_binary::do_process_got_plt): New function.
6002 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6003 data members.
6004 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6005 (Sized_incremental_binary::set_file_is_unchanged): New function.
6006 (Sized_incremental_binary::file_is_unchanged): New function.
6007 (Sized_incremental_binary::do_process_got_plt): New function.
6008 (Sized_incremental_binary::file_status_): New data member.
6009 (Sized_incremental_binary::main_symtab_loc_): New data member.
6010 (Sized_incremental_binary::main_strtab_loc_): New data member.
6011 * output.cc (Output_data_got::Got_entry::write): Add case
6012 RESERVED_CODE.
6013 (Output_data_got::add_global): Call add_got_entry.
6014 (Output_data_got::add_global_plt): Likewise.
6015 (Output_data_got::add_global_with_rel): Likewise.
6016 (Output_data_got::add_global_with_rela): Likewise.
6017 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6018 (Output_data_got::add_global_pair_with_rela): Likewise.
6019 (Output_data_got::add_local): Call add_got_entry.
6020 (Output_data_got::add_local_plt): Likewise.
6021 (Output_data_got::add_local_with_rel): Likewise.
6022 (Output_data_got::add_local_with_rela): Likewise.
6023 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6024 (Output_data_got::add_local_pair_with_rela): Likewise.
6025 (Output_data_got::reserve_slot): New function.
6026 (Output_data_got::reserve_slot_for_global): New function.
6027 (Output_data_got::add_got_entry): New function.
6028 (Output_data_got::add_got_entry_pair): New function.
6029 (Output_section::add_output_section_data): Edit FIXME.
6030 * output.h
6031 (Output_section_data_build::Output_section_data_build): New
6032 constructor with size parameter.
6033 (Output_data_space::Output_data_space): Likewise.
6034 (Output_data_got::Output_data_got): Initialize new data member; new
6035 constructor with size parameter.
6036 (Output_data_got::add_constant): Call add_got_entry.
6037 (Output_data_got::reserve_slot): New function.
6038 (Output_data_got::reserve_slot_for_global): New function.
6039 (class Output_data_got::Got_entry): Add RESERVED_CODE.
6040 (Output_data_got::add_got_entry): New function.
6041 (Output_data_got::add_got_entry_pair): New function.
6042 (Output_data_got::free_list_): New data member.
6043 * target.h (Sized_target::init_got_plt_for_update): New function.
6044 (Sized_target::register_global_plt_entry): New function.
6045 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
6046 Initialize new data member; call init; add constructor with PLT count.
6047 (Output_data_plt_x86_64::init): New function.
6048 (Output_data_plt_x86_64::add_relocation): New function.
6049 (Output_data_plt_x86_64::reserve_slot): New function.
6050 (Output_data_plt_x86_64::free_list_): New data member.
6051 (Target_x86_64::init_got_plt_for_update): New function.
6052 (Target_x86_64::register_global_plt_entry): New function.
6053 (Output_data_plt_x86_64::add_entry): Allocate from free list for
6054 incremental updates.
6055 (Output_data_plt_x86_64::add_relocation): New function.
6056 * testsuite/object_unittest.cc (Object_test): Set default options.
6057
ec69d6da
ILT
60582011-05-16 Ian Lance Taylor <iant@google.com>
6059
6060 * options.h (class General_options): Make -i a synonym for -r.
6061
732e31de
ILT
60622011-05-16 Ian Lance Taylor <iant@google.com>
6063
6064 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6065
403676b5
CC
60662011-05-10 Cary Coutant <ccoutant@google.com>
6067
6068 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6069 strip_all (-s).
6070
5b7b7d6e
ILT
60712011-05-06 Ian Lance Taylor <iant@google.com>
6072
6073 * layout.cc (Layout::layout): If the output section flags change,
6074 update the ordering.
6075
f0f9babf
CC
60762011-04-25 Cary Coutant <ccoutant@google.com>
6077
6078 * incremental-dump.cc (dump_incremental_inputs): Print local
6079 symbol info for each input file.
6080 * incremental.cc
6081 (Output_section_incremental_inputs::set_final_data_size): Add local
6082 symbol info to input file entries in incremental info.
6083 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6084 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6085 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6086 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6087 implementation.
6088 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6089 (Sized_incr_relobj::do_relocate): Write the local symbols.
6090 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6091 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6092 Adjust size of input file header.
6093 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6094 (Incremental_inputs_reader::get_local_symbol_count): New function.
6095 (Incremental_inputs_reader::get_input_section): Adjust size of input
6096 file header.
6097 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6098 (Sized_incr_relobj::This): New typedef.
6099 (Sized_incr_relobj::sym_size): New const data member.
6100 (Sized_incr_relobj::Local_symbol): New struct.
6101 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6102 (Sized_incr_relobj::do_local_symbol_offset): New function.
6103 (Sized_incr_relobj::local_symbol_count_): New data member.
6104 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6105 (Sized_incr_relobj::local_symbol_index_): New data member.
6106 (Sized_incr_relobj::local_symbol_offset_): New data member.
6107 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6108 (Sized_incr_relobj::local_symbols_): New data member.
6109 * object.h (Relobj::output_local_symbol_count): New function.
6110 (Relobj::local_symbol_offset): New function.
6111 (Relobj::do_output_local_symbol_count): New function.
6112 (Relobj::do_local_symbol_offset): New function.
6113 (Sized_relobj::do_output_local_symbol_count): New function.
6114 (Sized_relobj::do_local_symbol_offset): New function.
6115
d0a9ace3
ILT
61162011-04-22 Vladimir Simonov <sv@sw.ru>
6117
6118 * descriptors.cc (set_close_on_exec): New function.
6119 (Descriptors::open): Use set_close_on_exec.
6120 * output.cc (S_ISLNK): Define if not defined.
6121
94a3fc8b
CC
61222011-04-22 Cary Coutant <ccoutant@google.com>
6123
6124 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6125 global symbol map.
6126 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6127 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6128 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6129 relocations.
6130 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6131 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6132 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6133 * incremental.h
6134 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6135 function.
6136 (Incremental_binary::apply_incremental_relocs): New function.
6137 (Incremental_binary::do_apply_incremental_relocs): New function.
6138 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6139 data member.
6140 (Sized_incremental_binary::add_global_symbol): New function.
6141 (Sized_incremental_binary::global_symbol): New function.
6142 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6143 (Sized_incremental_binary::symbol_map_): New data member.
6144 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6145 * target.h (Sized_target::apply_relocation): New function.
6146 * target-reloc.h (apply_relocation): New function.
6147 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6148
c87e4302
DK
61492011-04-22 Doug Kwan <dougkwan@google.com>
6150
6151 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6152 flag of a SHT_ARM_EXIDX section.
2e702c99 6153 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
6154 * testsuite/Makefile.in: Regenerate.
6155 * testsuite/arm_exidx_test.s: New file.
6156 * testsuite/arm_exidx_test.sh: Same.
6157
e7782cf6
CC
61582011-04-20 Cary Coutant <ccoutant@google.com>
6159
6160 PR gold/12689
6161 * archive.h (Incremental_archive_entry::Archive_member):
6162 Initialize arg_serial_ (second constructor).
6163
308ecdc7
ILT
61642011-04-17 Ian Lance Taylor <iant@google.com>
6165
6166 * object.cc (Relocate_info::location): Simplify location string.
6167 * errors.cc (Errors::error_at_location): Don't print program
6168 name.
6169 (Errors::warning_at_location): Likewise.
6170 (Errors::undefined_symbol): Likewise.
6171 * testsuite/debug_msg.sh: Update accordingly.
6172
bec5b579
CC
61732011-04-14 Cary Coutant <ccoutant@google.com>
6174
6175 * gold/layout.cc (Layout::symtab_section_offset): New function.
6176 * gold/layout.h (Layout::symtab_section_offset): New function.
6177 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6178
88597d34
ILT
61792011-04-12 Ian Lance Taylor <iant@google.com>
6180
6181 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6182 with MREMAP_MAYMOVE.
6183 * output.h (class Output_file): Add map_is_allocated_ field.
6184 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6185 not available, provide stubs. If mremap is not available, #define
6186 it to gold_mremap.
6187 (MREMAP_MAYMOVE): Define if not defined.
6188 (Output_file::Output_file): Initialize map_is_allocated_.
6189 (Output_file::resize): Check map_is_allocated_.
6190 (Output_file::map_anonymous): If mmap fails, use malloc.
6191 (Output_file::unmap): Don't do anything for an anonymous map.
6192 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6193 is not available, provide stubs.
6194 (File_read::View::~View): Use free rather than delete[].
6195 (File_read::make_view): Use malloc rather than new[]. If mmap
6196 fails, use malloc.
6197 (File_read::find_or_make_view): Use malloc rather than new[].
6198 * gold.h: Remove HAVE_REMAP code.
6199 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6200 exists. Rename mremap to gold_mremap. If mmap is not available
6201 don't do anything.
6202 * configure, config.in: Rebuild.
6203
11e361bc
ILT
62042011-04-11 Ian Lance Taylor <iant@google.com>
6205
6206 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6207 initialize local variable v.
6208
cdc29364
CC
62092011-04-11 Cary Coutant <ccoutant@google.com>
6210
6211 * archive.cc (Archive::include_member): Adjust call to
6212 report_object.
6213 (Add_archive_symbols::run): Track argument serial numbers.
6214 (Lib_group::include_member): Likewise.
6215 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6216 * archive.h (Incremental_archive_entry::Archive_member):
6217 Initialize arg_serial_.
6218 (Archive_member::arg_serial_): New data member.
6219 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6220 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6221 incremental link.
6222 (Sized_dynobj::do_for_all_local_got_entries): New function.
6223 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6224 function.
6225 * fileread.cc (get_mtime): New function.
6226 * fileread.h (get_mtime): New function.
6227 * gold.cc (queue_initial_tasks): Check for incremental update.
6228 (process_incremental_input): New function.
6229 (queue_middle_tasks): Don't force valid target for incremental
6230 update.
6231 * incremental-dump.cc (find_input_containing_global): Adjust
6232 size of symbol info entry.
6233 (dump_incremental_inputs): Dump argument serial number and
6234 in_system_directory flag; bias shndx by 1; print symbol names
6235 when dumping per-file symbol lists; use new symbol info readers.
6236 * incremental.cc
6237 (Output_section_incremental_inputs:update_data_size): New function.
6238 (Sized_incremental_binary::setup_readers): Setup input readers
6239 for each input file; build maps for files added from libraries
6240 and scripts.
6241 (Sized_incremental_binary::check_input_args): New function.
6242 (Sized_incremental_binary::do_check_inputs): Build map of argument
6243 serial numbers to input arguments.
6244 (Sized_incremental_binary::do_file_has_changed): Rename
6245 do_file_is_unchanged to this; compare file modification times.
6246 (Sized_incremental_binary::do_init_layout): New function.
6247 (Sized_incremental_binary::do_reserve_layout): New function.
6248 (Sized_incremental_binary::do_get_input_reader): Remove.
6249 (Sized_incremental_binary::get_symtab_view): New function.
6250 (Incremental_checker::can_incrementally_link_output_file): Remove.
6251 (Incremental_inputs::report_command_line): Exclude --debug options.
6252 (Incremental_inputs::report_archive_begin): Add parameter; track
6253 argument serial numbers; don't put input file entry for archive
6254 before archive members.
6255 (Incremental_inputs::report_archive_end): Put input file entry
6256 for archive after archive members.
6257 (Incremental_inputs::report_object): Add parameter; track argument
6258 serial numbers and in_system_directory flag.
6259 (Incremental_inputs::report_script): Add parameter; track argument
6260 serial numbers.
6261 (Output_section_incremental_inputs::set_final_data_size): Adjust
6262 size of symbol info entry; check for forwarding symbols.
6263 (Output_section_incremental_inputs::write_input_files): Write
6264 in_system_directory flag and argument serial number.
6265 (Output_section_incremental_inputs::write_info_blocks): Map section
6266 indices between incremental info and original input file; store
6267 input section index for each symbol.
6268 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6269 change operator() to visit().
6270 (class Global_got_offset_visitor): Likewise.
6271 (class Global_symbol_visitor_got_plt):
6272 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6273 classes.
6274 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6275 (Sized_incr_relobj::do_read_symbols): New function.
6276 (Sized_incr_relobj::do_layout): New function.
6277 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6278 (Sized_incr_relobj::do_add_symbols): New function.
6279 (Sized_incr_relobj::do_should_include_member): New function.
6280 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6281 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6282 (Sized_incr_relobj::do_section_size): New function.
6283 (Sized_incr_relobj::do_section_name): New function.
6284 (Sized_incr_relobj::do_section_contents): New function.
6285 (Sized_incr_relobj::do_section_flags): New function.
6286 (Sized_incr_relobj::do_section_entsize): New function.
6287 (Sized_incr_relobj::do_section_address): New function.
6288 (Sized_incr_relobj::do_section_type): New function.
6289 (Sized_incr_relobj::do_section_link): New function.
6290 (Sized_incr_relobj::do_section_info): New function.
6291 (Sized_incr_relobj::do_section_addralign): New function.
6292 (Sized_incr_relobj::do_initialize_xindex): New function.
6293 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6294 (Sized_incr_relobj::do_read_relocs): New function.
6295 (Sized_incr_relobj::do_gc_process_relocs): New function.
6296 (Sized_incr_relobj::do_scan_relocs): New function.
6297 (Sized_incr_relobj::do_count_local_symbols): New function.
6298 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6299 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6300 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6301 (Sized_incr_relobj::do_relocate): New function.
6302 (Sized_incr_relobj::do_set_section_offset): New function.
6303 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6304 (Sized_incr_dynobj::do_read_symbols): New function.
6305 (Sized_incr_dynobj::do_layout): New function.
6306 (Sized_incr_dynobj::do_add_symbols): New function.
6307 (Sized_incr_dynobj::do_should_include_member): New function.
6308 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6309 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6310 (Sized_incr_dynobj::do_section_size): New function.
6311 (Sized_incr_dynobj::do_section_name): New function.
6312 (Sized_incr_dynobj::do_section_contents): New function.
6313 (Sized_incr_dynobj::do_section_flags): New function.
6314 (Sized_incr_dynobj::do_section_entsize): New function.
6315 (Sized_incr_dynobj::do_section_address): New function.
6316 (Sized_incr_dynobj::do_section_type): New function.
6317 (Sized_incr_dynobj::do_section_link): New function.
6318 (Sized_incr_dynobj::do_section_info): New function.
6319 (Sized_incr_dynobj::do_section_addralign): New function.
6320 (Sized_incr_dynobj::do_initialize_xindex): New function.
6321 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6322 (make_sized_incremental_object): New function.
6323 (Incremental_library::copy_unused_symbols): New function.
6324 (Incremental_library::do_for_all_unused_symbols): New function.
6325 * incremental.h (enum Incremental_input_flags): New type.
6326 (class Incremental_checker): Remove.
6327 (Incremental_input_entry::Incremental_input_entry): Add argument
6328 serial number.
6329 (Incremental_input_entry::arg_serial): New function.
6330 (Incremental_input_entry::set_is_in_system_directory): New function.
6331 (Incremental_input_entry::is_in_system_directory): New function.
6332 (Incremental_input_entry::arg_serial_): New data member.
6333 (Incremental_input_entry::is_in_system_directory_): New data member.
6334 (class Script_info): Move here from script.h.
6335 (Script_info::Script_info): Add filename parameter.
6336 (Script_info::filename): New function.
6337 (Script_info::filename_): New data member.
6338 (Incremental_script_entry::Incremental_script_entry): Add argument
6339 serial number.
6340 (Incremental_object_entry::Incremental_object_entry): Likewise.
6341 (Incremental_object_entry::add_input_section): Build list of input
6342 sections with map to original shndx.
6343 (Incremental_object_entry::get_input_section_index): New function.
6344 (Incremental_object_entry::shndx_): New data member.
6345 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6346 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6347 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6348 serial number.
6349 (Incremental_inputs::report_archive_begin): Likewise.
6350 (Incremental_inputs::report_object): Likewise.
6351 (Incremental_inputs::report_script): Likewise.
6352 (class Incremental_global_symbol_reader): New class.
6353 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6354 and store flags and input file type.
6355 (Incremental_input_entry_reader::arg_serial): New function.
6356 (Incremental_input_entry_reader::type): Extract type from flags.
6357 (Incremental_input_entry_reader::is_in_system_directory): New function.
6358 (Incremental_input_entry_reader::get_input_section_count): Call
6359 accessor function for type.
6360 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6361 function for type; adjust size of global symbol entry.
6362 (Incremental_input_entry_reader::get_global_symbol_count): Call
6363 accessor function for type.
6364 (Incremental_input_entry_reader::get_object_count): Likewise.
6365 (Incremental_input_entry_reader::get_object_offset): Likewise.
6366 (Incremental_input_entry_reader::get_member_count): Likewise.
6367 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6368 (Incremental_input_entry_reader::get_member_offset): Likewise.
6369 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6370 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6371 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6372 (Incremental_input_entry_reader::get_global_symbol_reader): New
6373 function.
6374 (Incremental_input_entry_reader::get_output_symbol_index): New
6375 function.
6376 (Incremental_input_entry_reader::type_): Remove.
6377 (Incremental_input_entry_reader::flags_): New data member.
6378 (Incremental_inputs_reader::input_file_offset): New function.
6379 (Incremental_inputs_reader::input_file_index): New function.
6380 (Incremental_inputs_reader::input_file): Call input_file_offset.
6381 (Incremental_inputs_reader::input_file_at_offset): New function.
6382 (Incremental_relocs_reader::get_r_type): Reformat.
6383 (Incremental_relocs_reader::get_r_shndx): Reformat.
6384 (Incremental_relocs_reader::get_r_offset): Reformat.
6385 (Incremental_relocs_reader::data): New function.
6386 (Incremental_binary::Incremental_binary): Initialize new data members.
6387 (Incremental_binary::check_inputs): Add cmdline parameter.
6388 (Incremental_binary::file_is_unchanged): Remove.
6389 (Input_reader::arg_serial): New function.
6390 (Input_reader::get_unused_symbol_count): New function.
6391 (Input_reader::get_unused_symbol): New function.
6392 (Input_reader::do_arg_serial): New function.
6393 (Input_reader::do_get_unused_symbol_count): New function.
6394 (Input_reader::do_get_unused_symbol): New function.
6395 (Incremental_binary::input_file_count): New function.
6396 (Incremental_binary::get_input_reader): Change signature to use
6397 index instead of filename.
6398 (Incremental_binary::file_has_changed): New function.
6399 (Incremental_binary::get_input_argument): New function.
6400 (Incremental_binary::get_library): New function.
6401 (Incremental_binary::get_script_info): New function.
6402 (Incremental_binary::init_layout): New function.
6403 (Incremental_binary::reserve_layout): New function.
6404 (Incremental_binary::output_file): New function.
6405 (Incremental_binary::do_check_inputs): New function.
6406 (Incremental_binary::do_file_is_unchanged): Remove.
6407 (Incremental_binary::do_file_has_changed): New function.
6408 (Incremental_binary::do_init_layout): New function.
6409 (Incremental_binary::do_reserve_layout): New function.
6410 (Incremental_binary::do_input_file_count): New function.
6411 (Incremental_binary::do_get_input_reader): Change signature.
6412 (Incremental_binary::input_args_map_): New data member.
6413 (Incremental_binary::library_map_): New data member.
6414 (Incremental_binary::script_map_): New data member.
6415 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6416 new data members.
6417 (Sized_incremental_binary::output_section): New function.
6418 (Sized_incremental_binary::inputs_reader): Add const.
6419 (Sized_incremental_binary::symtab_reader): Add const.
6420 (Sized_incremental_binary::relocs_reader): Add const.
6421 (Sized_incremental_binary::got_plt_reader): Add const.
6422 (Sized_incremental_binary::get_symtab_view): New function.
6423 (Sized_incremental_binary::Inputs_reader): New typedef.
6424 (Sized_incremental_binary::Input_entry_reader): New typedef.
6425 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6426 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6427 (Sized_incremental_binary::do_file_has_changed): New function.
6428 (Sized_incremental_binary::do_init_layout): New function.
6429 (Sized_incremental_binary::do_reserve_layout): New function.
6430 (Sized_input_reader::Inputs_reader): Remove.
6431 (Sized_input_reader::Input_entry_reader): Remove.
6432 (Sized_input_reader::do_arg_serial): New function.
6433 (Sized_input_reader::do_get_unused_symbol_count): New function.
6434 (Sized_input_reader::do_get_unused_symbol): New function.
6435 (Sized_incremental_binary::do_input_file_count): New function.
6436 (Sized_incremental_binary::do_get_input_reader): Change signature;
6437 use index instead of filename.
6438 (Sized_incremental_binary::section_map_): New data member.
6439 (Sized_incremental_binary::input_entry_readers_): New data member.
6440 (class Sized_incr_relobj): New class.
6441 (class Sized_incr_dynobj): New class.
6442 (make_sized_incremental_object): New function.
6443 (class Incremental_library): New class.
6444 * layout.cc (Free_list::num_lists): New static data member.
6445 (Free_list::num_nodes): New static data member.
6446 (Free_list::num_removes): New static data member.
6447 (Free_list::num_remove_visits): New static data member.
6448 (Free_list::num_allocates): New static data member.
6449 (Free_list::num_allocate_visits): New static data member.
6450 (Free_list::init): New function.
6451 (Free_list::remove): New function.
6452 (Free_list::allocate): New function.
6453 (Free_list::dump): New function.
6454 (Free_list::print_stats): New function.
6455 (Layout_task_runner::run): Resize output file for incremental updates.
6456 (Layout::Layout): Initialize new data members.
6457 (Layout::set_incremental_base): New function.
6458 (Layout::init_fixed_output_section): New function.
6459 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6460 incremental updates.
6461 (Layout::create_gold_note): Do not create gold note section for
6462 incremental updates.
6463 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6464 for incremental updates.
6465 (Layout::set_section_offsets): For incremental updates, allocate space
6466 from free list.
6467 (Layout::create_symtab_sections): Layout with offsets relative to
6468 start of section; for incremental updates, allocate space from free
6469 list.
6470 (Layout::create_shdrs): For incremental updates, allocate space from
6471 free list.
6472 (Layout::finish_dynamic_section): For incremental updates, do not
6473 check --as-needed (fixed in subsequent patch).
6474 * layout.h (class Free_list): New class.
6475 (Layout::set_incremental_base): New function.
6476 (Layout::incremental_base): New function.
6477 (Layout::init_fixed_output_section): New function.
6478 (Layout::allocate): New function.
6479 (Layout::incremental_base_): New data member.
6480 (Layout::free_list_): New data member.
6481 * main.cc (main): Print Free_list statistics.
6482 * object.cc (Relobj::finalize_incremental_relocs): Add
6483 clear_counts parameter; clear counts only when clear_counts is set.
6484 (Sized_relobj::Sized_relobj): Initialize new base class.
6485 (Sized_relobj::do_layout): Don't report special sections.
6486 (Sized_relobj::do_for_all_local_got_entries): New function.
6487 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6488 symtab_off to all symbol table offsets.
6489 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6490 * object.h (class Got_offset_list): Move to top of file.
6491 (Object::Object): Allow case where input_file == NULL.
6492 (Object::~Object): Likewise.
6493 (Object::input_file): Assert that input_file != NULL.
6494 (Object::lock): Allow case where input_file == NULL.
6495 (Object::unlock): Likewise.
6496 (Object::is_locked): Likewise.
6497 (Object::token): Likewise.
6498 (Object::release): Likewise.
6499 (Object::is_incremental): New function.
6500 (Object::get_mtime): New function.
6501 (Object::for_all_local_got_entries): New function.
6502 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6503 (Object::set_is_in_system_directory): New function.
6504 (Object::is_in_system_directory): New function.
6505 (Object::do_is_incremental): New function.
6506 (Object::do_get_mtime): New function.
6507 (Object::do_for_all_local_got_entries): New function.
6508 (Object::is_in_system_directory_): New data member.
6509 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6510 (class Sized_relobj_base): New class.
6511 (class Sized_relobj): Derive from Sized_relobj_base.
6512 (class Sized_relobj::Symbols): Redeclare from base class.
6513 (class Sized_relobj::local_got_offset_list): Remove.
6514 (class Sized_relobj::Output_sections): Redeclare from base class.
6515 (class Sized_relobj::do_for_all_local_got_entries): New function.
6516 (class Sized_relobj::write_local_symbols): Add offset parameter.
6517 (class Sized_relobj::local_symbol_offset_): Update comment.
6518 (class Sized_relobj::local_dynsym_offset_): Update comment.
6519 * options.cc (Input_arguments::add_file): Remove const.
6520 * options.h (Input_file_argument::Input_file_argument):
6521 Initialize arg_serial_ (all constructors).
6522 (Input_file_argument::set_arg_serial): New function.
6523 (Input_file_argument::arg_serial): New function.
6524 (Input_file_argument::arg_serial_): New data member.
6525 (Input_arguments::Input_arguments): Initialize file_count_.
6526 (Input_arguments::add_file): Remove const.
6527 (Input_arguments::number_of_input_files): New function.
6528 (Input_arguments::file_count_): New data member.
6529 (Command_line::number_of_input_files): Call
6530 Input_arguments::number_of_input_files.
6531 * output.cc (Output_segment_headers::Output_segment_headers):
6532 Set current size.
6533 (Output_section::Input_section::current_data_size): New function.
6534 (Output_section::Output_section): Initialize new data members.
6535 (Output_section::add_input_section): Don't do merge sections for
6536 an incremental link; allocate space from free list for an
6537 incremental update.
6538 (Output_section::add_output_section_data): Allocate space from
6539 free list for an incremental update.
6540 (Output_section::update_data_size): New function.
6541 (Output_section::set_fixed_layout): New function.
6542 (Output_section::reserve): New function.
6543 (Output_segment::set_section_addresses): Remove const.
6544 (Output_segment::set_section_list_addresses): Remove const; allocate
6545 space from free list for an incremental update.
6546 (Output_segment::set_offset): Adjust size of RELRO segment for an
6547 incremental update.
6548 * output.h (Output_data::current_data_size): Move here from
6549 child classes.
6550 (Output_data::pre_finalize_data_size): New function.
6551 (Output_data::update_data_size): New function.
6552 (Output_section_headers::update_data_size): new function.
6553 (Output_section_data_build::current_data_size): Move to Output_data.
6554 (Output_data_strtab::update_data_size): New function.
6555 (Output_section::current_data_size): Move to Output_data.
6556 (Output_section::set_fixed_layout): New function.
6557 (Output_section::has_fixed_layout): New function.
6558 (Output_section::reserve): New function.
6559 (Output_section::update_data_size): New function.
6560 (Output_section::has_fixed_layout_): New data member.
6561 (Output_section::free_list_): New data member.
6562 (Output_segment::set_section_addresses): Remove const.
6563 (Output_segment::set_section_list_addresses): Remove const.
6564 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6565 New function.
6566 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6567 New function.
6568 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6569 parameter when calling Add_symbols constructor; store argument
6570 serial number for members of a lib group.
6571 (Add_symbols::locks): Allow case where token == NULL.
6572 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6573 (Read_member::~Read_member): New function.
6574 (Read_member::is_runnable): New function.
6575 (Read_member::locks): New function.
6576 (Read_member::run): New function.
6577 (Check_script::~Check_script): New function.
6578 (Check_script::is_runnable): New function.
6579 (Check_script::locks): New function.
6580 (Check_script::run): New function.
6581 (Check_library::~Check_library): New function.
6582 (Check_library::is_runnable): New function.
6583 (Check_library::locks): New function.
6584 (Check_library::run): New function.
6585 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6586 (Add_symbols::library_): New data member.
6587 (class Read_member): New class.
6588 (class Check_script): New class.
6589 (class Check_library): New class.
6590 * reloc.cc (Read_relocs::is_runnable): Allow case where
6591 token == NULL.
6592 (Read_relocs::locks): Likewise.
6593 (Scan_relocs::locks): Likewise.
6594 (Relocate_task::locks): Likewise.
6595 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6596 to clear counters.
6597 (Sized_relobj::incremental_relocs_scan): Fix comment.
6598 (Sized_relobj::do_relocate): Pass output file offset to
6599 write_local_symbols.
6600 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6601 from class declaration.
6602 * script.cc (read_input_script): Allocate Script_info; pass
6603 argument serial number to report_script.
6604 * script.h (class Script_info): Move to incremental.h.
6605 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6606 * symtab.h (Symbol_table::add_from_incrobj): New function.
6607 (Symbol_table::set_file_offset): New function.
6608
b961d0d7
CC
66092011-04-05 Cary Coutant <ccoutant@google.com>
6610
6611 * incremental-dump.cc (dump_incremental_inputs): Change signature
6612 to take a Sized_incremental_binary; change caller. Use readers
6613 in Sized_incremental_binary.
6614 * incremental.cc
6615 (Sized_incremental_binary::find_incremental_inputs_sections):
6616 Rename do_find_incremental_inputs_sections to this.
6617 (Sized_incremental_binary::setup_readers): New function.
6618 (Sized_incremental_binary::do_check_inputs): Check
6619 has_incremental_info_ flag; move setup code to setup_readers;
6620 use input readers.
6621 (Sized_incremental_binary::do_file_is_unchanged): New function.
6622 (Sized_incremental_binary::do_get_input_reader): New function.
6623 * incremental.h (class Incremental_binary): Move to end of file.
6624 (Incremental_binary::file_is_unchanged): New function.
6625 (Incremental_binary::do_file_is_unchanged): New function.
6626 (Incremental_binary::Input_reader): New class.
6627 (Incremental_binary::get_input_reader): New function.
6628 (class Sized_incremental_binary): Move to end of file.
6629 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6630 input section reader classes.
6631 (Sized_incremental_binary::has_incremental_info): New function.
6632 (Sized_incremental_binary::inputs_reader): New function.
6633 (Sized_incremental_binary::symtab_reader): New function.
6634 (Sized_incremental_binary::relocs_reader): New function.
6635 (Sized_incremental_binary::got_plt_reader): New function.
6636 (Sized_incremental_binary::do_file_is_unchanged): New function.
6637 (Sized_incremental_binary::Sized_input_reader): New class.
6638 (Sized_incremental_binary::get_input_reader): New function.
6639 (Sized_incremental_binary::find_incremental_inputs_sections):
6640 Rename do_find_incremental_inputs_sections to this.
6641 (Sized_incremental_binary::setup_readers): New function.
6642 (Sized_incremental_binary::has_incremental_info_): New data member.
6643 (Sized_incremental_binary::inputs_reader_): New data member.
6644 (Sized_incremental_binary::symtab_reader_): New data member.
6645 (Sized_incremental_binary::relocs_reader_): New data member.
6646 (Sized_incremental_binary::got_plt_reader_): New data member.
6647 (Sized_incremental_binary::current_input_file_): New data member.
6648
a869183f
PP
66492011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6650
6651 PR gold/12640
6652 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6653 violation.
6654
66552011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
6656
6657 * archive.cc (Archive::include_member): Adjust call to report_object.
6658 (Add_archive_symbols::run): Add script_info to call to
6659 report_archive_begin.
6660 (Lib_group::include_member): Adjust call to report_object.
6661 (Add_lib_group_symbols::run): Adjust call to report_object.
6662 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6663 blocks. Add object count for script input files.
6664 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6665 script_info parameter; change all callers.
6666 (Incremental_inputs::report_object): Add script_info parameter;
6667 change all callers.
6668 (Incremental_inputs::report_script): Store backpointer to
6669 incremental info entry.
6670 (Output_section_incremental_inputs::set_final_data_size): Record
6671 additional information for scripts.
6672 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6673 * incremental.h (Incremental_script_entry::add_object): New function.
6674 (Incremental_script_entry::get_object_count): New function.
6675 (Incremental_script_entry::get_object): New function.
6676 (Incremental_script_entry::objects_): New data member; adjust
6677 constructor.
6678 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6679 (Incremental_inputs::report_object): Add script_info parameter.
6680 (Incremental_inputs_reader::get_object_count): New function.
6681 (Incremental_inputs_reader::get_object_offset): New function.
6682 * options.cc (Input_arguments::add_file): Return reference to
6683 new input argument.
6684 * options.h (Input_argument::set_script_info): New function.
6685 (Input_argument::script_info): New function.
6686 (Input_argument::script_info_): New data member; adjust all
6687 constructors.
6688 (Input_file_group::add_file): Return reference to new input argument.
6689 (Input_file_lib::add_file): Likewise.
6690 (Input_arguments::add_file): Likewise.
6691 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6692 * script.cc (Parser_closure::Parser_closure): Add script_info
6693 parameter; adjust all callers.
6694 (Parser_closure::script_info): New function.
6695 (Parser_closure::script_info_): New data member.
6696 (read_input_script): Report scripts earlier to incremental info.
6697 (script_add_file): Set script_info in Input_argument.
6698 (script_add_library): Likewise.
6699 * script.h (Script_options::Script_info): Rewrite class.
6700
a869183f 67012011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
6702
6703 * archive.cc (Library_base::should_include_member): Move
6704 method here from class Archive.
6705 (Archive::Archive): Initialize base class.
6706 (Archive::should_include_member): Move to base class.
6707 (Archive::do_for_all_unused_symbols): New function.
6708 (Add_archive_symbols::run): Remove redundant access to
6709 incremental_inputs.
6710 (Lib_group::Lib_group): Initialize base class.
6711 (Lib_group::do_filename): New function.
6712 (Lib_group::include_member): Pass pointer to Lib_group to
6713 report_object.
6714 (Lib_group::do_for_all_unused_symbols): New function.
6715 (Add_lib_group_symbols::run): Report archive information for
6716 incremental links.
6717 * archive.h (class Library_base): New base class.
6718 (class Archive): Derive from Library_base.
6719 (Archive::filename): Move to base class.
6720 (Archive::set_incremental_info): Likewise.
6721 (Archive::incremental_info): Likewise.
6722 (Archive::Should_include): Likewise.
6723 (Archive::should_include_member): Likewise.
6724 (Archive::Armap_entry): Remove.
6725 (Archive::Unused_symbol_iterator): Remove.
6726 (Archive::unused_symbols_begin): Remove.
6727 (Archive::unused_symbols_end): Remove.
6728 (Archive::do_filename): New function.
6729 (Archive::do_get_mtime): New function.
6730 (Archive::do_for_all_unused_symbols): New function.
6731 (Archive::task_): Move to base class.
6732 (Archive::incremental_info_): Likewise.
6733 (class Lib_group): Derive from Library_base.
6734 (Lib_group::do_filename): New function.
6735 (Lib_group::do_get_mtime): New function.
6736 (Lib_group::do_for_all_unused_symbols): New function.
6737 (Lib_group::task_): Move to base class.
6738 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6739 function.
6740 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6741 function.
6742 * incremental.cc (Incremental_inputs::report_archive_begin):
6743 Use Library_base; call library's get_mtime; add incremental inputs
6744 entry before members.
6745 (class Unused_symbol_visitor): New class.
6746 (Incremental_inputs::report_archive_end): Use Library_base; use
6747 visitor class to record unused symbols; don't add incremental inputs
6748 entry after members.
6749 (Incremental_inputs::report_object): Use Library_base.
6750 * incremental.h
6751 (Incremental_archive_entry::Incremental_archive_entry): Remove
6752 unused Archive parameter.
6753 (Incremental_inputs::report_archive_begin): Use Library_base.
6754 (Incremental_inputs::report_archive_end): Likewise.
6755 (Incremental_inputs::report_object): Likewise.
6756 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6757 function.
6758 * object.h (Object::for_all_global_symbols): New function.
6759 (Object::do_for_all_global_symbols): New function.
6760 (Sized_relobj::do_for_all_global_symbols): New function.
6761 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6762 function.
6763 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6764 function.
6765
61ab3e40
ILT
67662011-03-27 Ian Lance Taylor <iant@google.com>
6767
6768 * archive.cc (Archive::interpret_header): Return -1 if something
6769 goes wrong. Change callers accordingly.
6770
30e1f9e6
CC
67712011-03-25 Cary Coutant <ccoutant@google.com>
6772
6773 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6774 * testsuite/Makefile.in: Regenerate.
6775
9370ce59 67762011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
6777
6778 * plugin.cc (get_view): New.
6779 (Plugin::load): Pass get_view to the plugin.
6780 (Plugin_manager::get_view): New.
6781
9312bb0a
ILT
67822011-03-21 Ian Lance Taylor <iant@google.com>
6783
6784 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 6785 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 6786
7e12ba9e
ST
67872011-03-21 Sriraman Tallam <tmsriram@google.com>
6788
6789 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6790 Change == to -eq.
6791 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6792 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6793 Change == to -eq.
6794 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6795 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6796
fd7a005d
ILT
67972011-03-14 Ian Lance Taylor <iant@google.com>
6798
6799 * script-sections.cc (Sort_output_sections::script_compare):
6800 Rename from is_before, change return type.
6801 (Sort_output_sections::operator()): Adjust accordingly.
6802
ed16fd1b
ILT
68032011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6804
6805 PR gold/12572
6806 * testsuite/odr_violation2.cc: Add comment to make all error line
6807 numbers double digits.
6808 * testsuite/debug_msg.sh: Adjust expected errors.
6809
71ff8986
ILT
68102011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6811
6812 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6813 but mark earlier ones as non-canonical
6814 (offset_to_iterator): Update search target and example
6815 (do_addr2line): Return extra lines in a vector*
6816 (format_file_lineno): Extract from do_addr2line
6817 (one_addr2line): Add vector* out-param
6818 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6819 when a lineno entry appeared last for its instruction
6820 (Dwarf_line_info): Add vector* out-param
6821 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6822 * symtab.cc (Odr_violation_compare): Include the lineno in the
6823 comparison again.
6824 (linenos_from_loc): New. Combine the canonical line for an
6825 address with its other lines.
6826 (True_if_intersect): New. Helper functor to make
6827 std::set_intersection a query.
6828 (detect_odr_violations): Compare sets of lines instead of just
6829 one line for each function. This became less deterministic, but
6830 has fewer false positives.
6831 * symtab.h: Declarations.
6832 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6833 mix an optimized and non-optimized object in the same binary
6834 (odr_violation2.so): Same.
6835 * testsuite/Makefile.in: Regenerate from Makefile.am.
6836 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6837 * testsuite/debug_msg.sh: Update line numbers and add
6838 assertions.
6839 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6840 non-optimized context.
6841 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6842 isn't inlined, and use OdrDerived in an optimized context.
6843 * testsuite/odr_header1.h: Defines OdrDerived, where
6844 optimization will change the
6845 first-instruction-in-the-destructor's file and line number.
6846 * testsuite/odr_header2.h: Defines OdrBase.
6847
a19fefdc
ILT
68482011-03-09 Ian Lance Taylor <iant@google.com>
6849
6850 * fileread.cc (File_read::clear_views): Don't delete the whole
6851 file view.
6852
ecb351e9
ILT
68532011-03-08 Ian Lance Taylor <iant@google.com>
6854
6855 PR gold/12525
6856 * fileread.cc: #include <climits>.
6857 (GOLD_IOV_MAX): Define.
6858 (File_read::read_multiple): Limit number of entries by iov_max.
6859 * fileread.h (class File_read): Always set max_readv_entries to
6860 128.
6861
b821d13c
ILT
68622011-03-07 Ian Lance Taylor <iant@google.com>
6863
6864 PR gold/12525
6865 * options.h (class General_options): Add -dy and -dn.
6866
89243142
CC
68672011-03-02 Cary Coutant <ccoutant@google.com>
6868
6869 * testsuite/script_test_9.t: Add TLS segment.
6870
d0773f31
ILT
68712011-03-02 Simon Baldwin <simonb@google.com>
6872
6873 * configure.ac: Add check for gnu_indirect_function support in
6874 the toolchain building binutils.
6875 * configure: Rebuild.
6876
9370ce59 68772011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
6878
6879 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6880 plugin only symbols.
6881 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6882 in plugin files as not needed in the symbol table.
6883
4cf7a849
ST
68842011-02-11 Sriraman Tallam <tmsriram@google.com>
6885
6886 * output.cc (Output_section::add_input_section): Delay fill
6887 generation for section ordering.
6888
b578bd7d
ILT
68892011-02-09 Ian Lance Taylor <iant@google.com>
6890
6891 PR gold/12316
6892 * object.h (class Sized_relobj): Remove clear_local_symbols.
6893 * reloc.cc (Sized_relobj::do_relocate): Don't call
6894 clear_local_symbols.
6895
9370ce59 68962011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
6897
6898 * plugin.cc (is_visible_from_outside): Return true for symbols
6899 in the -u option.
6900
55382fb7
ILT
69012011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6902
6903 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6904 filename.
6905
4e271fff
ST
69062011-02-02 Sriraman Tallam <tmsriram@google.com>
6907
6908 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 6909 to std::string.
4e271fff 6910 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 6911 section_name to be std::string.
4e271fff
ST
6912 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6913
d433c3ac
ILT
69142011-01-25 Ian Lance Taylor <iant@google.com>
6915
6916 * script.cc (script_add_extern): Rewrite to use
6917 add_symbol_reference.
6918
880473a6
DK
69192011-01-25 Doug Kwan <dougkwan@google.com>
6920
d433c3ac 6921 * icf.cc (get_section_contents): Always lock section's object.
880473a6 6922
f30f86fa
ILT
69232011-01-24 Ian Lance Taylor <iant@google.com>
6924
6925 * options.h (class General_options): Accept
6926 --no-detect-odr-violations.
6927
8e51a0b9
ILT
69282011-01-24 Ian Lance Taylor <iant@google.com>
6929
6930 * version.cc (version_string): Bump to 1.11.
6931
0f3b89d8
ILT
69322011-01-24 Ian Lance Taylor <iant@google.com>
6933
6934 * plugin.cc (class Plugin_rescan): Define new class.
6935 (Plugin_manager::claim_file): Set any_claimed_.
6936 (Plugin_manager::save_archive): New function.
6937 (Plugin_manager::save_input_group): New function.
6938 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6939 necessary.
6940 (Plugin_manager::new_undefined_symbol): New function.
6941 (Plugin_manager::rescan): New function.
6942 (Plugin_manager::rescannable_defines): New function.
6943 (Plugin_manager::add_input_file): Set any_added_.
6944 * plugin.h (class Plugin_manager): define new fields rescannable_,
6945 undefined_symbols_, any_claimed_, and any_added_. Declare
6946 Plugin_rescan as friend. Declare new functions.
6947 (Plugin_manager::Rescannable): Define type.
6948 (Plugin_manager::Rescannable_list): Define type.
6949 (Plugin_manager::Undefined_symbol_list): Define type.
6950 (Plugin_manager::Plugin_manager): Initialize new fields.
6951 * archive.cc (Archive::defines_symbol): New function.
6952 (Add_archive_symbols::run): Pass archive to plugins if any.
6953 * archive.h (class Archive): Declare defines_symbol.
6954 * readsyms.cc (Input_group::~Input_group): New function.
6955 (Finish_group::run): Pass input_group to plugins if any.
6956 * readsyms.h (class Input_group): Declare destructor.
6957 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6958 any.
6959
3bb951e5
ILT
69602011-01-10 Ian Lance Taylor <iant@google.com>
6961
6962 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
6963 section as relro.
6964 (Layout::set_segment_offsets): Reset increase_relro before calling
6965 set_section_addresses a second time.
6966
0aa45fac
CC
69672011-01-04 Cary Coutant <ccoutant@google.com>
6968
6969 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
6970 sections before NOBITS sections.
6971
0db46eb4
L
69722011-01-01 H.J. Lu <hongjiu.lu@intel.com>
6973
6974 * version.cc (print_version): Update copyright to 2011.
6975
829c9745
CC
69762010-12-23 Cary Coutant <ccoutant@google.com>
6977
6978 * output.h (Output_data_reloc::add_output_section): Pass OD instead
6979 of OS to this->add. Add OD parameter to second form of the function.
6980
7500420b
ILT
69812010-12-20 Ian Lance Taylor <iant@google.com>
6982
6983 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
6984 second of two consecutive entries with same offset.
6985
f8e9a930
RW
69862010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6987
6988 * testsuite/Makefile.am (ifuncmain2static_LDADD)
6989 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
6990 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
6991 to avoid unneeded links against $(LDADD).
6992 * testsuite/Makefile.in: Regenerate.
6993
2fbb4320
ILT
69942010-12-15 Ian Lance Taylor <iant@google.com>
6995
6996 PR gold/12324
6997 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
6998 for R_X86_64_32 and R_X86_64_PC32.
6999 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7000 ver_matching_def_pic.o.
7001 (ver_matching_def_pic.o): New target.
7002
fedb228d
RW
70032010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7004
7005 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7006 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7007 Move definition before File_read::View member definitions.
7008 (File_read::View::~View): Initialize and hold lock before
7009 updating current_mapped_bytes.
7010
9b547ce6
RW
70112010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7012
7013 * dwarf_reader.cc: Remove outdated comment.
7014 * gold-threads.cc: Fix typo in error message.
7015 * archive.cc: Fix typos in comments.
7016 * archive.h: Likewise.
7017 * arm-reloc-property.cc: Likewise.
7018 * arm-reloc-property.h: Likewise.
7019 * arm-reloc.def: Likewise.
7020 * arm.cc: Likewise.
7021 * attributes.h: Likewise.
7022 * cref.cc: Likewise.
7023 * ehframe.cc: Likewise.
7024 * fileread.h: Likewise.
7025 * gold.h: Likewise.
7026 * i386.cc: Likewise.
7027 * icf.cc: Likewise.
7028 * incremental.h: Likewise.
7029 * int_encoding.cc: Likewise.
7030 * layout.h: Likewise.
7031 * main.cc: Likewise.
7032 * merge.h: Likewise.
7033 * object.cc: Likewise.
7034 * object.h: Likewise.
7035 * options.cc: Likewise.
7036 * readsyms.cc: Likewise.
7037 * reduced_debug_output.cc: Likewise.
7038 * reloc.cc: Likewise.
7039 * script-sections.cc: Likewise.
7040 * sparc.cc: Likewise.
7041 * symtab.h: Likewise.
7042 * target-reloc.h: Likewise.
7043 * target.cc: Likewise.
7044 * target.h: Likewise.
7045 * timer.cc: Likewise.
7046 * timer.h: Likewise.
7047 * x86_64.cc: Likewise.
7048
83e17bd5
CC
70492010-12-09 Cary Coutant <ccoutant@google.com>
7050
7051 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
7052 stack.
7053 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
7054 parameter; change all callers.
7055 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
7056 * options.h (warn_execstack): New option.
7057
017257f8
DK
70582010-12-07 Doug Kwan <dougkwan@google.com>
7059
7060 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
7061 like function call relocations.
7062
c20cbc06
ILT
70632010-12-07 Ian Lance Taylor <iant@google.com>
7064
7065 * archive.cc (Archive::get_elf_object_for_member): Permit
7066 punconfigured to be NULL.
7067 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7068 (Archive::include_member): Pass NULL to get_elf_object_for_member
7069 if we searched for the archive and this is the first included
7070 object.
7071
4dbfafcc
ILT
70722010-12-01 Ian Lance Taylor <iant@google.com>
7073
7074 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7075 track_relocs_type_ field.
7076 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7077 Set track_relocs_type_.
7078 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7079 contents when using RELA relocs.
7080 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7081 reloc_map_.
7082 * reloc.cc (Track_relocs::next_addend): New function.
7083 * reloc.h (class Track_relocs): Declare next_addend.
7084
e5e19edd
ILT
70852010-12-01 Ian Lance Taylor <iant@google.com>
7086
7087 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7088 virtual destructor.
7089
9a5ce24c
ILT
70902010-12-01 Ian Lance Taylor <iant@google.com>
7091
7092 * README: Update compilers known to work and fail.
7093
c7791212
NC
70942010-11-23 Matthias Klose <doko@ubuntu.com>
7095
7096 * configure.in: For --enable-gold, handle value `default' instead of
7097 `both*'. Always install ld as ld.bfd, install as ld if gold is
7098 not the default.
7099 * configure: Regenerate.
7100
0ad220c9
DK
71012010-11-18 Doug Kwan <dougkwan@google.com>
7102
7103 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7104 and right_alignment to be zero. Store result alignment only if it is
7105 greater than existing alignment.
7106
ab8056e0
CC
71072010-11-16 Cary Coutant <ccoutant@google.com>
7108
7109 PR gold/12220
7110 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7111 Check for ".zdebug_line".
7112
fd064a5b
CC
71132010-11-16 Doug Kwan <dougkwan@google.com>
7114 Cary Coutant <ccoutant@google.com>
7115
7116 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7117 by reference; adjust all callers.
7118 * output.cc (Output_segment::set_section_addresses): Adjust references
7119 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7120 list is empty.
7121 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7122 end at page boundary.
7123
6fc6ea19
CC
71242010-11-16 Cary Coutant <ccoutant@google.com>
7125
7126 PR gold/12220
7127 * layout.cc (Layout::choose_output_section): Transform names of
7128 compressed sections even when using a script with a SECTIONS clause.
7129 (Layout::output_section_name): Remove code to transform
7130 compressed debug section names.
7131 * output.cc (Output_section::add_input_section): Use uncompressed
7132 section size when tracking input sections.
7133
95a2c8d6
RS
71342010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7135
7136 * symtab.h (Symbol::NON_PIC_REF): Remove.
7137 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7138 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7139 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7140 (Symbol::use_plt_offset): Take a flags argument and pass it
7141 directly to needs_dynamic_reloc. Restrict check for undefined
7142 weak symbols to function calls.
7143 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7144 (Target_arm::Scan::global): Use it.
7145 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7146 (Target_arm::Relocate::relocate): Likewise.
7147 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7148 parameter with an r_type parameter. Use get_reference_flags
7149 to get the flags.
7150 (Target_arm::Relocate::relocate): Update accordingly.
7151 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7152 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7153 (Target_i386::Scan::global): Likewise.
7154 (Target_i386::Relocate::relocate): Likewise.
7155 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7156 parameter with an r_type parameter. Use get_reference_flags
7157 to get the flags.
7158 (Target_i386::Relocate::relocate): Update accordingly.
7159 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7160 (Target_powerpc::Scan::global): Use it.
7161 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7162 (Target_powerpc::Relocate::relocate): Likewise.
7163 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7164 (Target_sparc::Scan::global): Use it.
7165 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7166 (Target_sparc::Relocate::relocate): Likewise.
7167 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7168 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7169 (Target_x86_64::Scan::global): Likewise.
7170 (Target_x86_64::Relocate::relocate): Likewise.
7171
f625ae50
DK
71722010-11-08 Doug Kwan <dougkwan@google.com>
7173 Cary Coutant <ccoutant@google.com>
7174
7175 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7176 (Arm_exidx_merge_section::section_contents_): New data member.
7177 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7178 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 7179 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
7180 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7181 in parameters instead of calling Object::section_contents without
7182 locking.
7183 (Arm_output_section::group_section): New parameter TASK. Pass it
7184 to callees that need locking objects.
7185 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7186 to lock EXIDX input sections. Fix a formatting issue. Call
7187 Arm_exidx_merged_section::build_contents to create merged section
7188 contents.
7189 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7190 to lock object of stub table owner.
7191 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7192 TEXT_SIZE to initialize data member TEXT_SIZE_.
7193 (Arm_exidx_input_section::addralign): Fix typo in comment.
7194 (Arm_exidx_input_section::text_size): New method.
7195 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7196 that require locking objects. Lock objects before scanning for stubs
7197 and updating local symbols.
7198 (Arm_input_section<big_endian>::init): Copy contents of original
7199 input section.
2e702c99 7200 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
7201 original input section instead of calling Object::section_contents
7202 without locking.
7203 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7204 size without calling Object::section_size().
7205 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7206 for size. Allocate a buffer for merged EXIDX entries.
7207 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7208 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7209 building code to Arm_exidx_merged_section::build_contetns. Write
7210 out contetns in buffer instead of building it on the fly.
7211 (Arm_relobj::make_exidx_input_section): Also pass text section size
7212 to Arm_exidx_input_section constructor.
7213 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7214 (Arm_dynobj::do_read_symbols): Fix memory leak.
7215 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7216 * target.h: (class Task): Add forward declaration.
7217 (Target::relax): Add new parameter TASK and pass it to
7218 Target::do_relax().
7219 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7220
5f9bcf58
CC
72212010-11-05 Cary Coutant <ccoutant@google.com>
7222
7223 PR gold/10708
7224 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7225 object when reading from the file.
7226 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7227 second layout pass.
7228 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7229 when reading section contents.
7230 (get_section_contents): Likewise.
7231 (icf::find_identical_sections): Likewise.
7232 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7233 object when reading from the file.
7234 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7235 the object when doing deferred section layout.
7236
e597fa08
NC
72372010-11-03 Nick Clifton <nickc@redhat.com>
7238
7239 PR gold/12001
7240 * script.h (class Symbol_assignment: name): New member. Returns
7241 the name of the symbol.
7242 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7243 Returns true if the given symbol name is on the list of
7244 assignments wating to be processed.
7245 * archive.cc (should_incldue_member): If the symbol is undefined,
7246 check to see if it is on the list of symbols pending assignment.
7247
3f9a3278
ILT
72482010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7249
7250 * script-sections.cc (Script_sections::find_memory_region): Check
7251 for a NULL output section pointer.
7252
d06fb4d1
DK
72532010-10-29 Doug Kwan <dougkwan@google.com>
7254
7255 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7256 Output_section::add_relaxed_input_section.
7257 * output.cc (Output_section::add_relaxed_input_section): Add new
7258 arguments LAYOUT and NAME. Set section order index.
7259 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7260 Copy section order index.
7261 * output.h (Output_section::add_relaxed_input_section): Add new
7262 arguments LAYOUT and NAME.
7263
90e24de5
ILT
72642010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7265
7266 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7267 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7268 * testsuite/Makefile.in: Regenerate.
7269
c9484ea5
DK
72702010-10-20 Doug Kwan <dougkwan@google.com>
7271
7272 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7273 without SHF_LINK_ORDER flags.
7274 * layout.cc (Layout::choose_output_section): Do not filter
7275 SHF_LINK_ORDER flag in a relocatable link.
7276
5bc2f5be
CC
72772010-10-17 Cary Coutant <ccoutant@google.com>
7278
7279 * output.h (Output_segment::set_section_addresses): Change function
7280 signature. Update all callers.
7281 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7282 sections.
7283 (Output_segment::set_section_addresses): Align after last TLS
7284 section. Add padding before last relro section instead of after.
7285
0c91cf04
DK
72862010-10-17 Doug Kwan <dougkwan@google.com>
7287
7288 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7289 GOT output section to be writable.
7290
8c21d9d3
CC
72912010-10-14 Cary Coutant <ccoutant@google.com>
7292
7293 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7294 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7295 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7296 mode.
7297 * incremental.cc (report_command_line): Ignore all forms of
7298 --incremental.
7299 * layout.cc (Layout::Layout): Check parameters for incremental link
7300 mode.
7301 * options.cc (General_options::parse_incremental): New function.
7302 (General_options::parse_no_incremental): New function.
7303 (General_options::parse_incremental_full): New function.
7304 (General_options::parse_incremental_update): New function.
7305 (General_options::incremental_mode_): New data member.
7306 (General_options::finalize): Check incremental_mode_.
7307 * options.h (General_options): Update help text for --incremental.
7308 Add --no-incremental, --incremental-full, --incremental-update.
7309 (General_options::Incremental_mode): New enum type.
7310 (General_options::incremental_mode): New function.
7311 (General_options::incremental_mode_): New data member.
7312 * parameters.cc (Parameters::incremental_mode_): New data member.
7313 (Parameters::set_options): Set incremental_mode_.
7314 (Parameters::set_incremental_full): New function.
7315 (Parameters::incremental): New function.
7316 (Parameters::incremental_update): New function.
7317 (set_parameters_incremental_full): New function.
7318 * parameters.h (Parameters::set_incremental_full): New function.
7319 (Parameters::incremental): New function.
7320 (Parameters::incremental_update): New function.
7321 (Parameters::incremental_mode_): New data member.
7322 (set_parameters_incremental_full): New function.
7323 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7324 incremental link mode.
7325 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7326 (Sized_relobj::do_relocate_sections): Likewise.
7327 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7328 option.
7329 * testsuite/Makefile.in: Regenerate.
7330 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7331
bb32aa18 73322010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7333
7334 * script-sections.h (class Script_sections): Make
7335 Sections_elements typedef public.
7336 * script-sections.cc (class Sort_output_sections): Add elements_
7337 field. Add constructor which sets it; change all callers.
7338 (Sort_output_sections::is_before): New function.
7339 (Sort_output_sections::operator()): Call is_before.
7340 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7341 conditional.
7342 * testsuite/script_test_10.sh: New test. Test script section
7343 order.
7344 * testsuite/script_test_10.t: Likewise.
7345 * testsuite/script_test_10.s: Likewise.
7346 * testsuite/Makefile.am: Wrap the cross linker tests and the
7347 common tests into NATIVE_OR_CROSS_LINKER.
7348 (check_SCRIPTS): Add script_test_10.sh.
7349 (check_DATA): Add script_test_10.stdout.
7350 (script_test_10.o, script_test_10): New targets.
7351 (script_test_10.stdout): New target.
7352 * configure, testsuite/Makefile.in: Regenerate.
7353
3cef7179
ILT
73542010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7355
7356 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7357 error for the deprecated relocations.
7358 (Target_arm::Scan::global): Likewise.
7359 (Target_arm::Relocate::relocate): Likewise.
7360
7411e9a8
RS
73612010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7362
7363 * fileread.cc (Input_file::find_file): Initialize *found_name
7364 and *namep when using the fallback search for case 4.
7365
6a9da32a
CC
73662010-10-11 Cary Coutant <ccoutant@google.com>
7367
7368 * options.h (class General_options): Redefine -z lazy as an alias for
7369 the negation of -z now.
7370
ac897c20
ILT
73712010-10-11 Ian Lance Taylor <iant@google.com>
7372
7373 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7374 binding.
7375
ea5cae92
NC
73762010-10-06 Nick Clifton <nickc@redhat.com>
7377
7378 * script-sections.cc(class Memory_region): Remove
7379 current_lma_offset_ field. Rename current_vma_offset_ to
7380 current_offset_. Add last_section_ field.
7381 (Memory_region::get_current_vma_address): Rename to
7382 get_current_address.
7383 (Memory_region::get_current_lma_address): Delete.
7384 (Memory_region::increment_vma_offset): Rename to
7385 increment_offset.
7386 (Memory_region::increment_lma_offset): Delete.
7387 (Memory_region::attributes_compatible): New method. Returns
7388 true if the provided section is compatible with the region.
7389 (Memory_region::get_last_section): New method. Returns the last
7390 section to use the region.
7391 (Memory_region::set_last_section): New method. Stores the last
7392 section to use the region.
7393 (Script_sections::block_in_region): New method. Returns true if
7394 a block of memory is contained within a region.
7395 (Script_sections::find_memory_region): New method. Locates a
7396 memory region to be used to set a VMA or LMA address.
7397 (Output_section_definition::set_section_addresses): Add code to
7398 check for addresses set by memory regions.
7399 (Output_segment::set_section_addresses): Remove memory region
7400 walking code.
7401 (Script_sections::create_segment): Add a warning if a header
7402 segment is created outside of any region.
7403 * script-sections.h (class Script_sections): Add prototypes for
7404 find_memory_region and block_in_region methods.
7405 * testsuite/memory_test.s: Use .long instead of .word.
7406 * testsuite/memory_test.t: Add some more output sections.
7407 * testsuite/memory_test.sh: Update expected output.
7408
a9bfd952
DK
74092010-10-02 Doug Kwan <dougkwan@google.com>
7410
7411 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7412 defintion to symtab.h
7413 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7414 declaration to defintion.
7415
bacff3ab
NC
74162010-10-01 Nick Clifton <nickc@redhat.com>
7417
7418 * expression.cc (eval): Replace dummy argument with NULL.
7419 (eval_maybe_dot): Check for a NULL result section pointer.
7420 (Symbol_expression::value): Likewise.
7421 (Dot_expression::value): Likewise.
7422 (BINARY_EXPRESSION): Likewise.
7423 (Max_expression::value): Likewise.
7424 (Min_expression::value): Likewise.
7425 (Absolute_expression::value): Likewise.
7426 (Addr_expression::value_from_output_section): Likewise.
7427 (Loaddddr_expression::value_from_output_section): Likewise.
7428 (Segment_start_expression::value): Likewise.
7429 * script-sections.cc
7430 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7431 argument with NULL.
7432 (Sections_elememt_dot_assignment::set_section_addresses):
7433 Likewise.
7434 (Output_data_expression::do_write_to_buffer): Likewise.
7435 (Output_section_definition::finalize_symbols): Likewise.
7436 (Output_section_definition::set_section_addresses): Likewise.
7437
f81bc8b5
DK
74382010-09-30 Doug Kwan <dougkwan@google.com>
7439
7440 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7441
c95e9f27
ST
74422010-09-28 Sriraman Tallam <tmsriram@google.com>
7443
7444 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 7445 function.
c95e9f27
ST
7446 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7447 virtual function.
7448 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7449 virtual function.
7450 * icf.cc (get_section_contents): Inline merge sections only when
7451 target allows it.
7452
3cac54d2
RW
74532010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7454
7455 * configure: Regenerate.
7456
2904037a
ILT
74572010-09-17 Ian Lance Taylor <iant@google.com>
7458
7459 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7460 * testsuite/Makefile.am (memory_test.o): New target.
7461 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7462 memory_test.t.
7463 * testsuite/Makefile.in: Rebuild.
2904037a 7464
bca7fb63
DK
74652010-09-17 Doug Kwan <dougkwan@google.com>
7466
7467 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7468 defintion if relocation uses GOT entries of the symbol.
7469 * testsuite/icf_safe_test.sh: Fix test.
7470 * testsuite/icf_safe_so_test.sh: Fix test.
7471
4ef28648
CC
74722010-09-16 Cary Coutant <ccoutant@google.com>
7473
7474 * script_sections.cc (class Memory_region): Remove "NULL" from
7475 vector initializations.
7476
793990de
CC
74772010-09-15 Cary Coutant <ccoutant@google.com>
7478
7479 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7480 Resolve forwarding symbols.
7481
81e015e2
DK
74822010-09-15 Doug Kwan <dougkwan@google.com>
7483
7484 * gold/testsuite/script_test_3.t: Add ARM special sections.
7485 * gold/testsuite/script_test_4.t: Same.
7486 * gold/testsuite/script_test_5.t: Same.
7487 * gold/testsuite/script_test_6.t: Same.
7488 * gold/testsuite/script_test_7.t: Same.
7489 * gold/testsuite/script_test_7.t: Same.
7490 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7491
36171d64
CC
74922010-09-14 Cary Coutant <ccoutant@google.com>
7493
7494 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7495 (Target_x86_64::Relocate::relocate_tls): Replace check for
7496 saw_tls_block_reloc_ with test for executable section.
7497
d89051bd
CC
74982010-09-12 Cary Coutant <ccoutant@google.com>
7499
7500 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7501 position-independent executables to shared libraries need dynamic
7502 relocations.
7503 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7504 position-independent executables.
7505 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7506 * testsuite/Makefile.in: Regenerate.
7507
fca41f0f
NC
75082010-09-10 Nick Clifton <nickc@redhat.com>
7509
7510 PR gold/11997
7511 * testsuite/memory_test.t: Discard any sections that are not
7512 needed.
7513
6695e4b3
L
75142010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7515
7516 PR gold/11996
7517 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7518 "This::" to work around a bug in gcc 4.2.
7519
7520 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7521
0f72bf6f
RÁE
75222010-09-09 Rafael Espindola <espindola@google.com>
7523
7524 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7525 sections with different PF_X flags in the same segment.
7526 (Layout::find_first_load_seg): Search all segments to find the first
7527 one.
7528 * options.h (rosegment): New.
7529
75302010-09-08 Rafael Espindola <espindola@google.com>
a6577478 7531
05a79166 7532 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 7533
aa98ff75
DK
75342010-09-08 Doug Kwan <dougkwan@google.com>
7535
7536 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7537 (Arm_relobj::do_relocate_sections): Add new parameter for output
7538 file to match the parent.
7539 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7540 of local symbols instead of input values. Update code to track
7541 changes in gold::relocate_section.
7542 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7543 (Sized_relobj::compute_final_local_value_internal): New methods.
7544 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7545 body into private version of Sized_relobj::compute_final_local_value.
7546 Call the inline method.
7547 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7548 merged symbol value if there is one.
7549 (Symbol_value::has_output_value): New method defintiion.
7550 (Sized_relobj::Compute_final_local_value_status): New enum type.
7551 (Sized_relobj::compute_final_local_value): New methods.
7552 (Sized_relobj::compute_final_local_value_internal): New methods.
7553 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7554 and arm_cortex_a8.sh.
7555 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7556 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7557 New tests.
7558 * Makefile.in: Regenerate.
7559 * testsuite/arm_bl_out_of_range.s: Update test.
7560 * testsuite/thumb_bl_out_of_range.s: Ditto.
7561 * testsuite/thumb_blx_out_of_range.s: Ditto.
7562 * testsuite/arm_branch_out_of_range.sh: New file.
7563 * testsuite/arm_cortex_a8.sh: Ditto.
7564 * testsuite/arm_cortex_a8_b.s: Ditto.
7565 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7566 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7567 * testsuite/arm_cortex_a8_bl.s: Ditto.
7568 * testsuite/arm_cortex_a8_blx.s: Ditto.
7569 * testsuite/arm_cortex_a8_local.s: Ditto.
7570 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7571 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7572
05a79166
L
75732010-09-08 Rafael Espindola <espindola@google.com>
7574
7575 * Makefile.am (memory_test.stdout): Run readelf with -W.
7576 * Makefile.in: Regenerate.
7577 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7578 64 bit output.
7579
33dbc701
RÁE
75802010-09-08 Rafael Espindola <espindola@google.com>
7581
7582 * script-sections.cc (Script_sections::add_memory_region): Convert
7583 field precision to int.
7584 * script.cc (script_set_section_region, script_set_section_region):
7585 Convert field precision to int.
7586
731ca54a
RÁE
75872010-09-08 Rafael Espindola <espindola@google.com>
7588
7589 * arm.cc (do_finalize_sections): Create the __exidx_start and
7590 __exdix_end symbols even when the section is missing.
7591
7f8cd844
NC
75922010-09-08 Nick Clifton <nickc@redhat.com>
7593
7594 * README: Remove claim that MEMORY is not supported.
7595 * expression.cc (script_exp_function_origin)
7596 (script_exp_function_length): Move from here to ...
7597 * script.cc: ... here.
7598 (script_set_section_region, script_add_memory)
7599 (script_parse_memory_attr, script_include_directive): New
7600 functions.
7601 * script-sections.cc
7602 (class Memory_region): New class.
7603 (class Output_section_definition): Add set_memory_region,
7604 set_section_vma, set_section_lma and get_section_name methods.
7605 (class Script_Sections): Add add_memory_region,
7606 find_memory_region, find_memory_region_origin,
7607 find_memory_region_length and set_memory_region methods.
7608 Have set_section_addresses method walk the list of set memory
7609 regions.
7610 Extend the print methos to display memory regions.
7611 * script-sections.h: Add prototypes for new methods.
7612 Add enum for MEMORY region attributes.
7613 * yyscript.y: Add support for parsing MEMORY regions.
7614 * script-c.h: Add prototypes for new functions.
7615 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7616 * testsuite/Makefile.in: Regenerate.
7617 * testsuite/memory_test.sh: New script.
7618 * testsuite/memory_test.s: New assembler source file.
7619 * testsuite/memory_test.t: New linker script.
7620
a4649286
DK
76212010-08-27 Doug Kwan <dougkwan@google.com>
7622
7623 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7624 reference override an existing dynamic weak reference.
7625 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7626 * testsuite/Makefile.in: Regenerate.
7627 * testsuite/dyn_weak_ref.sh: New file.
7628 * testsuite/dyn_weak_ref_1.c: Ditto.
7629 * testsuite/dyn_weak_ref_2.c: Ditto.
7630
b56648ad
ILT
76312010-08-27 Ian Lance Taylor <iant@google.com>
7632
7633 * incremental.h (class Incremental_input_entry): Add virtual
7634 destructor.
7635
809313cb
ILT
76362010-08-27 Ian Lance Taylor <iant@google.com>
7637
7638 * testsuite/start_lib_test_3.c: Mark t3 as used.
7639
11e32464
NC
76402010-08-27 Nick Clifton <nickc@redhat.com>
7641
7642 * options.cc (version_script): Fix small typo in previous
7643 whitespace tidyup.
7644
ca09d69a
NC
76452010-08-25 Nick Clifton <nickc@redhat.com>
7646
7647 * archive.cc: Formatting fixes: Remove whitespace between
7648 typename and following asterisk. Remove whitespace between
7649 function name and opening parenthesis.
7650 * archive.h: Likewise.
7651 * arm.cc: Likewise.
7652 * attributes.cc: Likewise.
7653 * attributes.h: Likewise.
7654 * common.cc: Likewise.
7655 * copy-relocs.cc: Likewise.
7656 * dirsearch.h: Likewise.
7657 * dynobj.cc: Likewise.
7658 * ehframe.cc: Likewise.
7659 * ehframe.h: Likewise.
7660 * expression.cc: Likewise.
7661 * fileread.cc: Likewise.
7662 * fileread.h: Likewise.
7663 * gc.h: Likewise.
7664 * gold-threads.cc: Likewise.
7665 * gold.cc: Likewise.
7666 * i386.cc: Likewise.
7667 * icf.h: Likewise.
7668 * incremental-dump.cc: Likewise.
7669 * incremental.cc: Likewise.
7670 * layout.cc: Likewise.
7671 * layout.h: Likewise.
7672 * main.cc: Likewise.
7673 * merge.cc: Likewise.
7674 * merge.h: Likewise.
7675 * object.cc: Likewise.
7676 * object.h: Likewise.
7677 * options.cc: Likewise.
7678 * options.h: Likewise.
7679 * output.cc: Likewise.
7680 * output.h: Likewise.
7681 * plugin.cc: Likewise.
7682 * plugin.h: Likewise.
7683 * powerpc.cc: Likewise.
7684 * reloc.cc: Likewise.
7685 * script-c.h: Likewise.
7686 * script-sections.cc: Likewise.
7687 * script.cc: Likewise.
7688 * stringpool.cc: Likewise.
7689 * symtab.cc: Likewise.
7690 * symtab.h: Likewise.
7691 * target.cc: Likewise.
7692 * timer.cc: Likewise.
7693 * timer.h: Likewise.
7694 * version.cc: Likewise.
7695 * x86_64.cc: Likewise.
7696
b8fa8750
NC
76972010-08-24 Nick Clifton <nickc@redhat.com>
7698
7699 PR 11899
7700 * layout.cc (segment_precedes): Sort segments by their physical
7701 addresses, if they have been set.
7702
9919d93b
CC
77032010-08-23 Cary Coutant <ccoutant@google.com>
7704
7705 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7706 symbols data.
7707 (Lib_group::include_member): Unlock object after deleting its
7708 symbols data.
7709 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7710 the bug fixed here.
7711
97b4be1c
CC
77122010-08-19 Neil Vachharajani <nvachhar@google.com>
7713 Cary Coutant <ccoutant@google.com>
7714
7715 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7716 constructor, and set_blocker.
7717 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7718 readsyms_blocker_.
7719 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7720 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7721 * testsuite/Makefile.am (start_lib_test): New test case.
7722 * testsuite/Makefile.in: Regenerate.
7723 * testsuite/start_lib_test_main.c: New file.
7724 * testsuite/start_lib_test_1.c: New file.
7725 * testsuite/start_lib_test_2.c: New file.
7726 * testsuite/start_lib_test_3.c: New file.
7727
dd0b1884
ILT
77282010-08-19 Ian Lance Taylor <iant@google.com>
7729
7730 * Makefile.in: Rebuild with automake 1.11.1.
7731 * aclocal.m4: Likewise.
7732 * testsuite/Makefile.in: Likewise.
7733
7223e9ca
ILT
77342010-08-19 Ian Lance Taylor <iant@google.com>
7735
7736 PR 10893
7737 * i386.cc (class Output_data_plt_i386): Update declarations.
7738 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7739 local_ifuncs_ fields.
7740 (Target_i386::do_plt_section_for_global): New function.
7741 (Target_i386::do_plt_section_for_local): New function.
7742 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7743 parameter; change all callers. Initialize global_ifuncs_ and
7744 local_ifuncs_. If doing a static link define __rel_iplt_start and
7745 __rel_iplt_end.
7746 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7747 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7748 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7749 symbols.
7750 (Target_i386::make_plt_section): New function, broken out of
7751 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7752 (Target_i386::make_plt_entry): Call make_plt_section.
7753 (Target_i386::make_local_ifunc_plt_entry): New function.
7754 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7755 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7756 R_386_IRELATIVE to switch.
7757 (Target_i386::Scan::global): Likewise.
7758 (Target_i386::Relocate::relocate): Likewise.
7759 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7760 switch.
7761 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7762 (Target_x86_64::do_plt_section_for_global): New function.
7763 (Target_x86_64::do_plt_section_for_local): New function.
7764 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7765 parameter; change all callers. If doing a static link define
7766 __rela_iplt_start and __rela_iplt_end.
7767 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7768 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7769 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7770 to point to .plt.
7771 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7772 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7773 switch.
7774 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7775 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7776 R_X86_64_IRELATIVE to switch.
7777 (Target_x86_64::Scan::global): Likewise.
7778 (Target_x86_64::Relocate::relocate): Likewise.
7779 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7780 switch.
7781 * target.h (class Target): Add plt_section_for_global and
7782 plt_section_for_local functions. Add do_plt_section_for_global
7783 and do_plt_section_for_local virtual functions.
7784 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7785 clarifying comments.
7786 (Symbol::use_plt_offset): Handle IFUNC symbol.
7787 * object.cc (Sized_relobj::Sized_relobj): Initialize
7788 local_plt_offsets_.
7789 (Sized_relobj::local_has_plt_offset): New function.
7790 (Sized_relobj::local_plt_offset): New function.
7791 (Sized_relobj::set_local_plt_offset): New function.
7792 (Sized_relobj::do_count): Handle IFUNC symbol.
7793 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7794 a bit away from input_shndx_ field. Add set_is_func_symbol and
7795 is_ifunc_symbol functions.
7796 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7797 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7798 local_plt_offsets_ field.
7799 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7800 * output.h (class Output_section_data): Add non-const
7801 output_section function.
7802 (class Output_data_got): Update declarations.
7803 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7804 Add use_plt_offset parameter to global and local constructors.
7805 Change all callers. Change local_sym_index_ field to 31 bits.
7806 Change GSYM_CODE and CONSTANT_CODE accordingly.
7807 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7808 doing a static link don't set sh_link field.
7809 (Output_data_got::Got_entry::write): Use PLT offset if
7810 appropriate.
7811 (Output_data_got::add_global_plt): New function.
7812 (Output_data_got::add_local_plt): New function.
7813 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7814 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7815 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7816 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7817 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7818 IFUNC conditional.
7819 * testsuite/ifunc-sel.h: New file.
7820 * testsuite/ifuncmain1.c: New file.
7821 * testsuite/ifuncmain1vis.c: New file.
7822 * testsuite/ifuncmod1.c: New file.
7823 * testsuite/ifuncdep2.c: New file.
7824 * testsuite/ifuncmain2.c: New file.
7825 * testsuite/ifuncmain3.c: New file.
7826 * testsuite/ifuncmod3.c: New file.
7827 * testsuite/ifuncmain4.c: New file.
7828 * testsuite/ifuncmain5.c: New file.
7829 * testsuite/ifuncmod5.c: New file.
7830 * testsuite/ifuncmain6pie.c: New file.
7831 * testsuite/ifuncmod6.c: New file.
7832 * testsuite/ifuncmain7.c: New file.
7833 * configure, testsuite/Makefile.in: Rebuild.
7834
56f75c03
ILT
78352010-08-18 Ian Lance Taylor <iant@google.com>
7836
7837 * incremental.cc
7838 (Output_section_incremental_inputs::write_input_files): Add cast
7839 to avoid signed/unsigned comparison warning.
7840 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7841
55455f89
CC
78422010-08-12 Cary Coutant <ccoutant@google.com>
7843
7844 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7845
e2054bcb
ILT
78462010-08-13 Ian Lance Taylor <iant@google.com>
7847
7848 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7849
74f67560
DK
78502010-08-12 Cary Coutant <ccoutant@google.com>
7851 Doug Kwan <dougkwan@google.com>
7852
7853 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7854 defintion overrides non-weak undef, remember that the original undef
7855 is not weak.
7856 * symtab.cc (Symbol_table::sized_write_global): For undef without
7857 an original weak binding, set binding to global in output.
7858 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7859 * testsuite/Makefile.in: Regenerate.
7860 * testsuite/strong_ref_weak_def.sh: New file.
7861 * testsuite/strong_ref_weak_def_1.c: Ditto.
7862 * testsuite/strong_ref_weak_def_2.c: Ditto.
7863
d1238d12
CC
78642010-08-12 Cary Coutant <ccoutant@google.com>
7865
7866 * testsuite/incremental_test.sh: Rewrite.
7867 * testsuite/incremental_test_1.c: Rewrite.
7868 * testsuite/incremental_test_2.c: Rewrite.
7869
0e70b911
CC
78702010-08-12 Cary Coutant <ccoutant@google.com>
7871
7872 * arm.cc (Target_arm::got_size): Add const.
7873 (Target_arm::got_entry_count): New function.
7874 (Target_arm::plt_entry_count): New function.
7875 (Target_arm::first_plt_entry_offset): New function.
7876 (Target_arm::plt_entry_size): New function.
7877 (Output_data_plt_arm::entry_count): New function.
7878 (Output_data_plt_arm::first_plt_entry_offset): New function.
7879 (Output_data_plt_arm::get_plt_entry_size): New function.
7880 * i386.cc (Target_i386::got_size): Add const.
7881 (Target_i386::got_entry_count): New function.
7882 (Target_i386::plt_entry_count): New function.
7883 (Target_i386::first_plt_entry_offset): New function.
7884 (Target_i386::plt_entry_size): New function.
7885 (Output_data_plt_i386::entry_count): New function.
7886 (Output_data_plt_i386::first_plt_entry_offset): New function.
7887 (Output_data_plt_i386::get_plt_entry_size): New function.
7888 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7889 find_incremental_inputs_sections. Dump incremental_got_plt section.
7890 * incremental.cc: Include target.h.
7891 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7892 parameter. Adjust all callers. Find incremental_got_plt section.
7893 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7894 section.
7895 (Output_section_incremental_inputs::set_final_data_size): Calculate
7896 size of incremental_got_plt section.
7897 (Output_section_incremental_inputs::do_write): Write the
7898 incremental_got_plt section.
7899 (Got_plt_view_info): New struct.
7900 (Local_got_offset_visitor): New class.
7901 (Global_got_offset_visitor): New class.
7902 (Global_symbol_visitor_got_plt): New class.
7903 (Output_section_incremental_inputs::write_got_plt): New function.
7904 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7905 Add parameter. Adjust all callers.
7906 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7907 (Incremental_inputs::got_plt_section): New function.
7908 (Incremental_inputs::got_plt_section_): New data member.
7909 (Incremental_got_plt_reader): New class.
7910 * layout.cc (Layout::create_incremental_info_sections): Add the
7911 incremental_got_plt section.
7912 * object.h (Got_offset_list::get_list): New function.
7913 (Got offset_list::for_all_got_offsets): New function.
7914 (Sized_relobj::local_got_offset_list): New function.
7915 * powerpc.cc (Target_powerpc::got_size): Add const.
7916 (Target_powerpc::got_entry_count): New function.
7917 (Target_powerpc::plt_entry_count): New function.
7918 (Target_powerpc::first_plt_entry_offset): New function.
7919 (Target_powerpc::plt_entry_size): New function.
7920 (Output_data_plt_powerpc::entry_count): New function.
7921 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7922 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7923 * sparc.cc (Target_sparc::got_size): Add const.
7924 (Target_sparc::got_entry_count): New function.
7925 (Target_sparc::plt_entry_count): New function.
7926 (Target_sparc::first_plt_entry_offset): New function.
7927 (Target_sparc::plt_entry_size): New function.
7928 (Output_data_plt_sparc::entry_count): New function.
7929 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7930 (Output_data_plt_sparc::get_plt_entry_size): New function.
7931 * symtab.h (Symbol::got_offset_list): New function.
7932 (Symbol_table::for_all_symbols): New function.
7933 * target.h (Sized_target::got_entry_count): New function.
7934 (Sized_target::plt_entry_count): New function.
7935 (Sized_target::plt_entry_size): New function.
7936 * x86_64.cc (Target_x86_64::got_size): Add const.
7937 (Target_x86_64::got_entry_count): New function.
7938 (Target_x86_64::plt_entry_count): New function.
7939 (Target_x86_64::first_plt_entry_offset): New function.
7940 (Target_x86_64::plt_entry_size): New function.
7941 (Output_data_plt_x86_64::entry_count): New function.
7942 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7943 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7944
09ec0418
CC
79452010-08-12 Cary Coutant <ccoutant@google.com>
7946
7947 * archive.cc: Include incremental.h.
7948 (Archive::Archive): Initialize incremental_info_.
7949 (Archive::include_member): Record archive members in incremental info.
7950 (Add_archive_symbols::run): Record begin and end of an archive in
7951 incremental info.
7952 (Lib_group::include_member): Record objects in incremental info.
7953 * archive.h (Incremental_archive_entry): Forward declaration.
7954 (Archive::set_incremental_info): New member function.
7955 (Archive::incremental_info): New member function.
7956 (Archive::Unused_symbol_iterator): New class.
7957 (Archive::unused_symbols_begin): New member function.
7958 (Archive::unused_symbols_end): New member function.
7959 (Archive::incremental_info_): New data member.
7960 * incremental-dump.cc (find_input_containing_global): New function.
7961 (dump_incremental_inputs): Dump new incremental info sections.
7962 * incremental.cc: Include symtab.h.
7963 (Output_section_incremental_inputs): New class.
7964 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
7965 new incremental info sections.
7966 (Sized_incremental_binary::do_check_inputs): Likewise.
7967 (Incremental_inputs::report_archive): Remove.
7968 (Incremental_inputs::report_archive_begin): New function.
7969 (Incremental_inputs::report_archive_end): New function.
7970 (Incremental_inputs::report_object): New function.
7971 (Incremental_inputs::finalize_inputs): Remove.
7972 (Incremental_inputs::report_input_section): New function.
7973 (Incremental_inputs::report_script): Rewrite.
7974 (Incremental_inputs::finalize): Do nothing but finalize string table.
7975 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7976 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7977 (Incremental_inputs::create_data_sections): New function.
7978 (Incremental_inputs::relocs_entsize): New function.
7979 (Output_section_incremental_inputs::set_final_data_size): New function.
7980 (Output_section_incremental_inputs::do_write): New function.
7981 (Output_section_incremental_inputs::write_header): New function.
7982 (Output_section_incremental_inputs::write_input_files): New function.
7983 (Output_section_incremental_inputs::write_info_blocks): New function.
7984 (Output_section_incremental_inputs::write_symtab): New function.
7985 * incremental.h (Incremental_script_entry): Forward declaration.
7986 (Incremental_object_entry): Forward declaration.
7987 (Incremental_archive_entry): Forward declaration.
7988 (Incremental_inputs): Forward declaration.
7989 (Incremental_inputs_header_data): Remove.
7990 (Incremental_inputs_header): Remove.
7991 (Incremental_inputs_header_write): Remove.
7992 (Incremental_inputs_entry_data): Remove.
7993 (Incremental_inputs_entry): Remove.
7994 (Incremental_inputs_entry_write): Remove.
7995 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
7996 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
7997 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7998 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
7999 Likewise.
8000 (Incremental_input_entry): New class.
8001 (Incremental_script_entry): New class.
8002 (Incremental_object_entry): New class.
8003 (Incremental_archive_entry): New class.
8004 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8005 (Incremental_inputs::report_inputs): Remove.
8006 (Incremental_inputs::report_archive): Remove.
8007 (Incremental_inputs::report_archive_begin): New function.
8008 (Incremental_inputs::report_archive_end): New function.
8009 (Incremental_inputs::report_object): Change prototype.
8010 (Incremental_inputs::report_input_section): New function.
8011 (Incremental_inputs::report_script): Change prototype.
8012 (Incremental_inputs::get_reloc_count): New function.
8013 (Incremental_inputs::set_reloc_count): New function.
8014 (Incremental_inputs::create_data_sections): New function.
8015 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8016 (Incremental_inputs::inputs_section): New function.
8017 (Incremental_inputs::symtab_section): New function.
8018 (Incremental_inputs::relocs_section): New function.
8019 (Incremental_inputs::get_stringpool): Add const.
8020 (Incremental_inputs::command_line): Add const.
8021 (Incremental_inputs::inputs): Remove.
8022 (Incremental_inputs::command_line_key): New function.
8023 (Incremental_inputs::input_file_count): New function.
8024 (Incremental_inputs::input_files): New function.
8025 (Incremental_inputs::relocs_entsize): New function.
8026 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8027 (Incremental_inputs::finalize_inputs): Remove.
8028 (Incremental_inputs::Input_info): Remove.
8029 (Incremental_inputs::lock_): Remove.
8030 (Incremental_inputs::inputs_): Change type.
8031 (Incremental_inputs::inputs_map_): Remove.
8032 (Incremental_inputs::current_object_entry_): New data member.
8033 (Incremental_inputs::inputs_section_): New data member.
8034 (Incremental_inputs::symtab_section_): New data member.
8035 (Incremental_inputs::relocs_section_): New data member.
8036 (Incremental_inputs::reloc_count_): New data member.
8037 (Incremental_inputs_reader): New class.
8038 (Incremental_symtab_reader): New class.
8039 (Incremental_relocs_reader): New class.
8040 * layout.cc (Layout::finalize): Move finalization of incremental info
8041 and creation of incremental info sections to follow finalization of
8042 symbol table. Set offsets for postprocessing sections.
8043 (Layout::create_incremental_info_sections): Call
8044 Incremental_inputs::create_data_sections. Add incremental symtab
8045 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
8046 sections to layout after input sections.
8047 * layout.h (struct Timespec): Forward declaration.
8048 (Layout::incremental_inputs): Add const.
8049 (Layout::create_incremental_info_sections): Add parameter.
8050 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
8051 * object.cc: Include incremental.h.
8052 (Relobj::finalize_incremental_relocs): New function.
8053 (Sized_relobj::do_layout): Record input sections in incremental info.
8054 * object.h (Object::output_section): New function.
8055 (Object::output_section_offset): Moved from Relobj.
8056 (Object::get_incremental_reloc_base): New function.
8057 (Object::get_incremental_reloc_count): New function.
8058 (Object::do_output_section): New function.
8059 (Object::do_output_section_offset): Moved from Relobj.
8060 (Object::do_get_incremental_reloc_base): New function.
8061 (Object::do_get_incremental_reloc_count): New function.
8062 (Object::Object): Initialize new data members.
8063 (Relobj::output_section): Renamed do_output_section and moved to
8064 protected.
8065 (Relobj::output_section_offset): Moved to Object.
8066 (Relobj::do_get_incremental_reloc_base): New function.
8067 (Relobj::do_get_incremental_reloc_count): New function.
8068 (Relobj::allocate_incremental_reloc_counts): New function.
8069 (Relobj::count_incremental_reloc): New function.
8070 (Relobj::finalize_incremental_relocs): New function.
8071 (Relobj::next_incremental_reloc_index): New function.
8072 (Relobj::reloc_counts_): New data member.
8073 (Relobj::reloc_bases_): New data member.
8074 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8075 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8076 (Sized_relobj::incremental_relocs_scan): New function.
8077 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8078 (Sized_relobj::incremental_relocs_write): New function.
8079 (Sized_relobj::incremental_relocs_write_reltype): New function.
8080 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8081 incremental link.
8082 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8083 archives and object files elsewhere.
8084 (Add_symbols::run): Report object files here.
8085 (Finish_group::run): Report end of archive at end of group.
8086 * reloc.cc: Include layout.h, incremental.h.
8087 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8088 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8089 (Sized_relobj::incremental_relocs_scan): New function.
8090 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8091 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8092 (Sized_relobj::incremental_relocs_write): New function.
8093 (Sized_relobj::incremental_relocs_write_reltype): New function.
8094 * script.cc (read_input_script): Rewrite test for incremental link.
8095 Change call to Incremental_inputs::report_script.
8096 * symtab.h (Symbol_table::first_global_index): New function.
8097 (Symbol_table::output_count): New function.
8098
ce0d1972
DK
80992010-08-12 Doug Kwan <dougkwan@google.com>
8100
8101 * arm.cc (Target_arm::merge_object_attributes): Check command line
8102 options --no-wchar-size-warning and --no-enum-size-warning.
8103 * options.h (General_options): Add ld-compatible options
8104 --no-enum-size-warning and --no-wchar-size-warning.
8105
6e5710ce
ILT
81062010-08-04 Ian Lance Taylor <iant@google.com>
8107
8108 * x86_64.cc (Target_x86_64::Scan::local): Use
8109 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8110 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8111 (Target_x86_64::Scan::global): Likewise.
8112 (Target_x86_64::Relocate::relocate): Likewise.
8113 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8114 Likewise.
8115
fef830db
CC
81162010-08-03 Cary Coutant <ccoutant@google.com>
8117
8118 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8119 to reserve space in merged_strings vector. Keep total input size
8120 for stats.
8121 (Output_merge_string::do_print_merge_stats): Print total input size.
8122 * merge.h (Output_merge_string): Add input_size_ field.
8123 * stringpool.cc (Stringpool_template::string_length): Move
8124 implementations out of Stringpool_template class and place in
8125 stringpool.h.
8126 * stringpool.h (string_length): Move out of Stringpool_template.
8127
1e3811b0
ILT
81282010-08-03 Ian Lance Taylor <iant@google.com>
8129
8130 PR 11712
8131 * layout.cc (relaxation_loop_body): If address of load segment is
8132 set, adjust address to include headers if possible.
8133
7af0c620
ILT
81342010-08-03 Ian Lance Taylor <iant@google.com>
8135
8136 * version.cc (version_string): Bump to 1.10.
8137
22f0da72
ILT
81382010-08-03 Ian Lance Taylor <iant@google.com>
8139
8140 PR 11805
8141 * layout.h (enum Output_section_order): Define.
8142 (class Layout): Update declarations.
8143 * layout.cc (Layout::get_output_section): Add order parameter.
8144 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8145 is_first_non_relro parameters. Change all callers.
8146 (Layout::choose_output_section): Likewise.
8147 (Layout::add_output_section_data): Likewise.
8148 (Layout::make_output_section): Likewise. Set order.
8149 (Layout::default_section_order): New function.
8150 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8151 * output.cc (Output_section::Output_section): Initialize order_.
8152 Don't initialize deleted fields.
8153 (Output_segment::Output_segment): Don't initialize deleted
8154 fields.
8155 (Output_segment::add_output_section_to_load): New function
8156 replacing add_output_section. Change all callers to call this or
8157 add_output_section_to_nonload.
8158 (Output_segment::add_output_section_to_nonload): New function.
8159 (Output_segment::remove_output_section): Rewrite.
8160 (Output_segment::add_initial_output_data): Likewise.
8161 (Output_segment::has_any_data_sections): Likewise.
8162 (Output_segment::is_first_section_relro): Likewise.
8163 (Output_segment::maximum_alignment): Likewise.
8164 (Output_segment::has_dynamic_reloc): New function replacing
8165 dynamic_reloc_count. Change all callers.
8166 (Output_segment::has_dynamic_reloc_list): New function replacing
8167 dynamic_reloc_count_list. Change all callers.
8168 (Output_segment::set_section_addresses): Rewrite.
8169 (Output_segment::set_offset): Rewrite.
8170 (Output_segment::find_first_and_last_list): Remove.
8171 (Output_segment::set_tls_offsets): Rewrite.
8172 (Output_segment::first_section_load_address): Likewise.
8173 (Output_segment::output_section_count): Likewise.
8174 (Output_segment::section_with_lowest_load_address): Likewise.
8175 (Output_segment::write_section_headers): Likewise.
8176 (Output_segment::print_sections_to_map): Likewise.
8177 * output.h (class Output_data): Remove dynamic_reloc_count_
8178 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8179 (Output_data::add_dynamic_reloc): Rewrite.
8180 (Output_data::has_dynamic_reloc): New function.
8181 (Output_data::dynamic_reloc_count): Remove.
8182 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8183 is_last_relro_, is_first_non_relro_, is_interp_,
8184 is_dynamic_linker_section_ fields. Add order and set_order
8185 functions. Remove is_relro_local, set_is_relro_local,
8186 is_last_relro, set_is_last_relro, is_first_non_relro,
8187 set_is_first_non_relro functions, is_interp, set_is_interp,
8188 is_dynamic_linker_section, and set_is_dynamic_linker_section
8189 functions.
8190 (class Output_segment): Change Output_data_list from std::list to
8191 std:;vector. Add output_lists_ field. Remove output_data_ and
8192 output_bss_ fields. Update declarations.
8193
3ff2ccb0
ILT
81942010-08-02 Ian Lance Taylor <iant@google.com>
8195
8196 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8197 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8198 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8199
88a4108b
ILT
82002010-08-02 Ian Lance Taylor <iant@google.com>
8201
8202 PR 11855
8203 * script.cc (Script_options::Script_options): Initialize
8204 symbol_definitions_ and symbol_references_.
8205 (Script_options::add_symbol_assignment): Update
8206 symbol_definitions_ and symbol_references_.
8207 (Script_options::add_symbol_reference): New function.
8208 (script_symbol): New function.
8209 * script.h (class Script_options): Add symbol_definitions_ and
8210 symbol_references_ fields.
8211 (Script_options::referenced_const_iterator): New type.
8212 (Script_options::referenced_begin): New function.
8213 (Script_options::referenced_end): New function.
8214 (Script_options::is_referenced): New function.
8215 (Script_options::any_unreferenced): New function.
8216 * script-c.h (script_symbol): Declare.
8217 * yyscript.y (exp): Call script_symbol.
8218 * symtab.cc: Include "script.h".
8219 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8220 Change all callers. Check symbols referenced by scripts.
8221 (Symbol_table::add_undefined_symbols_from_command_line): Add
8222 layout parameter. Change all callers.
8223 (Symbol_table::do_add_undefined_symbols_from_command_line):
8224 Likewise. Break out loop body. Check symbols referenced by
8225 scripts.
8226 (Symbol_table::add_undefined_symbol_from_command_line): New
8227 function broken out of
8228 do_add_undefined_symbols_from_command_line.
8229 * symtab.h (class Symbol_table): Update declarations.
8230 * archive.cc: Include "layout.h".
8231 (Archive::should_include_member): Add layout parameter. Change
8232 all callers. Check for symbol mentioned in expression.
8233 * archive.h (class Archive): Update declaration.
8234 * object.cc (Sized_relobj::do_should_include_member): Add layout
8235 parameter.
8236 * object.h (Object::should_include_member): Add layout parameter.
8237 Change all callers.
8238 (Object::do_should_include_member): Add layout parameter.
8239 (class Sized_relobj): Update declaration.
8240 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8241 parameter.
8242 * dynobj.h (class Sized_dynobj): Update declaration.
8243 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8244 layout parameter.
8245 * plugin.h (class Sized_pluginobj): Update declaration.
8246
5f1ab67a
ILT
82472010-08-02 Ian Lance Taylor <iant@google.com>
8248
8249 PR 11866
8250 * output.cc (Output_segment::set_offset): Search for the first and
8251 last sections rather than assuming that the list is in order.
8252 (Output_segment::find_first_and_last_list): New function.
8253 * output.h (class Output_segment): Update declarations.
8254 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8255 (relro_strip_test_SOURCES): New variable.
8256 (relro_strip_test_DEPENDENCIES): New variable.
8257 (relro_strip_test_LDFLAGS): New variable.
8258 (relro_strip_test_LDADD): New variable.
8259 (relro_strip_test.so): New target.
8260
a8df5856
ILT
82612010-08-02 Ian Lance Taylor <iant@google.com>
8262
8263 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8264 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8265 (Target_i386::got_tlsdesc_section): New function.
8266 (Target_i386::got_section): Create space for GOT entries for
8267 TLSDESC relocations.
8268 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8269 R_386_TLS_GOTDESC.
8270 (Target_i386::Scan::global): Likewise.
8271 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8272 using TLSDESC GOT.
8273 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8274 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8275 (Target_x86_64::got_tlsdesc_section): New function.
8276 (Target_x86_64::got_section): Create space for GOT entries for
8277 TLSDESC relocations.
8278 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8279 R_386_TLS_GOTDESC.
8280 (Target_x86_64::Scan::global): Likewise.
8281 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8282 using TLSDESC GOT.
8283
0c10a0a6
ILT
82842010-08-02 Ian Lance Taylor <iant@google.com>
8285
8286 * testsuite/final_layout.sh: Use dc to convert from hex to
8287 decimal.
8288
41cbeecc
ST
82892010-07-29 Sriraman Tallam <tmsriram@google.com>
8290
8291 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8292 paramter to the call to gold::gc_process_relocs.
8293 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8294 paramter to the call to gold::gc_process_relocs.
8295 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8296 parameter to the call to gold::gc_process_relocs.
8297 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8298 template parameter to the call to gold::gc_process_relocs.
8299 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8300 paramter to the call to gold::gc_process_relocs.
8301 * gc.h (get_embedded_addend_size): New function.
8302 (gc_process_relocs): Save the size of the reloc for use by ICF.
8303 * icf.cc (get_section_contents): Get the addend from the text section
8304 for SHT_REL relocation sections.
8305 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8306 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8307 * int_encoding.h (read_from_pointer): New overloaded function.
8308 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8309 * testsuite/icf_sht_rel_addend_test.sh: New file.
8310 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8311 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8312
6ea55b82
RW
83132010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8314
8315 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8316 * Makefile.in: Regenerate.
8317 * testsuite/Makefile.in: Regenerate.
8318
9691462b
ILT
83192010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8320
8321 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8322 * gold/testsuite/debug_msg.cc: Likewise.
8323 * gold/testsuite/odr_violation1.cc
8324 * gold/testsuite/odr_violation2.cc
8325
76897331
CC
83262010-07-21 Cary Coutant <ccoutant@google.com>
8327
8328 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8329 string, and length fields.
8330 (Output_merge_string::Merged_strings_list): New type.
8331 (Output_merge_string::Merged_strings_lists): New typedef.
8332 (Output_merge_string): Replace merged_strings_ with
8333 merged_strings_lists_.
8334 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8335 Merged_strings_list per input object and section. Don't store pointer
8336 to the string. Don't store length with each merged string entry.
8337 (Output_merge_string::finalize_merged_data): Loop over list of merged
8338 strings lists. Recompute length of each merged string.
8339
78384e8f
CC
83402010-07-15 Cary Coutant <ccoutant@google.com>
8341
8342 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8343 here.
8344
783659f9
ILT
83452010-07-14 Ian Lance Taylor <iant@google.com>
8346
8347 * descriptors.cc (Descriptors::open): Report correct name in error
8348 message.
8349
131687b4
DK
83502010-07-13 Doug Kwan <dougkwan@google.com>
8351
8352 * arm.cc (Arm_input_section::Arm_input_section): For a
8353 SHT_ARM_EXIDX section, always keeps the input sections.
8354 (Arm_input_section::set_exidx_section_link): New method.
8355 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8356 has_errors_ to false.
8357 (Arm_exidx_input_section::has_errors,
8358 Arm_exidx_input_section::set_has_errors): New methods.
8359 (Arm_exidx_input_section::has_errors_): New data member.
8360 (Arm_relobj::get_exidx_shndx_list): New method.
8361 (Arm_output_section::append_text_sections_to_list): Do not skip
8362 section without SHF_EXECINSTR.
8363 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8364 errors.
2e702c99 8365 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8366 section header. Make error messages more verbose. Check for
8367 a non-executable section linked to an EXIDX section.
8368 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8369 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8370 check that there is no deferred EXIDX section if we exit early.
8371 Instead of not making an EXIDX section in case of an error, make one
8372 and set the has_errors flag of it.
8373 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8374 in a relocatable link.
8375 (Target_arm::do_relax): Look for the EXIDX output section instead of
8376 assuming that it is called .ARM.exidx.
2e702c99 8377 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8378 section list. Do not check for SHF_EXECINSTR section flags but
8379 skip any input section with errors.
8380 * output.cc (Output_section::Output_section): Initialize
8381 always_keeps_input_sections_ to false.
8382 (Output_section::add_input_section): Check for
8383 always_keeps_input_sections_.
8384 * output.h (Output_section::always_keeps_input_sections,
8385 Output_section::set_always_keeps_input_sections): New methods.
8386 (Output_section::always_keeps_input_sections): New data member.
8387
69517287
RÁE
83882010-07-13 Rafael Espindola <espindola@google.com>
8389
8390 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8391 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8392
82742395
ILT
83932010-07-13 Philip Herron <herron.philip@googlemail.com>
8394 Ian Lance Taylor <iant@google.com>
8395
8396 * output.h (Output_section_lookup_maps::add_merge_section):
8397 Correct check of whether value was inserted.
8398 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8399 (Output_section_lookup_maps::add_relaxed_input_section):
8400 Likewise.
8401 * arm.cc (Target_arm::got_section): Remove used local os.
8402 * i386.cc (Target_i386::got_section): Likewise.
8403 * x86_64.cc (Target_x86_64::got_section): Likewise.
8404 * sparc.cc (Target_sparc::got_section): Likewise.
8405 (Target_sparc::relocate): Remove unused local have_got_offset.
8406 * powerpc.cc (Target_powerpc::relocate): Likewise.
8407
f2d707b5
ILT
84082010-07-13 Ian Lance Taylor <iant@google.com>
8409
241531d6
ILT
8410 * compressed_output.cc (zlib_decompress): Fix signature in
8411 !HAVE_ZLIB_H case.
8412
f2d707b5
ILT
8413 * archive.cc (Archive::include_member): Unlock an external member
8414 of a thin archive. Don't bother to delete an object we know is
8415 NULL.
8416
a2e47362
CC
84172010-07-12 Cary Coutant <ccoutant@google.com>
8418
8419 * compressed_output.cc (zlib_decompress): New function.
8420 (get_uncompressed_size): New function.
8421 (decompress_input_section): New function.
8422 * compressed_output.h (get_uncompressed_size): New function.
8423 (decompress_input_section): New function.
8424 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8425 Handle compressed debug sections.
8426 * layout.cc (is_compressed_debug_section): New function.
8427 (Layout::output_section_name): Map compressed section names to
8428 canonical names.
8429 * layout.h (is_compressed_debug_section): New function.
8430 (is_debug_info_section): Recognize compressed debug sections.
8431 * merge.cc: Include compressed_output.h.
8432 (Output_merge_data::do_add_input_section): Handle compressed
8433 debug sections.
8434 (Output_merge_string::do_add_input_section): Handle compressed
8435 debug sections.
8436 * object.cc: Include compressed_output.h.
8437 (Sized_relobj::Sized_relobj): Initialize new data members.
8438 (build_compressed_section_map): New function.
8439 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8440 * object.h (Object::section_is_compressed): New method.
8441 (Object::do_section_is_compressed): New method.
8442 (Sized_relobj::Compressed_section_map): New type.
8443 (Sized_relobj::do_section_is_compressed): New method.
8444 (Sized_relobj::compressed_sections_): New data member.
8445 * output.cc (Output_section::add_input_section): Handle compressed
8446 debug sections.
8447 * reloc.cc: Include compressed_output.h.
8448 (Sized_relobj::write_sections): Handle compressed debug sections.
8449
ce279a62
CC
84502010-07-08 Cary Coutant <ccoutant@google.com>
8451
8452 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8453 weak when resolving to a dynamic def.
8454 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8455 for weak undef/dynamic def cases. Adjust callers.
8456 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8457 undef_binding_weak_.
8458 (Symbol_table::sized_write_globals): Adjust symbol binding.
8459 (Symbol_table::sized_write_symbol): Add binding parameter.
8460 * symtab.h (Symbol::set_undef_binding): New method.
8461 (Symbol::is_undef_binding_weak): New method.
8462 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8463 (Symbol_table::should_override): Add new parameter.
8464 (Symbol_table::sized_write_symbol): Add new parameter.
8465
8466 * testsuite/weak_undef_file1.cc: Add new test case.
8467 * testsuite/weak_undef_file2.cc: Fix header comment.
8468 * testsuite/weak_undef_test.cc: Add new test case.
8469
b2286c10
DK
84702010-06-29 Doug Kwan <dougkwan@google.com>
8471
8472 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8473 Initialize USE_SYMBOL_.
8474 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8475 definition.
8476 (Arm_reloc_property::uses_symbol_): New data member declaration.
8477 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8478 uses symbol value and symbol is undefined but not weakly undefined.
8479
4802450a
RÁE
84802010-06-28 Rafael Espindola <espindola@google.com>
8481
8482 * plugin.cc (Plugin::load): Use dlerror.
8483
e5ca47ba
ILT
84842010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8485
8486 * symtab.cc (detect_odr_violations): When reporting an ODR
8487 violation, report an object where the symbol is defined.
8488
8a75a161
DK
84892010-06-25 Doug Kwan <dougkwan@google.com>
8490
8491 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8492 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8493 definition.
8494 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8495 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8496 target hook to detect function points.
8497 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8498 * icf.h (Icf::check_section_for_function_pointers): Change type of
8499 parameter SECTION_NAME to const reference to std::string. Use
8500 target hook to determine if section may have unsafe pointers.
8501 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8502 method definition.
8503
42218b9f
RÁE
85042010-06-21 Rafael Espindola <espindola@google.com>
8505
8506 * fileread.cc (Input_file::find_fie): New
8507 (Input_file::open): Use Input_file::find_fie.
8508 * fileread.h (Input_file::find_fie): New
8509 * plugin.cc (set_extra_library_path): New.
8510 (Plugin::load): Add set_extra_library_path to the transfer vector.
8511 (Plugin_manager::set_extra_library_path): New.
8512 (Plugin_manager::add_input_file): Use the extra search path if set.
8513 (set_extra_library_path(): New.
8514 * plugin.h (Plugin_manager): Add set_extra_library_path and
8515 extra_search_path_.
8516
a0506cca
CC
85172010-06-19 Cary Coutant <ccoutant@google.com>
8518
8519 * layout.cc (gdb_sections): Add .debug_types.
8520 (lines_only_debug_sections): Likewise.
8521
6508b958
RÁE
85222010-06-18 Rafael Espindola <espindola@google.com>
8523
8524 * plugin.cc (add_input_file,add_input_library)
8525 (Plugin_manager::add_input_file): Make filename arguments const.
8526 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8527 const.
8528
3e235302
DK
85292010-06-16 Doug Kwan <dougkwan@google.com>
8530
8531 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8532 .ARM.attributes section if we have not merged any input
8533 attributes sections.
8534
106e8a6c
DK
85352010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8536
8537 * arm.cc: Allow combining objects with no EABI version
8538 information.
8539
91ff43fe
RÁE
85402010-06-15 Rafael Espindola <espindola@google.com>
8541
8542 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8543
68ed838c
ILT
85442010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8545
8546 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8547 (struct iovec): Correct !HAVE_READV definition.
8548
f3a2388f
CC
85492010-06-10 Cary Coutant <ccoutant@google.com>
8550
8551 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8552 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8553 reloc sections.
8554 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8555
8556 PR 11683
8557 * symtab.h (Symbol::is_placeholder): New member function.
8558 * target-reloc.h (relocate_section): Check for placeholder symbols.
8559
8560 * testsuite/Makefile.am (plugin_test_8): New test.
8561 (plugin_test_9): New test.
8562 * testsuite/Makefile.in: Regenerate.
8563
e1df38aa
NC
85642010-06-09 Nick Clifton <nickc@redhat.com>
8565
8566 * yyscript.y (input_list_element): Allow strings prefixed with
8567 the '-' character. Treat these as libraries.
8568 * script.cc (script_add_library): New function. Adds a library
8569 specified by "-l<name>" found in an input script.
8570 * script-c.h: Add prototype for script_add_library.
8571
25bbe950
DK
85722010-06-07 Doug Kwan <dougkwan@google.com>
8573
8574 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8575 Restrict stub-group size to be within long conditional branch
8576 range when working around cortex-A8 erratum.
8577
0f32ea4c
ILT
85782010-06-07 Damien Diederen <dd@crosstwine.com>
8579
8580 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8581 #ifdef typo.
8582
8fe2a369
ST
85832010-06-03 Sriraman Tallam <tmsriram@google.com>
8584
8585 PR gold/11658
8586 * output.cc
8587 (Output_section::Input_section_sort_entry::compare_section_ordering):
8588 Change to return non-zero correctly.
8589 (Output_section::Input_section_sort_section_order_index_compare
8590 ::operator()): Change to fix ambiguity in comparisons.
8591
6e9ba2ca
ST
85922010-06-01 Sriraman Tallam <tmsriram@google.com>
8593
8594 * gold.h (is_wildcard_string): New function.
8595 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8596 (Layout::layout_eh_frame): Ditto.
8597 (Layout::find_section_order_index): New method.
8598 (Layout::read_layout_from_file): New method.
8599 * layout.h (Layout::find_section_order_index): New method.
8600 (Layout::read_layout_from_file): New method.
8601 (Layout::input_section_position_): New private member.
8602 (Layout::input_section_glob_): New private member.
8603 * main.cc (main): Call read_layout_from_file here.
8604 * options.h (--section-ordering-file): New option.
8605 * output.cc (Output_section::input_section_order_specified_): New
8606 member.
8607 (Output_section::Output_section): Initialize new member.
8608 (Output_section::add_input_section): Add new parameter.
8609 Keep input sections when --section-ordering-file is used.
8610 (Output_section::set_final_data_size): Sort input sections when
8611 section ordering file is specified.
8612 (Output_section::Input_section_sort_entry): Add new parameter.
8613 Check sorting type.
8614 (Output_section::Input_section_sort_entry::compare_section_ordering):
8615 New method.
8616 (Output_section::Input_section_sort_compare::operator()): Change to
8617 consider section_order_index.
8618 (Output_section::Input_section_sort_init_fini_compare::operator()):
8619 Change to consider section_order_index.
8620 (Output_section::Input_section_sort_section_order_index_compare
8621 ::operator()): New method.
8622 (Output_section::sort_attached_input_sections): Change to sort
8623 according to section order when specified.
e1df38aa
NC
8624 (Output_section::add_input_section<32, true>): Add new parameter.
8625 (Output_section::add_input_section<64, true>): Add new parameter.
8626 (Output_section::add_input_section<32, false>): Add new parameter.
8627 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
8628 * output.h (Output_section::add_input_section): Add new parameter.
8629 (Output_section::input_section_order_specified): New
8630 method.
8631 (Output_section::set_input_section_order_specified): New method.
8632 (Input_section::Input_section): Initialize section_order_index_.
8633 (Input_section::section_order_index): New method.
8634 (Input_section::set_section_order_index): New method.
8635 (Input_section::section_order_index_): New member.
8636 (Input_section::Input_section_sort_section_order_index_compare): New
8637 struct.
8638 (Output_section::input_section_order_specified_): New member.
8639 * script-sections.cc (is_wildcard_string): Delete and move modified
8640 method to gold.h.
8641 (Output_section_element_input::Output_section_element_input): Modify
8642 call to is_wildcard_string.
8643 (Output_section_element_input::Input_section_pattern
8644 ::Input_section_pattern): Ditto.
8645 (Output_section_element_input::Output_section_element_input): Ditto.
8646 * testsuite/Makefile.am (final_layout): New test case.
8647 * testsuite/Makefile.in: Regenerate.
8648 * testsuite/final_layout.cc: New file.
8649 * testsuite/final_layout.sh: New file.
8650
3537c84b
RÁE
86512010-06-01 Rafael Espindola <espindola@google.com>
8652
8653 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8654
105b6afd
RÁE
86552010-06-01 Rafael Espindola <espindola@google.com>
8656
8657 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8658 visibility of symbols.
8659
29e11421
DK
86602010-05-27 Doug Kwan <dougkwan@google.com>
8661
8662 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8663 from start of output section instead of address for a local symbol
8664 in a merged or relaxed section when doing a relocatable link.
8665
5e0f337e
RÁE
86662010-05-26 Rafael Espindola <espindola@google.com>
8667
703d02da 8668 PR 11604
5e0f337e
RÁE
8669 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8670 adding sections the garbage collector removed.
8671 * gold/testsuite/Makefile.am: Add test.
8672 * gold/testsuite/Makefile.in: Regenerate.
8673 * gold/testsuite/plugin_test_7.sh: New.
8674 * gold/testsuite/plugin_test_7_1.c: New.
8675 * gold/testsuite/plugin_test_7_2.c: New.
8676
f4187277
RÁE
86772010-05-26 Rafael Espindola <espindola@google.com>
8678
8679 * script-sections.cc (Output_section_definition::set_section_addresses):
8680 Check for --section-start.
8681
5c388529
DK
86822010-05-26 Doug Kwan <dougkwan@google.com>
8683
8684 * arm.cc (Arm_scan_relocatable_relocs): New class.
8685 (Target_arm::relocate_special_relocatable): New method.
8686 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8687 (Arm_relocate_functions::thumb_branch_common): Same.
8688 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8689 instead of Default_scan_relocatable_relocs.
8690 * target-reloc.h (relocate_for_relocatable): Let target handle
8691 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8692 * target.h (Sized_target::relocate_special_relocatable): New method.
8693
bca1c3ae
ILT
86942010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8695
8696 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8697
0439c796
DK
86982010-05-23 Doug Kwan <dougkwan@google.com>
8699
8700 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8701 instead of a cast.
8702 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8703 with a direct branch, not a conditional branch, to a stub.
8704 * merge.cc (Output_merge_base::record_input_section): New method
8705 defintion.
8706 (Output_merge_data::do_add_input_section): Record input section if
8707 keeps-input-sections flag is set.
8708 (Output_merge_string::do_add_input_section): Ditto.
8709 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8710 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8711 INPUT_SECTIONS_.
8712 (Output_merge_base::keeps_input_sections,
8713 Output_merge_base::set_keeps_input_sections,
8714 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8715 method definitions.
8716 (Output_merge_base::Input_sections): New type declaration.
8717 (Output_merge_base::input_sections_begin,
8718 Output_merge_base::input_sections_end,
8719 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8720 (Output_merge_base::bool keeps_input_sections_,
8721 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8722 Output_merge_base::input_sections_): New data members.
8723 (Output_merge_data::do_set_keeps_input_sections): New method
8724 defintion.
8725 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8726 * output.cc (Output_section::Input_section::relobj): Move method
8727 defintion from class declaration to here and handle merge sections.
8728 (Output_section::Input_section::shndx): Ditto.
8729 (Output_section::Output_section): Remove initializations of removed
8730 data members and initialize new data member LOOKUP_MAPS_.
8731 (Output_section::add_input_section): Set keeps-input-sections flag
8732 for a newly created merge output section as appropriate. Adjust code
8733 to use Output_section_lookup_maps class.
8734 (Output_section::add_relaxed_input_section): Adjst code for lookup
8735 maps code refactoring.
2e702c99 8736 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
8737 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8738 class. If adding input section to a newly created merge output
8739 section fails, remove the new merge section.
8740 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 8741 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 8742 (Output_section::find_merge_section): Ditto.
0439c796 8743 (Output_section::build_lookup_maps): New method defintion.
2e702c99 8744 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
8745 Output_section_lookup_maps class.
8746 (Output_section::get_input_sections): Export merge sections. Adjust
8747 code to use Output_section_lookup_maps class.
8748 (Output_section:::add_script_input_section): Adjust code to use
8749 Output_section_lookup_maps class. Update lookup maps for merge
8750 sections also.
8751 (Output_section::discard_states): Use Output_section_lookup_maps.
8752 (Output_section::restore_states): Same.
8753 * output.h (Merge_section_properties): Move class defintion out of
8754 Output_section.
8755 (Output_section_lookup_maps): New class.
8756 (Output_section::Input_section::is_merge_section): New method
8757 defintion.
8758 (Output_section::Input_section::relobj): Move defintion out of class
8759 defintion. Declare method only.
8760 (Output_section::Input_section::shndx): Ditto.
8761 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 8762 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
8763 (Output_section::Merge_section_by_properties_map,
8764 Output_section::Output_section_data_by_input_section_map,
8765 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8766 Remove types.
2e702c99 8767 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
8768 KEEPS_INPUT_SECTIONS.
8769 (Output_section::build_lookup_maps): New method declaration.
8770 (Output_section::merge_section_map_,
8771 Output_section::merge_section_by_properties_map_,
8772 Output_section::relaxed_input_section_map_,
8773 Output_section::is_relaxed_input_section_map_valid_): Remove data
8774 members.
8775 (Output_section::lookup_maps_): New data member.
8776
76295588
L
87772010-05-21 Doug Kwan <dougkwan@google.com>
8778
8779 PR gold/11619
8780 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8781 avoid a compilation error.
8782
d103a984
RÁE
87832010-05-19 Rafael Espindola <espindola@google.com>
8784
8785 * script-sections.cc (Output_section_definition::allocate_to_segment):
8786 Update the phdrs_list even when the output section is NULL.
8787 * testsuite/Makefile.am: Add test.
8788 * testsuite/Makefile.in: Regenerate.
8789 * testsuite/script_test_9.cc: New.
8790 * testsuite/script_test_9.sh: New.
8791 * testsuite/script_test_9.t: New.
8792
6625d24e
DK
87932010-05-19 Doug Kwan <dougkwan@google.com>
8794
8795 * arm.cc (Arm_input_section::original_size): New method.
8796 (Arm_input_section::do_addralign): Add a cast.
8797 (Arm_input_section::do_output_offset): Remove static cast.
8798 (Arm_input_section::original_addralign,
8799 Arm_input_section::original_size_): Change type to uint32_t.
8800 (Arm_input_section::init): Add safe casts for section alignment
8801 and size.
8802 (Arm_input_section::set_final_data_size): Do not set address and
8803 offset of stub table.
8804 (Arm_output_section::fix_exidx_coverage): Change use of of
8805 Output_section::Simple_input_section to that of
8806 Output_section::Input_section.
8807 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8808 except for the first pass.
8809 * output.cc (Output_section::get_input_sections): Change type of
8810 input_sections to std::list<Input_section>.
8811 (Output_section::add_script_input_section): Rename from
8812 Output_section::add_simple_input_section. Change type of SIS
8813 parameter from Simple_input_section to Input_section.
8814 * output.h (Output_section::Simple_input_section): Remove class.
8815 (Output_section::Input_section): Change class visibility to public.
8816 (Output_section::Input_section::addralign): Use stored alignments
8817 for special input sections if set.
8818 (Output_section::Input_section::set_addralign): New method.
8819 (Output_section::get_input_sections): Change parameter type from
8820 list of Simple_input_section to list of Input_section.
8821 (Output_section::add_script_input_section): Rename from
8822 Output_section::add_simple_input_section. Change first parameter's
8823 type from Simple_input_section to Input_section and remove the
8824 second and third parameters.
8825 * script-sections.cc (Input_section::Input_section_list): Change
8826 type to list of Output_section::Input_section/
8827 (Input_section_info::Input_section_info): Change parameter type of
8828 INPUT_SECTION to Output_section::Input_section.
8829 (Input_section_info::input_section): Change return type.
8830 (Input_section_info::input_section_): Change type to
8831 Output_section::Input_section.
8832 (Output_section_element_input::set_section_addresses): Adjust code
8833 to use Output_section::Input_section instead of
8834 Output_section::Simple_input_section. Adjust code for renaming
8835 of Output_section::add_simple_input_section.
8836 (Orphan_output_section::set_section_addresses): Ditto.
8837
e1e82ea4
RW
88382010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8839
8840 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8841 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8842
91e75c8a
RÁE
88432010-05-18 Rafael Espindola <espindola@google.com>
8844
8845 * options.cc (General_options::finalize): Handle -nostdlib.
8846 * options.h (nostdlib): New option.
8847 * script.cc (script_add_search_dir): Handle -nostdlib.
8848
da59ad79
DK
88492010-05-12 Doug Kwan <dougkwan@google.com>
8850
8851 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8852 attributes section only if there no attributes section after merging.
8853 (Target_arm::merge_object_attributes): Move value of
e1df38aa 8854 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
8855 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8856 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8857 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8858 and arm_attr_merge_7.stdout.
8859 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8860 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8861 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8862 arm_attr_merge_7b.o): New rules.
8863 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8864 arm_attr_merge_7
8865 * testsuite/Makefile.in: Regenerate.
8866 * testsuite/arm_attr_merge.sh: New file.
8867 * testsuite/arm_attr_merge_[67][ab].s: Same.
8868
3e01a7fd
NC
88692010-05-05 Nick Clifton <nickc@redhat.com>
8870
8871 * po/es.po: Updated Spanish translation.
8872
7ad2014a
L
88732010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8874
8875 * Makefile.am (install-exec-local): Properly install gold as
8876 default cross linker.
8877 * Makefile.in: Regenerated.
8878
4fda8867
NC
88792010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8880 Nick Clifton <nickc@redhat.com>
8881
8882 * configure.ac (install_as_default): Define and set to false
8883 unless --enable-gold or --enable-gold=both/gold has been
8884 specified.
8885 * configure: Regenerate.
8886
8887 * Makefile.am (install-exec-local): Install the executable as
8888 'ld.gold'. If install_as_default is true then also install it as
8889 'ld'.
8890 * Makefile.in: Regenerated.
8891
bd288ea2
ILT
88922010-04-24 Ian Lance Taylor <iant@google.com>
8893
8894 * layout.cc (Layout::layout_reloc): In relocatable link don't
8895 combine reloc sections for grouped sections.
8896
ef38fd8a
ST
88972010-04-23 Sriraman Tallam <tmsriram@google.com>
8898
8899 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8900 sections that are not ordinary to icf.
8901 * icf.cc (get_section_contents): Handle relocation pointing to section
8902 with no object or shndx information.
8903 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8904 * testsuite/Makefile.in: Regenerate.
8905 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8906 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8907
f6973bdc
ILT
89082010-04-22 Ian Lance Taylor <iant@google.com>
8909
8910 * expression.cc (Expression::Expression_eval_info): Add
8911 result_alignment_pointer field.
8912 (Expression::eval_with_dot): Add result_alignment_pointer
8913 parameter. Change all callers.
8914 (Expression::eval_maybe_dot): Likewise.
8915 (class Binary_expression): Add alignment_pointer parameter to
8916 left_value and right_value. Change all callers.
8917 (BINARY_EXPRESSION): Set result alignment.
8918 (class Trinary_expression): Add alignment_pointer parameter to
8919 arg2_value and arg3_value. Change all callers.
8920 (Trinary_cond::value): Set result alignment.
8921 (Max_expression::value, Min_expression::value): Likewise.
8922 (Align_expression::value): Likewise.
8923 * script-sections.cc (class Sections_element): Add dot_alignment
8924 parameter to set_section_addresses virtual function. Update
8925 instantiations.
8926 (class Output_section_element): Likewise.
8927 (Script_sections::create_segments): Add dot_alignment parameter.
8928 Change all callers.
8929 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8930 (Script_sections::set_phdrs_clause_addresses): Likewise.
8931 * script-sections.h: Update declarations.
8932 * script.h: Update declarations.
8933 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8934 min_p_align.
8935 * testsuite/script_test_3.t: Set large alignment.
8936 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8937 segment has expected alignment.
8938
9c9c98a5
NC
89392010-04-22 Nick Clifton <nickc@redhat.com>
8940
8941 * po/gold.pot: Updated by the Translation project.
8942 * po/vi.po: Updated Vietnamese translation.
8943
2253bfba
L
89442010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8945
8946 * testsuite/Makefile.am (check_PROGRAMS): Add
8947 icf_virtual_function_folding_test.
8948 * testsuite/Makefile.in: Regenerated.
8949
85fdf906
AH
89502010-04-15 Andrew Haley <aph@redhat.com>
8951
8952 * options.h (merge_exidx_entries): New option.
8953 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8954 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8955 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8956 (Target_arm::merge_exidx_entries): New function.
8957 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8958 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8959 to Arm_exidx_fixup constructor.
8960 Add new arg, merge_exidx_entries.
8961 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
8962 Arm_output_section::fix_exidx_coverage.
8963
ce97fa81
ST
89642010-04-18 Sriraman Tallam <tmsriram@google.com>
8965
8966 * icf.cc (get_section_contents): Check for preemptible functions.
8967 Ignore addend when appropriate.
8968 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
8969 section folded.
8970 (add_from_relobj): Check for section folded.
8971 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
8972 * symtab.h (should_add_dynsym_entry): Add new parameter.
8973 * target-reloc.h (scan_relocs): Check for section folded.
8974 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
8975 Check reloc types for function pointers in shared objects.
8976 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
8977 case.
8978 (icf_preemptible_functions_test): New test case.
8979 (icf_string_merge_test): New test case.
8980 * testsuite.Makefile.in: Regenerate.
8981 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
8982 bar_glob. Refactor code.
8983 * testsuite/icf_preemptible_functions_test.cc: New file.
8984 * testsuite/icf_preemptible_functions_test.sh: New file.
8985 * testsuite/icf_string_merge_test.cc: New file.
8986 * testsuite/icf_string_merge_test.sh: New file.
8987 * testsuite/icf_virtual_function_folding_test.cc: New file.
8988 * testsuite/icf_virtual_function_folding_test.sh: New file.
8989
04ceb17c
DK
89902010-04-14 Doug Kwan <dougkwan@google.com>
8991
8992 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
8993 for local symbol recounting if we remove a section due to ICF.
8994 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
8995 there are no regular objects in input.
8996
153e7da4
DK
89972010-04-13 Doug Kwan <dougkwan@google.com>
8998
8999 * arm.cc (Arm_input_section::set_final_data_size): Compute
9000 accurate final data size instead of using current data size.
9001
4dbd9faf
DK
90022010-04-09 Doug Kwan <dougkwan@google.com>
9003
9004 * layout.cc (Layout::choose_output_section): Handle script section
9005 types.
9006 (Layout::make_output_section_for_script): Add section type parameter.
9007 Handle script section types.
9008 * layout.h (Layout::make_output_section_for_script): Add section
9009 type parameter.
9010 * output.cc (Output_section::Output_section): Initialize data member
9011 is_noload_.
9012 (Output_section::do_reset_address_and_file_offset): Do not set address
9013 to 0 if section is a NOLOAD section.
9014 * output.h (Output_section::is_noload): New method.
9015 (Output_section::set_is_noload): Ditto.
9016 (Output_section::is_noload_): New data member.
9017 * script-c.h (Script_section_type): New enum type.
9018 (struct Parser_output_section_header): Add new file section_type.
9019 * script-sections.cc (Sections_element::output_section_name): Add
9020 parameter for returning script section type.
9021 (Output_section_definition::output_section_name): Ditto.
9022 (Output_section_definition::section_type)P; New method.
9023 (Output_section_definiton::script_section_type_name): Ditto.
9024 (Output_section_definition::script_section_type_): New data member.
9025 (Output_section_definition::Output_section_definition): Initialize
9026 data member Output_section_definition::script_section_type_.
9027 (Output_section_definition::create_sections): Pass script section type
9028 to Layout::make_output_section_for_script.
9029 (Output_section_definition::output_section_name): Return script
9030 section type to caller.
9031 (Output_section_definition::set_section_address): Do not advance
9032 dot value and load address if section type is NOLOAD. Set address
9033 of NOLOAD sections regardless of section flags.
9034 (Output_section_definition::print): Print section type if it is
9035 not SCRIPT_SECTION_TYPE_NONE.
9036 (Output_section_definition::section_type): New method.
9037 (Output_section_definition::script_section_type_name): Ditto.
9038 (Script_sections::output_section_name): Add new parameter
9039 PSECTION_TYPE for returning script section type. Pass it to
9040 section elements. Handle discard sections.
9041 (Sort_output_sections::operator()): Handle NOLOAD sections.
9042 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 9043 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
9044 returning script section type.
9045 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
9046 INFO and NOLOAD.
9047 * yyscript.y (union): Add new field SECTION_TYPE.
9048 (COPY, DSECT, INFO, NOLOAD): New tokens.
9049 (opt_address_and_section_type): Change type to output_section_header.
9050 (section_type): New non-terminal
9051 (section_header): Handle section type.
2253bfba 9052 (opt_address_and_section_type): Return section type value.
4dbd9faf 9053
721ea635
L
90542010-04-09 H.J. Lu <hongjiu.lu@intel.com>
9055
9056 * testsuite/plugin_common_test_1.c (foo): Add prototype.
9057 * testsuite/plugin_common_test_2.c (foo): Likewise.
9058
6bf924b0
DK
90592010-04-08 Doug Kwan <dougkwan@google.com>
9060
9061 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
9062 Output_merge_data.
9063 * output.cc (Output_section::add_merge_input_section): Simplify
9064 code and return status of Output_merge_base::add_input_section.
e1df38aa 9065 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
9066 returns true.
9067
24af6f92
DK
90682010-04-07 Doug Kwan <dougkwan@google.com>
9069
9070 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9071 if section is marked as containing instructions but has no mapping
9072 symbols.
9073 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9074 correct section index.
9075 (Arm_relobj::find_linked_text_section): Ditto.
9076
00698fc5
CC
90772010-04-07 Cary Coutant <ccoutant@google.com>
9078
9079 * archive.cc (include_member): Destroy Read_symbols_data object before
9080 releasing file.
9081 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9082 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9083 (Read_symbols_data::~Read_symbols_data) New destructor.
9084 (Section_relocs::Section_relocs) New constructor.
9085 (Section_relocs::~Section_relocs) New destructor.
9086 (Read_relocs_data::Read_relocs_data) New constructor.
9087 (Read_relocs_data::~Read_relocs_data) New destructor.
9088 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9089 pointers to NULL after deleting.
9090
7296d933
DK
90912010-04-07 Doug Kwan <dougkwan@google.com>
9092
9093 * arm.cc: Replace "endianity" with "endianness" in comments.
9094 (Arm_exidx_cantunwind): Ditto.
9095 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9096 (Arm_relobj::merge_flags_and_attributes): New method.
9097 (Arm_relobj::merge_flags_and_attributes_): New data member.
9098 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9099 (Arm_relobj::scan_sections_for_stubs): Ditto.
9100 (Arm_relobj::do_read_symbols): Check to see if we really want to
9101 merge processor-specific flags and attributes. Exit early if
9102 an object is empty except for section names and the undefined symbol.
9103 (Target_arm::do_finalize_sections): Move check for ELF format to
9104 Arm_relobj::do_read_symbols. Merge processor specific flags and
9105 attributes from a regular object only when we have determined that
9106 it is aapropriate. Do not create an .ARM.attributes section in
9107 output if there is no regular input object.
9108 (Target_arm::merge_processor_specific_flags): Check
9109 --warn-mismatch before printing any error.
9110 (Target_arm::merge_object_attributes): Ditto.
9111 * gold.cc (queue_middle_tasks): Handle the case in which there is
9112 no regular object in input.
9113 * options.cc (General_options::parse_EB): New method.
9114 (General_options::parse_EL): Same.
9115 (General_options::General_options): Initialize endianness_.
9116 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9117 New options.
9118 (General_options::Endianness): New enum.
9119 (General_options::endianness): New method.
9120 (General_options::endianness_): New data member.
9121 * parameters.cc (Parameters::set_options): Check target endianness.
9122 (Parameters::set_target_once): Ditto.
9123 (Parameters::check_target_endianness): New method.
9124 (parameters_force_valid_target): If either -EL or -EB is specified,
9125 use it to define endianness of default target.
9126 * parameters.h (Parameters::check_target_endianness): New method
9127 declaration.
9128 * target.h (class Target): Change "endianity" to "endianness"
9129 in comments.
9130
efc8d4f2
RW
91312010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9132
9133 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9134 * configure: Regenerate.
9135 * Makefile.in: Regenerate.
9136 * testsuite/Makefile.in: Regenerate.
9137
be234d88
CC
91382010-04-06 Cary Coutant <ccoutant@google.com>
9139
9140 gcc PR lto/42757
9141 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9142 prevailing definitions of common symbols.
9143 * testsuite/plugin_test_6.sh: New test case.
9144 * testsuite/plugin_common_test_1.c: New test case.
9145 * testsuite/plugin_common_test_2.c: New test case.
9146 * testsuite/Makefile.am (plugin_test_6): New test case.
9147 * testsuite/Makefile.in: Regenerate.
9148
bd32c6bd
NC
91492010-04-06 Nick Clifton <nickc@redhat.com>
9150
9151 * po/vi.po: New Vietnamese translation.
9152
323c532f
DK
91532010-03-30 Doug Kwan <dougkwan@google.com>
9154
9155 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9156
4fcd97eb
DK
91572010-03-25 Doug Kwan <dougkwan@google.com>
9158
9159 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9160 to avoid a conversion warning on a 32-bit host.
9161
4ebf39db
ILT
91622010-03-24 Ian Lance Taylor <iant@google.com>
9163
9164 * testsuite/script_test_3.t: Add a TLS segment.
9165 * testsuite/Makefile.am (check_PROGRAMS): Add
9166 tls_phdrs_script_test.
9167 (tls_phdrs_script_test_SOURCES): Define.
9168 (tls_phdrs_script_test_DEPENDENCIES): Define.
9169 (tls_phdrs_script_test_LDFLAGS): Define.
9170 (tls_phdrs_script_test_LDADD): Define.
9171 * testsuite/Makefile.in: Rebuild.
9172
4a599bdd
CC
91732010-03-23 Cary Coutant <ccoutant@google.com>
9174
9175 * fileread.cc (find_or_make_view): Fix comment.
9176
6c93b22c
ILT
91772010-03-23 Ian Lance Taylor <iant@google.com>
9178
9179 * script-sections.cc (class Orphan_section_placement): Define
9180 PLACE_TLS and PLACE_TLS_BSS.
9181 (Orphan_section_placement::Orphan_section_placement): Initialize
9182 new places.
9183 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9184 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9185 (tls_script_test_SOURCES): Define.
9186 (tls_script_test_DEPENDENCIES): Define.
9187 (tls_script_test_LDFLAGS): Define.
9188 (tls_script_test_LDADD): Define.
9189 * testsuite/Makefile.in: Rebuild.
9190
a2c7281b
DK
91912010-03-22 Doug Kwan <dougkwan@google.com>
9192
9193 * arm.cc (Arm_relocate_functions::abs8,
9194 Arm_relocate_functions::abs16): Use correct check for overflow
9195 specified in the ARM ELF specs.
9196 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9197 target of a BLX instruction specially.
9198 (Reloc_stub::stub_type_for_reloc): Ditto.
9199 (Relocate::relocate): Use symbolic names instead of numeric relocation
9200 codes to report error.
9201 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9202 workaround.
9203 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9204 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9205 thumb2_blx_out_of_range.stdout
9206 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9207 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9208 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9209 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9210 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9211 thumb2_blx_in_range, thumb2_blx_in_range.o,
9212 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9213 thumb2_blx_out_of_range.o): New rules.
2e702c99 9214 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
9215 thumb2_blx_in_range and thumb2_blx_out_of_range.
9216 * testsuite/Makefile.in: Regenerate.
9217 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9218 * testsuite/thumb_blx_in_range.s: New file.
9219 * testsuite/thumb_blx_out_of_range.s: New file.
9220
b0193076
RÁE
92212010-03-22 Rafael Espindola <espindola@google.com>
9222
9223 * archive.cc (Should_include): Move to archive.h.
9224 (should_include_member): Make it a member of Archive.
9225 (Lib_group): New.
9226 (Add_lib_group_symbols): New.
9227 * archive.h: Include options.h.
9228 (Archive_member): Moved from Archive.
9229 (Should_include): Moved from archive.cc.
9230 (Lib_group): New.
9231 (Add_lib_group_symbols): New.
9232 * dynobj.cc (do_should_include_member): New.
9233 * dynobj.h (do_should_include_member): New.
9234 * gold.cc (queue_initial_tasks): Update call to queue.
9235 * main.cc (main): Print lib group stats.
9236 * object.cc (do_should_include_member): New.
9237 * object.h: Include archive.h.
9238 (Object::should_include_member): New.
9239 (Object::do_should_include_member): New.
9240 (Sized_relobj::do_should_include_member): New.
9241 * options.cc (General_options::parse_start_lib): New.
9242 (General_options::parse_end_lib): New.
9243 (Input_arguments::add_file): Handle lib groups.
9244 (Input_arguments::start_group): Check we are not in a lib.
9245 (Input_arguments::start_lib): New.
9246 (Input_arguments::end_lib): New.
9247 * options.h (General_options): Add start_lib and end_lib.
9248 (Input_argument::lib_): New.
9249 (Input_argument::lib): New.
9250 (Input_argument::is_lib): New.
9251 (Input_file_lib): New.
9252 (Input_arguments::in_lib_): New.
9253 (Input_arguments::in_lib): New.
9254 (Input_arguments::start_lib): New.
9255 (Input_arguments::end_lib_): New.
9256 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9257 in unused members as preempted.
9258 (Sized_pluginobj::do_should_include_member): New.
9259 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9260 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9261 return the blocker.
9262 (Read_symbols::do_whole_lib_group): New.
9263 (Read_symbols::do_lib_group): New.
9264 (Read_symbols::do_read_symbols): Handle lib groups.
9265 (Read_symbols::get_name): Handle lib groups.
9266 * readsyms.h (Read_symbols): Add an archive member pointer.
9267 (Read_symbols::do_whole_lib_group): New.
9268 (Read_symbols::do_lib_group): New.
9269 (Read_symbols::member_): New.
9270 * script.cc (read_input_script): Update call to queue_soon.
9271
d099120c
DK
92722010-03-19 Doug Kwan <dougkwan@google.com>
9273
9274 * arm.cc (Stub_table::Stub_table): Initialize new data members
9275 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9276 (Stub_table::add_reloc_stub): Assign stub offset and update
9277 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9278 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9279 New data members.
2e702c99 9280 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9281 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9282 instead of going over all reloc stubs.
2e702c99 9283 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9284 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9285 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9286 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9287 Stringpool_template::offset_.
9288 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9289 Stringpool_template::offset_ to zero.
9290
1aa37384
DK
92912010-03-15 Doug Kwan <dougkwan@google.com>
9292
9293 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9294 offset_.
9295 (Stringpool_template::new_key_offset): New method.
9296 (Stringpool_template::add_string): Assign offsets when adding new
9297 strings.
9298 (Stringpool_template::set_string_offsets): Do not set string offsets
9299 when not optimizing.
9300 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9301 member size_.
2e702c99
RM
9302 (Chunked_vector::clear): Clear size_.
9303 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9304 (Chunked_vector::size): Return size_.
9305 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9306 (Chunked_vector::size_): New data member.
1aa37384
DK
9307 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9308 (Stringpool_template::new_key_offset): New method declaration.
9309 (Stringpool_template::offset_): New data member.
9310
b672b057
RÁE
93112010-03-15 Rafael Espindola <espindola@google.com>
9312
9313 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9314 Add_symbols' constructor.
9315 * readsyms.h (Add_symbols): Remove the input_group member.
9316
b6848d3c
ILT
93172010-03-10 Ian Lance Taylor <iant@google.com>
9318
9319 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9320 target to ask whether a reference to a symbol requires a stack
9321 split.
9322 * target.h (Target::is_call_to_non_split): New function.
9323 (Target::do_is_call_to_non_split): Declare virtual function.
9324 * target.cc: Include "symtab.h".
9325 (Target::do_is_call_to_non_split): New function.
9326 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9327
a2a5469e
CC
93282010-03-10 Cary Coutant <ccoutant@google.com>
9329
9330 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9331 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9332 (File_read::open[2]): Add whole_file_view_ to list of views.
9333 (File_read::make_view): Remove test of whole_file_view_.
9334 (File_read::find_or_make_view): Create whole_file_view_ if
9335 necessary.
9336 (File_read::clear_views): Replace bool parameter with enum;
9337 adjust all callers. Don't delete views with permanent data;
9338 do delete cached views and views from archives if
9339 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9340 if clearing the corresponding view.
9341 * fileread.h (File_read::Clear_views_mode): New enum.
9342 (File_read::View::is_permanent_view): New method.
9343 (File_read::clear_views): Replace bool parameter
9344 with enum; adjust all callers.
9345 * options.h (General_options): Change keep_files_mapped option;
9346 add map_whole_files.
9347 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9348 releasing the file.
9349 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9350 the file.
9351
8861f32b
DM
93522010-03-10 David S. Miller <davem@davemloft.net>
9353
9354 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9355
d62d0f5f
ST
93562010-03-09 Sriraman Tallam <tmsriram@google.com>
9357
9358 * icf.cc (get_section_contents): Add '@' marker after processing the
9359 merge reloc.
9360
9177756d
DK
93612010-03-08 Doug Kwan <dougkwan@google.com>
9362
9363 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9364 due to a conversion warning.
9365 (Arm_relobj::update_output_local_symbol_count): Check for local
9366 symbol with unset output index.
9367
9e9e071b
ILT
93682010-03-05 Ian Lance Taylor <iant@google.com>
9369
9370 * options.h (class General_options): Add --spare-dynamic-tags.
9371 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9372 --spare-dynamic-tags.
9373
a81ee015
ILT
93742010-03-05 Ian Lance Taylor <iant@google.com>
9375
9376 * incremental.cc: Include "libiberty.h".
9377
44ec90b9
RO
93782010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9379
9380 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9381 function, is_info_ member.
9382 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9383 (Versions::Versions): Update caller.
9384 (Versions::define_base_version): Likewise.
9385 (Versions::add_def): Likewise.
9386
0897ed3b
ST
93872010-03-03 Sriraman Tallam <tmsriram@google.com>
9388
9389 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9390 (Scan::possible_function_pointer_reloc): New function.
9391 (Scan::local_reloc_may_be_function_pointer): Change to call
9392 possible_function_pointer_reloc.
9393 (Scan::global_reloc_may_be_function_pointer): Ditto.
9394 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9395 relocations in ".data.rel.ro._ZTV" section.
9396 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9397 * testsuite/icf_safe_so_test.cc: Ditto.
9398 * testsuite/icf_safe_test.cc: Ditto.
9399 * testsuite/icf_safe_test.sh: Ditto.
9400
d3bbad62
ILT
94012010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9402 Ian Lance Taylor <iant@google.com>
9403
9404 * target-reloc.h (relocate_section): Check the symbol table index
9405 for -1U before setting the local symbol index.
9406 (scan_relocatable_relocs): If copying the relocation, record that
9407 the local symbol is required.
9408 * object.h (Symbol_value::is_output_symtab_index_set): New
9409 function.
9410 (Symbol_value::may_be_discarded_from_output_symtab): New
9411 function.
9412 (Symbol_value::has_output_symtab_entry): New function.
9413 (Symbol_value::needs_output_symtab_entry): Remove.
9414 (Symbol_value::output_symtab_index): Make sure the symbol index is
9415 set.
9416 (Symbol_value::set_output_symtab_index): Make sure the symbol
9417 index is not set. Make sure the new index is valid.
9418 (Symbol_value::set_must_have_output_symtab_entry): New function.
9419 (Symbol_value::has_output_dynsym_entry): New function.
9420 (Symbol_value::set_output_dynsym_index): Make sure the new index
9421 is valid.
9422 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9423 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9424 local symbol if permitted.
9425 (Sized_relobj::do_finalize_local_symbols): Call
9426 is_output_symtab_index_set rather than needs_output_symtab_entry.
9427 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9428 rather than needs_output_symtab_entry. Call
9429 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9430 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9431 is_output_symtab_index_set rather than needs_output_symtab_entry.
9432 * testsuite/discard_locals_relocatable_test.c: New file.
9433 * testsuite/discard_locals_test.sh: Test -r.
9434 * testsuite/Makefile.am (check_DATA): Add
9435 discard_locals_relocatable_test1.syms,
9436 discard_local_relocatable_test2.syms.
9437 (MOSTLYCLEANFILES): Likewise. Also add
9438 discard_locals_relocatable_test1.lout and
9439 discard_locals_relocatable_test2.out.
9440 (discard_locals_relocatable_test1.syms): New target.
9441 (discard_locals_relocatable_test.o): New target.
9442 (discard_locals_relocatable_test1.out): New target.
9443 (discard_locals_relocatable_test2.syms): New target.
9444 (discard_locals_relocatable_test2.out): New target.
9445 (various): Add missing ../ld-new dependencies.
9446 * testsuite/Makefile.in: Rebuild.
9447
7e8ccf26
NC
94482010-03-03 Nick Clifton <nickc@redhat.com>
9449
9450 * po/fi.po: New Finnish translation.
9451
2a0ff005
DK
94522010-03-01 Doug Kwan <dougkwan@google.com>
9453
9454 * layout.cc (Layout::Layout): Force section types of .init_array*,
9455 .preinit_array* and .fini_array* sections.
9456 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9457 Fix check of return value of std::string::find.().
9458 (Output_section::Input_section_sort_compare::operator()): Remove
9459 comment about .init_array.
9460 (Output_section::Input_section_sort_init_fini_compare::operator()):
9461 New method.
9462 (Output_section::sort_attached_input_sections): Handle .init_array
9463 and .fini_array specially.
9464 * output.h (Output_section::Inut_section_sort_compare): Update
9465 comment.
9466 (Output_section::Input_section_sort_init_fini_compare): New struct.
9467
c3e4ae29
DK
94682010-02-26 Doug Kwan <dougkwan@google.com>
9469
9470 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9471 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9472 * testsuite/debug_msg.sh: Avoid matching source line number for
9473 use of global variable undef_int.
9474
2fd9ae7a
DK
94752010-02-26 Doug Kwan <dougkwan@google.com>
9476
9477 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9478 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9479 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9480 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9481 * options.cc (General_options::General_options): Initialize member
9482 fix_v4bx_.
9483 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9484 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9485 and rm_no_fix_v4bx.stdout
9486 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9487 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9488 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9489 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9490 and arm_no_fix_v4bx.
9491 * Makefile.in: Regenerate.
9492 * testsuite/arm_fix_v4bx.s: New file.
9493 * testsuite/arm_fix_v4bx.sh: Ditto.
9494
67ec7d0b
DK
94952010-02-24 Doug Kwan <dougkwan@google.com>
9496
9497 * arm.cc (Target_arm::got_section): Make the .got section the first
9498 non RELRO section in the data segment.
9499 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9500 suffixes of section names.
9501
10165461
DK
95022010-02-24 Doug Kwan <dougkwan@google.com>
9503
9504 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9505 flags and attributes merging if an input file is a binary file.
9506 * fileread.cc (Input_file::open): Record format of original file.
9507 * fileread.h (Input_file::Format): New enum type.
2e702c99 9508 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9509 (Input_file::format): New method definition.
9510 (Input_file::format_):: New data member.
9511
4a54abbb
DK
95122010-02-24 Doug Kwan <dougkwan@google.com>
9513
9514 * arm.cc (Arm_output_data_got): New class.
9515 (ARM_TCB_SIZE): New constant
9516 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9517 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9518 If user uses a script with a SECTIONS clause, issue only a warning
9519 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9520 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9521 garbage collection.
9522 (Target_arm::got_mode_index_entry): Handle static linking.
9523 (Target_arm::Scan::local): Ditto.
9524 (Target_arm::Scan::global): Ditto.
9525 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9526 all incorrectly implemented relocations.
e1df38aa 9527 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
9528 Arm_output_section::fix_exidx_coverage.
9529 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9530 from ".ARM.exidx." and ".ARM.extab.".
9531
ca419a6f
ILT
95322010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9533
9534 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9535 section if it does not already exist.
9536 * attributes.cc (Attributes_section_data::Attributes_section_data):
9537 Don't crash if size is zero.
9538
135b9c78
ILT
95392010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9540 Ian Lance Taylor <iant@google.com>
9541
9542 * gold.cc (queue_middle_tasks): If no input files were opened,
9543 exit.
9544 * workqueue.h (Task_function::Task_function): Assert that there is
9545 a blocker.
9546
bb0bfe4f
DK
95472010-02-22 Doug Kwan <dougkwan@google.com>
9548
9549 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9550 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9551 types to avoid warnings due to different uint64_t implementations
9552 on different hosts.
9553
2a2b6d42
DK
95542010-02-21 Doug Kwan <dougkwan@google.com>
9555
9556 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9557 handling of the maximum backward branch offset.
2e702c99 9558 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
9559 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9560 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 9561 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
9562 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9563 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9564 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9565 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9566 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9567 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9568 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9569 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9570 thumb2_bl_out_of_range.o): New rules.
9571 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9572 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9573 thumb2_bl_out_of_range
9574 * testsuite/Makefile.in: Regenerate.
9575 * testsuite/arm_bl_in_range.s: New file.
9576 * testsuite/arm_bl_out_of_range.s: Ditto.
9577 * testsuite/arm_branch_in_range.sh: Ditto.
9578 * testsuite/arm_branch_range.t: Ditto.
9579 * testsuite/thumb2_branch_range.t: Ditto.
9580 * testsuite/thumb_bl_in_range.s: Ditto.
9581 * testsuite/thumb_bl_out_of_range.s: Ditto.
9582 * testsuite/thumb_branch_range.t: Ditto.
9583
b487ad64
ST
95842010-02-20 Sriraman Tallam <tmsriram@google.com>
9585
9586 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9587 Add reloc offset information.
9588 * icf.cc (get_section_contents): Change iterators to point to the new
9589 vectors. Add reloc offset information to the contents.
9590 * icf.h (Icf::Sections_reachable_info): New typedef.
9591 (Icf::Sections_reachable_list): New typedef.
9592 (Icf::Offset_info): New typedef.
9593 (Icf::Reloc_info): New struct typedef.
9594 (Icf::Reloc_info_list): New typedef.
9595 (Icf::symbol_reloc_list): Delete method.
9596 (Icf::addend_reloc_list): Delete method.
9597 (Icf::section_reloc_list): Delete method.
9598 (Icf::reloc_info_list): New method.
9599 (Icf::reloc_info_list_): New member.
9600
f96accdf
DK
96012010-02-19 Doug Kwan <dougkwan@google.com>
9602
9603 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9604 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9605 * arm.cc (Arm_relocation_functions): New forward declaration.
9606 (Target_arm::Target_arm): Initialize new data members
9607 got_mod_index_offset_ and tls_base_symbol_defined_.
9608 (Target_arm::Relocate::relocate_tls): New method.
9609 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9610 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9611 New methods.
2e702c99 9612 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
9613 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9614 (Target_arm::got_mod_index_offset_,
9615 Target_arm::tls_base_symbol_defined_): New data members.
9616 (Target_arm::Scan::local, Target::Scan::global,
9617 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9618 relocations.
9619
c8761b9a
DK
96202010-02-18 Doug Kwan <dougkwan@google.com>
9621
9622 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9623 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9624 text section as a parameter becuase some broken tools may not set
9625 the link in section header.
9626 (Target_arm::has_got_section): New method.
9627 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9628 without any mapping symbol as data only. Remove warning.
9629 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9630 link in its section header, try to discover the link by inspecting the
9631 REL31 relocation at the beginning of the section.
9632 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9633 in error message.
9634 (Target_arm::Scan::global): Treat any reference to the symbol
9635 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9636
21bb3914
ST
96372010-02-12 Sriraman Tallam <tmsriram@google.com>
9638
9639 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9640 (Scan::global_reloc_may_be_function_pointer): New function.
9641 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9642 (Scan::global_reloc_may_be_function_pointer): New function.
9643 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9644 (Scan::global_reloc_may_be_function_pointer): New function.
9645 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9646 (Scan::global_reloc_may_be_function_pointer): New function.
9647 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9648 (Scan::global_reloc_may_be_function_pointer): New function.
9649 (Scan::possible_function_pointer_reloc): New function.
9650 (Target_x86_64::can_check_for_function_pointers): New function.
9651 * gc.h (gc_process_relocs): Scan relocation types to determine if
9652 function pointers were taken for targets that support it.
9653 * icf.cc (Icf::find_identical_sections): Include functions for
9654 folding in safe ICF whose pointer is not taken.
9655 * icf.h (Secn_fptr_taken_set): New typedef.
9656 (fptr_section_id_): New member.
9657 (section_has_function_pointers): New function.
9658 (set_section_has_function_pointers): New function.
9659 (check_section_for_function_pointers): New function.
9660 * options.h: Fix comment for safe ICF option.
9661 * target.h (can_check_for_function_pointers): New function.
9662 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9663 Modify icf_safe_test for X86-64.
9664 * testsuite/Makefile.in: Regenerate.
9665 * testsuite/icf_safe_so_test.cc: New file.
9666 * testsuite/icf_safe_so_test.sh: New file.
9667 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9668 (main): Change to take pointer to function kept_func_3.
9669 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9670 folding is done correctly for X86-64.
9671
0da6fa6c
DM
96722010-02-12 David S. Miller <davem@davemloft.net>
9673
9674 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9675 is_symbolless parameter.
9676 (Output_reloc<SHT_REL>::is_symbolless): New.
9677 (Output_reloc<SHT_REL>::is_symbolless_): New.
9678 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9679 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9680 (Output_reloc<SHT_RELA>::is_symbolless): New.
9681 (Output_data_reloc::add_global): Handle is_symbolless.
9682 (Output_data_reloc::add_global_relative): Likewise.
9683 (Output_data_reloc::add_local): Likewise.
9684 (Output_data_reloc::add_local_relative): Likewise.
9685 (Output_data_reloc::add_symbolless_global_addend): New.
9686 (Output_data_reloc::add_symbolless_local_addend): New.
9687 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9688 is_symbolless.
9689 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9690 instead of ->is_relative_
9691 (Output_reloc::write): Likewise.
9692 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9693 (Output_reloc::write_rel): Simplify.
9694
9695 * sparc.cc (Target_sparc::Scan::local): Use
9696 ->add_symbolless_local_addend as needed.
9697 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9698 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9699 based upon relocation offset.
9700
e4782e83
DK
97012010-02-11 Doug Kwan <dougkwan@google.com>
9702
9703 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9704 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9705 beginning of function.
9706 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9707 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9708 parameter is_32bit in calls to should_apply_static_reloc.
9709 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9710 (check_DATA): Add arm_abs_global.stdout.
9711 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9712 arm_abs_global.stdout): New rules.
9713 (MOSTLLYCLEANFILES): Add arm_abs_global
9714 * Makefile.in: Regenerate.
9715 * testsuite/arm_abs_global.s: New file.
9716 * testsuite/arm_abs_global.sh: Ditto.
9717 * testsuite/arm_abs_lib.s: Ditto.
9718
93ceb764
ILT
97192010-02-11 Ian Lance Taylor <iant@google.com>
9720
9721 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9722 Read_relocs task.
9723 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9724 Allocate_commons_task first.
9725 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9726 task, rather than symtab_lock_.
9727 (Gc_process_relocs::~Gc_process_relocs): New function.
9728 (Gc_process_relocs::is_runnable): Check this_blocker_.
9729 (Gc_process_relocs::locks): Use next_blocker_ rather than
9730 blocker_.
9731 (Scan_relocs::~Scan_relocs): New function.
9732 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9733 symtab_lock_.
9734 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9735 next_blocker_.
9736 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9737 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9738 constructor accordingly.
9739 (class Gc_process_relocs): Likewise.
9740 (class Scan_relocs): Likewise.
9741 * common.h (class Allocate_commons_task): Remove symtab_lock_
9742 field, and corresponding constructor parameter.
9743 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9744 symtab_lock_.
9745 (Allocate_commons_task::locks): Likewise.
9746
114dfbe1
ILT
97472010-02-11 Ian Lance Taylor <iant@google.com>
9748
9749 * gold-threads.h (class Once): Define.
9750 (class Initialize_lock): Rewrite as child of Once.
9751 * gold-threads.cc (class Once_initialize): Define.
9752 (once_pointer_control): New static variable.
9753 (once_pointer, once_arg): New static variables.
9754 (c_run_once): New static function.
9755 (Once::Once, Once::run_once, Once::internal_run): New functions.
9756 (class Initialize_lock_once): Remove.
9757 (initialize_lock_control): Remove.
9758 (initialize_lock_pointer): Remove.
9759 (initialize_lock_once): Remove.
9760 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9761 (Initialize_lock::initialize): Rewrite.
9762 (Initialize_lock::do_run_once): New function.
9763 * archive.cc (Archive::interpret_header): Only clear name if it is
9764 not already empty.
9765 * fileread.cc: Include "gold-threads.h"
9766 (file_counts_lock): New static variable.
9767 (file_counts_initialize_lock): Likewise.
9768 (File_read::release): Only increment counts when using --stats.
9769 Use a lock around the increment.
9770 * parameters.cc (class Set_parameters_target_once): Define.
9771 (set_parameters_target_once): New static variable.
9772 (Parameters::Parameters): Move here from parameters.h.
9773 (Parameters::set_target): Rewrite.
9774 (Parameters::set_target_once): New function.
9775 (Parameters::clear_target): Move here and rewrite.
9776 * parameters.h (class Parameters): Update declarations. Add
9777 set_parameters_target_once_ field.
9778 (Parameters::Parameters): Move to parameters.cc.
9779 (Parameters::clear_target): Likewise.
9780 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9781 task.
9782 (Start_group::~Start_group): New function.
9783 (Start_group::is_runnable): New function.
9784 (Start_group::locks, Start_group::run): New functions.
9785 (Finish_group::run): Change saw_undefined to size_t.
9786 * readsyms.h (class Start_group): Define.
9787 (class Finish_group): Change saw_undefined_ field to size_t.
9788 (Finish_group::Finish_group): Remove saw_undefined and
9789 this_blocker parameters. Change all callers.
9790 (Finish_group::set_saw_undefined): New function.
9791 (Finish_group::set_blocker): New function.
9792 * symtab.h (class Symbol_table): Change saw_undefined to return
9793 size_t. Change saw_undefined_ field to size_t.
9794 * target-select.cc (Set_target_once::do_run_once): New function.
9795 (Target_selector::Target_selector): Initialize set_target_once_
9796 field. Don't initialize lock_ and initialize_lock_ fields.
9797 (Target_selector::instantiate_target): Rewrite.
9798 (Target_selector::set_target): New function.
9799 * target-select.h (class Set_target_once): Define.
9800 (class Target_selector): Update declarations. Make
9801 Set_target_once a friend. Remove lock_ and initialize_lock_
9802 fields. Add set_target_once_ field.
9803
fa17a3f4
ILT
98042010-02-10 Ian Lance Taylor <iant@google.com>
9805
9806 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9807 queueing any tasks.
9808 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9809 (queue_middle_tasks): Add all blockers before queueing any tasks.
9810 (queue_final_tasks): Likewise.
9811 * token.h (Task_token::add_blockers): New function.
9812 * object.h (Input_objects::number_of_relobjs): New function.
9813
c7177d31
ILT
98142010-02-10 Ian Lance Taylor <iant@google.com>
9815
5de0e392
ILT
9816 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9817 shared, not if not position independent.
9818 * x86_64.cc (Relocate::relocate_tls): Likewise.
9819 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9820 (tls_pie_pic_test): New target.
9821 * testsuite/Makefile.in: Rebuild.
9822
c7177d31
ILT
9823 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9824 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9825 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9826 * testsuite/Makefile.in: Rebuild.
9827
684b268a
DM
98282010-02-09 David S. Miller <davem@davemloft.net>
9829
9830 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9831 R_SPARC_RELATIVE using ->add_local_relative().
9832 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9833
612a8d3d
DM
9834 * output.h (Output_data_dynamic::add_section_size): New method
9835 that takes two Output_data objects.
9836 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9837 entry param. Handle it in initializers.
9838 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9839 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9840 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9841 arg.
9842 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9843 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9844 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9845 for dynrel_includes_plt.
9846 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9847 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9848 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9849 before .rela.plt
9850 (Target_sparc::do_finalize_sections): Update to pass true for
9851 dynrel_includes_plt.
9852 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9853 output before .rela.plt
9854 (Target_powerpc::do_finalize_sections): Update to pass true for
9855 dynrel_includes_plt when 32-bit.
9856
cb1be87e
DK
98572010-02-08 Doug Kwan <dougkwan@google.com>
9858
9859 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9860 method.
9861 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9862 Arm_relobj::scan_section_for_cortex_a8_stubs,
9863 Arm_relobj::do_relocation_section): Instead of calling
9864 Output_section::output_address, use faster
9865 Arm_relobj::simple_input_section_output_address.
9866
705b5121
DM
98672010-02-08 David S. Miller <davem@davemloft.net>
9868
9869 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9870 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9871 relocation helper function.
9872
024c4466
DM
9873 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9874 just like R_SPARC_GOT{10,13,22}.
9875 (Target_sparc::Scan::local): Likewise.
9876 (Target_sparc::Relocate:relocate): Likewise.
9877
9109c078
ILT
98782010-02-06 Ian Lance Taylor <iant@google.com>
9879
9880 * configure.ac: Rewrite targetobjs duplicate removal code to use
9881 only shell constructs.
9882 * configure: Rebuild.
9883
cf846138
DK
98842010-02-05 Doug Kwan <dougkwan@google.com>
9885
9886 PR 11247
9887 * arm.cc (Arm_relobj::section_is_scannable): New method.
9888 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9889 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9890
6cfaf60b
DK
98912010-02-04 Doug Kwan <dougkwan@google.com>
9892
9893 PR 11247
9894 * arm-reloc-property.cc (cstdio): Include.
9895 * configure.ac (targetobjs): Remove duplicates.
9896 * configure: Regenerate.
9897 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9898 big and little endian version for a given address size.
9899
5c57f1be
DK
99002010-02-03 Doug Kwan <dougkwan@google.com>
9901
9902 * arm-reloc-property.cc
9903 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9904 definition.
9905 * arm-reloc-property.h
9906 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9907 New method definition.
9908 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9909 declaration.
9910 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9911 overflow to N.
9912 (GOT_PREL): Change implemented to Y.
9913 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9914 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9915 (Arm_relocate_functions::movw_abs_nc): Remove method.
9916 (Arm_relocate_functions::movt_abs): Ditto.
9917 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9918 (Arm_relocate_functions::thm_movt_abs): Ditto.
9919 (Arm_relocate_functions::movw_rel_nc): Ditto.
9920 (Arm_relocate_functions::movw_rel): Ditto.
9921 (Arm_relocate_functions::movt_rel): Ditto.
9922 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9923 (Arm_relocate_functions:thm_movw_rel): Ditto.
9924 (Arm_relocate_functions:thm_movt_rel): Ditto.
9925 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9926 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9927 New method definitions.
9928 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9929 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9930 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9931 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9932 (Target_arm::Relocate::relocate): Check for non-static or
9933 unimplemented relocation code and exit early. Change calls to
9934 Target_arm::reloc_uses_thumb_bit and
9935 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9936 instead. Refactor code to handle similar relocations to increase
9937 code sharing. Remove check for unsupported relocation code in switch
9938 statement.
9939 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9940 relocation property table to find out size. Change error message to
9941 print out the name of a relocation code instead of the numeric value.
9942 (Target_arm::scan_reloc_for_stub): Use relocation property table
9943 instead of calling Target_arm::reloc_uses_thumb_bit().
9944
218c5831
DK
99452010-02-02 Doug Kwan <dougkwan@google.com>
9946
9947 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9948 types of relaxed input section.
9949
0d31c79d
DK
99502010-02-02 Doug Kwan <dougkwan@google.com>
9951
9952 * Makefile.am (HFILES): Add arm-reloc-property.h.
9953 (DEFFILES): New.
2e702c99
RM
9954 (TARGETSOURCES): Add arm-reloc-property.cc
9955 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
9956 (libgold_a_SOURCES): $(DEFFILES)
9957 * Makefile.in: Regenerate.
9958 * arm-reloc-property.cc: New file.
9959 * arm-reloc-property.h: New file.
9960 * arm-reloc.def: New file.
9961 * arm.cc: Update comments.
9962 (arm-reloc-property.h): New included header.
9963 (arm_reloc_property_table): New global variable.
9964 (Target_arm::do_select_as_default_target): New method definition.
9965 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
9966 arm-reloc-property to targ_extra_obj.
9967 * parameters.cc (set_parameters_target): Call
9968 Target::select_as_default_target().
9969 * target.h (Target::select_as_default_target): New method definition.
9970 (Target::do_select_as_default_target): Same.
9971
546c7457
DK
99722010-02-01 Doug Kwan <dougkwan@google.com>
9973
9974 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
9975 first_output_text_section_.
9976 (Arm_exidx_fixup::first_output_text_section): New method definition.
9977 (Arm_exidx_fixup::first_output_text_section_): New data member.
9978 (Arm_exidx_fixup::process_exidx_section): Record the first text
9979 output section seen.
9980 (Arm_output_section::fix_exidx_coverage): Set correct linked section
9981 and entsize in output section header.
9982
11b861d5
DK
99832010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9984
9985 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
9986 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
9987 (Arm_relocate_functions::thm_alu11): New Method.
9988 (Arm_relocate_functions::thm_pc8): New Method.
9989 (Arm_relocate_functions::thm_pc12): New Method.
9990 (Target_arm::Scan::local): Handle the relocations.
9991 (Target_arm::Scan::global): Likewise.
9992 (Target_arm::Relocate::relocate): Likewise.
9993 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9994
c9a2c125
DK
99952010-01-29 Doug Kwan <dougkwan@google.com>
9996
9997 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
9998 of relocation types as ld.
9999
1521477a
DK
100002010-01-29 Doug Kwan <dougkwan@google.com>
10001
10002 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10003 to public.
10004 (Arm_relocate_functions::thumb_branch_common): Ditto.
10005 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10006 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10007 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10008 Arm_relocate_functions::jump24): Remove.
10009 (Target_arm::Relocate::relocate): Adjust code to call
10010 Arm_relocation_functions::arm_branch_common and
10011 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 10012 wrappers. Merge switch-cases together to reduce source code size.
1521477a 10013
e7eca48c
DK
100142010-01-29 Doug Kwan <dougkwan@google.com>
10015
10016 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10017 output_local_symbol_count_needs_update_.
10018 (Arm_relobj::output_local_symbol_count_needs_update,
10019 Arm_relobj::set_output_local_symbol_count_needs_update,
10020 Arm_relobj::update_output_local_symbol_count): New methods.
10021 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10022 member.
10023 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10024 of pointed function as in a R_ARM_PREL31 relocation.
10025 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10026 for output local symbol count updating.
10027 (Target_arm::do_relax): Update output local symbol counts in objects
10028 if necessary.
10029 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10030
02961d7e
ILT
100312010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10032
10033 * arm.cc: Added support for the ARM relocations:
10034 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
10035 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
10036 (Arm_relocate_functions::movw_rel_nc): Renamed (was
10037 movw_prel_nc).
10038 (Arm_relocate_functions::movw_rel): New method.
10039 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
10040 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
10041 thm_movw_prel_nc).
10042 (Arm_relocate_functions::thm_movw_rel): New method.
10043 (Arm_relocate_functions::thm_movt_rel): Renamed (was
10044 thm_movt_prel).
10045 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
10046 relocations.
10047 (Target_arm::Scan::global): Likewise.
10048 (Target_arm::Relocate::relocate): Likewise.
10049 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10050 Likewise.
10051
b10d2873
ILT
100522010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10053
10054 * arm.cc: Added support for ARM group relocations.
10055 (Target_arm::reloc_needs_sym_origin): New method.
10056 (Arm_relocate_functions::calc_grp_kn): New method.
10057 (Arm_relocate_functions::calc_grp_residual): New method.
10058 (Arm_relocate_functions::calc_grp_gn): New method.
10059 (Arm_relocate_functions::arm_grp_alu): New Method.
10060 (Arm_relocate_functions::arm_grp_ldr): New Method.
10061 (Arm_relocate_functions::arm_grp_ldrs): New Method.
10062 (Arm_relocate_functions::arm_grp_ldc): New Method.
10063 (Target_arm::Scan::local): Handle the ARM group relocations.
10064 (Target_arm::Scan::global): Likewise.
10065 (Target_arm::Relocate::relocate): Likewise.
10066 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10067 Likewise.
10068
2b328d4e
DK
100692010-01-26 Doug Kwan <dougkwan@google.com>
10070
10071 * arm.cc (set): Include.
10072 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10073 pointer type.
2e702c99 10074 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
10075 (Arm_output_section::append_text_sections_to_list): New method.
10076 (Arm_output_section::fix_exidx_coverage): Ditto.
10077 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 10078 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
10079 Relobj::set_section_offset() instead of
10080 Sized_relobj::invalidate_section_offset().
2e702c99 10081 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
10082 parameter for section headers. Ignore relocation sections for
10083 unallocated sections and EXIDX sections.
10084 (Target_arm::fix_exidx_coverage): New method.
10085 (Target_arm::output_section_address_less_than): New type.
10086 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10087 linked text section instead of the EXIDX section.
10088 (Arm_output_section::create_stub_group): Add an assertion to check
10089 that this is not an EXIDX output section.
10090 (Arm_output_section::append_text_sections_to_list): New method.
10091 (Arm_output_section::fix_exidx_coverage): Ditto.
10092 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 10093 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
10094 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10095 first pass.
10096 (Target_arm::fix_exidx_coverage): New method.
10097 * object.h (Relobj::set_output_section): New method.
10098 (Sized_relobj::invalidate_section_offset): Remove method.
10099 (Sized_relobj::do_invalidate_section_offset): Remove method.
10100 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10101
c7f3c371
DK
101022010-01-25 Doug Kwan <dougkwan@google.com>
10103
10104 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10105 Fix warning due to signed and unsigned comparison on a 32-bit host.
10106
8923b24c
DK
101072010-01-22 Doug Kwan <dougkwan@google.com>
10108
10109 * arm.cc (Target_arm::do_relax): Record an output section for section
10110 offset adjustment it contains any stub table that has changed.
10111 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10112 offsets in an output section if necessary.
10113 * output.cc (Output_section::Output_section): Initialize
10114 section_offsets_need_adjustments_.
10115 (Output_section::add_input_section_for_script): Renamed to
10116 Output_section::add_simple_input_section.
10117 (Output_section::save_states): Add a comment.
10118 (Output_section::discard_states): New method defintion.
10119 (Output_section::adjust_section_offsets): Same.
10120 * output.h (Output_section::add_input_section_for_script): Renamed to
10121 Output_section::add_simple_input_section.
10122 (Output_section::discard_states): New method declaration.
10123 (Output_section::adjust_section_offsets): Same.
10124 (Output_section::section_offsets_need_adjustment,
10125 Output_section::set_section_offsets_need_adjustment): New method
10126 definitions.
10127 (Output_section::section_offsets_need_adjustment_): New data member.
10128 * script-sections.cc
10129 (Output_section_element_input::set_section_address): Adjust code for
10130 renaming of Output_section::add_input_section_for_script.
10131 (Orphan_output_section::set_section_address): Same.
10132
9b2fd367
DK
101332010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10134
10135 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10136 Fix_v4bx enum values .
10137 * gold/options.h (General_options): New option definitions.
10138 (General_options::fix_v4bx): New method.
10139 (General_options::Fix_v4bx): New enum.
10140 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10141 (General_options::parse_fix_v4bx_interworking): New method.
10142
80d0d023
DK
101432010-01-22 Doug Kwan <dougkwan@google.com>
10144
10145 * arm.cc (Arm_exidx_fixup): New class.
10146
af2cdeae
DK
101472010-01-21 Doug Kwan <dougkwan@google.com>
10148
10149 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10150 classes.
10151 (Arm_exidx_section_offset_map): New type.
10152
993d07c1
DK
101532010-01-21 Doug Kwan <dougkwan@google.com>
10154
10155 * arm.cc (Arm_exidx_input_section): New class.
10156 (Arm_relobj::exidx_input_section_by_link,
10157 Arm_relobj::exidx_input_section_by_shndx,
10158 Arm_relobj::make_exidx_input_section): New methods.
10159 (read_arm_attributes_section): Remove.
10160 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10161 information about them.
10162 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10163 to here.
10164
5ac169d4
DK
101652010-01-20 Doug Kwan <dougkwan@google.com>
10166
10167 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10168 Input_section_specifier to Section_id.
10169 (Target_arm::new_arm_input_section: Adjust code for change of key
10170 type.
10171 (Target_arm::find_arm_input_section): Ditto.
10172 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10173 (Section_id): Remove.
10174 (Garbage_collection::Section_id_hash): Remove.
10175 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10176 (Section_id): Remove.
10177 (Icf::Section_id_hash): Remove.
10178 * object.h (Section_id, Const_section_id, Section_id_hash,
10179 Const_section_id_hash): New type definitions.
10180 * output.cc (Output_section::add_relaxed_input_section): Change to
10181 use Const_section_id instead of Input_section_specifier as key type.
10182 (Output_section::add_merge_input_section): Ditto.
10183 (Output_section::build_relaxation_map): Change to use Section_id
10184 instead of Input_section_specifier as key type.
2e702c99 10185 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
10186 Ditto.
10187 (Output_section::convert_input_sections_to_relaxed_sections): Change
10188 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 10189 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
10190 (Output_section::find_relaxed_input_section): Ditto.
10191 * output.h (Input_section_specifier): Remove class.
10192 (Output_section::Output_section_data_by_input_section_map): Change
10193 key type to Const_section_id.
10194 (Output_section::Output_relaxed_input_section_by_input_section_map):
10195 Ditto.
10196 (Output_section::Relaxation_map): Change key type to Section_id.
10197
a2162063
ILT
101982010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10199
10200 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10201 (class Arm_v4bx_stub): New class.
10202 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10203 (Stub_factory::make_arm_v4bx_stub): New method.
10204 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10205 (Stub_table::empty): Handle v4bx stubs.
10206 (Stub_table::add_arm_v4bx_stub): New method.
10207 (Stub_table::find_arm_v4bx_stub): New method.
10208 (Arm_relocate_functions::v4bx): New method.
10209 (Target_arm::fix_v4bx): New method.
10210 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10211 (Stub_table::relocate_stubs): Likewise.
10212 (Stub_table::do_write): Likewise.
10213 (Stub_table::update_data_size_and_addralign): Likewise.
10214 (Stub_table::finalize_stubs): Likewise.
10215 (Target_arm::Scan::local): Likewise.
10216 (Target_arm::Scan::global): Likewise.
10217 (Target_arm::do_finalize_sections): Likewise.
10218 (Target_arm::Relocate::relocate): Likewise.
10219 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10220 Likewise.
10221 (Target_arm::scan_reloc_for_stub): Likewise.
10222 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10223
5696ab0b
ILT
102242010-01-19 Ian Lance Taylor <iant@google.com>
10225
10226 * output.cc (Output_section_headers::do_sized_write): Write large
10227 segment count to sh_info field.
10228 (Output_file_header::do_sized_write): For large segment count,
10229 write PN_XNUM to e_phnum field.
10230
800d0f56
ILT
102312010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10232
10233 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10234 (Arm_relocate_functions::thm_jump8): New function.
10235 (Arm_relocate_functions::thm_jump11): New function.
10236 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10237 R_ARM_THM_JUMP11.
10238 (Target_arm::Scan::global): Likewise.
10239 (Target_arm::Relocate::relocate): Likewise.
10240 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10241 Likewise.
10242
41263c05
DK
102432010-01-14 Doug Kwan <dougkwan@google.com>
10244
10245 * arm.cc (map, utility): Include headers.
10246 (Target_arm::apply_cortex_a8_workaround): New method.
10247 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10248 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10249 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10250 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10251 the --[no-]fix-cortex-a8 command line options.
10252 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10253 (Target_arm::relocate_stub): Use addend in instruction template.
10254 * options.h (DEFINE_bool): Set the user-set flag.
10255 (General_options): Add --[no-]-fix-cortex options.
10256 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10257 : Update fast look-up map after conversion.
41263c05 10258
459e9b03
ST
102592010-01-14 Sriraman Tallam <tmsriram@google.com>
10260
10261 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10262 in the first pass of do_layout.
10263
b521dfe4
DK
102642010-01-13 Doug Kwan <dougkwan@google.com>
10265
10266 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10267 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10268 apparent compiler problem of not folding static constant integral
10269 data members of elfcpp::Elf_sizes<32>.
10270
44272192
DK
102712010-01-13 Doug Kwan <dougkwan@google.com>
10272
10273 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10274 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10275 Arm_relobj::scan_section_for_cortex_a8_erratum,
10276 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10277 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10278 sections to scan for relocation stubs into a new method
10279 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10280 relocation and Cortex-A8 stub scanning.
10281 (Target_arm::do_relax): Force stubs to be after stubbed sections
10282 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10283 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10284 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10285
44b71ece
ILT
102862010-01-12 Ian Lance Taylor <iant@google.com>
10287
10288 * target-reloc.h (visibility_error): New inline function.
10289 (relocate_section): Call visibility_error.
10290 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10291 (MOSTLYCLEANFILES): Likewise.
10292 (protected_4_pic.o, protected_3.err): New targets.
10293 * testsuite/protected_4.cc: New file.
10294
a120bc7f
DK
102952010-01-12 Doug Kwan <dougkwan@google.com>
10296
10297 * arm.cc (Cortex_a8_reloc): New class.
10298 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10299 and cortex_a8_relocs_info_.
10300 (Target_arm::fix_cortex_a8): New method definition.
10301 (Target_arm::Cortex_a8_relocs_info): New type.
10302 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10303 New data member declarations.
10304 (Target_arm::scan_reloc_for_stub): Record information about
10305 relocations for THUMB branches that might be exempted from the
10306 Cortex-A8 workaround.
10307 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10308 at the beginning of a relaxation pass.
10309
20138696
DK
103102010-01-12 Doug Kwan <dougkwan@google.com>
10311
10312 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10313 (Arm_relobj::Mapping_symbol_position,
10314 Arm_reloj::Mapping_symbol_position_less,
10315 Arm_relobj::Mapping_symbols_info): New types.
10316 (Target_arm::is_mapping_symbol_name): New method definition.
10317 (Arm_relobj::do_count_local_symbols): Save information about mapping
10318 symbols.
10319
089d69dc
DK
103202010-01-11 Doug Kwan <dougkwan@google.com>
10321
10322 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10323 Arm_relocate_functions::thumb32_branch_upper,
10324 Arm_relocate_functions::thumb32_branch_lower,
10325 Arm_relocate_functions::thumb32_cond_branch_offset,
10326 Arm_relocate_functions::thumb32_cond_branch_upper,
10327 Arm_relocate_functions::thumb32_cond_branch_lower,
10328 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10329 branch offset encoding.
10330 (Arm_relocate_functions::thumb_branch_common): Use new branch
10331 offset encoding methods to avoid code duplication.
10332 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10333 (Stub_addend_reader::operator()): Use new branch encoding method
10334 to avoid code duplication.
10335
99e5bff2
DK
103362010-01-11 Doug Kwan <dougkwan@google.com>
10337
10338 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10339 (Target_arm::do_finalize_sections): Define special EXIDX section
10340 symbols only if referenced.
10341 * gc.h (Garbage_collection::add_reference): New method.
10342 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10343 code duplication.
10344
98e090bd
ILT
103452010-01-11 Ian Lance Taylor <iant@google.com>
10346
d0a91bd8
ILT
10347 * script.cc (Version_script_info::build_expression_list_lookup):
10348 Change complaing about duplicate wildcard match from error to
10349 warning.
10350
98e090bd
ILT
10351 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10352 of 2009-12-30.
10353 (Version_script_info::Version_script_info): Initialize globs_,
10354 default_version_, default_is_global_, and exact_. Don't
10355 initialize globals_ or locals_.
10356 (Version_script_info::build_lookup_tables): Build local symbols
10357 first.
10358 (Version_script_info::unquote): New function.
10359 (Version_script_info::add_exact_match): New function.
10360 (Version_script_info::build_expression_list_lookup): Remove lookup
10361 parameter. Add is_global parameter. Change all callers. Handle
10362 wildcard pattern specially. Unquote pattern. Call
10363 add_exact_match.
10364 (Version_script_info::get_name_to_match): New function.
10365 (Version_script_info::get_symbol_version): New function.
10366 (Version_script_info::get_symbol_version_helper): Remove.
10367 (Version_script_info::check_unmatched_names): Call unquote.
10368 * script.h (class Version_script_info): Change get_symbol_version
10369 to be non-inline and add is_global parameter; change all callers.
10370 Rewrite symbol_is_local. Update declarations. Define struct
10371 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10372 Remove globals_ and locals_ members. Add exact_, globs_,
10373 default_version_, is_global_.
10374 (Version_script_info::Glob): Remove pattern, add expression and
10375 is_global. Update constructor. Change all callers.
10376 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10377 default version.
10378 (Versions::symbol_section_contents): If a symbol is undefined, or
10379 defined in a dynamic object, set the version index to
10380 VER_NDX_LOCAL.
10381 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10382 symbol_is_local.
10383 (Symbol_table::add_from_pluginobj): Likewise.
10384 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10385
d56962d3
DK
103862010-01-11 Doug Kwan <dougkwan@google.com>
10387
10388 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10389 (incremental_dump_LDADD): Add linking option for libintl.
10390 * Makefile.in: Regenerate.
10391
94e6ee91
L
103922010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10393
10394 PR gold/11144
10395 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10396 instead of -Ds.
10397 * testsuite/Makefile.in: Regenerated.
10398
e96c574b
DK
103992010-01-10 Doug Kwan <dougkwan@google.com>
10400
10401 * options.h (DEFINE_var): Use parentheses around argument varname__
10402 in macro body to avoid any unintended subsequent substitutions.
10403
7198066b
ILT
104042010-01-10 Ian Lance Taylor <iant@google.com>
10405
ba4d53bf
ILT
10406 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10407 candidates before doing symbol resolution.
10408
7198066b
ILT
10409 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10410 ODR candidates if only one is weak.
10411
a2beed37
ILT
104122010-01-08 Ian Lance Taylor <iant@google.com>
10413
10414 * script.cc (Version_script_info::build_expression_list_lookup):
10415 Don't warn about ambiguous version, just record the ambiguity.
10416 (Version_script_info::get_symbol_version_helper): Give error if
10417 version is ambiguous.
10418
2fb7225c
DK
104192010-01-08 Doug Kwan <dougkwan@google.com>
10420
10421 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10422 prev_data_size_ and prev_addralign_. Remove initializer for
10423 deleted data member has_been_changed_.
10424 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10425 to determine if the table is empty.
10426 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10427 Remove.
10428 (Stub_table::add_reloc_stub): Define method in class definition
10429 instead of just declaring it there.
10430 (Stub_table::add_cortex_a8_stub): New method definition.
10431 (Stub_table::update_data_size_and_addralign): Ditto.
10432 (Stub_table::finalize_stubs): Ditto.
10433 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10434 (Stub_table::do_addralign_): Return address alignment in the
10435 (Stub_table::do_reset_address_and_file_offset): Define method in
10436 class definition instead of declaring it there. Set current data
10437 size to be the data size of the previous pass.
10438 (Stub_table::set_final_data_size): Use current data size as the
10439 final data size.
10440 (Stub_table::relocate_stub): Change parameter type of stub from
10441 Reloc_stub pointer to Stub pointer.
10442 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10443 (Stub_table::Cortex_a8_stub_list): New typedef.
10444 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10445 Stub_table::prev_addralign_): New data member.
10446 (Arm_relobj::Arm_relobj): Initialize data member
10447 section_has_cortex_a8_workaround_.
10448 (Arm_relobj::section_has_cortex_a8_workaround,
10449 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10450 definitions.
10451 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10452 declarations.
10453 (Target_arm::relocate_stub): Change parameter type of stub from
10454 Reloc_stub pointer to Stub pointer.
10455 (Insn_template::size, Insn_template::alignment): Handle
10456 THUMB16_SPECIAL_TYPE.
10457 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10458 Stub_table::update_data_size_and_addralign,
10459 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10460 definitions.
10461 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10462 (Stub_table::do_write): Ditto.
10463 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10464
880cd20d
ILT
104652010-01-08 Ian Lance Taylor <iant@google.com>
10466
10467 PR 11108
10468 * symtab.h (class Symbol): Remove fields is_target_special_ and
10469 has_plt_offset_. Add field is_defined_in_discarded_section_.
10470 (Symbol::is_defined_in_discarded_section): New function.
10471 (Symbol::set_is_defined_in_discarded_section): New function.
10472 (Symbol::has_plt_offset): Rewrite.
10473 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10474 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10475 Don't initialize is_target_special_ or has_plt_offset_.
10476 Initialize is_defined_in_discarded_section_.
10477 (Symbol_table::add_from_relobj): If appropriate, set
10478 is_defined_in_discarded_section.
10479 * resolve.cc (Symbol::override_base_with_special): Don't test
10480 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10481 * target-reloc.h (relocate_section): Do special handling for
10482 symbols defined in discarded sections for global symbols as well
10483 as local symbols.
10484
2703e3eb
ILT
104852010-01-08 Ian Lance Taylor <iant@google.com>
10486
10487 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10488 the SHT_SYMTAB case.
10489
339d40a3
ILT
104902010-01-08 Ian Lance Taylor <iant@google.com>
10491
10492 * object.cc (Sized_relobj::do_layout): Don't get confused if
10493 layout_eh_frame returns NULL.
10494
abecea76
ILT
104952010-01-08 Ian Lance Taylor <iant@google.com>
10496
10497 PR 11084
10498 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10499 dynamic symbol table, use the normal symbol table.
10500 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10501 symbol table.
10502
6b7dd3f3
ILT
105032010-01-08 Ian Lance Taylor <iant@google.com>
10504
10505 PR 11072
10506 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10507 sections.
10508
36c50e63
L
105092010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10510
10511 * version.cc (print_version): Change to "Copyright 2010".
10512
e291e7b9
ILT
105132010-01-08 Ian Lance Taylor <iant@google.com>
10514
10515 PR 10287
10516 PR 11063
10517 * i386.cc (class Target_i386): Change return type of plt_section
10518 to be non-const.
10519 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10520 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10521 tls_desc_rel_ field.
10522 (Output_data_plt_i386::rel_tls_desc): New function.
10523 (Target_i386::rel_tls_desc_section): New function.
10524 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10525 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10526 R_386_TLS_DESC reloc in rel_tls_desc_section.
10527 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10528 Define struct Tlsdesc_info.
10529 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10530 (Target_x86_64::do_reloc_symbol_index): New function.
10531 (Target_x86_64::add_tlsdesc_info): New function.
10532 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10533 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10534 tlsdesc_rel_ field.
10535 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10536 all callers.
10537 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10538 (Target_x86_64::rela_tlsdesc_section): New function.
10539 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10540 handling.
10541 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10542 (Target_x86_64::do_reloc_addend): New function.
10543 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10544 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10545 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10546 (Output_reloc::type): New function.
10547 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10548 (Output_reloc::is_target_specific): New function.
10549 (Output_reloc::target_arg): New function.
10550 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10551 absolute relocs and target specific relocs.
10552 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10553 add_target_specific.
10554 (class Output_data_reloc) [SHT_RELA]: Likewise.
10555 * output.cc (Output_reloc::Output_reloc): Add four new versions
10556 for absolute relocs and target specific relocs.
10557 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10558 (Output_reloc::get_symbol_index): Likewise.
10559 (Output_reloc::local_section_offset): Check that local_sym_index_
10560 is not TARGET_CODE or 0.
10561 (Output_reloc::symbol_value): Likewise.
10562 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10563 reloc.
10564 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10565 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10566 functions.
10567 * layout.cc (add_target_dynamic_tags): Use output section for
10568 DT_PLTRELSZ and DT_JMPREL.
10569
3a44184e
ILT
105702010-01-07 Ian Lance Taylor <iant@google.com>
10571
10572 PR 11061
10573 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10574 function.
10575 (class Output_data_reloc_generic): Define.
10576 (class Output_data_reloc_base): Change base class to
10577 Output_data_reloc_generic. Change add() method to call
10578 bump_relative_reloc_count for a relative reloc. Remove
10579 sort_relocs_ field.
10580 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10581 to sort_relocs().
10582 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10583 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10584 appropriate.
10585 * layout.h (class Layout): Update declaration.
10586
ea715a34
ILT
105872010-01-07 Ian Lance Taylor <iant@google.com>
10588
10589 * output.h (class Output_data): Add const version of
10590 output_section and do_output_section.
10591 (class Output_section_data): Add const version of
10592 do_output_section.
10593 (class Output_section): Likewise.
10594 * layout.cc (Layout::add_target_dynamic_tags): New function.
10595 * layout.h (class Layout): Update declarations.
10596 * arm.cc (Target_arm::do_finalize_sections): Use
10597 add_target_dynamic_tags.
10598 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10599 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10600 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10601 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10602
659948a4
ILT
106032010-01-07 Ian Lance Taylor <iant@google.com>
10604
10605 PR 11042
10606 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10607 object as needed.
10608
9d3b86f6
ILT
106092010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10610 Ian Lance Taylor <iant@google.com>
10611
10612 PR 11019
10613 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10614 Xindex::read_symtab_xindex.
10615
bb0d3eb0
DK
106162010-01-07 Doug Kwan <dougkwan@google.com>
10617
10618 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10619 (Insn_template::thumb16_bcond_insn): New method declaration.
10620 (Insn_template): Fix spelling.
10621 (Stub::thumb16_special): New method declaration.
10622 (Stub::do_write): Define virtual method which was previously pure
10623 virtual.
10624 (Stub::do_thumb16_special): New method declaration.
10625 (Stub::do_fixed_endian_write): New template member.
10626 (Reloc_stub::do_write): Remove.
10627 (Reloc_stub::do_fixed_endian_write): Remove.
10628 (Cortex_a8_stub): New class definition.
10629 (Stub_factory::make_cortex_a8_stub): New method definition.
10630 (Stub_factory::Stub_factory): Add missing static storage class
10631 qualifier for elf32_arm_stub_a8_veneer_blx.
10632
ffeef7df
ILT
106332010-01-07 Ian Lance Taylor <iant@google.com>
10634
dc3f80fe
ILT
10635 PR 10980
10636 * options.h (class General_options): Add --warn-unresolved-symbols
10637 and --error-unresolved-symbols.
10638 * errors.cc (Errors::undefined_symbol): Implement
10639 --warn-unresolved-symbols.
10640
ffeef7df
ILT
10641 * options.h (class General_options): Add -z text and -z textoff.
10642 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10643
f1ec9ded
ST
106442010-01-06 Sriraman Tallam <tmsriram@google.com>
10645
10646 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10647 (Garbage_collection::cident_sections): New function.
10648 (Garbage_collection::add_cident_section): New function.
10649 (Garbage_collection::cident_sections_): New member.
10650 (gc_process_relocs): Add references to sections whose names are C
10651 identifiers.
10652 * gold.h (cident_section_start_prefix): New constant.
10653 (cident_section_stop_prefix): New constant.
10654 (is_cident): New function.
10655 * layout.cc (Layout::define_section_symbols): Replace string constants
10656 with the newly defined constants.
10657 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10658 C identifiers.
10659 * testsuite/Makefile.am: Add gc_orphan_section_test.
10660 * testsuite/Makefile.in: Regenerate.
10661 * testsuite/gc_orphan_section_test.cc: New file.
10662 * testsuite/gc_orphan_section_test.sh: New file.
10663
6eda8c29
ILT
106642010-01-06 Ian Lance Taylor <iant@google.com>
10665
b9674e17
ILT
10666 PR 10980
10667 * options.h (class General_options): Add --warn-shared-textrel.
10668 * layout.cc (Layout::finish_dynamic_section): Implement
10669 --warn-shared-textrel.
10670
6eda8c29
ILT
10671 PR 10980
10672 * options.h (class General_options): Add --warn-multiple-gp.
10673
32dcd44e
ILT
106742010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10675
10676 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10677 $(THREADSLIB) and $(LIBDL).
10678 * Makefile.in: Rebuild.
10679
a192ba05
ILT
106802010-01-06 Ian Lance Taylor <iant@google.com>
10681
10682 PR 10980
10683 * options.cc (General_options::parse_section_start): New function.
10684 (General_options::section_start): New function.
10685 (General_options::General_options): Initialize all members.
10686 * options.h: Include <map>
10687 (class General_options): Add --section-start. Add section_starts_
10688 member.
10689 * layout.cc (Layout::attach_allocated_section_to_segment): If
10690 --section-start was used, set the address of the segment. Remove
10691 local sort_sections.
10692 (Layout::relaxation_loop_body): If the address of the load segment
10693 has been set by --section-start, don't use it.
10694 * output.h (Output_segment::update_flags_for_output_section): New
10695 function.
10696 * output.cc (Output_segment::add_output_section): Call
10697 update_flags_for_output_section.
10698
dde3f402
ILT
106992010-01-05 Ian Lance Taylor <iant@google.com>
10700
62dfdd4d
ILT
10701 PR 10980
10702 * options.h (class General_options): Add --undefined-version.
10703 * script.cc (struct Version_expression): Add was_matched_by_symbol
10704 field.
10705 (Version_script_info::matched_symbol): New function.
10706 (Version_script_info::get_symbol_version_helper): Call
10707 matched_symbol.
10708 (Version_script_info::check_unmatched_names): New function.
10709 * script.h (class Version_script_info): Update declarations.
10710 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10711
9c4ae156
ILT
10712 * options.h (class General_options): Use DEFINE_bool_alias for
10713 allow_multiple_definition.
10714 * resolve.cc (Symbol_table::should_override): Don't test
10715 allow_multiple_definition.
10716
dde3f402
ILT
10717 PR 10980
10718 * options.h (class General_options): Add --cref.
10719 * main.cc (main): Print cref table if --cref. Don't close mapfile
10720 until after printing cref table.
10721 * cref.cc: Include "symtab.h".
10722 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10723 (Cref_table_compare::operator()): New function.
10724 (Cref_inputs::gather_cref): New function.
10725 (filecol): New static const.
10726 (Cref_inputs::print_cref): New function.
10727 (Cref::print_cref): New function.
10728 * cref.h: Include <cstdio>.
10729 (class Cref): Update declarations.
10730 * mapfile.h (Mapfile::file): New function.
10731 * object.h (class Object): Define Symbols. Declare virtual
10732 do_get_global_symbols.
10733 (Object::get_global_symbols): New function.
10734 * object.cc (Input_objects::add_object): Pass object to cref_ if
10735 --cref.
10736 (Input_objects::archive_start): Likewise.
10737 (Input_objects::archive_stop): Likewise.
10738 (Input_objects::print_cref): New function.
10739 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10740 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10741 --cref.
10742 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10743 function.
10744 * plugin.h (class Sized_pluginobj): Update declarations.
10745
8781f709
ILT
107462010-01-05 Ian Lance Taylor <iant@google.com>
10747
10748 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10749 to is_default_version. Rename insdef to insdefault.
10750 (Symbol_table::add_from_relobj): Rename def to is_default_version
10751 and local to is_forced_local.
10752 (Symbol_table::add_from_pluginobj): Likewise.
10753 (Symbol_table::add_from_dynobj): Likewise.
10754 (Symbol_table::define_special_symbol): Rename insdef to
10755 insdefault.
10756
fe35d28d
ILT
107572010-01-04 Ian Lance Taylor <iant@google.com>
10758
30bc8c46
ILT
10759 PR 10980
10760 * options.h (class General_options): Add
10761 --allow-multiple-definition and -z muldefs.
10762 * resolve.cc (Symbol_table::should_override): Don't warn about a
10763 multiple symbol definition if --allow-multiple-definition or -z
10764 muldefs.
10765
7eaea549
ILT
10766 PR 10980
10767 * options.h (class General_options): Add --add-needed and
10768 --copy-dt-needed-entries. Tweak --as-needed help entry.
10769 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10770 error if --copy-dt-needed-entries aka --add-needed is used and
10771 would cause a change in behaviour.
10772
fe35d28d
ILT
10773 PR 10980
10774 * options.h (class General_options): Add -G as a short version of
10775 --shared. Add no-op options -assert, -g, and -i.
10776
55a2bb35
ST
107772010-01-04 Sriraman Tallam <tmsriram@google.com>
10778
10779 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10780 check for .text or .gnu.linkonce.t sections.
10781 * icf.cc (Icf::find_identical_sections): Ditto.
10782 Change the detection for mangled function name within the section
10783 name.
10784 * icf.h (is_section_foldable_candidate): New function.
10785
719328e1
ILT
107862009-12-30 Ian Lance Taylor <iant@google.com>
10787
10788 PR 10980
10789 * options.h (class General_options): Permit two dashes with
10790 --retain-symbols-file.
10791
d7bb5745
ILT
107922009-12-30 Ian Lance Taylor <iant@google.com>
10793
403a15dd
ILT
10794 PR 10979
10795 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10796 don't put the file header and segment headers in the text
10797 segment.
10798
eda294df
ILT
10799 PR 10979
10800 * common.cc (Sort_commons::operator()): Stabilize sort when both
10801 entries are NULL.
10802 (Symbol_table::do_allocate_commons_list): When allocating common
10803 symbols, skip a symbol which is no longer common.
10804 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10805 an object before checking its type.
10806 * testsuite/common_test_2.c: New file.
10807 * testsuite/common_test_3.c: New file.
10808 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10809 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10810 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10811 (common_test_2_pic.o, common_test_2.so): New targets.
10812 (common_test_3_pic.o, common_test_3.so): New targets.
10813 * testsuite/Makefile.in: Rebuild.
10814
d7bb5745
ILT
10815 PR 10979
10816 * script.cc (read_input_script): If we see a new SECTIONS clause,
10817 and we have added an input section, give an error.
10818 * layout.h (class Layout): Add have_added_input_section function.
10819 Add have_added_input_section_ field.
10820 * layout.cc (Layout::Layout): Initialize
10821 have_added_input_section_.
10822 (Layout::layout): Set have_added_input_section_.
10823 (Layout::layout_eh_frame): Likewise.
10824
fc59c572
ILT
108252009-12-30 Ian Lance Taylor <iant@google.com>
10826
10827 PR 10931
10828 * options.h (class General_options): Add --sort-common option.
10829 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10830 * common.cc (Sort_common): Add sort_order parameter to
10831 constructor. Add sort_order_ field.
10832 (Sort_commons::operator): Check sort_order_.
10833 (Symbol_table::allocate_commons): Determine the sort order.
10834 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10835 Change all callers.
10836 (Symbol_table::do_allocate_commons_list): Likewise.
10837
1c74fab0
ILT
108382009-12-30 Ian Lance Taylor <iant@google.com>
10839
10840 PR 10916
10841 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10842 symbols from this object, don't change the visibility of an
10843 undefined symbol.
10844 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10845
6affe781
ILT
108462009-12-30 Ian Lance Taylor <iant@google.com>
10847
10848 PR 10861
10849 * script.h (class Version_script_info): Define Language enum.
10850 Update declarations. Define Glob, Exact, and Lookup types. Add
10851 new fields globals_, locals_, and is_finalized_.
10852 * script.cc: Various formatting fixes.
10853 (class Parser_closure): Change language_stack_ from a vector of
10854 std::string to one of Version_script_info::Language. Adjust all
10855 uses accordingly.
10856 (class Lazy_demangler): Remove.
10857 (struct Version_expression): Change language from std::string to
10858 Version_script_info::Language.
10859 (Version_script_info::Version_script_info): New function.
10860 (Version_script_info::~Version_script_info): Don't call clear.
10861 (Version_script_info::finalize): New function.
10862 (Version_script_info::build_lookup_tables): New function.
10863 (Version_script_info::build_expression_list_lookup): New
10864 function.
10865 (Version_script_info::get_symbol_version_helper): Rewrite to use
10866 lookup tables.
10867 (Version_script_info::print_expression_list): Adjust to use
10868 Version_script_info::Language.
10869 (script_push_lex_into_version_mode): Check that the version script
10870 has not been finalized.
10871 (version_script_push_lang): Change language string to
10872 Version_script_info::Language.
10873 * options.cc (Command_line::version_script): New function.
10874 * options.h (class General_options): Add finalize_dynamic_list
10875 function. Change version_script from declaration to definition.
10876 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10877 * testsuite/version_script.map: Remove duplicate def of foo.
10878 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10879 version_script.map.
10880 * testsuite/Makefile.in: Rebuild.
10881
818bf354
ILT
108822009-12-30 Ian Lance Taylor <iant@google.com>
10883
10884 PR 10843
10885 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10886 if the input symbol index is 0, make the output symbol index 0.
10887
ebcc8304
ILT
108882009-12-30 Ian Lance Taylor <iant@google.com>
10889
10890 PR 10670
10891 * options.h (class General_options): Add -x/--discard-all.
10892 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10893 --discard-all. If the local symbol needs a dynamic entry, check
10894 that before handling --discard-locals.
10895
176fe33f
ILT
108962009-12-30 Ian Lance Taylor <iant@google.com>
10897
bb321bb1
ILT
10898 PR 10450
10899 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10900 flags to PF_R.
10901 (Output_segment::add_output_section): Don't change the flags if
10902 the type is PT_TLS.
10903
176fe33f
ILT
10904 PR 10450
10905 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10906 GNU hash table if they need a dynamic value. Otherwise, don't add
10907 them if they are defined in a dynamic object or are forced local.
10908
e8cd95c7
ILT
109092009-12-29 Ian Lance Taylor <iant@google.com>
10910
1b81fb71
ILT
10911 PR 10450
10912 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10913 .gnu.hash table for a 32-bit target.
10914
8d6d383d
ILT
10915 PR 10450
10916 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10917 regular and a dynamic object only needs a dynamic symbol table
10918 entry if it is externally visible.
10919
e785ec03
ILT
10920 PR 10450
10921 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10922 constructor. Add global_offset_table_ field.
10923 (Target_i386::got_section): Set global_offset_table_.
10924 (Target_i386::do_finalize_sections): Set global_offset_table_
10925 size.
10926 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10927 in constructor. Add global_offset_table_ field.
10928 (Target_x86_64::got_section): Set global_offset_table_.
10929 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10930 size.
10931
1a2dff53
ILT
10932 * layout.cc (Layout::Layout): Initialize increase_relro_.
10933 (Layout::get_output_section): Add is_relro, is_last_relro, and
10934 is_first_non_relro parameters. Change all callers.
10935 (Layout::choose_output_section): Likewise.
10936 (Layout::add_output_section_data): Likewise.
10937 (Layout::make_output_section): Likewise.
10938 (Layout::set_segment_offsets): Clear increase_relro when using a
10939 linker script.
10940 * layout.h (class Layout): Add increase_relro method. Add
10941 increase_relro_ field. Update declarations.
10942 * output.cc (Output_section::Output_section): Initialize
10943 is_last_relro_ and is_first_non_relro_.
10944 (Output_segment::add_output_section): Group relro sections is
10945 do_sort is true. Handle is_last_relro and is_first_non_relro.
10946 (Output_segment::maximum_alignment): Remove relro handling.
10947 (Output_segment::set_section_addresses): Add increase_relro
10948 parameter. Change all callers. Add initial alignment to align
10949 relro sections on separate page. Remove old relro handling.
10950 (Output_segment::set_section_list_addresses): Remove in_relro
10951 parameter. Change all callers.
10952 (Output_segment::set_offset): Add increase parameter. Change all
10953 callers. Remove old relro handling.
10954 * output.h (class Output_section): Add new methods: is_last_relro,
10955 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10956 Add is_last_relro_ and is_first_non_relro_ fields.
10957 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10958 Create separate .got.plt section. Call increase_relro.
10959 * x86_64.cc (Target_x86_64::got_section): Likewise.
10960 * testsuite/relro_script_test.t: Add .got.plt.
10961
f0ba79e2
ILT
10962 PR 10450
10963 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
10964 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
10965 (Layout::finalize): Call set_dynamic_symbol_size.
10966 (Layout::set_dynamic_symbol_size): New function.
10967 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
10968 set_dynamic_symbol_size.
10969
e8cd95c7
ILT
10970 PR 10450
10971 * output.h (class Output_section): Add is_entsize_zero_ field.
10972 * output.cc (Output_section::Output_section): Initialize
10973 is_entsize_zero_.
10974 (Output_section::set_entsize): If two different entsizes are
10975 requested, force it to zero.
10976 (Output_section::add_input_section): Set flags for .debug_str
10977 before updating section flags. Set entsize.
10978 (Output_section::update_flags_for_input_section): Set SHF_MERGE
10979 and SHF_STRING if all input sections have those flags.
10980
3e1b9a8a
RÁE
109812009-12-29 Rafael Espindola <espindola@google.com>
10982
10983 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
10984 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
10985 reporting.
3e1b9a8a 10986
3dcad376
ST
109872009-12-29 Sriraman Tallam <tmsriram@google.com>
10988
10989 * options.cc (General_options::parse_version): Allow -v to exit
10990 without an error if there is nothing to link.
10991
084e2665
ILT
109922009-12-29 Ian Lance Taylor <iant@google.com>
10993
10994 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
10995 using a version of gcc before 4.1.
10996 * configure: Rebuild.
10997
250acde3
CD
109982009-12-28 Chris Demetriou <cgd@google.com>
10999
11000 * attributes.cc (Output_attributes_section_data::do_write): Use
11001 std::vector::front rather than std::vector::data.
11002
99fff23b
ILT
110032009-12-28 Ian Lance Taylor <iant@google.com>
11004
11005 * symtab.h (class Symbol_table): Add enum Defined.
11006 * resolve.cc (Symbol_table::should_override): Add defined
11007 parameter. Change all callers. Test whether object is NULL
11008 before calling a method on it.
11009 (Symbol_table::report_resolve_problem): Add defined parameter.
11010 Change all callers.
11011 (Symbol_table::should_override_with_special): Likewise.
11012 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11013 parameter. Change all callers.
11014 (Symbol_table::do_define_in_output_data): Likewise.
11015 (Symbol_table::define_in_output_segment): Likewise.
11016 (Symbol_table::do_define_in_output_segment): Likewise.
11017 (Symbol_table::define_as_constant): Likewise.
11018 (Symbol_table::do_define_as_constant): Likewise.
11019 * script.h (class Symbol_assignment): Add is_defsym parameter to
11020 constructor; change all callers.
11021 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11022 parameter. Change all callers. Add is_defsym_ field.
11023 (class Parser_closure): Add parsing_defsym parameter to
11024 constructor; change all callers. Add parsing_defsym accessor
11025 function. Add parsing_defsym_ field.
11026
556bd683
ILT
110272009-12-28 Ian Lance Taylor <iant@google.com>
11028
11029 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 11030 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 11031
1782c879
ILT
110322009-12-23 Ian Lance Taylor <iant@google.com>
11033
11034 * i386.cc (Target_i386::do_calls_non_split): Recognize
11035 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
11036 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
11037 -fsplit-stack prologue when using %r11.
1782c879 11038
329ca2b1
ST
110392009-12-21 Sriraman Tallam <tmsriram@google.com>
11040
11041 * options.cc (General_options::parse_version): Make -v continue and do
11042 the link like GNU ld does.
11043
d675ff46
RÁE
110442009-12-17 Rafael Avila de Espindola <espindola@google.com>
11045
11046 * Makefile.am (CCFILES): Add timer.cc.
11047 (HFILES): Add timer.h.
11048 * configure.ac: Check for sysconf and times.
11049 * main.cc: include timer.h.
11050 (main): Use Timer instead of get_run_time.
11051 * timer.cc: New.
11052 * timer.h: New.
11053 * workqueue.cc: include timer.h.
11054 (Workqueue::find_and_run_task):
11055 Report user, sys and wall time.
11056 * Makefile.in: Regenerate.
11057 * config.in: Regenerate.
11058 * configure: Regenerate.
11059
d6344fb5
DK
110602009-12-16 Doug Kwan <dougkwan@google.com>
11061
11062 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
11063 sections.
11064 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11065 relaxed input sections.
11066 * output.cc (Output_section::find_relaxed_input_section): Change
11067 return type to Output_relaxed_input_section pointer. Adjust code
11068 for new type of relaxed_input_section_map_.
11069 * output.h (Output_section::find_relaxed_input_section): Change
11070 return type to Output_relaxed_input_section pointer.
11071 (Output_section::Output_relaxed_input_section_by_input_section_map):
11072 New type.
11073 (Output_section::relaxed_input_section_map_): Change type to
11074 Output_section::Output_relaxed_input_section_by_input_section_map.
11075 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11076 input section.
11077
0e0d5469
ILT
110782009-12-15 Ian Lance Taylor <iant@google.com>
11079
11080 * layout.cc (Layout::create_shstrtab): Only write out after input
11081 sections if we are compressing debug sections.
11082
0649a889
ILT
110832009-12-15 Ian Lance Taylor <iant@google.com>
11084
11085 * archive.cc (Archive::add_symbols): Only look up a symbol without
11086 a version if there is, in fact, a version.
11087
2ea97941
ILT
110882009-12-14 Ian Lance Taylor <iant@google.com>
11089
11090 Revert -Wshadow changes, all changes from:
11091 2009-12-11 Doug Kwan <dougkwan@google.com>
11092 2009-12-11 Nick Clifton <nickc@redhat.com>
11093 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11094
b0eec2cc
DK
110952009-12-11 Doug Kwan <dougkwan@google.com>
11096
11097 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11098 due to -Wshadow.
11099 * attributes.cc (Object_attribute::size): Ditto.
11100 (Attributes_section_data::size): Ditto.
11101 (Attributes_section_data::Attributes_section_data): Ditto.
11102 (Output_attributes_section_data::do_write): Ditto.
11103 * attributes.h (Object_attribute::set_type): Ditto.
11104 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11105
91d6fa6a
NC
111062009-12-11 Nick Clifton <nickc@redhat.com>
11107
11108 * archive.cc: Fix shadowed variable warnings.
11109 * arm.cc: Likewise.
11110 * compressed_output.cc: Likewise.
11111 * compressed_output.h: Likewise.
11112 * configure: Likewise.
11113 * dwarf_reader.cc: Likewise.
11114 * dynobj.cc: Likewise.
11115 * dynobj.h: Likewise.
11116 * ehframe.cc: Likewise.
11117 * ehframe.h: Likewise.
11118 * errors.cc: Likewise.
11119 * expression.cc: Likewise.
11120 * fileread.cc: Likewise.
11121 * fileread.h: Likewise.
11122 * freebsd.h: Likewise.
11123 * i386.cc: Likewise.
11124 * icf.cc: Likewise.
11125 * incremental.h: Likewise.
11126 * layout.cc: Likewise.
11127 * layout.h: Likewise.
11128 * mapfile.cc: Likewise.
11129 * merge.cc: Likewise.
11130 * merge.h: Likewise.
11131 * object.cc: Likewise.
11132 * object.h: Likewise.
11133 * options.h: Likewise.
11134 * output.cc: Likewise.
11135 * output.h: Likewise.
11136 * parameters.cc: Likewise.
11137 * plugin.cc: Likewise.
11138 * powerpc.cc: Likewise.
11139 * reduced_debug_output.cc: Likewise.
11140 * reduced_debug_output.h: Likewise.
11141 * reloc.cc: Likewise.
11142 * reloc.h: Likewise.
11143 * resolve.cc: Likewise.
11144 * script-sections.cc: Likewise.
11145 * script.cc: Likewise.
11146 * script.h: Likewise.
11147 * sparc.cc: Likewise.
11148 * symtab.cc: Likewise.
11149 * symtab.h: Likewise.
11150 * target-select.cc: Likewise.
11151 * target-select.h: Likewise.
11152 * token.h: Likewise.
11153 * workqueue.cc: Likewise.
11154 * workqueue.h: Likewise.
11155 * x86_64.cc: Likewise.
11156
a0351a69
DK
111572009-12-10 Doug Kwan <dougkwan@google.com>
11158
11159 * arm.cc (attributes.h): New include.
11160 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11161 (Arm_relobj::~Arm_relobj): Delete object pointed by
11162 attributes_section_data_.
11163 (Arm_relobj::attributes_section_data): New method definition.
11164 (Arm_relobj::attributes_section_data_): New data member declaration.
11165 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11166 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11167 attributes_section_data_.
11168 (Arm_dynobj::attributes_section_data): New method definition.
11169 (Arm_dynobj::attributes_section_data_): New data member declaration.
11170 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11171 initialization value of may_use_blx_ to false.
2e702c99 11172 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
11173 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11174 object attributes to compute results instead of hard-coding.
11175 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11176 Target_arm::get_secondary_compatible_arch,
11177 Target_arm::set_secondary_compatible_arch
11178 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11179 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11180 New method declarations.
11181 (Target_arm::get_aeabi_object_attribute): New method definition.
11182 (Target_arm::attributes_section_data_): New data member declaration.
11183 (read_arm_attributes_section): New template definition.
11184 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11185 (Arm_dynobj::do_read_symbols): Ditto.
11186 (Target_arm::do_finalize_sections): Merge attributes sections from
11187 input. Check for BLX use after attributes section merging.
11188 Fix __exidx_start and __exidx_end visibility. Create an
11189 .ARM.attributes section if necessary.
11190 (Target_arm::get_secondary_compatible_arch,
11191 Target_arm::set_secondary_compatible_arch,
11192 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11193 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 11194 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
11195 New method definitions.
11196
b59befec
ILT
111972009-12-09 Ian Lance Taylor <iant@google.com>
11198
11199 * plugin.cc (Plugin::load): Don't cast from void* to a function
11200 pointer.
11201
1276bc89
ILT
112022009-12-09 Ian Lance Taylor <iant@google.com>
11203
11204 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11205 information fields.
11206
2f2de248
L
112072009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11208
11209 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11210 Replace two_file_shared_1.so with two_file_shared_2.so.
11211 * testsuite/Makefile.in: Regenerated.
11212
4f787271
DK
112132009-12-08 Doug Kwan <dougkwan@google.com>
11214
11215 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11216 (HFILES): Add attributes.h and int_encoding.h.
11217 * Makefile.in: Regenerate.
11218 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11219 function definitions to int_encoding.cc
11220 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11221 prototypes to int_encoding.h
11222 * reduced_debug_output.cc (int_encoding.h): New include.
11223 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11224 function definitions to int_encoding.cc
11225 (insert_into_vector, read_from_pointer): Move template definitions to
11226 int_encoding.h
11227 * attributes.cc: New file.
11228 * attributes.h: New file.
11229 * int_encoding.cc: New file.
11230 * int_encoding.h: New file.
11231
20b52f1a
RÁE
112322009-12-07 Rafael Avila de Espindola <espindola@google.com>
11233
11234 PR gold/11055
11235 * incremental-dump.cc (dump_incremental_inputs): New.
11236 (main): Use dump_incremental_inputs.
11237
53d7974c
L
112382009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11239
11240 PR gold/10893
11241 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11242 checking elfcpp::STT_FUNC.
11243 (Target_i386::Relocate::relocate): Likewise.
11244 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11245
11246 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11247 symbols from shared libraries into normal FUNC symbols.
11248
11249 * symtab.h (Symbol): Add is_func and use it.
11250
05a352e6
DK
112512009-12-05 Doug Kwan <dougkwan@google.com>
11252
11253 * arm.cc (Target_arm::arm_info): Initialize new fields
11254 attributes_section and attributes_vendor.
11255 * i386.cc (Target_i386::i386_info): Same.
11256 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11257 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11258 fields attributes_section and attributes_vendor.
53d7974c 11259 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11260 * target.h (Target::attributes_section, Target::attributes_vendor,
11261 Target::is_attributes_section, Target::attribute_arg_type,
11262 Target::attributes_order): New method definitions.
11263 (Target::Target_info::attributes_section,
11264 Target::Target_info::attributes_vendor): New fields.
11265 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11266 virtual method definitions.
11267 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11268 attributes_section and attributes_vendor.
11269 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11270
f4e5969c
DK
112712009-12-05 Doug Kwan <dougkwan@google.com>
11272
11273 * arm.cc: Update comments about interworking and stub generation.
11274 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11275 considered as non-PIC.
11276 (Arm_relocate_functions::base_abs): Fix formatting.
11277 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11278 of function to use GOT entry address instead of offset.
11279 (Target_arm::Scan::global): Issue an error if a symbol would need a
11280 PLT does not get one because it is untyped. Remove code to create
11281 dynamic symbols for relative branches.
11282 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11283 takes unsigned integer instead of boolean.
11284
1abce4a6
L
112852009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11286
11287 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11288 (two_file_test_LDADD): Likewise.
11289 (common_test_1_LDADD): Likewise.
11290 (exception_test_LDADD) Likewise.
11291 (weak_test_LDADD): Likewise.
11292 (many_sections_test_LDADD): Likewise.
11293 (initpri1_LDADD): Likewise.
11294 (script_test_1_LDADD): Likewise.
11295 (script_test_2_LDADD): Likewise.
11296 (justsyms_LDADD): Likewise.
11297 (binary_test_LDADD): Likewise.
11298 (large_LDADD): Likewise.
11299 * testsuite/Makefile.in: Regenerated.
11300
adcf2816 113012009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11302
adcf2816
L
11303 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11304 (Symbol_table::override_with_special): Likewise.
11305 (Symbol_table::add_from_object): Likewise.
11306
28e67f5d
RÁE
113072009-12-04 Rafael Avila de Espindola <espindola@google.com>
11308
11309 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11310 Don't set the data_offset twice.
11311
ae10a101
RÁE
113122009-12-04 Rafael Avila de Espindola <espindola@google.com>
11313
11314 * testsuite/Makefile.in: Regenerate.
11315
f59f41f3
DK
113162009-12-03 Doug Kwan <dougkwan@google.com>
11317
11318 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11319 (Target_arm::do_finalize_sections): Add parameter for symbol table
11320 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11321 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11322 parameter for symbol table pointer.
11323 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11324 an additional parameter for a pointer to symbol table.
11325 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11326 parameter for a symbol table pointer.
11327 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11328 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11329 Ditto.
11330 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11331 parameter for a symbol table pointer.
11332
ca55d848
RÁE
113332009-12-03 Rafael Avila de Espindola <espindola@google.com>
11334
11335 * incremental.cc (Incremental_inputs_header)
11336 (Incremental_inputs_header_write, Incremental_inputs_entry)
11337 (Incremental_inputs_entry_write): Move ...
11338 * incremental.h (Incremental_inputs_header)
11339 (Incremental_inputs_header_write, Incremental_inputs_entry)
11340 (Incremental_inputs_entry_write): here.
11341
3aec4f9c
RÁE
113422009-12-02 Rafael Avila de Espindola <espindola@google.com>
11343
11344 * incremental.cc (make_sized_incremental_binary): Set the target.
11345 Error if it is incompatible.
11346 * output.h (Output_file): Add filename method.
11347
9c0ae74d
RÁE
113482009-12-02 Rafael Avila de Espindola <espindola@google.com>
11349
11350 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11351 from the get_* methods.
11352
a45500ae
RÁE
113532009-12-02 Rafael Avila de Espindola <espindola@google.com>
11354
11355 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11356 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11357 Write 0 for the data_offset of scripts.
11358
325e6408
RÁE
113592009-12-02 Rafael Avila de Espindola <espindola@google.com>
11360
11361 * testsuite/Makefile.am: Add the incremental_test.sh test.
11362 * testsuite/incremental_test.sh: New.
11363 * testsuite/incremental_test_1.c: New.
11364 * testsuite/incremental_test_2.c: New.
11365
954c3e2e
RÁE
113662009-12-01 Rafael Avila de Espindola <espindola@google.com>
11367
703d02da 11368 * incremental-dump.cc (main): Fix typos.
954c3e2e 11369
f8086623
RÁE
113702009-11-27 Rafael Avila de Espindola <espindola@google.com>
11371
11372 PR gold/11025
11373 * incremental-dump.cc (main): Use llu to print 64 bit values.
11374
3b0dd6ac
L
113752009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11376 H.J. Lu <hongjiu.lu@intel.com>
11377
11378 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11379 $(LIBDL).
11380 (incremental_dump_LDADD): Likewise.
11381 * Makefile.in: Regenerated.
11382
a6d1ef57 113832009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11384
a6d1ef57
DK
11385 Revert:
11386
11387 2009-11-25 Doug Kwan <dougkwan@google.com>
11388
11389 * arm.cc (Target_arm::Target_arm): Move method definition
11390 outside of class definition. Add code to handle
11391 --target1-rel, --target1-abs and --target2= options.
11392 (Target_arm::get_reloc_reloc_type): Change method to be
11393 non-static and const.
11394 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11395 New data member declaration.
11396 (Target_arm::Scan::local, Target_arm::Scan::global,
11397 Target_arm::Relocate::relocate,
11398 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11399 Adjust call to Target_arm::get_real_reloc_type.
11400 (Target_arm::get_real_reloc_type): Use command line options
11401 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11402 * options.h (--target1-rel, --target1-abs, --target2): New
11403 ARM-only options.
11404
50aeb7d4
DK
114052009-11-25 Doug Kwan <dougkwan@google.com>
11406
11407 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11408 class definition. Add code to handle --target1-rel, --target1-abs
11409 and --target2= options.
11410 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11411 and const.
11412 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11413 member declaration.
11414 (Target_arm::Scan::local, Target_arm::Scan::global,
11415 Target_arm::Relocate::relocate,
11416 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11417 call to Target_arm::get_real_reloc_type.
11418 (Target_arm::get_real_reloc_type): Use command line options to
11419 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11420 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11421 options.
11422
51938283
DK
114232009-11-25 Doug Kwan <dougkwan@google.com>
11424
11425 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11426 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11427 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11428 formatting.
11429 (Arm_relocate_functions::thm_call): Replace body with a call to
11430 Arm_relocate_functions::thumb_branch_common.
11431 (Arm_relocate_functions::thm_jump24,
11432 Arm_relocate_functions::thm_xpc22): New method definitions.
11433 (Arm_relocate_functions::thumb_branch_common): New method definition.
11434 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11435 operator.
11436 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11437 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11438
e2b8f3c4
RÁE
114392009-11-24 Rafael Avila de Espindola <espindola@google.com>
11440
11441 * Makefile.am: Build incremental-dump
11442 * Makefile.in: Regenerate.
11443 * incremental-dump.cc: New.
11444 * incremental.cc (Incremental_inputs_header_data,
11445 Incremental_inputs_entry_data): Move to incremental.h
11446 * incremental.h: (Incremental_inputs_header_data,
11447 Incremental_inputs_entry_data): Move from incremental.cc
11448
bcba9aec
RÁE
114492009-11-24 Rafael Avila de Espindola <espindola@google.com>
11450
11451 * incremental.cc (Incremental_inputs_header,
11452 Incremental_inputs_header_write, Incremental_inputs_entry,
11453 Incremental_inputs_entry_write): Add a typedef with the data type.
11454
7c3afe08
RÁE
114552009-11-24 Rafael Avila de Espindola <espindola@google.com>
11456
11457 * incremental.cc (Incremental_inputs_header,
11458 Incremental_inputs_header_write, Incremental_inputs_entry,
11459 Incremental_inputs_entry_write): Update comment about which
11460 type has the filed descriptions.
11461
d204b6e9
DK
114622009-11-15 Doug Kwan <dougkwan@google.com>
11463
11464 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11465 (Arm_relocate_functions::arm_branch_common): Change method defintion
11466 in class definition to a method declaration and update list of formal
11467 parameters.
11468 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11469 Arm_relocation_functions::jump24): Adjust call to
11470 Arm_relocate_functions::arm_branch_common. Update list of formal
11471 parameters.
11472 (Arm_relocate_functions::xpc25): New method definition.
11473 (Arm_relocate_functions::arm_branch_common): Move method defintion
11474 out from class definition. Use stubs for mode-switching and extending
11475 branch ranges.
11476 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11477 specially. Change code to enable use of stubs in ARM branches.
11478
43d12afe
DK
114792009-11-10 Doug Kwan <dougkwan@google.com>
11480
11481 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11482 in method declaration.
11483 (Target_arm::relocate_stub): New method declaration.
11484 (Target_arm::default_target): Change to return a pointer instead of
11485 a const reference.
11486 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11487 Target_arm::default_target.
11488 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11489 method definition.
11490 (Target_arm::relocate_section): Adjust view.
11491 (Target_arm::relocate_stub): New method definition.
11492
ac33a407
DK
114932009-11-10 Doug Kwan <dougkwan@google.com>
11494
11495 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11496 a format warning.
11497 * incremental.cc (open_incremental_binary): Initialized local
11498 variables to avoid warnings.
11499 * object.cc (make_elf_object): Ditto.
11500 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11501 a format warning.
e1df38aa 11502
88ee28e9
L
11503009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11504
11505 PR gold/10930
11506 * testsuite/plugin_test.c: Include "config.h".
11507
2daedcd6
DK
115082009-11-09 Doug Kwan <dougkwan@google.com>
11509
11510 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11511 (arm_symbol_value): Remove.
11512 (Arm_relocate_functions::arm_branch_common,
11513 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11514 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11515 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11516 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11517 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11518 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11519 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11520 Arm_relocate_functions::thm_mobw_abs_nc,
11521 Arm_relocate_functions::thm_mov_abs,
11522 Arm_relocate_functions::movw_prel_nc,
11523 Arm_relocate_functions::thm_movt_abs,
11524 Arm_relocate_functions::movt_prel,
11525 Arm_relocate_functions::thm_movw_prel_nc,
11526 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11527 (Target_arm::Relocate::relocate): Only decompose address into two
11528 parts if relocation type uses the thumb-bit and pass the actual
11529 bit instead of a flag indicating that the thumb-bit is used. Adjust
11530 calls to methods in Arm_relocate_functions for this change.
11531
1276bc89 115322009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
11533
11534 PR 10925
11535 * reloc.cc: Instantiate
11536 Sized_relobj::initialize_input_to_output_maps and
11537 Sized_relobj:free_input_to_output_maps.
11538
e53ad1b5
ILT
115392009-11-06 Ian Lance Taylor <iant@google.com>
11540
11541 PR 10876
11542 * defstd.cc (in_segment): Set only_if_ref true for "end".
11543
eb44217c
DK
115442009-11-06 Doug Kwan <dougkwan@google.com>
11545
11546 * arm.cc (class Reloc_stub): Correct a comment.
11547 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11548 (Target_arm::scan_section_for_stubs): New method declaration.
11549 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11550 Change methods from private to protected.
11551 (Target_arm::do_may_relax): New method definition.
11552 (Target_arm::do_relax, Target_arm::group_sections,
11553 Target_arm::scan_reloc_for_stub,
11554 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11555 (Target_arm::arm_input_section_map_): New data member declaration.
11556 (Target_arm::scan_reloc_for_stub,
11557 Target_arm::scan_reloc_section_for_stubs,
11558 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11559 Target_arm::do_relax): New method definitions.
11560
5d329b7d
ILT
115612009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11562
11563 * configure.ac: Check for (struct stat)::st_mtim
11564 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11565 * config.in: Regenerate.
11566 * configure: Regenerate.
11567
96a0d71b
ILT
115682009-11-05 Ian Lance Taylor <iant@google.com>
11569
11570 PR 10910
11571 * output.cc (Output_segment::add_output_section): Add missing
11572 return statement.
11573
594c8e5e
ILT
115742009-11-04 Ian Lance Taylor <iant@google.com>
11575
11576 PR 10880
11577 * object.h (class Object): Add is_needed and set_is_needed
11578 methods. Add is_needed_ field. Make bool fields into bitfields.
11579 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11580 defined in a dynamic object and referenced by a regular object,
11581 set is_needed for the dynamic object.
11582 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11583 if the file is marked with as_needed and it is not needed.
11584
22b127cc
ILT
115852009-11-04 Ian Lance Taylor <iant@google.com>
11586
11587 PR 10887
11588 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11589 tags if data is discarded by linker script.
11590 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11591 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11592 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11593 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11594
f5c870d2
ILT
115952009-11-04 Ian Lance Taylor <iant@google.com>
11596
11597 * layout.cc (Layout::get_output_section): Add is_interp and
11598 is_dynamic_linker_section parameters. Change all callers.
11599 (Layout::choose_output_section): Likewise.
11600 (Layout::make_output_section): Likewise.
11601 (Layout::add_output_section_data): Add is_dynamic_linker_section
11602 parameter. Change all callers.
11603 * layout.h (class Layout): Update declarations.
11604 * output.h (class Output_section): Add is_interp, set_is_interp,
11605 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11606 Add is_interp_, is_dynamic_linker_section_ fields. Change
11607 generate_code_fills_at_write_ to a bitfield.
11608 * output.cc (Output_section::Output_sections): Initialize new
11609 fields.
11610 (Output_segment::add_output_section): Add do_sort parameter.
11611 Change all callers.
11612
1ae4d23b
ILT
116132009-11-03 Ian Lance Taylor <iant@google.com>
11614
11615 PR 10860
11616 * options.h (class General_options): Add --warn-common.
11617 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11618 merging two common symbols.
11619 (Symbol_table::should_override): Handle --warn-common when merging
11620 a common symbol with a defined symbol. Use report_resolve_problem
11621 for multiple definitions.
11622 (Symbol_table::report_resolve_problem): New function.
11623 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11624
55da9579
DK
116252009-11-03 Doug Kwan <dougkwan@google.com>
11626
11627 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11628 stub_factory_.
11629 (Target_arm::stub_factory): New method definition.
11630 (Target_arm::new_arm_input_section,
11631 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11632 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 11633 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
11634 New type definitions.
11635 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11636 member declarations.
11637 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11638 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11639 New method definitions.
11640
37a9ac43
ILT
116412009-11-03 Ian Lance Taylor <iant@google.com>
11642
11643 * options.h (class General_options): Add --warn_constructors.
11644
b3d6a3d4
ILT
116452009-11-03 Ian Lance Taylor <iant@google.com>
11646
11647 PR 10893
11648 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11649 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11650
934b01dd
ILT
116512009-11-03 Ian Lance Taylor <iant@google.com>
11652
11653 PR 10895
11654 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11655 --msgid-bugs-address.
11656 (install-pdf): New target.
11657 (install-data_yes): Look up one directory to find mkinstalldirs.
11658
03c1939b
L
116592009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11660
11661 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11662 tree.
11663
ebd95253
DK
116642009-10-30 Doug Kwan <dougkwan@google.com>
11665
11666 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11667
e9bbb538
DK
116682009-10-30 Doug Kwan <dougkwan@google.com>
11669
11670 * arm.cc (Stub_addend_reader): New struct template definition
11671 and partial specializations.
11672 (Stub_addend_reader::operator()): New method definition for a
11673 partially specialized template.
11674
d5b40221
DK
116752009-10-30 Doug Kwan <dougkwan@google.com>
11676
11677 * arm.cc (Arm_relobj::processor_specific_flags): New method
11678 definition.
11679 (Arm_relobj::do_read_symbols): New method declaration.
11680 (Arm_relobj::processor_specific_flags_): New data member declaration.
11681 (Arm_dynobj): New class definition.
11682 (Target_arm::do_finalize_sections): Add input_objects parameter.
11683 (Target_arm::do_adjust_elf_header): New method declaration.
11684 (Target_arm::are_eabi_versions_compatible,
11685 (Target_arm::merge_processor_specific_flags): New method declaration.
11686 (Target_arm::do_make_elf_object): New overloaded method definitions
11687 and declaration.
11688 (Arm_relobj::do_read_symbols): New method definition.
11689 (Arm_dynobj::do_read_symbols): Ditto.
11690 (Target_arm::do_finalize_sections): Add input_objects parameters.
11691 Merge processor-specific flags from all input objects.
11692 (Target_arm::are_eabi_versions_compatible,
11693 Target_arm::merge_processor_specific_flags,
11694 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11695 New method definitions.
11696 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11697 Input_objects pointer type parameter.
11698 * layout.cc (Layout::finalize): Pass input objects to target's.
11699 finalize_sections function.
11700 * output.cc (Output_file_header::do_sized_write): Set ELF file
11701 header's processor-specific flags.
11702 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11703 Input_objects pointer type parameter.
11704 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11705 * target.h (Input_objects): New forward class declaration.
11706 (Target::processor_specific_flags,
11707 Target::are_processor_specific_flags_sect): New method definitions.
11708 (Target::finalize_sections): Add input_objects parameter.
11709 (Target::Target): Initialize processor_specific_flags_ and
11710 are_processor_specific_flags_set_.
11711 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11712 parameter.
11713 (Target::set_processor_specific_flags): New method definition.
11714 (Target::processor_specific_flags_,
11715 Target::are_processor_specific_flags_set_): New data member
11716 declarations.
11717 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11718 Input_objects pointer type parameter.
11719
ebabffbd
DK
117202009-10-30 Doug Kwan <dougkwan@google.com>
11721
11722 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11723
ad0f2072
ILT
117242009-10-28 Ian Lance Taylor <iant@google.com>
11725
11726 * object.h (class Relobj): Drop options parameter from
11727 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11728 do_scan_relocs, do_relocate. Change all callers.
11729 (class Sized_relobj): Drop options parameters from
11730 do_gc_process_relocs, do_scan_relocs, do_relocate,
11731 do_relocate_sections, relocate_sections, emit_relocs_scan,
11732 emit_relocs_scan_reltype. Change all callers.
11733 (struct Relocate_info): Remove options field and all references to
11734 it.
11735 * reloc.h (class Read_relocs): Remove options constructor
11736 parameter and options_ field. Change all callers.
11737 (class Gc_process_relocs, class Scan_relocs): Likewise.
11738 (class Relocate_task): Likewise.
11739 * target-reloc.h (scan_relocs): Remove options parameter. Change
11740 all callers.
11741 (scan_relocatable_relocs): Likewise.
11742 * target.h (class Sized_target): Remove options parameter from
11743 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11744 all callers.
11745 * gc.h (gc_process_relocs): Remove options parameter. Change all
11746 callers.
11747 * arm.cc: Update functions to remove options parameters.
11748 * i386.cc: Likewise.
11749 * powerpc.cc: Likewise.
11750 * sparc.cc: Likewise.
11751 * x86_64.cc: Likewise.
11752 * testsuite/testfile.cc: Likewise.
11753
8ffa3667
DK
117542009-10-28 Doug Kwan <dougkwan@google.com>
11755
11756 * arm.cc (Arm_relobj): New class definition.
e1df38aa 11757 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
11758 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11759 New method definitions.
11760
40f36857
CC
117612009-10-28 Cary Coutant <ccoutant@google.com>
11762
11763 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11764 (Plugin::cleanup_done_): New member.
11765 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11766 (Plugin_manager::cleanup_done_): Remove.
11767 (Plugin_manager::add_input_file): Edit error message.
11768 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11769 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11770
2c849493
ILT
117712009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11772
11773 * fileread.cc: (File_read::View::~View): Use the new
11774 data_ownership_ filed.
11775 (File_read::~File_read): Dispose the new whole_file_view_.
11776 (File_read::open): Mmap the whole file if needed.
11777 (File_read::open): Use whole_file_view_ instead of contents_.
11778 (File_read::find_view): Use whole_file_view_ if applicable.
11779 (File_read::do_read): Use whole_file_view_ instead of contents_.
11780 (File_read::make_view): Use whole_file_view_ instead of contents_,
11781 update File_read::View::View call.
11782 (File_read::find_or_make_view): Update File_read::View::View
11783 call.
11784 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11785 remove contents_
11786 (File_read::View::Data_ownership): New enum.
11787 (File_read::View::View): Replace bool mapped_ with Data_ownership
11788 argument.
11789 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11790 (File_read::View::data_ownership_): New field.
11791 (File_read::contents_): Remove (replaced by whole_file_view_).
11792 (File_read::whole_file_view_): New field.
11793 * options.h (class General_options): Add --keep-files-mapped.
11794
24998053
CC
117952009-10-27 Cary Coutant <ccoutant@google.com>
11796
11797 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11798 * testsuite/Makefile.am (plugin_test_5): New test case.
11799 * testsuite/Makefile.in: Regenerate.
11800
72adc4fa
DK
118012009-10-25 Doug Kwan <dougkwan@google.com>
11802
11803 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11804 from private to protected to allow access by child class.
11805 (Sized_relobj::do_relocate_sections): New method declaration.
11806 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 11807 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
11808 Sized_relobj::relocate_sections. Instantiate template explicitly
11809 for different target sizes and endianity.
11810
07f508a2
DK
118112009-10-24 Doug Kwan <dougkwan@google.com>
11812
11813 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11814 (Arm_input_section::as_arm_input_section): New method.
11815 (Arm_output_section): New class definition.
11816 (Arm_output_section::create_stub_group,
11817 Arm_output_section::group_sections): New method definitions.
11818
10ad9fe5
DK
118192009-10-22 Doug Kwan <dougkwan@google.com>
11820
11821 * arm.cc (Arm_input_section): New class definition.
11822 (Arm_input_section::init, Arm_input_section:do_write,
11823 Arm_input_section::set_final_data_size,
11824 Arm_input_section::do_reset_address_and_file_offset): New method
11825 definitions.
11826
56ee5e00
DK
118272009-10-21 Doug Kwan <dougkwan@google.com>
11828
11829 * arm.cc (Stub_table, Arm_input_section): New forward class
11830 declarations.
11831 (Stub_table): New class defintion.
11832 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11833 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11834 New method definition.
11835
b569affa
DK
118362009-10-21 Doug Kwan <dougkwan@google.com>
11837
11838 * arm.cc: Update copyright comments.
11839 (Target_arm): New forward class template declaration.
11840 (Arm_address): New type.
11841 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11842 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11843 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11844 constants.
11845 (Insn_template): Same.
11846 (DEF_STUBS): New macro.
11847 (Stub_type): New enum type.
11848 (Stub_template): New class definition.
11849 (Stub): Same.
11850 (Reloc_stub): Same.
11851 (Stub_factory): Same.
11852 (Target_arm::Target_arm): Initialize may_use_blx_ and
11853 should_force_pic_veneer_.
11854 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11855 Target_arm::should_force_pic_veneer,
11856 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11857 Target_arm::using_thumb_only, Target_arm:;default_target): New
11858 method defintions.
11859 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11860 New data member declarations.
11861 (Insn_template::size, Insn_template::alignment): New method defintions.
11862 (Stub_template::Stub_template): New method definition.
11863 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11864 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11865 (Stub_factory::Stub_factory): New method definition.
11866 * gold.h (string_hash): New template.
11867 * output.h (Input_section_specifier::hash_value): Use
11868 gold::string_hash.
11869 (Input_section_specifier::string_hash): Remove.
11870 * stringpool.cc (Stringpool_template::string_hash): Use
11871 gold::string_hash.
11872
6c172549
DK
118732009-10-20 Doug Kwan <dougkwan@google.com>
11874
11875 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11876 symbols of relaxed input sections.
11877 * output.h (Output_section::find_relaxed_input_section): Make
11878 method public.
11879
c5617f2f
DK
118802009-10-16 Doug Kwan <dougkwan@google.com>
11881
11882 * dynobj.cc (Versions::Versions): Initialize version_script_.
11883 Only insert base version symbol definition for a shared object
11884 if version script defines any version versions.
11885 (Versions::define_base_version): New method definition.
11886 (Versions::add_def): Check that base version is not needed.
11887 (Versions::add_need): Define base version lazily.
11888 * dynobj.h (Versions::define_base_version): New method declaration.
11889 (Versions::needs_base_version_): New data member declaration.
11890 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11891 (check_DATA): Add no_version_test.stdout.
11892 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11893 New make rules.
11894 * testsuite/Makefile.in: Regenerate.
11895 * testsuite/no_version_test.c: New file.
11896 * testsuite/no_version_test.sh: Ditto.
11897
3c12dcdb
DK
118982009-10-16 Doug Kwan <dougkwan@google.com>
11899
11900 * expression.cc (class Segment_start_expression): New class definition.
11901 (Segment_start_expression::value): New method definition.
11902 (script_exp_function_segment_start): Return a new
11903 Segment_start_expression.
11904 * gold/script-c.h (script_saw_segment_start_expression): New function
11905 prototype.
11906 * script-sections.cc (Script_sections::Script_sections): Initialize
11907 SAW_SEGMENT_START_EXPRESSION_ to false.
11908 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11909 and -Tbbs options to specify section addresses if given in
11910 command line and no SEGMENT_START expression is seen in a script.
11911 * script-sections.h (Script_sections::saw_segment_start_expression,
11912 Script_sections::set_saw_segment_start_expression): New method
11913 definition.
11914 (Script_sections::saw_segment_start_expression_): New data member
11915 declaration.
11916 * script.cc (script_saw_segment_start_expression): New function.
11917 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11918 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11919 script_test_7.sh and script_test_8.sh.
11920 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11921 script_test_8.stdout.
11922 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11923 (script_test_6, script_test_6.stdout, script_test_7,
11924 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11925 * Makefile.in: Regenerate.
11926 * testsuite/script_test_6.sh: New file.
11927 * testsuite/script_test_6.t: Same.
11928 * testsuite/script_test_7.sh: Same.
11929 * testsuite/script_test_7.t: Same.
11930 * testsuite/script_test_8.sh: Same.
11931
64b1ae37
DK
119322009-10-16 Doug Kwan <dougkwan@google.com>
11933
11934 * output.cc (Output_segment::set_section_list_address): Cast
11935 expressions to unsigned long long type to avoid format warnings.
11936
661be1e2
ILT
119372009-10-15 Ian Lance Taylor <iant@google.com>
11938
12edd763 11939 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 11940 dot assignment to script_sections_.
12edd763
ILT
11941 * script-sections.cc (Script_sections::add_dot_assignment):
11942 Initialize if necessary.
11943
68b6574b
ILT
11944 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11945 program headers with no load segment if there is a linker script.
11946
661be1e2
ILT
11947 * layout.cc (Layout::set_segment_offsets): Align the file offset
11948 to the segment aligment for -N or -n with no load segment.
11949 * output.cc (Output_segment::add_output_section): Don't crash if
11950 the first section is a TLS section.
11951 (Output_segment::set_section_list_addresses): Print an error
11952 message if the address moves backward in a linker script.
11953 * script-sections.cc
11954 (Output_section_element_input::set_section_addresses): Don't
11955 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11956 (Orphan_output_section::set_section_addresses): Likewise.
11957
f15f61a7
DK
119582009-10-15 Doug Kwan <dougkwan@google.com>
11959
11960 * layout.cc (Layout::finish_dynamic_section): Generate tags
11961 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
11962 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
11963 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
11964
82bb573a
ILT
119652009-10-14 Ian Lance Taylor <iant@google.com>
11966
11967 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
11968 fields.
11969 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
11970 data_shdr fields of relinfo.
11971 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
11972 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
11973 R_386_TLS_LDO_32, adjust based on section flags.
11974 (Target_i386::Relocate::fix_up_ldo): Remove.
11975
374ad285
ILT
119762009-10-13 Ian Lance Taylor <iant@google.com>
11977
11978 Add support for -pie.
11979 * options.h (class General_options): Add -pie and
11980 --pic-executable.
11981 (General_options::output_is_position_independent): Test -pie.
11982 (General_options::output_is_executable): Return true if not shared
11983 and not relocatable.
11984 (General_options::output_is_pie): Remove.
11985 * options.cc (General_options::finalize): Reject incompatible uses
11986 of -pie.
11987 * gold.cc (queue_middle_tasks): A -pie link is not static.
11988 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
11989 * symtab.cc (Symbol::final_value_is_known): Return false if
11990 output_is_position_independent.
11991 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
11992 output_is_position_independent.
11993 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
11994 output_is_position_independent.
11995 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
11996 output_is_position_independent.
11997 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
11998 two_file_pie_test.
11999 (basic_pie_test.o, basic_pie_test): New targets.
12000 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12001 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12002 (two_file_pie_test): New target.
12003 * testsuite/Makefile.in: Rebuild.
12004 * README: Remove note saying that -pie is not supported.
12005
c6585162
ILT
120062009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12007
12008 * options.h (class General_options): Add -init and -fini.
12009 * layout.cc (Layout::finish_dynamic_section): Emit
12010 given init and fini functions.
12011
032ce4e9
ST
120122009-10-13 Sriraman Tallam <tmsriram@google.com>
12013
12014 * gc.h (gc_process_relocs): Check if icf is enabled using new
12015 function.
12016 * gold.cc (queue_initial_tasks): Likewise.
12017 (queue_middle_tasks): Likewise.
12018 * object.cc (do_layout): Likewise.
12019 * symtab.cc (is_section_folded): Likewise.
12020 * main.cc (main): Likewise.
12021 * reloc.cc (Read_relocs::run): Likewise.
12022 (Sized_relobj::do_scan_relocs): Likewise.
12023 * icf.cc (is_function_ctor_or_dtor): New function.
12024 (Icf::find_identical_sections): Check if function is ctor or dtor when
12025 safe icf is chosen.
12026 * options.h (General_options::icf): Change option to be an enum.
12027 (Icf_status): New enum.
12028 (icf_enabled): New method.
12029 (icf_safe_folding): New method.
12030 (set_icf_status): New method.
12031 (icf_status_): New variable.
12032 * (options.cc) (General_options::finalize): Set icf_status_.
12033 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12034 icf_test and icf_keep_unique_test to use the --icf enum flag.
12035 * testsuite/icf_safe_test.sh: New file.
e1df38aa 12036 * testsuite/icf_safe_test.cc: New file.
032ce4e9 12037
f345227a
ST
120382009-10-12 Sriraman Tallam <tmsriram@google.com>
12039
12040 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
12041 includes to gc.h and icf.h.
12042 * arm.cc: Include gc.h.
12043 * gold.cc: Likewise.
12044 * i386.cc: Likewise.
12045 * powerpc.cc: Likewise.
12046 * sparc.cc: Likewise.
12047 * x86_64.cc: Likewise.
12048 * gc.h: Include icf.h.
12049
1c7814ed
ILT
120502009-10-11 Ian Lance Taylor <iant@google.com>
12051
12052 * plugin.cc: Include "gold.h" before other header files.
12053
ae3b5189
CD
120542009-10-10 Chris Demetriou <cgd@google.com>
12055
12056 * options.h (Input_file_argument::Input_file_type): New enum.
12057 (Input_file_argument::is_lib_): Replace with...
12058 (Input_file_argument::type_): New member.
12059 (Input_file_argument::Input_file_argument): Take Input_file_type
12060 'type' rather than boolean 'is_lib' as second argument.
12061 (Input_file_argument::is_lib): Use type_.
12062 (Input_file_argument::is_searched_file): New function.
12063 (Input_file_argument::may_need_search): Handle is_searched_file.
12064 * options.cc (General_options::parse_library): Support -l:filename.
12065 (General_options::parse_just_symbols): Update for Input_file_argument
12066 changes.
12067 (Command_line::process): Likewise.
12068 * archive.cc (Archive::get_file_and_offset): Likewise.
12069 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12070 * script.cc (read_script_file, script_add_file): Likewise.
12071 * fileread.cc (Input_file::Input_file): Likewise.
12072 (Input_file::will_search_for): Handle is_searched_file.
12073 (Input_file::open): Likewise.
12074 * readsyms.cc (Read_symbols::get_name): Likewise.
12075 * testsuite/Makefile.am (searched_file_test): New test.
12076 * testsuite/Makefile.in: Regenerate.
12077 * testsuite/searched_file_test.cc: New file.
12078 * testsuite/searched_file_test_lib.cc: New file.
12079
f3048a1d
ILT
120802009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12081 Ian Lance Taylor <iant@google.com>
12082
12083 * descriptor.cc: Include <cstdio> and "binary-io.h".
12084 (Descriptors::open): Open the files in binary mode always.
12085 * script.cc (Lex::get_token): Treat \r as whitespace.
12086
d4780e57
ILT
120872009-10-09 Ian Lance Taylor <iant@google.com>
12088
12089 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12090
d9a893b8
ILT
120912009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12092 Ian Lance Taylor <iant@google.com>
12093
12094 * configure.ac: Check for readv function also.
12095 * fileread.cc (readv): Define if not HAVE_READV.
12096 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12097 does not exist.
12098 * config.in: Regenerate.
12099 * configure: Regenerate.
12100
c0a62865
DK
121012009-10-09 Doug Kwan <dougkwan@google.com>
12102
12103 * layout.cc (Layout::make_output_section): Call target hook to make
12104 ordinary output section.
12105 (Layout::finalize): Adjust parameter list of call the
12106 Target::may_relax().
12107 * layout.h (class Layout::section_list): New method.
12108 * merge.h (Output_merge_base::entsize): Change visibility to public.
12109 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12110 New methods.
12111 (Output_merge_string::do_is_string): New method.
12112 * object.cc (Sized_relobj::do_setup): renamed from
12113 Sized_relobj::set_up.
12114 * object.h (Sized_relobj::adjust_shndx,
12115 Sized_relobj::initializ_input_to_output_maps,
12116 Sized_relobj::free_input_to_output_maps): Change visibilities to
12117 protected.
12118 (Sized_relobj::setup): Virtualize.
12119 (Sized_relobj::do_setup): New method declaration.
12120 (Sized_relobj::invalidate_section_offset,
12121 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12122 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12123 * options.cc (parse_int): New function.
12124 * options.h (parse_int): New declaration.
12125 (DEFINE_int): New macro.
12126 (stub_group_size): New option.
12127 * output.cc (Output_section::Output_section): Initialize memebers
12128 merge_section_map_, merge_section_by_properties_map_,
12129 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12130 (Output_section::add_input_section): Handled deferred code-fill
12131 generation and remove an old comment.
12132 (Output_section::add_relaxed_input_section): New method definition.
12133 (Output_section::add_merge_input_section): Use merge section by
12134 properties map to speed to search. Update merge section maps
12135 as appropriate.
12136 (Output_section::build_relaxation_map): New method definition.
12137 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12138 Same.
12139 (Output_section::relax_input_section): Renamed to
12140 Output_section::convert_input_sections_to_relaxed_sections and change
12141 interface to take a vector of pointers to relaxed sections.
12142 (Output_section::find_merge_section,
12143 Output_section::find_relaxed_input_section): New method definitions.
12144 (Output_section::is_input_address_mapped,
12145 Output_section::output_offset, Output_section::output_address):
12146 Use output section data maps to speed up searching.
12147 (Output_section::find_starting_output_address): Add comments.
12148 (Output_section::do_write,
12149 Output_section::write_to_postprocessing_buffer): Do code-fill
12150 generation as appropriate.
12151 (Output_section::get_input_sections): Invalidate relaxed input section
12152 map.
12153 (Output_section::restore_states): Adjust type of checkpoint .
12154 Invalidate relaxed input section map.
12155 * output.h (Output_merge_base): New class declaration.
12156 (Input_section_specifier): New class defintion.
12157 (class Output_relaxed_input_section) Change base class to
12158 Output_section_data_build.
12159 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12160 base class initializer.
12161 (Output_section::add_relaxed_input_section): New method declaration.
12162 (Output_section::Input_section): Change visibility to protected.
2e702c99 12163 (Output_section::Input_section::relobj,
c0a62865
DK
12164 Output_section::Input_section::shndx): Handle relaxed input sections.
12165 Output_section::input_sections) Change visibility to protected. Also
12166 define overload to return a non-const pointer.
12167 (Output_section::Merge_section_properties): New class defintion.
12168 (Output_section::Merge_section_by_properties_map,
12169 Output_section::Output_section_data_by_input_section_map,
12170 Output_section::Relaxation_map): New types.
12171 (Output_section::relax_input_section): Rename method to
12172 Output_section::convert_input_sections_to_relaxed_sections and change
12173 interface to take a vector of relaxed section pointers.
12174 (Output_section::find_merge_section,
12175 Output_section::find_relaxed_input_section,
12176 Output_section::build_relaxation_map,
12177 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12178 New method declarations.
12179 (Output_section::merge_section_map_
12180 Output_section::merge_section_by_properties_map_,
12181 Output_section::relaxed_input_section_map_,
12182 Output_section::is_relaxed_input_section_map_valid_,
12183 Output_section::generate_code_fills_at_write_): New data members.
12184 * script-sections.cc
12185 (Output_section_element_input::set_section_addresses): Call
12186 current_data_size and addralign methods of relaxed input sections.
12187 (Orphan_output_section::set_section_addresses): Call current_data_size
12188 and addralign methods of relaxed input sections.
12189 * symtab.cc (Symbol_table::compute_final_value): Extract template
12190 from the body of Symbol_table::sized_finalize_symbol.
12191 (Symbol_table::sized_finalized_symbol): Call
12192 Symbol_table::compute_final_value.
12193 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12194 (Symbol_table::compute_final_value): New templated method declaration.
12195 * target.cc (Target::do_make_output_section): New method defintion.
12196 * target.h (Target::make_output_section): New method declaration.
12197 (Target::relax): Add more parameters for input objects, symbol table
12198 and layout. Adjust call to do_relax.
12199 (Target::do_make_output_section): New method declaration.
12200 (Target::do_relax): Add parameters for input objects, symbol table
12201 and layout.
12202
d446d6c4
ILT
122032009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12204
12205 * pread.c: Include stdio.h.
12206
bc06c745
ILT
122072009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12208
12209 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12210 defined.
12211
75aea3d0
ILT
122122009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12213
12214 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12215 Change read_shndx type to unsigned int.
12216 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12217 int.
12218 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12219 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12220 Change read_shndx type to unsigned int.
12221 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12222 int.
12223 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12224 * layout.cc (Layout::create_symtab_sections): Cast the result of
12225 local_symcount * symsize to off_t in the gold_assert.
12226
be8fcb75
ILT
122272009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12228
12229 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12230 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12231 R_ARM_BASE_ABS.
12232 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12233 (Arm_relocate_functions::thm_abs5): New function.
12234 (Arm_relocate_functions::abs12): New function.
12235 (Arm_relocate_functions::abs16): New function.
12236 (Arm_relocate_functions::base_abs): New function.
12237 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12238 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12239 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12240 R_ARM_BASE_ABS.
12241 (Scan::global): Likewise.
12242 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12243 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12244 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12245 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12246 R_ARM_BASE_ABS.
12247
c2a122b6
ILT
122482009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12249
12250 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12251 (Arm_relocate_functions::movt_prel): New function.
12252 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12253 (Arm_relocate_functions::thm_movt_prel): New function.
12254 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12255 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12256 (Scan::global, Relocate::relocate): Likewise.
12257 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12258
c4aa1e2d
ILT
122592009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12260
12261 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12262 Incremental_checker.
12263 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12264 unsigned int.
12265 (class Incremental_inputs_header): New class.
12266 (Incremental_inputs_header_writer): Edit comment.
12267 (Incremental_inputs_entry): New class.
12268 (Incremental_inputs_entry_writer): Edit comment.
12269 (Sized_incremental_binary::do_find_incremental_inputs_section):
12270 Add *strtab_shndx parameter, fill it.
12271 (Sized_incremental_binary::do_check_inputs): New method.
12272 (Incremental_checker::can_incrementally_link_output_file): Use
12273 Sized_incremental_binary::check_inputs.
12274 (Incremental_inputs::report_command_line): Save command line in
12275 command_line_.
12276 * incremental.h:
12277 (Incremental_binary::find_incremental_inputs_section): New
12278 method.
12279 (Incremental_binary::do_find_incremental_inputs_section): Add
12280 strtab_shndx parameter.
12281 (Incremental_binary::do_check_inputs): New pure virtual method.
12282 (Sized_incremental_binary::do_check_inputs): Declare.
12283 (Incremental_checker::Incremental_checker): Add incremental_inputs
12284 parameter, use it to initialize incremental_inputs_.
12285 (Incremental_checker::incremental_inputs_): New field.
12286 (Incremental_checker::command_line): New method.
12287 (Incremental_checker::inputs): New method.
12288 (Incremental_checker::command_line_): New field.
12289
c549a694
ILT
122902009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12291
12292 * incremental.cc: Include <cstdarg> and "target-select.h".
12293 (vexplain_no_incremental): New function.
12294 (explain_no_incremental): New function.
12295 (Incremental_binary::error): New method.
12296 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12297 method.
12298 (make_sized_incremental_binary): New function.
12299 (open_incremental_binary): New function.
12300 (can_incrementally_link_file): Add checks if output is ELF and has
12301 inputs section.
12302 * incremental.h: Include "elfcpp_file.h" and "output.h".
12303 (Incremental_binary): New class.
12304 (Sized_incremental_binary): New class.
12305 (open_incremental_binary): Declare.
12306 * object.cc (is_elf_object): Use
12307 elfcpp::Elf_recognizer::is_elf_file.
12308 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12309 * output.h (Output_file::filesize): New method.
12310
fd3c5f0b
ILT
123112009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12312
12313 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12314 New function.
12315 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12316 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12317 function.
12318 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12319 function.
12320 (Arm_relocate_functions::movw_abs_nc): New function.
12321 (Arm_relocate_functions::movt_abs): New function.
12322 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12323 (Arm_relocate_functions::thm_movt_abs): New function.
12324 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12325 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12326 (Scan::global): Likewise.
12327 (Relocate::relocate): Likewise.
12328 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12329
7f5309a5
ILT
123302009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12331
12332 * arm.cc (Arm_relocate_functions::got_prel) New function.
12333 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12334 (Relocate::relocate): Likewise.
12335 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12336
364c7fa5
ILT
123372009-10-06 Ian Lance Taylor <iant@google.com>
12338
12339 * options.h (class General_options): Define
12340 split_stack_adjust_size parameter.
12341 * object.h (class Object): Add uses_split_stack_ and
12342 has_no_split_stack_ fields. Add uses_split_stack and
12343 has_no_split_stack accessor functions. Declare
12344 handle_split_stack_section.
12345 (class Reloc_symbol_changes): Define.
12346 (class Sized_relobj): Define Function_offsets. Declare
12347 split_stack_adjust, split_stack_adjust_reltype, and
12348 find_functions.
12349 * object.cc (Object::handle_split_stack_section): New function.
12350 (Sized_relobj::do_layout): Call handle_split_stack_section.
12351 * dynobj.cc (Sized_dynobj::do_layout): Call
12352 handle_split_stack_section.
12353 * reloc.cc (Sized_relobj::relocate_sections): Call
12354 split_stack_adjust for executable sections in split_stack
12355 objects. Pass reloc_map to relocate_section.
12356 (Sized_relobj::split_stack_adjust): New function.
12357 (Sized_relobj::split_stack_adjust_reltype): New function.
12358 (Sized_relobj::find_functions): New function.
12359 * target-reloc.h: Include "object.h".
12360 (relocate_section): Add reloc_symbol_changes parameter. Change
12361 all callers.
12362 * target.h (class Target): Add calls_non_split method. Declare
12363 do_calls_non_split virtual method. Declare match_view and
12364 set_view_to_nop.
12365 * target.cc: Include "elfcpp.h".
12366 (Target::do_calls_non_split): New function.
12367 (Target::match_view): New function.
12368 (Target::set_view_to_nop): New function.
12369 * gold.cc (queue_middle_tasks): Give an error if mixing
12370 split-stack and non-split-stack objects with -r.
12371 * i386.cc (Target_i386::relocate_section): Add
12372 reloc_symbol_changes parameter.
12373 (Target_i386::do_calls_non_split): New function.
12374 * x86_64.cc (Target_x86_64::relocate_section): Add
12375 reloc_symbol_changes parameter.
12376 (Target_x86_64::do_calls_non_split): New function.
12377 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12378 parameter.
12379 * powerpc.cc (Target_powerpc::relocate_section): Add
12380 reloc_symbol_changes parameter.
12381 * sparc.cc (Target_sparc::relocate_section): Add
12382 reloc_symbol_changes parameter.
12383 * configure.ac: Call AM_CONDITIONAL for the default target.
12384 * configure: Rebuild.
12385 * testsuite/Makefile.am (TEST_AS): New variable.
12386 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12387 (check_DATA): Add split_i386 and split_x86_64 files.
12388 (SPLIT_DEFSYMS): Define.
12389 (split_i386_[1234n].o): New targets.
12390 (split_i386_[124]): New targets.
12391 (split_i386_[1234r].stdout): New targets.
12392 (split_x86_64_[1234n].o): New targets.
12393 (split_x86_64_[124]): New targets.
12394 (split_x86_64_[1234r].stdout): New targets.
12395 (MOSTLYCLEANFILES): Add new executables.
12396 * testsuite/split_i386.sh: New file.
12397 * testsuite/split_x86_64.sh: New file.
12398 * testsuite/split_i386_1.s: New file.
12399 * testsuite/split_i386_2.s: New file.
12400 * testsuite/split_i386_3.s: New file.
12401 * testsuite/split_i386_4.s: New file.
12402 * testsuite/split_i386_n.s: New file.
12403 * testsuite/split_x86_64_1.s: New file.
12404 * testsuite/split_x86_64_2.s: New file.
12405 * testsuite/split_x86_64_3.s: New file.
12406 * testsuite/split_x86_64_4.s: New file.
12407 * testsuite/split_x86_64_n.s: New file.
12408 * testsuite/testfile.cc (Target_test): Update relocation_section
12409 function.
12410 * testsuite/Makefile.in: Rebuild.
12411
e8a9fcda
ILT
124122009-10-06 Ian Lance Taylor <iant@google.com>
12413
12414 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12415 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12416 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12417 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12418 the address on ldo_addrs_.
12419 (Target_i386::Relocate::fix_up_ldo): New function.
12420
e99daf92
ILT
124212009-10-06 Rafael Espindola <espindola@google.com>
12422
12423 * plugin.cc (add_input_library): New.
12424 (Plugin::load): Add add_input_library to tv.
12425 (Plugin_manager::add_input_file): Add the is_lib argument.
12426 (add_input_file): Update call to Plugin_manager::add_input_file.
12427 (add_input_library): New.
12428 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12429
966d4097
DK
124302009-09-30 Doug Kwan <dougkwan@google.com>
12431
12432 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12433 symbol and call Symbol::may_need_copy_reloc to determine if
12434 a copy reloc is needed.
12435 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12436 nocopyreloc is given in command line.
12437 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12438 given in command line.
12439 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12440 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12441 of the removed Target_i386::may_need_copy_reloc.
12442 * options.h (copyreloc): New option with default value false.
12443 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12444 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12445 instead of the removed Target_powerpc::may_need_copy_reloc.
12446 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12447 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12448 instead of the removed Target_sparc::may_need_copy_reloc.
12449 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12450 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12451 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12452 instead of the removed Target_x86_64::may_need_copy_reloc.
12453
029ba973
ILT
124542009-09-30 Ian Lance Taylor <iant@google.com>
12455
12456 * object.h (class Object): Remove target_ field, and target,
12457 sized_target, and set_target methods.
12458 (Object::sized_target): Remove.
12459 (class Sized_relobj): Update declarations. Remove sized_target.
12460 * object.cc (Sized_relobj::setup): Remove target parameter.
12461 Change all callers.
12462 (Input_objects::add_object): Don't do anything with the target.
12463 (make_elf_sized_object): Add punconfigured parameter. Change all
12464 callers. Set or test parameter target.
12465 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12466 Change all callers.
12467 * parameters.cc (Parameters::set_target): Change parameter type to
12468 be non-const.
12469 (Parameters::default_target): Remove.
12470 (set_parameters_target): Change parameter type to be non-const.
12471 (parameters_force_valid_target): New function.
12472 (parameters_clear_target): New function.
12473 * parameters.h (class Parameters): Update declarations. Remove
12474 default_target method. Add sized_target and clear_target
12475 methods. Change target_ to be non-const.
12476 (set_parameters_target): Update declaration.
12477 (parameters_force_valid_target): Declare.
12478 (parameters_clear_target): Declare.
12479 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12480 as NULL if we aren't searching.
12481 (Add_symbols::run): Don't check for compatible target.
12482 * fileread.cc (Input_file::open_binary): Call
12483 parameters_force_valid_target.
12484 * gold.cc (queue_middle_tasks): Likewise.
12485 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12486 set_target on object.
12487 * dynobj.h (class Sized_dynobj): Update declarations.
12488 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12489 make_elf_object returns NULL.
12490 (Archive::include_member): Don't check whether object target is
12491 compatible.
12492 * output.cc (Output_section::add_input_section): Get target from
12493 parameters.
12494 (Output_section::relax_input_section): Likewise.
12495 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12496 parameters.
12497 (Sized_relobj::do_scan_relocs): Likewise.
12498 (Sized_relobj::relocate_sections): Likewise.
12499 * resolve.cc (Symbol_table::resolve): Likewise.
12500 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12501 parameter. Change all callers.
12502 (Symbol_table::add_from_object): Get target from parameters.
12503 (Symbol_table::add_from_relobj): Don't check object target.
12504 (Symbol_table::add_from_dynobj): Likewise.
12505 (Symbol_table::define_special_symbol): Get target from
12506 parameters.
12507 * symtab.h (class Symbol_table): Update declaration.
12508 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12509 parameter. Change all callers. Clear parameter target.
12510 (Binary_test): Test target here.
12511 * testsuite/object_unittest.cc (gold_testsuite): Remove
12512 target_test_pointer parameter. Change all callers.
12513 (Object_test): Test target here.
12514
a6a22b83
ILT
125152009-09-26 Ian Lance Taylor <iant@google.com>
12516
12517 * testsuite/initpri1.c: Don't try to use constructor priorities if
12518 compiling with gcc before 4.3.
12519
6a8f49fe
ILT
125202009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12521
12522 * testsuite/retain_symbols_file_test.sh (check_present): Change
12523 output file name to retain_symbols_file_test.stdout.
12524 (check_absent): Likewise.
12525
8c604651
CS
125262009-09-18 Craig Silverstein <csilvers@google.com>
12527
12528 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12529 * options.cc: Include <cerrno> and <fstream>.
12530 (General_options::finalize): Parse -retain-symbols-file tag.
12531 * options.h: New flag.
12532 (General_options): New method should_retain_symbol, new
12533 variable symbols_to_retain.
12534 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12535 should_retain_symbol map.
12536 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12537 * testsuite/Makefile.in: Regenerate.
12538 * testsuite/retain_symbols_file_test.sh: New file.
12539
ca58b19f
NC
125402009-09-18 Nick Clifton <nickc@redhat.com>
12541
12542 * po/es.po: Updated Spanish translation.
12543
20e6d0d6
DK
125442009-09-17 Doug Kwan <dougkwan@google.com>
12545
12546 * debug.h (DEBUG_RELAXATION): New constant.
12547 (DEBUG_ALL): Add DEBUG_RELAXATION.
12548 (debug_string_to_enum): Add relaxation debug option.
12549 * layout.cc
12550 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12551 Layout::Relaxation_debug_check::read_sections,
12552 Layout::Relaxation_debug_check::read_sections): New method definitions.
12553 (Layout::Layout): Initialize data members
12554 record_output_section_data_from_scrips_,
12555 script_output_section_data_list_ and relaxation_debug_check_.
12556 (Layout::save_segments, Layout::restore_segments,
12557 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12558 Layout::relaxation_loop_body): New method definitions.
12559 (Layout::finalize): Support relaxation. Move section layout code to
12560 Layout::relaxation_loop_body.
12561 (Layout::set_asection_address_from_script): Move code for orphan
12562 section placement out.
12563 (Layout::place_orphan_sections_in_script): New method definition.
12564 * layout.h (Output_segment_headers, Output_file_header):
12565 New forward class declarations.
12566 (Layout::~Layout): Define.
12567 (Layout::new_output_section_data_from_script): New method definition.
12568 (Layout::place_orphan_sections_in_script): New method declaration.
12569 (Layout::Segment_states): New type declaration.
12570 (Layout::save_segments, Layout::restore_segments,
12571 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12572 Layout::relaxation_loop_body): New method declarations.
12573 (Layout::Output_section_data_list): New type declaration.
12574 (Layout::Relaxation_debug_check): New class definition.
12575 (Layout::record_output_section_data_from_script_,
12576 Layout::script_output_section_data_list_, Layout::segment_states_,
12577 Layout::relaxation_debug_check_): New data members.
12578 * output.cc: (Output_section_headers::do_size): New method definition.
12579 (Output_section_headers::Output_section_headers): Move size
12580 computation to Output_section_headers::do_size.
12581 (Output_segment_headers::do_size): New method definition.
e1df38aa 12582 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
12583 Output_file_header::do_size and call it.
12584 (Output_file_header::do_size): New method definition.
12585 (Output_data_group::Output_data_group): Adjust call to
12586 Output_section_data.
12587 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12588 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 12589 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
12590 RELAXED_INPUT_SECTION_CODE.
12591 (Output_section::Output_section): Initialize data member checkpoint_.
12592 (Output_section::~Output_section): Delete checkpoint object pointed
12593 by checkpoint_.
12594 (Output_section::add_input_section): Always add an Input_section if
12595 relaxing.
12596 (Output_section::add_merge_input_section): Add assert.
12597 (Output_section::relax_input_section): New method definition.
12598 (Output_section::set_final_data_size): Set load address to zero for
12599 an unallocated section.
12600 (Output_section::do_address_and_file_offset_have_reset_values):
12601 New method definition.
12602 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12603 Handle relaxed input section.
12604 (Output_section::sort_attached_input_sections): Checkpoint input
12605 section list lazily.
12606 (Output_section::get_input_sections): Change type of input_sections to
12607 list of Simple_input_section pointers. Checkpoint input section list
12608 lazily. Also handle relaxed input sections.
12609 (Output_section::add_input_section_for_script): Take a reference to
12610 a Simple_input_section object instead of Relobj pointer and section
12611 index as parameter. Handle relaxed input sections.
12612 (Output_section::save_states, Output_section::restore_states): New
12613 method definitions.
12614 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12615 (Output_data::is_data_size_fixed): New method definition.
12616 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12617 if it is fixed.
12618 (Output_data::address_and_file_offset_have_reset_values): New method
12619 definition.
12620 (Output_data::do_address_and_file_offset_have_reset_values): New method
12621 definition.
12622 (Output_data::set_data_size): Check that data size is not fixed.
12623 (Output_data::fix_data_size): New method definition.
12624 (Output_data::is_data_size_fixed_): New data member.
12625 (Output_section_headers::set_final_data_size): New method definition.
12626 (Output_section_headers::do_size): New method declaration.
12627 (Output_segment_headers::set_final_data_size): New method definition.
12628 (Output_segment_headers::do_size): New method declaration.
12629 (Output_file_header::set_final_data_size)::New method definition.
12630 (Output_file_header::do_size)::New method declaration.
12631 (Output_section_data::Output_section_data): Add new parameter
12632 is_data_size_fixed and use it to fix data size.
12633 (Output_data_const::Output_data_const): Adjust call to base class
12634 constructor and fix data size.
12635 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12636 base class constructor and fix data size.
12637 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12638 base class constructor and fix data size.
12639 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12640 class constructor and fix data size.
12641 (Output_data_group::set_final_data_size): New method definition.
12642 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12643 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12644 class constructor and fix data size.
12645 (Output_relaxed_input_section): New class definition.
12646 (Output_section::Simple_input_section): New class definition.
12647 (Output_section::get_input_sections): Adjust parameter list.
12648 (Output_section::add_input_section_for_script): Same.
12649 (Output_section::save_states, Output_section::restore_states,
12650 Output_section::do_address_and_file_offset_have_reset_values,
12651 (Output_section::Input_section::Input_section): Handle
12652 RELAXED_INPUT_SECTION_CODE. Add new overload for
12653 Output_relaxed_input_section.
12654 (Output_section::Input_section::is_input_section,
12655 Output_section::Input_section::set_output_section): Handle relaxed
12656 input section.
12657 (Output_section::Input_section::is_relaxed_input_section,
12658 Output_section::Input_section::output_section_data,
12659 Output_section::Input_section::relaxed_input_section): New method
12660 definitions.
12661 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12662 value.
12663 (Output_section::Input_section::u1_): Update comments.
12664 (Output_section::Input_section::u2_): Add new union member poris.
12665 (Output_section::Checkpoint_output_section): New classs definition.
12666 (Output_section::relax_input_section): New method declaration.
12667 (Output_section::checkpoint_): New data member.
12668 (Output_segment): Update comments.
12669 (Output_segment::Output_segment): Un-privatize copy constructor.
12670 (Output_segment::operator=): Un-privatize.
12671 * script-sections.cc (Output_section_element::Input_section_list):
12672 Change element type to Output_section::Simple_input_section.
12673 (Output_section_element_dot_assignment::set_section_addresses):
12674 Register output section data for relaxation clean up.
12675 (Output_data_exression::Output_data_expression): Adjust call to base
12676 constructor to fix data size.
12677 (Output_section_element_data::set_section_addresses): Register
12678 Output_data_expression object for relaxation clean up.
12679 (struct Input_section_info): Replace Relobj pointer and section index
12680 pair with Output_section::Simple_input_section and Convert struct to a
12681 class.
12682 (Input_section_sorter::operator()): Adjust access to
e1df38aa 12683 Input_section_info data member to use accessors.
20e6d0d6
DK
12684 (Output_section_element_input::set_section_addresses): Use layout
12685 parameter. Adjust code to use Output_section::Simple_input_section
12686 and Input_secction_info classes. Register filler for relaxation
12687 clean up.
12688 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12689 and section index pair with Output_section::Simple_input_section
12690 class. Adjust code accordingly.
12691 (Phdrs_element::release_segment): New method definition.
12692 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12693 segment list.
12694 (Script_sections::release_segments): New method definition.
12695 * gold/script-sections.h (Script_sections::release_segments): New
12696 method declaration.
12697 * gold/target.h (Target::may_relax, Target::relax,
12698 Target::do_may_relax, Target::do_relax): New method definitions.
12699
5e445df6
ILT
127002009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12701
12702 * arm.cc (has_signed_unsigned_overflow): New function.
12703 (Arm_relocate_functions::abs8): New function.
12704 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12705 (Target_arm::Scan::global): Likewise.
12706 (Target_arm::relocate::relocate): Likewise.
12707 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12708 Likewise.
12709
8c604651 127102009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
12711
12712 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12713 * testsuite/Makefile.in: Regenerate.
12714
1e9cc1c2
NC
127152009-09-11 Nick Clifton <nickc@redhat.com>
12716
12717 * po/gold.pot: Updated by the Translation project.
12718
6a89f575
CC
127192009-09-08 Cary Coutant <ccoutant@google.com>
12720
12721 * output.cc (Output_file::open): Add execute permission to empty file.
12722 * testsuite/Makefile.am (permission_test): New test.
12723 * testsuite/Makefile.in: Regenerate.
12724
fdcac5af
ILT
127252009-09-02 Ian Lance Taylor <iant@google.com>
12726
12727 * output.cc (Output_file::resize): Call map_no_anonymous rather
12728 than map.
12729
44453f85
ILT
127302009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12731
12732 * gold.cc: Include "incremental.h".
12733 (queue_initial_tasks): Call Incremental_checker methods.
12734 * incremental.cc: Include "output.h".
12735 (Incremental_checker::can_incrementally_link_output_file): New
12736 method.
12737 * incremental.h (Incremental_checker): New class.
12738
12739 * output.cc (Output_file::open_for_modification): New method.
12740 (Output_file::map_anonymous): Changed return type to bool. Record
12741 map in base_ field.
12742 (Output_file::map_no_anonymous): New method, broken out of map.
12743 (Output_file::map): Use map_no_anonymous and map_anonymous.
12744 * output.h (class Output_file): Update declarations.
12745
293c1386
CC
127462009-08-24 Cary Coutant <ccoutant@google.com>
12747
12748 * options.h (Command_line::Pre_options): New class.
12749 (Command_line::pre_options): New member.
12750 * options.cc (gold::options::ready_to_register): New variable.
12751 (One_option::register_option): Do nothing if not registering options.
12752 Assert if same short option registered twice.
12753 (General_options::General_options): Turn off option registration when
12754 done constructing.
12755 (Command_line::Pre_options::Pre_options): New constructor.
12756
f773f3d2
CC
127572009-08-24 Cary Coutant <ccoutant@google.com>
12758
06a73cfe
CC
12759 * options.h (General_options::no_keep_memory): Remove incorrect
12760 short option.
f773f3d2 12761
a15af8e2
RW
127622009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12763
12764 * Makefile.am (am__skiplex, am__skipyacc): New.
12765 * Makefile.in: Regenerate.
12766
c462b41b
RW
127672009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12768
14ec8efd
RW
12769 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12770 (INCLUDES): ... this.
12771 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12772 (AM_CPPFLAGS): Renamed from ...
12773 (INCLUDE): ... this.
12774 * Makefile.in, testsuite/Makefile.in: Regenerate.
12775
81ecdfbb
RW
12776 * Makefile.in: Regenerate.
12777 * aclocal.m4: Likewise.
12778 * config.in: Likewise.
12779 * configure: Likewise.
12780 * testsuite/Makefile.in: Likewise.
12781
c462b41b
RW
12782 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12783 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12784 * Makefile.in: Regenerate.
12785 * testsuite/Makefile.in: Regenerate.
12786
2da73f13
CC
127872009-08-19 Cary Coutant <ccoutant@google.com>
12788
12789 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12790 symbols in shared libraries overridden by hidden or internal symbols
12791 in the main program.
12792
2db70501
CD
127932009-08-19 Chris Demetriou <cgd@google.com>
12794
12795 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12796 checking source file names in error messages.
12797
f733487b
DK
127982009-08-18 Doug Kwan <dougkwan@google.com>
12799
12800 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12801 an elcpp::Ehdr as parameter. Adjust call to set_target.
12802 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12803 an elfcpp::Ehdr as parameter.
12804 * object.cc (Object::set_target): Remove the version that looks up
12805 a target and sets it.
12806 (Sized_relobj::setup): Take a Target object instead of
12807 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12808 (make_elf_sized_object): Find target and ask target to
12809 make an ELF object.
12810 * object.h: (Object::set_target): Remove the version that looks up
12811 a target and sets it.
12812 (Sized_relobj::setup): Take a Target object instead of
12813 an elfcpp:Ehdr as parameter.
12814 * target.cc: Include dynobj.h.
12815 (Target::do_make_elf_object_implementation): New.
2e702c99 12816 (Target::do_make_elf_object): New.
f733487b
DK
12817 * target.h (Target::make_elf_object): New template declaration.
12818 (Target::do_make_elf_object): New method declarations.
12819 (Target::do_make_elf_object_implementation): New template declaration.
12820
cc70f101
ILT
128212009-08-14 Ian Lance Taylor <iant@google.com>
12822
12823 * gold.h (FUNCTION_NAME): Define.
12824 (gold_unreachable): Use FUNCTION_NAME.
12825
ef5e0cb1
ST
128262009-08-12 Sriraman Tallam <tmsriram@google.com>
12827
12828 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12829 symbol in the --keep-unique list is not found.
12830
48c187ce
ST
128312009-08-12 Sriraman Tallam <tmsriram@google.com>
12832
12833 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12834 been maked as --keep-unique.
12835 (Icf::unfold_section): New function.
12836 * icf.h (Icf::unfold_section): New function.
12837 * options.h (General_options::keep_unique): New option.
12838 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12839 * testsuite/Makefile.in: Regenerate.
12840 * testsuite/icf_keep_unique_test.sh: New file.
12841 * testsuite/icf_keep_unique_test.cc: New file.
12842
645afe0c
CC
128432009-08-12 Cary Coutant <ccoutant@google.com>
12844
12845 PR 10471
12846 * resolve.cc (Symbol_table::resolve): Check for references from
12847 dynamic objects to hidden and internal symbols.
12848 * testsuite/Makefile.am (hidden_test.sh): New test.
12849 * testsuite/Makefile.in: Regenerate.
12850 * testsuite/hidden_test.sh: New script.
12851 * testsuite/hidden_test_1.c: New test source.
12852 * testsuite/hidden_test_main.c: New test source.
12853
11af873f
DK
128542009-08-11 Doug Kwan <dougkwan@google.com>
12855
12856 * arm.cc: Update comments.
12857 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12858 segment to locate the .ARM.exidx section if present.
12859
b9f7d72d
DK
128602009-08-09 Doug Kwan <dougkwan@google.com>
12861
12862 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12863 patch.
12864
ddd3c53c
ST
128652009-08-07 Sriraman Tallam <tmsriram@google.com>
12866 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12867 compiler warnings.
12868
27721062
ST
128692009-08-06 Sriraman Tallam <tmsriram@google.com>
12870
12871 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12872 valid tls_segment only for non-debug-section relocations.
12873 * testsuite/Makefile.am: Add gc_tls_test.
12874 * testsuite/Makefile.in: Regenerate.
12875 * testsuite/gc_tls_test.cc: New file.
12876 * testsuite/gc_tls_test.sh: New file.
12877
ef15dade 128782009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 12879
ef15dade
ST
12880 * icf.cc: New file.
12881 * icf.h: New file.
12882 * Makefile.am (CCFILES): Add icf.cc.
12883 (HFILES): Add icf.h
12884 * Makefile.in: Regenerate.
12885 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12886 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12887 section, symbol and addend information for the relocs.
12888 * gold.cc (queue_middle_tasks): Call identical code folding.
12889 * gold.h: Add defines for multimap.
12890 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12891 to the call of finalize_local_symbols.
12892 * main.cc (main): Create object of class Icf.
12893 * object.cc (Sized_relobj::do_layout): Allow this function to be
12894 called twice during icf.
12895 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12896 to sections marked as identical by icf.
12897 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12898 when available.
12899 (Sized_relobj::do_section_entsize): New function.
12900 * object.h (Object::section_entsize): New function.
12901 (Object::do_section_entsize): New pure virtual function.
12902 (Relobj::finalize_local_symbols): Add new parameter.
12903 (Relobj::do_section_entsize): New function.
12904 * options.h (General_options::icf): New option.
12905 (General_options::icf_iterations): New option.
12906 (General_options::print_icf_sections): New option.
12907 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12908 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12909 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12910 icf.
12911 * symtab.cc (Symbol_table::is_section_folded): New function.
12912 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12913 to sections marked as identical by icf.
12914 * symtab.h (Symbol_table::set_icf): New function.
12915 (Symbol_table::icf): New function.
12916 (Symbol_table::is_section_folded): New function.
12917 (Symbol_table::icf_): New data member.
12918 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12919 * testsuite/Makefile.am: Add commands to build icf_test.
12920 * testsuite/Makefile.in: Regenerate.
12921 * testsuite/icf_test.sh: New file.
12922 * testsuite/icf_test.cc: New file.
12923
c3b65ac4
CD
129242009-07-24 Chris Demetriou <cgd@google.com>
12925
12926 * layout.cc (is_compressible_debug_section): Fix incorrect
12927 comment about compressed section names.
12928
1caf2c51
ILT
129292009-07-20 Ian Lance Taylor <ian@airs.com>
12930
12931 PR 10419
12932 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12933
1ef4d87f
ILT
129342009-07-16 Ian Lance Taylor <iant@google.com>
12935
12936 PR 10400
12937 * layout.h: #include <map>.
12938 (class Kept_section): Change from struct to class. Add accessors
12939 and setters. Add section size to Comdat_group mapping. Change
12940 Comdat_group to std::map. Add is_comdat_ field. Add
12941 linkonce_size field in union.
12942 (class Layout): Update declaration of find_or_add_kept_section.
12943 Don't declare find_kept_object.
12944 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12945 parameter. Add object, shndx, is_comdat, and is_group_name
12946 parameters. Change all callers. Adjust for new Kept_section.
12947 (Layout::find_kept_object): Remove.
12948 * object.cc (Sized_relobj::include_section_group): Update use of
12949 Kept_section. Rename secnum to shndx. Only record
12950 Kept_comdat_section if sections are the same size.
12951 (Sized_relobj::include_linkonce_section): Update use of
12952 Kept_section. Only record Kept_comdat_section if sections are the
12953 same size. Set size of linkonce section.
12954 (Sized_relobj::map_to_kept_section): Update call to
12955 get_kept_comdat_section.
12956 * object.h (class Sized_relobj): Rename fields in
12957 Kept_comdat_section to drop trailing underscores; change object
12958 field to Relobj*. Change Kept_comdat_section_table to store
12959 struct rather than pointer.
12960 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
12961 Add kept_object and kept_shndx parameters. Change all callers.
12962 (Sized_relobj::get_kept_comdat_section): Change return type to
12963 bool. Add kept_object and kept_shndx parameters. Change all
12964 callers.
12965 * plugin.cc (Pluginobj::include_comdat_group): Update call to
12966 Layout::find_or_add_kept_section.
12967
37c3b7b0
ILT
129682009-07-09 Ian Lance Taylor <iant@google.com>
12969
12970 * merge.cc (Object_merge_map::initialize_input_to_output_map):
12971 Reserve space in the hash table.
12972
98fa85cb
ILT
129732009-07-06 Mikolaj Zalewski <mikolajz@google.com>
12974
12975 * fileread.cc (File_read::get_mtime): New method.
12976 * fileread.h (Timespec): New structure.
12977 (File_read::get_mtime): New method.
12978 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
12979 Renamed from timestamp_nsec.
12980 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
12981 Elf_Xword.
e1df38aa 12982 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 12983 timestamp_nsec.
e1df38aa 12984 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
12985 (Incremental_inputs::report_obejct): Save mtime; style fix.
12986 (Incremental_inputs::report_script): Save mtime; style fix.
12987 (Incremental_inputs::finalize_inputs): Style fix.
12988 (Incremental_inputs::finalize): Style fix.
12989 (Incremental_inputs::create_input_section_data): Store inputs
12990 mtime.
12991 * incremental.h (Incremental_inputs::report_script): Add mtime
12992 argument.
12993 (Incremental_inputs::Input_info::Input_info): Intialize only one
12994 union member.
12995 (Incremental_inputs::Input_info::archive): Move to nameless
12996 union.
12997 (Incremental_inputs::Input_info::obejct): Move to nameless union.
12998 (Incremental_inputs::Input_info::script): Move to nameless union.
12999 (Incremental_inputs::mtime): New field.
13000 * script.cc (read_input_script): Pass file mtime to
13001 Incremental_input.
13002 * script.h (Script_info::inputs): Style fix.
13003
c9d70757
ILT
130042009-07-01 Ian Lance Taylor <ian@airs.com>
13005
13006 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13007 instead of 32.
13008
9c547ec3
ILT
130092009-06-24 Ian Lance Taylor <iant@google.com>
13010
13011 PR 10156
13012 * layout.cc (Layout::choose_output_section): If we find an
13013 existing section, update the flags.
13014 (Layout::create_notes): New function, broken out of
13015 Layout::finalize.
13016 (Layout::finalize): Don't create note sections.
13017 (Layout::create_note): Don't crash if linker script discards
13018 section.
13019 (Layout::create_gold_note): Likewise.
13020 (Layout::create_build_id): Likewise. Don't set
13021 after_input_sections on the section.
13022 (Layout::create_executable_stack_info): Remove target parameter.
13023 Change caller.
13024 * layout.h (class Layout): Declare create_notes. Update
13025 declaration of create_executable_stack_info.
13026 * gold.cc (queue_middle_tasks): Call create_notes.
13027 * output.cc (Output_section::update_flags_for_input_section): Move
13028 here from output.h. If SHF_ALLOC flag is newly set, mark address
13029 invalid.
13030 * output.h (Output_data::mark_address_invalid): New function.
13031 (class Output_section): Only declare, not define,
13032 update_flags_for_input_section. Remove set_flags.
13033
55458500
ILT
130342009-06-24 Ian Lance Taylor <iant@google.com>
13035
13036 * script-sections.cc (Output_section_definition::
13037 set_section_addresses): Rename shadowing local load_address to
13038 laddr.
13039
1307d6cd
ILT
130402009-06-24 Ian Lance Taylor <iant@google.com>
13041
13042 PR 10244
13043 * reloc.cc (relocate_sections): Skip empty relocation sections.
13044
ec3f783e
ILT
130452009-06-23 Ian Lance Taylor <iant@google.com>
13046
13047 PR 10156
13048 * layout.cc (Layout::create_note): Use choose_output_section
13049 rather than make_output_section.
13050
459c9f1c
ILT
130512009-06-23 Ian Lance Taylor <iant@google.com>
13052
13053 PR 10237
13054 * options.cc (General_options::parse_V): Set printed_version_.
13055 (General_options::General_options): Initialize printed_version_.
13056 * options.h (class General_options): Add printed_version_ field.
13057 * gold.cc (queue_initial_tasks): If there are no input files,
13058 don't give a fatal error if we printed the version information.
13059 (queue_middle_tasks): If using -r with a shared object, give a
13060 fatal error rather than an ordinary error.
13061
1518dc8f
ILT
130622009-06-23 Ian Lance Taylor <iant@google.com>
13063
13064 PR 10219
13065 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13066 (Layout::make_output_section): Set have_stabstr_section_ if we see
13067 a .stab*str section.
13068 (Layout::finalize): Call link_stabs_sections.
13069 (Layout::link_stabs_sections): New file.
13070 * layout.h (class Layout): Add have_stabstr_section_ field.
13071 Declare link_stabs_sections.
13072
3d857b98
DK
130732009-06-23 Doug Kwan <dougkwan@google.com>
13074
13075 * Makefile.am (libgold_a_LIBADD): New.
13076 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 13077 * Makefile.in: Regenerate.
3d857b98
DK
13078 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13079 * configure: Regenerate.
13080 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13081 * fileread.cc: Include sys/state.h
13082 * gold.h: Declare memmem and strndup if found missing.
13083 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13084
0639a6f6
ILT
130852009-06-23 Ian Lance Taylor <iant@google.com>
13086
13087 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13088 * configure: Rebuild.
13089
8d63875c
ILT
130902009-06-23 Ian Lance Taylor <iant@google.com>
13091
13092 PR 10147
13093 * object.cc (Object::section_contents): Don't try to get a view if
13094 the section has length zero.
13095 (Object::handle_gnu_warning_section): If the section is empty, use
13096 the name of the section as the warning.
13097
f7c8a183
ILT
130982009-06-23 Ian Lance Taylor <iant@google.com>
13099
13100 PR 10133
13101 * stringpool.h (class Stringpool_template): Add optimize_ field.
13102 (Stringpool_template::set_optimize): New function.
13103 * stringpool.cc (Stringpool_template::Stringpool_template):
13104 Initialize optimize_ field.
13105 (Stringpool_template::set_string_offsets): Test local optimize
13106 fild rather than parameter.
13107 * layout.cc (Layout::Layout): Call set_optimize on the section
13108 name stringpool.
13109
e6a307ba
ILT
131102009-06-22 Ian Lance Taylor <iant@google.com>
13111
13112 PR 10030
13113 * yyscript.y: Parse TARGET.
13114 * script.cc (script_set_target): New function.
13115 * script-c.h (script_set_target): Declare.
13116 * options.cc (General_options::string_to_object_format): Rename
13117 from string_to_object_format in anonymous namespace. Change
13118 callers.
13119 * options.h (class General_options): Declare
13120 string_to_object_format.
13121
3ee173de
ILT
131222009-06-22 Ian Lance Taylor <iant@google.com>
13123
13124 * script-sections.cc (Script_sections::create_segments): Don't put
13125 program headers in a PT_LOAD segment if -n or -N.
13126
131272009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
13128
13129 PR 10141
13130 * options.h (class General_options): Add -z lazy and -z now. Sort
13131 -z options into alphabetical order.
13132 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13133
cd6739a1 131342009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
13135
13136 * layout.cc (Layout::make_output_section): Call
13137 Target::new_output_section.
13138 (Layout::attach_allocated_section_to_segment): Put large section
13139 sections in a separate load segment with the large segment flag
13140 set.
13141 (Layout::segment_precedes): Sort large data segments after other
13142 load segments.
13143 (align_file_offset): New static function.
13144 (Layout::set_segment_offsets): Use align_file_offset.
13145 * output.h (class Output_section): Add is_small_section_ and
13146 is_large_section_ fields.
13147 (Output_section::is_small_section): New function.
13148 (Output_section::set_is_small_section): New function.
13149 (Output_section::is_large_section): New function.
13150 (Output_section::set_is_large_section): New function.
13151 (Output_section::is_large_data_section): New function.
13152 (class Output_segment): Add is_large_data_segment_ field.
13153 (Output_segment::is_large_data_segment): New function.
13154 (Output_segment::set_is_large_data_segment): New function.
13155 * output.cc (Output_section::Output_section): Initialize new
13156 fields.
13157 (Output_segment::Output_segment): Likewise.
13158 (Output_segment::add_output_section): Add assertion that large
13159 data sections always go in large data segments. Force small data
13160 sections to the end of the list of data sections. Force small BSS
13161 sections to the start of the list of BSS sections. For large BSS
13162 sections to the end of the list of BSS sections.
13163 * symtab.h (class Symbol): Declare is_common_shndx.
13164 (Symbol::is_defined): Check Symbol::is_common_shndx.
13165 (Symbol::is_common): Likewise.
13166 (class Symbol_table): Define enum Commons_section_type. Update
13167 declarations. Add small_commons_ and large_commons_ fields.
13168 * symtab.cc (Symbol::is_common_shndx): New function.
13169 (Symbol_table::Symbol_table): Initialize new fields.
13170 (Symbol_table::add_from_object): Put small and large common
13171 symbols in the right list.
13172 (Symbol_table::sized_finalized_symbol): Check
13173 Symbol::is_common_shndx.
13174 (Symbol_table::sized_write_globals): Likewise.
13175 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13176 common symbol lists. Don't call do_allocate_commons_list if the
13177 list is empty.
13178 (Symbol_table::do_allocate_commons_list): Remove is_tls
13179 parameter. Add comons_section_type parameter. Change all
13180 callers. Handle small and large common symbols.
13181 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13182 Symbol::is_common_shndx.
13183 * resolve.cc (symbol_to_bits): Likewise.
13184 * target.h (Target::small_common_shndx): New function.
13185 (Target::small_common_section_flags): New function.
13186 (Target::large_common_shndx): New function.
13187 (Target::large_common_section_flags): New function.
13188 (Target::new_output_section): New function.
13189 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13190 small_common_section_flags, and large_common_section_flags
13191 fields.
13192 (Target::do_new_output_section): New virtual function.
13193 * arm.cc (Target_arm::arm_info): Initialize new fields.
13194 * i386.cc (Target_i386::i386_info): Likewise.
13195 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13196 Likewise.
13197 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13198 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13199 (Target_x86_64::do_new_output_section): New function.
13200 * configure.ac: Define conditional MCMODEL_MEDIUM.
13201 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13202 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13203 (large_LDFLAGS): Define.
13204 * testsuite/large.c: New file.
13205 * testsuite/testfile.cc (Target_test::test_target_info):
13206 Initialize new fields.
13207 * configure, testsuite/Makefile.in: Rebuild.
13208
bb04269c
DK
132092009-06-05 Doug Kwan <dougkwan@google.com>
13210
13211 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13212 * Makefile.in: Regenerate.
bb04269c
DK
13213 * i386.cc (class Target_i386): Define new virtual method to
13214 override do_is_local_label_name in parent.
13215 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13216 local symbols if --discard-locals or -X is given.
13217 * options.h (class General_options): Declare new options
13218 '--discard-locals' and '-X' for discarding locals.
13219 * target.h (class Target): Define new methods is_local_label_name.
13220 Declare new virtual method do_is_local_label_name.
13221 * target.cc: New file.
13222 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13223 (check_SCRIPTS): Add discard_locals_test.sh.
13224 (check_DATA): Add discard_local_tests.syms.
13225 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13226 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13227 * testsuite/Makefile.in: Regenerate.
13228 * testsuite/discard_locals_test.c: New file.
13229 * testsuite/discard_locals_test.sh: Same.
13230
805bb01c
DK
132312009-06-05 Doug Kwan <dougkwan@google.com>
13232
13233 * object.cc (Sized_relobj::Sized_relobj): Initialize
13234 discarded_eh_frame_shndx_ to -1U.
13235 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13236 section.
13237 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13238 a discarded .eh_frame section.
13239 (Sized_relobj::do_finalize_local_symbols): Ditto.
13240 * object.h (class Sized_relobj): Declare new member
13241 discarded_eh_frame_shndx_.
13242 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13243 (local_labels_test.o, local_labels_test): New rules.
13244 * testsuite/Makefile.in: Regenerate.
13245
1dcd334d
DK
132462009-06-04 Doug Kwan <dougkwan@google.com>
13247
13248 * layout.cc (Layout::section_name_mapping): Add mapping for
13249 special ARM sections.
13250
96d49306
DK
132512009-06-03 Doug Kwan <dougkwan@google.com>
13252
13253 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13254 (utils::has_overflow): Same.
13255
dff16297
ILT
132562009-06-03 Ian Lance Taylor <iant@google.com>
13257
13258 * layout.cc (Layout::section_name_mapping): New array, replacing
13259 Layout::linkonce_mapping.
13260 (Layout::section_name_mapping_count): New variable, replacing
13261 Layout::linkonce_mapping_count.
13262 (Layout::linkonce_output_name): Remove.
13263 (Layout::output_section_name): Rewrite.
13264 * layout.h (class Layout): Rename Linkonce_mapping to
13265 Section_name_mapping, linkonce_mapping to section_name_mapping,
13266 linkonce_mapping_count to section_name_mapping_count. Don't
13267 declare linkonce_output_name.
13268
c121c671
DK
132692009-06-03 Doug Kwan <dougkwan@google.com>
13270
13271 * gold/arm.cc (namespace utils): New.
13272 (Target_arm::reloc_is_non_pic): Define new method.
13273 (class Arm_relocate_functions): New.
13274 (Target_arm::Relocate::relocate): Handle relocation types used by
13275 Android.
13276
07800fab
ILT
132772009-06-03 Ian Lance Taylor <iant@google.com>
13278
13279 * arm.cc (Target_arm::scan::global): Use || instead of |.
13280
c121c671
DK
132812009-06-02 Doug Kwan <dougkwan@google.com>
13282
13283 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13284 issued_non_pic_error_.
13285 (class Target_arm::Scan): Declare new method check_non_pic.
13286 Define new method symbol_needs_plt_entry.
13287 Declare new data member issued_non_pic_error_.
13288 (class Target_arm::Relocate): Declare new method
13289 should_apply_static_reloc.
13290 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13291 (Target_arm::Scan::check_non_pic): Define new method.
13292 (Target_arm::Scan::local): Handle a small subset of reloc types used
13293 by Android.
13294 (Target_arm::Scan::local): Same.
13295 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13296
b19b0c6d
ILT
132972009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13298
13299 * incremental.cc (Incremental_inputs::report_command_line): Filter
13300 out --incremental-* options.
13301
94cdfcff
DK
133022009-05-29 Doug Kwan <dougkwan@google.com>
13303
13304 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13305 template class.
13306 (class Target_arm): Update comment.
13307 (Target_arm::Target_arm): Initialize new data members GOT_,
13308 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13309 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13310 and Target_arm::rel_dyn_section.
13311 Declare new_enum Target_arm::Got_type.
13312 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13313 and DYNBSS_.
13314 Update commments for member do_dynsym_value.
13315 (Target_arm::got_size, Target_arm::plt_section,
13316 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13317 new methods inside class defintion.
13318 (Target_arm::got_section): Define new method.
13319 (Target_arm::rel_dyn_section): Same.
13320 (Output_data_plt_arm): New template class.
13321 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13322 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13323 (Output_data_plt_arm::add_entry): Same.
13324 (Output_data_plt_arm::first_plt_entry): Define new
13325 static data member for PLT instruction template.
13326 (Output_data_plt_arm::plt_entry): Same.
13327 (Output_data_plt_arm::do_write): Define new method.
13328 (Target_arm::make_plt_entry): Same.
13329 (Target_arm::do_finalize_sections): Same.
13330 (Target_arm::do_dynsym_value): Same.
13331
4a657b0d
DK
133322009-05-28 Doug Kwan <dougkwan@google.com>
13333
13334 * Makefile.am (TARGETSOURCES): Add arm.cc.
13335 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13336 * Makefile.in: Regenerate.
13337 * arm.cc: New file.
13338 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13339
e7ae8c36
DK
133402009-05-26 Doug Kwan <dougkwan@google.com>
13341
13342 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13343 (General_options::check_excluded_libs): Strip off directories in
13344 archive name before matching like GNU ld does.
13345 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13346 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13347 (exclude_libs_test_LDFLAGS): Add linker option
13348 -Wl,--exclude-libs,libexclude_libs_test_3
13349 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13350 an explicit archive without using -l.
13351 (alt/libexclude_libs_test_3.a): New make rule.
13352 * testsuite/Makefile.in: Regenerate.
13353 * testsuite/exclude_libs_test.c : Declare lib3_default().
13354 (main): Call it.
13355 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13356 * exclude_libs_test_3.c: New file.
13357
f12e7348
NC
133582009-05-26 Nick Clifton <nickc@redhat.com>
13359
13360 * po/id.po: New Indonesian translation.
13361 * po/gold.pot: Updated template file.
13362
4daadc0d
ST
133632009-05-22 Sriraman Tallam <tmsriram@google.com>
13364
e1df38aa 13365 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13366 gc_comdat_test files. Add -Wl,--gc-sections to build
13367 gc_comdat_test.
13368 * testsuite/Makefile.in: Regenerate.
13369 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13370
531813ad
ST
133712009-05-21 Sriraman Tallam <tmsriram@google.com>
13372
13373 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13374 kept comdat section was garbage collected.
13375 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13376 * testsuite/Makefile.in: Regenerate.
13377 * testsuite/gc_comdat_test.sh: New file.
13378 * testsuite/gc_comdat_test_1.cc: New file.
13379 * testsuite/gc_comdat_test_2.cc: New file.
13380
65514900
CC
133812009-05-19 Doug Kwan <dougkwan@google.com>
13382
13383 * archive.cc (Archive::Archive): Move constructor from archive.h
13384 to here. Initialize no_export_.
13385 (Archive::get_elf_object_for_member): Set no_export flag of object.
13386 * archive.h (Archive::Archive): Move constructor body to
13387 archive.cc.
13388 (Archive::no_export): New method.
13389 (Archive::no_export_): New field.
13390 * object.h (Object::Object): Initialize no_export_ to false.
13391 (Object::no_export, Object::set_no_export): New methods.
13392 (Object::no_export_): New field.
13393 * options.cc (General_options::parse_exclude_libs): New method.
13394 (General_options::check_excluded_libs) Same.
13395 * options.h (exclude_libs): New option.
13396 (General_options::check_excluded_libs): New method declaration.
13397 (General_options::excluded_libs_): New field.
13398 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13399 default or protected visibility if an object has no-export flag set.
13400 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13401 (check_SCRIPTS): Add exclude_libs_test.sh.
13402 (check_DATA): Add exclude_libs_test.syms.
13403 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13404 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13405 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13406 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13407 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13408 libexclude_libs_test_2.a): New rules.
13409 * testsuite/Makefile.in: Regenerate.
13410 * testsuite/exclude_libs_test.c: New file.
13411 * testsuite/exclude_libs_test.sh: Ditto.
13412 * testsuite/exclude_libs_test_1.c: Ditto.
13413 * testsuite/exclude_libs_test_2.c: Ditto.
13414
1b77ea50
ILT
134152009-05-15 Ian Lance Taylor <iant@google.com>
13416
13417 * configure.ac: Check for declarations for cases where libiberty.h
13418 checks HAVE_DECL_xxx.
13419 * configure, config.in: Rebuild.
13420
072fe7ce
ILT
134212009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13422
13423 * gold.h (Incremental_argument_list): Remove (invalid) forward
13424 declaration.
13425 * incremental.cc (Incremental_inputs::report_achive): New method.
13426 (Incremental_inputs::report_object): New method.
13427 (Incremental_inputs::report_script): New method.
13428 (Incremental_inputs::finalize_inputs): New method.
13429 (Incremental_inputs::finalize): Call finalize_inputs().
13430 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13431 Create inputs entries.
13432 * incremental.h (Incremental_input_type): New enum.
13433 (Incremental_inputs::Incremental_input): Initialize new fields.
13434 (Incremental_inputs::report_inputs): New method.
13435 (Incremental_inputs::report_achive): New method.
13436 (Incremental_inputs::report_object): New method.
13437 (Incremental_inputs::report_script): New method.
13438 (Incremental_inputs::finalize_inputs): New method.
13439 (Incremental_inputs::Input_info): New struct.
13440 (Incremental_inputs::Input_info_map): New typedef.
13441 (Incremental_inputs::lock_): New field.
13442 (Incremental_inputs::Inputs_): New field.
13443 (Incremental_inputs::Inputs_map): New field.
13444 * main.cc (main): Call Incremental_input::report_inputs.
13445 * options.h (Input_argument_list): Typedef moved from
13446 Input_arguments.
13447 (Input_file_group::Files): Remove, use ::Input_argument_list.
13448 (Input_file_group::Input_argument_list): Remove, use
13449 ::Input_argument_list.
13450 * plugin.cc (Plugin_manager::add_input_file): Add error in
13451 incremental build.
13452 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13453 functions.
13454 * script.cc (read_input_script): Call
13455 Incremental_input::report_script.
13456 * script.h (Script_info): New class.
13457
b0481b0b
ILT
134582009-04-27 Ian Lance Taylor <iant@google.com>
13459
13460 * x86_64.cc (do_adjust_output_section): Set entsize to
13461 plt_entry_size.
13462
b22a5a41 134632009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13464
13465 * output.cc (Output_file::close): After short writes, continue
13466 writing from the correct offset in the buffer being written.
13467
40fde488
CD
134682009-04-23 Chris Demetriou <cgd@google.com>
13469
13470 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13471 * configure: Regenerate.
13472 * config.in: Regenerate.
13473 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13474 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13475
3ce2c28e
ILT
134762009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13477
13478 * incremental.cc (Incremental_inputs_header_data): Renamed from
13479 Incremental_input_header_data.
13480 (Incremental_inputs_header_data::data_size): New field.
13481 (Incremental_inputs_header_data::put_input_file_count): Renamed
13482 from input_file_count.
13483 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13484 from command_line_offset.
13485 (Incremental_inputs_header_data::put_reserved): Renamed from
13486 put_reserved.
13487 (Incremental_inputs_entry_data): Renamed from
13488 Incremental_input_entry_data.
13489 (Incremental_inputs_entry_data::data_size): New field.
13490 (Incremental_inputs::report_command_line): New method.
13491 (Incremental_inputs::finalize): New method.
13492 (Incremental_inputs::create_incremental_inputs_data): New method.
13493 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13494 * incremental.h: New file.
13495 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13496 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13497 incremental builds.
703d02da 13498 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13499 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13500 (Layout::create_incremental_info_sections): New method.
13501 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13502 * main.cc (main): Notify Incremental_input of the command line.
13503
e55bde5e
ILT
135042009-04-01 Ian Lance Taylor <iant@google.com>
13505 Mikolaj Zalewski <mikolajz@google.com>
13506
13507 * gold.h (reserve_unordered_map): Define, three versions, one for
13508 each version of Unordered_map.
13509 * layout.cc (Layout::Layout): Remove options parameter. Add
13510 number_of_input_files parameter. Don't initialize options_.
13511 Initialize number_of_input_files_ and resized_signatures_. Move
13512 sections_are_attached_.
13513 (Layout::layout_group): Reserve space for group_signatures_.
13514 (Layout::find_or_add_kept_section): Change name parameter to be a
13515 reference. Resize signatures_ map when it gets large enough.
13516 (Layout::layout_eh_frame): Use parameters->options() instead of
13517 this->options_.
13518 (Layout::make_output_section): Likewise.
13519 (Layout::attach_allocated_section_to_segment): Likewise.
13520 (Layout::finalize, Layout::create_executable_stack): Likewise.
13521 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13522 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13523 * layout.h (class Layout): Update declarations. Remove options_
13524 field. Add number_of_input_files_ and resized_signatures_
13525 fields. Move sections_are_attached_ field.
13526 * main.cc (main): Pass number of input files to Layout
13527 constructor. Don't pass options.
13528
154b857c
ILT
135292009-03-30 Ian Lance Taylor <iant@google.com>
13530
13531 * ffsll.c (ffsll): Correct implementation.
13532
2f35ab9b
ILT
135332009-03-27 Ian Lance Taylor <iant@google.com>
13534
fd03461a
ILT
13535 * ffsll.c: New file.
13536 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13537 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13538 * ftruncate.c (ftruncate): Declare before definition.
13539 * mremap.c (mremap): Likewise.
13540 * pread.c (pread): Likewise.
13541 * configure, Makefile.in, config.in: Rebuild.
13542
2f35ab9b
ILT
13543 * mremap.c: New file.
13544 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13545 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13546 (mremap): Declare if HAVE_MREMAP is not defined.
13547 * configure, Makefile.in, config.in: Rebuild.
13548
33aea2fd
CC
135492009-03-27 Cary Coutant <ccoutant@google.com>
13550
13551 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13552 position independent.
13553 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13554 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13555
6d479619
CC
135562009-03-24 Cary Coutant <ccoutant@google.com>
13557
13558 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13559 an executable.
13560 (needs_dynamic_reloc): Likewise.
13561
afc06bb8
ILT
135622009-03-24 Ian Lance Taylor <iant@google.com>
13563
13564 * yyscript.y (file_cmd): Recognize EXTERN.
13565 (extern_name_list, extern_name_list_body): New nonterminals.
13566 * script.cc (script_add_extern): Define.
13567 * script-c.h (script_add_extern): Declare.
13568
f6060a4d
ILT
135692009-03-24 Rafael Avila de Espindola <espindola@google.com>
13570
13571 * object.cc (is_elf_object): Define.
13572 * object.h (is_elf_object): Declare.
13573 * archive.cc (Archive::get_elf_object_for_member): Call
13574 is_elf_object.
33aea2fd 13575 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 13576
26736d8e
ILT
135772009-03-24 Elliott Hughes <enh@google.com>
13578
13579 * output.cc (Output_file::map_anonymous): Define.
13580 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13581 try an anonymous one. Report the size if the mmap fails.
13582 * output.h (class Output_file): Declare map_anonymous.
13583
22fd9730
ILT
135842009-03-24 Ian Lance Taylor <iant@google.com>
13585
13586 * target-select.cc (instantiate_target): Don't acquire the lock if
13587 the instantiated_target_ field has already been set.
13588
cb010894
ILT
135892009-03-23 Ian Lance Taylor <iant@google.com>
13590
7f055c20
ILT
13591 * gold-threads.h (class Initialize_lock): Define.
13592 * gold-threads.cc (class Initialize_lock_once): Define.
13593 (initialize_lock_control): New static variable.
13594 (initialize_lock_pointer): New static variable.
13595 (initialize_lock_once): New static function.
13596 (Initialize_lock::Initialize_lock): Define.
13597 (Initialize_lock::initialize): Define.
13598 * target-select.h: Include "gold-threads.h".
13599 (class Target_selector): Add lock_ and initialize_lock_ fields.
13600 Don't define instantiate_target, just declare it.
13601 * target-select.cc (Target_selector::Target_selector): Initialize
13602 new fields.
13603 (Target_selector::instantiate_target): Define.
13604 * descriptors.h: Include "gold-threads.h".
13605 (class Descriptors): Add initialize_lock_ field.
13606 * descriptors.cc (Descriptors::Descriptors): Initialize new
13607 field.
13608 (Descriptors::open): Use initialize_lock_ field
13609 * errors.h (class Errors): Add initialize_lock_ field.
13610 * errors.cc (Errors::Errors): Initialize new field.
13611 (Errors::initialize_lock): Use initialize_lock_ field.
13612 * powerpc.cc (class Target_selector_powerpc): Remove
13613 instantiated_target_ field. In do_recognize call
13614 instantiate_target rather than do_instantiate_target. In
13615 do_instantiate_target just allocate a new target.
13616 * sparc.cc (class Target_selector_sparc): Likewise.
13617
36959681
ILT
13618 * freebsd.h: New file.
13619 * i386.cc: Include "freebsd.h".
13620 (Target_i386): Derive from Target_freebsd rather than
13621 Sized_target.
13622 (Target_selector_i386): Derive from Target_selector_freebsd rather
13623 than Target_selector.
13624 * x86_64.cc: Include "freebsd.h".
13625 (Target_x86_64): Derive from Target_freebsd rather than
13626 Sized_target.
13627 (Target_selector_x86_64): Derive from Target_selector_freebsd
13628 rather than Target_selector.
13629 * target.h (class Target): Add adjust_elf_header and
13630 do_adjust_elf_header.
13631 * output.cc (Output_file_header:: do_sized_write): Call target
13632 adjust_elf_header routine.
13633 * configure.tgt: Set targ_osabi.
13634 * configure.ac: Define GOLD_DEFAULT_OSABI.
13635 * parameters.cc (Parameters::default_target): Pass
13636 GOLD_DEFAULT_OSABI to select_target.
13637 * target-select.h (class Target_selector): Make instantiate_target
13638 protected rather than private.
13639 * Makefile.am (HFILES): Add freebsd.h.
13640 * configure, Makefile.in, config.in: Rebuild.
13641
cb010894
ILT
13642 * merge.cc (do_add_input_section): Correct pend value. Change
13643 message about last entry not being null terminated from error to
13644 warning.
13645
0e879927
ILT
136462009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13647
13648 * incremental.cc: New file.
13649 * Makefile.am (CCFILES): Add incremental.cc.
13650 * Makefile.in: Rebuild.
13651
41105937
PP
136522009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13653
13654 * layout.cc (Layout::output_section_name): Preserve names
13655 of '.note.' sections.
e1df38aa 13656
60439920
ILT
136572009-03-19 Ian Lance Taylor <iant@google.com>
13658
13659 * descriptors.cc (Descriptors::open): Check that the options are
13660 valid before using them.
13661
0d371ad3
ILT
136622009-03-18 Ian Lance Taylor <iant@google.com>
13663
13664 * script-sections.h: Include <list>.
13665 (class Script_sections): Change Sections_elements from std::vector
13666 to std::list. Typedef public Elements_iterator. Add
13667 orphan_section_placement_, data_segment_align_start_, and
13668 saw_data_segment_align_ fields. Remove data_segment_align_index_
13669 field.
13670 * script-sections.cc (class Orphan_section_placement): New class.
13671 (class Sections_element): Add virtual functions is_relro and
13672 orphan_section_init. Remove virtual function place_orphan_here.
13673 (class Output_section_definition): Add is_relro and
13674 orphan_section_init. Remove place_orphan_here.
13675 (class Orphan_output_section): Likewise.
13676 (Script_sections::Script_sections): Update for field changes.
13677 (Script_sections::data_segment_align): Set saw_data_segment_align_
13678 and data_segment_align_start_, not data_segment_align_index.
13679 (Script_sections::data_segment_relro_end): Check
13680 saw_data_segment_align_. Use data_segment_align_start_ rather
13681 than data_segment_align_index_.
13682 (Script_sections::place_orphan): Rewrite to use
13683 Orphan_section_placement.
13684
9201d894
ILT
136852009-03-17 Ian Lance Taylor <iant@google.com>
13686
9c5b8369
ILT
13687 * archive.cc (Archive::add_symbols): Check for a version attached
13688 to the symbol name in the archive map.
13689 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13690 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13691 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13692 (ver_test_11.a): New target.
13693 * testsuite/Makefile.in: Rebuild.
13694
9201d894
ILT
13695 * configure.ac: Check for chsize and posix_fallocate. Replace
13696 ftruncate.
13697 * ftruncate.c: New file, from gnulib.
13698 * output.cc (posix_fallocate): Define dummy version if not
13699 HAVE_POSIX_FALLOCATE.
13700 (Output_file::map): Call posix_fallocate rather than lseek and
13701 write.
13702 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13703 * configure, Makefile.in, config.in: Rebuild.
13704
ef4ab7a8 137052009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 13706
ef4ab7a8
PP
13707 * layout.h (Layout::create_note): Add section_name parameter.
13708 * layout.cc (Layout::create_note): Likewise.
13709 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 13710
8c500701
ILT
137112009-03-17 Ian Lance Taylor <iant@google.com>
13712
e85b18e1
ILT
13713 * descriptors.cc: Include "options.h".
13714 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13715 (Descriptors::open): Always use O_CLOEXEC when opening a new
13716 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13717 then set FD_CLOEXEC.
13718
9efe6174
ILT
13719 * sparc.cc (class Target_sparc): Add has_got_section.
13720 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13721 make sure we have a GOT section.
13722
13723 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13724 (Target_sparc::Scan::local): Likewise.
13725 (Target_sparc::Scan::global): Likewise.
13726 (Target_sparc::Relocate::relocate): Likewise.
13727 (Target_sparc::Relocate::relocate_tls): Likewise.
13728
8c500701
ILT
13729 * symtab.cc (Symbol_table::define_default_version): New function,
13730 broken out of add_from_object.
13731 (Symbol_table::add_from_object): Call define_default_version.
13732 (Symbol_table::define_special_symbol): Add resolve_oldsym
13733 parameter. Change all callers. If the version for a symbol comes
13734 from a version script, resolve it with the symbol with the same
13735 name with no version. Also add the symbol without a version if
13736 appropriate.
13737 (do_define_in_output_data): If resolving with oldsym, don't delete
13738 sym.
13739 (do_define_in_output_segment): Likewise.
13740 (do_define_as_constant): Likewise.
13741 * symtab.h (class Symbol_table): Update declarations.
13742
f1ed28fb
ILT
137432009-03-13 Ian Lance Taylor <iant@google.com>
13744
15f8229b
ILT
13745 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13746 (Read_symbols::requeue): New function.
13747 (Read_symbols::do_read_symbols): If make_elf_object fails because
13748 the target type is not configured, and the file was searched for,
13749 issue a warning and retry with the next directory.
13750 (Add_symbols::run): If the file has an incompatible format, and
13751 it was searched for, requeue the Read_symbols task. On error,
13752 release the object.
13753 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13754 dirindex parameter to constructor. Change all callers. Declare
13755 incompatible_warning and requeue.
13756 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13757 input_argument_ and input_group_ fields. Add them to
13758 constructor. Change all callers.
13759 (class Read_script): Add dirindex_ field. Add it to constructor.
13760 Change all callers.
13761 * archive.cc (Archive::setup): Remove input_objects parameter.
13762 Change all callers.
13763 (Archive::get_file_and_offset): Likewise.
13764 (Archive::read_all_symbols): Likewise.
13765 (Archive::read_symbols): Likewise.
13766 (Archive::get_elf_object_for_member): Remove input_objects
13767 parameter. Add punconfigured parameter. Change all callers.
13768 (Archive::add_symbols): Change return type to bool. Check return
13769 value of include_member.
13770 (Archive::include_all_members): Likewise.
13771 (Archive::include_member): Change return type to bool. Return
13772 false if first included object has incompatible target. Set
13773 included_member_ field.
13774 (Add_archive_symbols::run): If add_symbols returns false, requeue
13775 Read_symbols task.
13776 * archive.h (class Archive): Add included_member_ field.
13777 Initialize it in constructor. Add input_file and searched_for
13778 methods. Update declarations.
13779 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13780 input_argument_ fields. Add them to constructor. Change all
13781 callers.
13782 * script.cc: Include "target-select.h".
13783 (class Parser_closure): Add skip_on_incompatible_target_ and
13784 found_incompatible_target_ fields. Add
13785 skip_on_incompatible_target parameter to constructor. Change all
13786 callers. Add methods skip_on_incompatible_target,
13787 clear_skip_on_incompatible_target, found_incompatible_target, and
13788 set_found_incompatible_target.
13789 (read_input_script): Add dirindex parameter. Change all callers.
13790 If parser finds an incompatible target, requeue Read_symbols
13791 task.
13792 (script_set_symbol): Clear skip_on_incompatible_target in
13793 closure.
13794 (script_add_assertion, script_parse_option): Likewise.
13795 (script_start_sections, script_add_phdr): Likewise.
13796 (script_check_output_format): New function.
13797 * script.h (read_input_script): Update declaration.
13798 * script-c.h (script_check_output_format): Declare.
13799 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13800 (ignore_cmd): Remove OUTPUT_FORMAT.
13801 * fileread.cc (Input_file::Input_file): Add explicit this.
13802 (Input_file::will_search_for): New function.
13803 (Input_file::open): Add pindex parameter. Change all callers.
13804 * fileread.h (class Input_file): Add input_file_argument method.
13805 Declare will_search_for. Update declarations.
13806 * object.cc (make_elf_object): Add punconfigured parameter.
13807 Change all callers.
13808 * object.h (class Object): Make input_file public. Add
13809 searched_for method.
13810 (make_elf_object): Update declaration.
13811 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13812 restart search.
13813 * dirsearch.h (class Dirsearch): Update declaration.
13814 * options.h (class General_options): Add --warn-search-mismatch.
13815 * parameters.cc (Parameters::is_compatible_target): New function.
13816 * parameters.h (class Parameters): Declare is_compatible_target.
13817 * workqueue.cc (Workqueue::add_blocker): New function.
13818 * workqueue.h (class Workqueue): Declare add_blocker.
13819
f1ed28fb
ILT
13820 * fileread.cc (Input_file::open): Remove options parameter.
13821 Change all callers.
13822 (Input_file::open_binary): Likewise.
13823 * script.cc (read_input_script): Likewise.
13824 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13825 options parameter from constructor. Change all callers.
13826 (class Read_script): Likewise.
13827 * fileread.h (class Input_file): Update declarations.
13828 * script.h (read_input_script): Update declaration.
13829
34dd024a
NC
138302009-03-10 Nick Clifton <nickc@redhat.com>
13831
13832 * po/es.po: New Spanish translation.
13833
6d71b17c
CC
138342009-03-06 Cary Coutant <ccoutant@google.com>
13835
13836 * options.cc (parse_short_option): Keep dash_z from registering itself.
13837
031cdbed
ILT
138382009-03-03 Ian Lance Taylor <iant@google.com>
13839
13840 PR 9918
13841 * target-reloc.h (relocate_section): Pass output_section to
13842 relocate.
13843 * i386.cc (Target_i386::should_apply_static_reloc): Add
13844 output_section parameter. Change all callers.
13845 (Target_i386::Relocate::relocate): Add output_section parameter.
13846 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13847 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13848 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13849 * testsuite/two_file_shared.sh: New script.
13850 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13851 (check_DATA): Add two_file_shared.dbg.
13852 (two_file_shared.dbg): New target.
13853 * testsuite/Makefile.in: Rebuild.
13854
15d5fa16
ILT
138552009-03-01 Ian Lance Taylor <iant@google.com>
13856
13857 * configure.ac: Check for byteswap.h.
13858 * configure: Rebuild.
13859 * config.in: Rebuild.
13860
8a4c0b0d
ILT
138612009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13862
13863 * layout.cc (Layout::find_or_add_kept_section): New function.
13864 (Layout::add_comdat): Removed.
13865 * layout.h (struct Kept_section): Move out of class Layout.
13866 Remove trailing underscores from field names. Add group_sections
13867 field. Rename group_ field to is_group. Change all uses.
13868 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13869 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13870 comdat_groups_ field.
13871 (Sized_relobj::include_section_group): Use
13872 find_or_add_kept_section and Kept_section::group_sections.
13873 (Sized_relobj::include_linkonce_section): Likewise.
13874 * object.cc (class Sized_relobj): Don't define Comdat_group or
13875 Comdat_group_table. Remove find_comdat_group and
13876 add_comdat_group. Remove comdat_groups_ field.
13877 * plugin.cc (include_comdat_group): Use
13878 Layout::find_or_add_kept_section.
13879
b4ecf66b
ILT
138802009-02-28 Ian Lance Taylor <iant@google.com>
13881
14359ca0
ILT
13882 * README: --gc-sections and map files are now supported. Document
13883 some build requirements.
13884
b4ecf66b
ILT
13885 PR 6992
13886 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13887 relocatable link set the value of the section symbol to zero.
13888 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13889 relocatable link don't include the section address in the local
13890 symbol value.
13891
0602e05a
ILT
138922009-02-27 Ian Lance Taylor <iant@google.com>
13893
fd9d194f
ILT
13894 PR 6811
13895 * options.h (class Search_directory): Add is_system_directory.
13896 (class General_options): Declare is_in_system_directory.
13897 * options.cc (get_relative_sysroot): Make static.
13898 (get_default_sysroot): Make static.
13899 (General_optoins::is_in_system_directory): New function.
13900 * fileread.cc (Input_file::is_in_system_directory): New function.
13901 * fileread.h (class Input_file): Declare is_in_system_directory.
13902 * object.h (class Object): Add is_in_system_directory.
13903 (class Input_objects): Remove system_library_directory_ field.
13904 * object.cc (Input_objects::add_object): Don't set
13905 system_library_directory_.
13906 (input_objects::found_in_system_library_directory): Remove.
13907 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13908 parameter. Change all callers.
13909 (Symbol_table::sized_write_globals): Likewise.
13910 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13911 Call Object::is_in_system_directory.
13912 * symtab.h (class Symbol_table): Update declarations.
13913
61edd21f
ILT
13914 PR 5990
13915 * descriptors.h (Open_descriptor): Add is_on_stack field.
13916 * descriptors.cc (Descriptors::open): If the descriptor is on the
13917 top of the stack, remove it. Initialize is_on_stack field.
13918 (Descriptors::release): Only add pod to stack if it is not on the
13919 stack already.
13920 (Descriptors::close_some_descriptor): Clear stack_next and
13921 is_on_stack fields.
13922
e29e076a
ILT
13923 PR 7091
13924 * output.cc (Output_section::find_starting_output_address): Rename
13925 from starting_output_address; add PADDR parameter; change return
13926 type.
13927 * output.h (class Output_section): Declare
13928 find_starting_output_address instead of starting_output_address.
13929 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13930 section symbol for which we can't find a merge section.
13931
0602e05a
ILT
13932 PR 9836
13933 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13934 hidden or internal, force the symbol to be local.
13935 * resolve.cc (Symbol::override_visibility): Define.
13936 (Symbol::override_base): Use override_visibility.
13937 (Symbol_table::resolve): Likewise.
13938 (Symbol::override_base_with_special): Likewise.
13939 (Symbol_table::override_with_special): If the visibility is hidden
13940 or internal, force the symbol to be local.
13941 * symtab.h (class Symbol): Add set_visibility and
13942 override_visibility.
13943 * testsuite/ver_test_1.sh: New file.
13944 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13945 (check_DATA): Add ver_test_1.syms.
13946 (ver_test_1.syms): New target.
13947 * testsuite/Makefile.in: Rebuild.
13948
401a9a73
CC
139492009-02-25 Cary Coutant <ccoutant@google.com>
13950
13951 * layout.cc (Layout::choose_output_section): Don't rename sections
13952 when using a linker script that has a SECTIONS clause.
13953 * Makefile.in: Regenerate.
13954
13955 * testsuite/Makefile.am (script_test_5.sh): New test case.
13956 * testsuite/Makefile.in: Regenerate.
13957 * testsuite/script_test_5.cc: New file.
13958 * testsuite/script_test_5.sh: New file.
13959 * testsuite/script_test_5.t: New file.
13960
f488e4b0
CC
139612009-02-13 Rafael Avila de Espindola <espindola@google.com>
13962
13963 * archive.cc (Archive::include_member): Update calls to add_symbols.
13964 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
13965 the Layout argument.
13966 * dynobj.h (do_add_symbols): Add the Layout argument.
13967 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
13968 Layout argument.
13969 * object.h (Object::add_symbols): Add the Layout argument.
13970 (Object::do_add_symbols): Add the Layout argument.
13971 (Sized_relobj::do_add_symbols): Add the Layout argument.
13972 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
13973 Unify the two versions.
13974 (Add_plugin_symbols): Remove.
13975 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
13976 (Sized_pluginobj::do_add_symbols): Unify the two versions.
13977 (Add_plugin_symbols): Remove.
13978 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
13979 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
13980 (Add_symbols::run): Make it work with Pulginobj.
13981
89dd1680
ILT
139822009-02-06 Ian Lance Taylor <iant@google.com>
13983
13984 * object.cc (Sized_relobj::do_layout): Make info message start
13985 with lower case letter.
13986
266d0a74
ILT
139872009-02-06 Mikolaj Zalewski <mikolajz@google.com>
13988
602b464e
ILT
13989 * binary.cc: Fix file comment.
13990
266d0a74
ILT
13991 * options.h (enum Incremental_disposition): Define.
13992 (class General_options): Add new options: --incremental,
13993 --incremental_changed, --incremental_unchanged,
13994 --incremental_unknown. Add incremental_disposition_ and
13995 implicit_incremental_ fields.
13996 (General_options::incremental_disposition): New function.
13997 (class Position_dependent_options): Add incremental_disposition
13998 option.
13999 (Position_dependent_options::copy_from_options): Set incremental
14000 dispositions.
14001 * options.cc (General_options::parse_incremental_changed): New
14002 function.
2e702c99
RM
14003 (General_options::parse_incremental_unchanged): New function.
14004 (General_options::parse_incremental_unknown): New function.
14005 (General_options::General_options): Initialize new fields
266d0a74 14006 incremental_disposition_ and implicit_incremental_.
2e702c99 14007 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
14008 without --incremental.
14009
f073bbf7
CD
140102009-02-06 Chris Demetriou <cgd@google.com>
14011
14012 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14013 pointer and to report location as the file name associated with
14014 the symbol.
14015 (gold_undefined_symbol_at_location): New function to replace the
14016 old gold_undefined_symbol functionality.
14017 * target-reloc.h (relocate_section): Update to use
14018 gold_undefined_symbol_at_location.
14019 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14020 Call gold_undefined_symbol function rather than gold_error.
14021 * errors.h (Errors::undefined_symbol): Take location as a
14022 string, rather than calculating it from a relocation.
14023 * errors.cc (Errors::fatal): Print "fatal error:" before the
14024 formatted message.
14025 (Errors::error, Errors::error_at_location): Print "error: "
14026 before the formatted message.
14027 (Errors::undefined_symbol): Take location as a string, rather
14028 than calculating it from a relocation.
14029 (gold_undefined_symbol_at_location): New function akin to
14030 old gold_undefined_symbol, calculates location from relocation.
14031 (gold_undefined_symbol): Change to take only a Symbol pointer
14032 and to report location as the file name associated with the symbol.
14033 * testsuite/debug_msg.sh: Update for changed error messages.
14034 * testsuite/undef_symbol.sh: Likewise.
14035
8e94a90c
ILT
140362009-02-04 Duncan Sands <baldrick@free.fr>
14037
14038 PR 9812
14039 * reduced_debug_output.h
14040 (Output_reduced_debug_abbrev_section::failed): Use format for
14041 gold_warning.
14042 (Output_reduced_debug_info_section::faild): Likewise.
14043
88a0e15b
ILT
140442009-01-31 Mikolaj Zalewski <mikolajz@google.com>
14045
14046 * script.cc (Lazy_demangler): New class.
2e702c99 14047 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
14048 symbol only once.
14049
5efc7cd2
CC
140502009-01-29 Cary Coutant <ccoutant@google.com>
14051
14052 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
14053 to __tls_get_addr.
14054 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14055
e0ebcf42
ILT
140562009-01-28 Ian Lance Taylor <iant@google.com>
14057
5efc7cd2 14058 * version.cc (version_string): Bump to 1.9.
75fe7426 14059
e0ebcf42
ILT
14060 * gold.h: Include <cstring> and <stdint.h>.
14061 * version.cc: Include <cstdio>.
14062 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
14063 warning.
14064 * reduced_debug_output.cc (insert_into_vector): Rename from
14065 Insert_into_vector; change all callers. Use Swap_unaligned to
14066 avoid aliasing issue; remove union since it is unnecessary.
14067
8e2813be 140682009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
14069
14070 * Makefile.am (CCFILES): Add gc.cc.
14071 (HFILES): Add gc.h.
14072 * Makefile.in: Regenerate.
14073 * gold.cc (Gc_runner): New class.
14074 (queue_initial_tasks): Call garbage collection related tasks
14075 when corresponding options are invoked.
14076 (queue_middle_gc_tasks): New function.
14077 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14078 processed early before laying out sections during garbage collection.
14079 * gold.h (queue_middle_gc_tasks): New function.
14080 (is_prefix_of): Move from "layout.cc".
14081 * i386.cc (Target_i386::gc_process_relocs): New function.
14082 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14083 * main.cc (main): Create object of class "Garbage_collection".
14084 * object.cc (Relobj::copy_symbols_data): New function.
14085 (Relobj::is_section_name_included): New function.
e1df38aa
NC
14086 (Sized_relobj::do_layout): Allow this function to be called twice
14087 during garbage collection and defer layout of section during the
6d03d481
ST
14088 first call.
14089 * object.h (Relobj::get_symbols_data): New function.
14090 (Relobj::is_section_name_included): New function.
14091 (Relobj::copy_symbols_data): New function.
14092 (Relobj::set_symbols_data): New function.
14093 (Relobj::get_relocs_data): New function.
14094 (Relobj::set_relocs_data): New function.
14095 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14096 (Relobj::gc_process_relocs): New function.
14097 (Relobj::do_gc_process_relocs): New pure virtual function.
14098 (Relobj::sd_): New data member.
14099 (Sized_relobj::is_output_section_offset_invalid): New function.
14100 (Sized_relobj::do_gc_process_relocs): New function.
14101 * options.h (General_options::gc_sections): Modify to not be a no-op.
14102 (General_options::print_gc_sections): New option.
14103 * plugin.cc (Plugin_finish::run): Remove function call to
14104 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14105 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14106 * reloc.cc (Read_relocs::run): Add task to process relocs and
14107 determine unreferenced sections when doing garbage collection.
14108 (Gc_process_relocs): New class.
14109 (Sized_relobj::do_gc_process_relocs): New function.
14110 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14111 sections that are garbage collected.
14112 * reloc.h (Gc_process_relocs): New class.
14113 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14114 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14115 symbols whose corresponding sections are garbage collected.
14116 (Symbol_table::Symbol_table): Add new parameter for the garbage
14117 collection object.
14118 (Symbol_table::gc_mark_undef_symbols): New function.
14119 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14120 (Symbol_table::gc_mark_dyn_syms): New function.
14121 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14122 as garbage.
14123 (Symbol_table::add_from_object): Likewise.
14124 (Symbol_table::add_from_relobj): When building shared objects, do not
14125 treat externally visible symbols as garbage.
14126 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14127 table information for static and relocatable links.
14128 * symtab.h (Symbol_table::set_gc): New function.
14129 (Symbol_table::gc): New function.
14130 (Symbol_table::gc_mark_undef_symbols): New function.
14131 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14132 (Symbol_table::gc_mark_dyn_syms): New function.
14133 (Symbol_table::gc_): New data member.
e1df38aa 14134 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
14135 function.
14136 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14137 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14138
3b293544
CF
141392009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14140
14141 * options.h (General_options::gc_sections): Define as a no-op for now.
14142 (General_options::no_keep_memory): Ditto.
14143 (General_options::Bshareable): Define.
14144 * options.cc (General_options::finalize): Honor -Bshareable.
14145
83d22aa8
AS
141462009-01-20 Andreas Schwab <schwab@suse.de>
14147
14148 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14149 read the value in the contents, since we don't use it. Use the
14150 template endianness when writing.
14151 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14152
cd536b21
AS
141532009-01-19 Andreas Schwab <schwab@suse.de>
14154
14155 * configure.tgt (powerpc64-*): Fix targ_obj.
14156
99e9a495
ILT
141572009-01-15 Ian Lance Taylor <iant@google.com>
14158
14159 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14160 local symbols when stripping all symbols.
14161
bbbfea06
CC
141622009-01-14 Cary Coutant <ccoutant@google.com>
14163
99e9a495 14164 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 14165
0f7c0701
CC
141662009-01-14 Cary Coutant <ccoutant@google.com>
14167
14168 * archive.cc (Archive::get_elf_object_for_member): Remove call
14169 to File_read::claim_for_plugin.
14170 * descriptors.cc (Descriptors::open): Remove reference to
14171 is_claimed.
14172 (Descriptors::claim_for_plugin): Remove.
14173 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14174 (Descriptors::is_claimed): Remove.
14175 (claim_descriptor_for_plugin): Remove.
14176 * fileread.cc (File_read::claim_for_plugin): Remove.
14177 * fileread.h (File_read::claim_for_plugin): Remove.
14178 (File_read::descriptor): Reopen descriptor if necessary.
14179 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14180 (Plugin_manager::all_symbols_read): Add task parameter. Change
14181 all callers.
14182 (Plugin_manager::get_input_file): New function.
14183 (Plugin_manager::release_input_file): New function.
14184 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14185 corresponding data member.
14186 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14187 and pass to base constructor. Change all callers.
14188 (get_input_file, release_input_file): New functions.
14189 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14190 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14191 (Plugin_manager::all_symbols_read): Add task parameter.
14192 (Plugin_manager::get_input_file): New function.
14193 (Plugin_manager::release_input_file): New function.
14194 (Plugin_manager::task_): New data member.
14195 (Pluginobj::Pluginobj): Add filesize parameter.
14196 (Pluginobj::filename): New function.
14197 (Pluginobj::descriptor): New function.
14198 (Pluginobj::filesize): New function.
14199 (Pluginobj::filesize_): New data member.
14200 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14201 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14202 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14203
14204 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14205 with archive libraries.
14206 * testsuite/Makefile.in: Regenerate.
14207 * testsuite/plugin_test.c (struct sym_info): New type.
14208 (get_input_file, release_input_file): New static variables.
14209 (onload): Capture new transfer vector entries.
14210 (claim_file_hook): Stop reading at end of file according to filesize.
14211 Factor out parsing of readelf output into separate function.
14212 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14213 APIs and get the source file name from the symbol table. Convert
14214 source file name to corresponding object file name. Print info
14215 message when adding new input files.
14216 (parse_readelf_line): New function.
14217 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14218 * testsuite/plugin_test_2.sh: Likewise.
14219 * testsuite/plugin_test_3.sh: Likewise.
14220 * testsuite/plugin_test_4.sh: New test case.
14221
62a6d109
ILT
142222009-01-07 Ian Lance Taylor <iant@google.com>
14223
14224 * version.cc (version_string): Bump to 1.8.
14225
483620e8
CC
142262008-12-23 Cary Coutant <ccoutant@google.com>
14227
14228 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14229 * plugin.cc (Plugin_manager::finish): Rename as
14230 layout_deferred_objects. Move cleanup to separate function.
14231 (Plugin_manager::cleanup): New function.
14232 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14233 separately.
14234 * plugin.h (Plugin_manager::finish): Rename as
14235 layout_deferred_objects.
14236 (Plugin_manager::cleanup): New function.
14237 (Plugin_manager::cleanup_done): New field.
14238
d66a9eb3
CC
142392008-12-23 Cary Coutant <ccoutant@google.com>
14240
14241 * plugin.cc (is_visible_from_outside): New function.
14242 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14243 so we don't return "IR only" status for exported symbols or -r links.
14244
14245 * testsuite/Makefile.am (plugin_test_3): New test case.
14246 * testsuite/Makefile.in: Regenerate.
14247 * testsuite/plugin_test_3.sh: New file.
14248
5995b570
CC
142492008-12-22 Cary Coutant <ccoutant@google.com>
14250
14251 * object.cc (Sized_relobj::layout_section): New function.
14252 (Sized_relobj::do_layout): Defer layout of input sections until after
14253 plugin has provided replacement files.
14254 (Sized_relobj::do_layout_deferred_sections): New function.
14255 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14256 (Relobj::layout_deferred_sections): New function.
14257 (Relobj::do_layout_deferred_sections): New function.
14258 (Sized_relobj::do_layout_deferred_sections): New function.
14259 (Sized_relobj::layout_section): New function.
14260 (Sized_relobj::Deferred_layout): New structure.
14261 (Sized_relobj::deferred_layout_): New field.
14262 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14263 Change all callers. Layout deferred sections.
14264 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14265 references.
14266 (Plugin_hook::run): Move code from do_plugin_hook inline.
14267 (Plugin_hook::do_plugin_hook): Remove.
14268 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14269 (Plugin_manager::finish): Renamed, was cleanup.
14270 (Plugin_manager::should_defer_layout): New function.
14271 (Plugin_manager::add_deferred_layout_object): New function.
14272 (Plugin_manager::Deferred_layout_list): New type.
14273 (Plugin_manager::deferred_layout_objects_): New field.
14274 (Plugin_hook::do_plugin_hook): Remove.
14275
ee769c88
ILT
142762008-12-17 Ian Lance Taylor <iant@google.com>
14277
14278 * options.h (class General_options): Add --no case for
14279 --export-dynamic.
14280
abc8dcba
CC
142812008-12-16 Cary Coutant <ccoutant@google.com>
14282
14283 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14284 vector.
14285 (Plugin_manager::claim_file): Create plugin object even if
14286 plugin did not call the add_symbols callback.
14287 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14288 asking for more symbols than were added.
14289 * testsuite/Makefile.am (plugin_test_1): Add test case with
14290 no global symbols.
14291 (empty.syms): New target.
14292 * testsuite/Makefile.in: Regenerate.
14293 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14294 message. Don't call add_symbols if no globals.
14295 (all_symbols_read_hook): Don't provide replacement for empty
14296 claimed file.
14297
b0074644
ILT
142982008-12-12 Ian Lance Taylor <iant@google.com>
14299
68943102
ILT
14300 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14301 r_type == 0 for a local symbol with r_sym == 0.
14302 (scan_relocatable_relocs): Pass r_sym to
14303 local_non_section_strategy.
14304 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14305 r_sym parameter.
14306
b0074644
ILT
14307 * configure.ac: Update test for TLS descriptors: they are
14308 supported as of glibc 2.9.
14309 * configure: Rebuild.
14310
c2508178
ILT
143112008-12-11 Ian Lance Taylor <iant@google.com>
14312
14313 PR 7091
14314 * target-reloc.h (Default_scan_relocatable_relocs): For each
14315 function, map r_type == 0 to RELOC_DISCARD.
14316
2756a258
CC
143172008-12-10 Cary Coutant <ccoutant@google.com>
14318
14319 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14320 object to override a kept COMDAT group from a plugin object.
14321
bb6f53d3
ILT
143222008-12-09 Ian Lance Taylor <iant@google.com>
14323
fbc558e1
ILT
14324 PR 7088
14325 * yyscript.y (file_cmd): Handle INPUT.
14326
bb6f53d3
ILT
14327 * testsuite/initpri1.c: Change all declarations to be full
14328 prototypes by adding void, to avoid compiler warnings.
14329
4674ecfc
CC
143302008-12-05 Rafael Avila de Espindola <espindola@google.com>
14331
14332 * options.cc (General_options::parse_plugin_opt): New.
14333 (General_options::add_plugin): The argument now is just the filename.
14334 (General_options::add_plugin_option): New.
14335 * options.h (plugin_opt): New.
14336 (add_plugin): Change argument name.
14337 (add_plugin_option): New.
14338 * plugin.cc (Plugin::load): Don't parse the plugin option.
14339 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14340 (Plugin::add_option): New.
14341 (Plugin::args_): Change type.
14342 (Plugin::filename_): New.
14343 (Plugin_manager::add_plugin_option): New.
14344 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14345 * testsuite/Makefile.in: Regenerate.
14346
fd06b4aa
CC
143472008-12-05 Cary Coutant <ccoutant@google.com>
14348
14349 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14350 Handle --strip-lto-sections option.
14351 * options.h (strip_lto_sections): New option.
14352
6c52134c
CC
143532008-12-01 Cary Coutant <ccoutant@google.com>
14354
14355 * plugin.cc (ld_plugin_message): Change format parameter to const.
14356 Fix mismatch between new[] and delete.
14357
a45248e0
CC
143582008-11-14 Cary Coutant <ccoutant@google.com>
14359
14360 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14361 instead of -1U.
14362
c82fbeee
CS
143632008-11-05 Craig Silverstein <csilvers@google.com>
14364
14365 * options.cc (General_options::parse_dynamic_list): New function.
14366 * options.h (General_options): New flags dynamic_list,
14367 dynamic_list_data, dynamic_list_cpp_new, and
14368 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14369 (General_options::in_dynamic_list): New function.
14370 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14371 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14372 (Lex::can_continue_name): Likewise.
14373 (yylex): Likewise.
14374 (read_script_file): New parameter script_options.
14375 (read_dynamic_list): New function.
14376 (Script_options::define_dynamic_list): New function.
14377 (dynamic_list_keyword_parsecodes): New variable.
14378 (dynamic_list_keywords): New variable.
14379 * script.h (Script_options::define_dynamic_list): New function
14380 prototype.
14381 (read_dynamic_list): New function prototype.
14382 * symtab.cc (strprefix): New macro.
14383 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14384 dynamic_list_data, dynamic_list_cpp_new, and
14385 dynamic_list_cpp_typeinfo.
14386 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14387 (dynamic_list_expr): New rule.
14388 (dynamic_list_nodes): Likewise.
14389 (dynamic_list_node): Likewise.
14390 * testsuite/Makefile.am (dynamic_list): New test.
14391 * testsuite/Makefile.in: Regenerated.
14392 * testsuite/dynamic_list.t: New file.
14393 * testsuite/dynamic_list.sh: New file.
14394
e0bb29a5
CS
143952008-11-05 Craig Silverstein <csilvers@google.com>
14396
14397 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14398 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14399 (t11_last): Likewise.
14400 * testsuite/ver_test_6.c (main): Likewise.
14401
4e1e25e0
CC
144022008-10-07 Cary Coutant <ccoutant@google.com>
14403
14404 * options.c (General_options::finalize): Add check for -static and
14405 -shared.
14406 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14407 is not empty.
14408
92f03fcb
CC
144092008-10-02 Cary Coutant <ccoutant@google.com>
14410
14411 * plugin.cc (make_sized_plugin_object): Fix conditional
14412 compilation to work when not all targets are enabled.
14413
fbd8a257
CC
144142008-09-29 Cary Coutant <ccoutant@google.com>
14415
14416 * archive.cc (Archive::get_file_and_offset): Use filename instead
14417 of name to get library path.
14418 (Archive::include_member): Unlock external member of a thin archive.
14419
14420 * testsuite/Makefile.am (TEST_AR): New variable.
14421 (thin_archive_test_1): New test.
14422 (thin_archive_test_2): New test.
81636b3f
CC
14423 * testsuite/Makefile.in: Regenerate.
14424 * testsuite/thin_archive_main.cc: New file.
14425 * testsuite/thin_archive_test_1.cc: New file.
14426 * testsuite/thin_archive_test_2.cc: New file.
14427 * testsuite/thin_archive_test_3.cc: New file.
14428 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14429
eff45813
CC
144302008-09-29 Cary Coutant <ccoutant@google.com>
14431
14432 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14433 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14434 instead of -1U.
14435 (Sized_relobj::do_finalize_local_symbols): Likewise.
14436 (Sized_relobj::map_to_kept_section): Likewise.
14437 * object.h (Sized_relobj::invalid_address): New constant.
14438 (Sized_relobj::do_output_section_offset): Check for invalid_address
14439 and return -1ULL.
14440 * output.cc (Output_reloc::local_section_offset): Use constant
14441 invalid_address instead of -1U.
14442 (Output_reloc::get_address): Likewise.
14443 (Output_section::output_address): Change -1U to -1ULL.
14444 * output.h (Output_reloc::invalid_address): New constant.
14445 * reloc.cc (Sized_relobj::write_sections): Use constant
14446 invalid_address instead of -1U.
14447 (Sized_relobj::relocate_sections): Likewise.
14448 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14449 values for merge sections.
14450 * target-reloc.h (relocate_for_relocatable): Use constant
14451 invalid_address instead of -1U.
14452
89fc3421
CC
144532008-09-19 Cary Coutant <ccoutant@google.com>
14454
14455 Add plugin functionality for link-time optimization (LTO).
14456 * configure.ac (plugins): Add --enable-plugins option.
14457 * configure: Regenerate.
14458 * config.in: Regenerate.
14459 * Makefile.am (LIBDL): New variable.
14460 (CCFILES): Add plugin.cc.
14461 (HFILES): Add plugin.h.
14462 (ldadd_var): Add LIBDL.
14463 * Makefile.in: Regenerate.
14464
14465 * archive.cc: Include "plugin.h".
14466 (Archive::setup): Don't preread archive symbols when using a plugin.
14467 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14468 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14469 files.
14470 (Archive::include_member): Add symbols from plugin objects.
14471 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14472 * descriptors.cc (Descriptors::open): Check for file descriptors
14473 abandoned by plugins.
14474 (Descriptors::claim_for_plugin): New function.
14475 * descriptors.h (Descriptors::claim_for_plugin): New function.
14476 (Open_descriptor::is_claimed): New field.
14477 (claim_descriptor_for_plugin): New function.
14478 * fileread.cc (File_read::claim_for_plugin): New function.
14479 * fileread.h (File_read::claim_for_plugin): New function.
14480 (File_read::descriptor): New function.
14481 * gold.cc: Include "plugin.h".
14482 (queue_initial_tasks): Add task to call plugin hooks for generating
14483 new object files.
14484 * main.cc: Include "plugin.h".
14485 (main): Load plugin libraries.
14486 * object.h (Pluginobj): Declare.
14487 (Object::pluginobj): New function.
14488 (Object::do_pluginobj): New function.
14489 (Object::set_target): New function.
14490 * options.cc: Include "plugin.h".
14491 (General_options::parse_plugin): New function.
14492 (General_options::General_options): Initialize plugins_ field.
14493 (General_options::add_plugin): New function.
14494 * options.h (Plugin_manager): Declare.
14495 (General_options): Add --plugin option.
14496 (General_options::has_plugins): New function.
14497 (General_options::plugins): New function.
14498 (General_options::add_plugin): New function.
14499 (General_options::plugins_): New field.
14500 * plugin.cc: New file.
14501 * plugin.h: New file.
14502 * readsyms.cc: Include "plugin.h".
14503 (Read_symbols::do_read_symbols): Check for archive before checking
14504 for ELF file. Call plugin hooks to claim files.
14505 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14506 from a real object file; force override when processing replacement
14507 files.
14508 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14509 (Symbol::init_base_object): Likewise.
14510 (Symbol::init_base_output_data): Likewise.
14511 (Symbol::init_base_output_segment): Likewise.
14512 (Symbol::init_base_constant): Likewise.
14513 (Symbol::init_base_undefined): Likewise.
14514 (Symbol::output_section): Assert that object is not a plugin.
14515 (Symbol_table::add_from_pluginobj): New function.
14516 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14517 undefined.
14518 (Symbol_table::sized_write_globals): Likewise.
14519 (Symbol_table::add_from_pluginobj): Instantiate template.
14520 * symtab.h (Sized_pluginobj): Declare.
14521 (Symbol::in_real_elf): New function.
14522 (Symbol::set_in_real_elf): New function.
14523 (Symbol::in_real_elf_): New field.
14524 (Symbol_table::add_from_pluginobj): New function.
14525
14526 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14527 (LIBDL): New variable.
14528 (LDADD): Add LIBDL.
14529 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14530 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14531 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14532 (MOSTLYCLEANFILES): Likewise.
14533 * testsuite/Makefile.in: Regenerate.
14534 * testsuite/plugin_test.c: New file.
14535 * testsuite/plugin_test_1.sh: New file.
14536 * testsuite/plugin_test_2.sh: New file.
14537
de31bda5
ILT
145382008-09-16 Ian Lance Taylor <iant@google.com>
14539
9c2d0ef9
ILT
14540 * target-reloc.h (relocate_section): Check whether a symbol is
14541 defined by the ABI before reporting an undefined symbol error.
14542 * target.h (Target::is_defined_by_abi): Make parameter const.
14543 (Target::do_is_defined_by_abi): Likewise.
14544 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14545 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14546 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14547 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14548 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14549 * testsuite/Makefile.in: Rebuild.
14550
de31bda5
ILT
14551 * fileread.cc (make_view): Add casts to avoid warning.
14552
9fa33bee
AO
145532008-09-16 Alexandre Oliva <aoliva@redhat.com>
14554
14555 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14556 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14557
183fd0e3
AO
145582008-09-16 Alexandre Oliva <aoliva@redhat.com>
14559
14560 * options.h (General_options::output_is_executable): New.
14561 (General_options::output_is_pie): New.
14562 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14563 for shared libraries.
14564 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14565
7be8330a
CD
145662008-09-11 Chris Demetriou <cgd@google.com>
14567
14568 * options.h (origin): New -z option.
14569 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14570 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14571 in DT_FLAGS_1.
14572
a9caad02
CC
145732008-09-05 Cary Coutant <ccoutant@google.com>
14574
14575 * fileread.cc (File_read::make_view): Add check for attempt to map
14576 beyond end of file.
14577
ae6dce4d
CC
145782008-09-05 Cary Coutant <ccoutant@google.com>
14579
14580 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14581 explicit instantiations.
14582
d7ab2a47
KVH
145832008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14584
14585 PR gold/6858
14586 * options.cc (General_options::finalize): Allow undefined symbols
14587 in shlibs if linking -shared.
14588
14589 PR gold/6859
14590 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14591 symbols as not needing a dynsym entry.
14592
1e52a9c1
CS
145932008-08-20 Craig Silverstein <csilvers@google.com>
14594
14595 * fileread.cc (File_read::open): Do not lock the file unless it
14596 was successfully opened.
14597
d85c80a3
CC
145982008-08-14 Cary Coutant <ccoutant@google.com>
14599
14600 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14601 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14602 * testsuite/tls_test.cc (struct int128): 128-bit struct
14603 for testing TLS relocs with non-zero addend.
14604 (v12): New TLS variable.
14605 (t12): New test.
14606 (t_last): Add check for v12.
14607 * testsuite/tls_test.h (t12): New function.
14608 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14609
2d924fd9
ILT
146102008-08-13 Ian Lance Taylor <iant@google.com>
14611
14612 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14613 set tls_segment_ or relro_segment_.
14614 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14615 when appropriate.
14616 * output.h (Output_section::clear_is_relro): New function.
14617 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14618 sections specially even when output_data_ is empty.
14619 (Output_segment::maximum_alignment): When first section is relro,
14620 only force alignment for PT_LOAD segments.
14621 * script.cc (script_data_segment_align): New function.
14622 (script_data_segment_relro_end): New function.
14623 * script-c.h (script_data_segment_align): Declare.
14624 (script_data_segment_relro_end): Declare.
14625 * script-sections.h (class Script_sections): Declare
14626 data_segment_align and data_segment_relro_end. Add fields
14627 segment_align_index_ and saw_relro_end_.
14628 * script-sections.cc (class Sections_element): Add set_is_relro
14629 virtual function. Add new bool* parameter to place_orphan_here.
14630 Add get_output_section virtual function.
14631 (class Output_section_definition): Add set_is_relro. Add new
14632 bool* parameter to place_orphan_here. Add get_output_section.
14633 Add is_relro_ field.
14634 (Output_section_definition::Output_section_definition): Initialize
14635 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14636 and is_relro_ fields.
14637 (Output_section_definition::place_orphan_here): Add is_relro
14638 parameter.
14639 (Output_section_definition::set_section_addresses): Set relro for
14640 output section.
14641 (Output_section_definition::alternate_constraint): Likewise.
14642 (class Orphan_output_section): Add new bool* parameter to
14643 place_orphan_here. Add get_output_section.
14644 (Orphan_output_section::place_orphan_here): Add is_relro
14645 parameter.
14646 (Script_sections::Script_sections): Initialize
14647 data_segment_align_index_ and saw_relro_end_.
14648 (Script_sections::data_segment_align): New function.
14649 (Script_sections::data_segment_relro_end): New function.
14650 (Script_sections::place_orphan): Set or clear is_relro.
14651 (Script_sections::set_section_addresses): Force alignment of first
14652 TLS section.
14653 * yyscript.y (exp): Call script_data_segment_align and
14654 script_data_segment_relro_end.
14655 * testsuite/relro_script_test.t: New file.
14656 * testsuite/relro_test.cc (using_script): Declare.
14657 (t1, t2): Test using_script.
14658 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14659 (relro_script_test_SOURCES): Define.
14660 (relro_script_test_DEPENDENCIES): Define.
14661 (relro_script_test_LDFLAGS): Define.
14662 (relro_script_test_LDADD): Define.
14663 (relro_script_test.so): New target.
14664 * testsuite/Makefile.in: Rebuild.
14665
f827c9a9
CC
146662008-08-06 Cary Coutant <ccoutant@google.com>
14667
14668 * archive.cc (Archive::total_archives, Archive::total_members)
14669 (Archive::total_members_loaded): New variables.
14670 (Archive::setup): Add parameter. Add option to preread
14671 archive symbols.
14672 (Archive::read_armap): Add counter.
14673 (Archive::get_file_and_offset): New function.
14674 (Archive::get_elf_object_for_member): New function.
14675 (Archive::read_all_symbols): New function.
14676 (Archive::read_symbols): New function.
14677 (Archive::add_symbols): Add counters.
14678 (Archive::include_all_members): Use armap to find members if it's
14679 already built.
14680 (Archive::include_member): Skip reading symbols if already read.
14681 Factored code into Archive::get_file_and_offset and
14682 Archive::get_elf_object_for_member. Changed call to
14683 Mapfile::report_include_archive_member.
14684 (Archive::print_stats): New function.
14685 * archive.h: Declare Object and Read_symbols_data classes.
14686 (Archive::Archive): Add initializers for new members.
14687 (Archive::setup): Add parameter.
14688 (Archive::print_stats): New function.
14689 (Archive::total_archives, Archive::total_members)
14690 (Archive::total_members_loaded): New variables.
14691 (Archive::get_file_and_offset): New function.
14692 (Archive::get_elf_object_for_member): New function.
14693 (Archive::read_all_symbols): New function.
14694 (Archive::read_symbols): New function.
14695 (Archive::Archive_member): New class.
14696 (Archive::members_): New member.
14697 (Archive::num_members_): New member.
14698 * main.cc: Include archive.h.
14699 (main): Call Archive::print_stats.
14700 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14701 archive parameter; member_name is now the fully-decorated name.
14702 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14703 * options.h: (General_options): Add --preread-archive-symbols option.
14704 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14705 Archive::setup.
14706
de4c45bd
ILT
147072008-08-04 Ian Lance Taylor <iant@google.com>
14708
14709 * symtab.h (Symbol::use_plt_offset): New function.
14710 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14711 * powerpc.cc (Relocate::relocate): Likewise.
14712 * sparc.cc (Relocate::relocate): Likewise.
14713 * x86_64.cc (Relocate::relocate): Likewise.
14714 * testsuite/weak_plt.sh: New test.
14715 * testsuite/weak_plt_main.cc: New test.
14716 * testsuite/weak_plt_shared.cc: New test.
14717 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14718 (check_PROGRAMS): Add weak_plt.
14719 (check_DATA): Add weak_plt_shared.so.
14720 (weak_plt_main_pic.o, weak_plt): New targets.
14721 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14722 * testsuite/Makefile.in: Rebuild.
14723
14724 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14725 gcctestdir/ld.
14726 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14727 * testsuite/Makefile.in: Rebuild.
14728
323ee3f4
AM
147292008-08-04 Alan Modra <amodra@bigpond.net.au>
14730
14731 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14732 * Makefile.in: Regenerate.
14733 * po/POTFILES.in: Regenerate.
14734
7c07ecec
ILT
147352008-07-29 Ian Lance Taylor <iant@google.com>
14736
14737 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14738 symbols before other symbols.
14739 * testsuite/script_test_2.cc (test_addr): Declare.
14740 (test_addr_alias): Declare.
14741 (main): Check that test_addr and test_addr_alias have the right
cd536b21 14742 values.
7c07ecec
ILT
14743 * testsuite/script_test_2.t: Define test_addr_alias and
14744 test_addr.
14745
5778530e
ILT
147462008-07-24 Ian Lance Taylor <iant@google.com>
14747
2a00e4fb
ILT
14748 PR 5990
14749 * descriptors.cc: New file.
14750 * descriptors.h: New file.
14751 * gold-threads.h (class Hold_optional_lock): New class.
14752 * fileread.cc: Include "descriptors.h".
14753 (File_read::~File_read): Release descriptor rather than closing
14754 it.
14755 (File_read::open) [file]: Call open_descriptor rather than open.
14756 Set is_descriptor_opened_.
14757 (File_read::open) [memory]: Assert that descriptor is not open.
14758 (File_read::reopen_descriptor): New function.
14759 (File_read::release): Release descriptor.
14760 (File_read::do_read): Make non-const. Reopen descriptor.
14761 (File_read::read): Make non-const.
14762 (File_read::make_view): Reopen descriptor.
14763 (File_read::do_readv): Likewise.
14764 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14765 Update declarations.
14766 * layout.cc: Include "descriptors.h".
14767 (Layout::create_build_id): Use open_descriptor rather than open.
14768 * output.cc: Include "descriptors.h".
14769 (Output_file::open): Use open_descriptor rather than open.
14770 * archive.cc (Archive::const_iterator): Change Archive to be
14771 non-const.
14772 (Archive::begin, Archive::end): Make non-const.
14773 (Archive::count_members): Likewise.
14774 * archive.h (class Archive): Update declarations.
14775 * object.h (Object::read): Make non-const.
14776 * Makefile.am (CCFILES): Add descriptors.cc.
14777 (HFILES): Add descriptors.h.
14778 * Makefile.in: Rebuild.
14779
801647d1
ILT
14780 PR 6716
14781 * gold.h: Always include <clocale>. Add Solaris workarounds
14782 following code in binutils/sysdep.h.
14783
5edd166e
ILT
14784 PR 6048
14785 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14786 this->eh_frame_hdr_ is NULL before using it.
14787
c89ad728
ILT
14788 * dynobj.cc (Versions::Versions): Update comment.
14789
aa86f06b
ILT
14790 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14791 the base version name.
14792
5778530e
ILT
14793 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14794 array size plus one.
14795 (Stringpool_template::set_string_offsets): Subtract one from key
14796 before using it as an array index.
14797 (Stringpool_template::get_offset_with_length): Likewise.
14798 (Stringpool_template::write_to_buffer): Likewise.
14799 * stringpool.h (Stringpool_template::get_offset_from_key):
14800 Likewise.
14801
057ead22
ILT
148022008-07-23 Ian Lance Taylor <iant@google.com>
14803
7f649c59
ILT
14804 PR 6658
14805 * object.h (Merged_symbol_value::value): Do our best to handle a
14806 negative addend.
14807
057ead22
ILT
14808 PR 6647
14809 * script.cc (Version_script_info::get_versions): Don't add empty
14810 version tag to return value.
14811 (Version_script_info::get_symbol_version_helper): Change return
14812 type to bool. Add pversion parameter. Change all callers.
14813 (script_register_vers_node): Don't require a non-NULL tag.
14814 * script.h (class Version_script_info): Update declarations.
14815 (Version_script_info::get_symbol_version): Change return type to
14816 bool. Add version parameter. Change all callers.
14817 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14818 handling. Handle an empty version from a version script.
14819 (Symbol_table::define_special_symbol): Likewise.
14820 * testsuite/ver_test_10.script: New file.
14821 * testsuite/ver_test_10.sh: New file.
14822 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14823 (check_DATA): Add ver_test_10.syms.
14824 (ver_test_10.syms, ver_test_10.so): New target.
14825 * testsuite/Makefile.in: Rebuild.
14826
58e54ac2
CD
148272008-07-23 Simon Baldwin <simonb@google.com>
14828
14829 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14830 to zero for undefined symbols from dynamic libraries.
14831
95d14cd3
ILT
148322008-07-23 Ian Lance Taylor <iant@google.com>
14833
14834 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14835 Change all callers.
14836 * symtab.h (class Symbol_table): Update declaration.
14837 * testsuite/ver_test_9.cc: New file.
14838 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14839 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14840 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14841 (ver_test_9.so, ver_test_9.o): New targets.
14842 * testsuite/Makefile.in: Rebuild.
14843
92de84a6
ILT
148442008-07-22 Ian Lance Taylor <iant@google.com>
14845
34810851
ILT
14846 * options.h (class General_options): Define --check-sections.
14847 * layout.cc (Layout::set_segment_offsets): Handle
14848 --check-sections.
14849
af6156ef
ILT
14850 * options.h (class General_options): Define -n/--nmagic and
14851 -N/--omagic.
14852 * options.cc (General_options::finalize): For -n/--nmagic or
14853 -N/--omagic, set -static.
14854 * layout.cc (Layout::attach_allocated_section_to_segment): If
14855 -N/--omagic, don't put read-only and read-write sections in
14856 different segments.
14857 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14858 finding a read-only segment.
14859 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14860 don't set the minimum segment alignment to the common page size,
14861 and don't set the file offset to the address modulo the page size.
14862 * script-sections.cc (Script_sections::create_segments): If
14863 -n/--omagic, don't put read-only and read-write sections in
14864 different segments.
14865
92de84a6
ILT
14866 * cref.cc: New file.
14867 * cref.h: New file.
14868 * options.h (class General_options): Add --print-symbol-counts.
14869 * main.cc (main): Issue defined symbol report if requested.
14870 * archive.cc (Archive::interpret_header): Make into a const member
14871 function.
14872 (Archive::add_symbols): Call Input_objects::archive_start and
14873 archive_stop.
14874 (Archive::const_iterator): Define new class.
14875 (Archive::begin, Archive::end): New functions.
14876 (Archive::include_all_members): Rewrite to use iterator.
14877 (Archive::count_members): New function.
14878 * archive.h (class Archive): Update declarations.
14879 (Archive::filename): New function.
14880 * object.cc: Include "cref.h".
14881 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14882 (Sized_relobj::do_get_global_symbol_counts): New function.
14883 (Input_objects::add_object): Add object to cross-referencer.
14884 (Input_objects::archive_start): New function.
14885 (Input_objects::archive_stop): New function.
14886 (Input_objects::print_symbol_counts): New function.
14887 * object.h: Declare Cref and Archive.
14888 (Object::get_global_symbol_counts): New function.
14889 (Object::do_get_global_symbol_counts): New pure virtual function.
14890 (class Sized_relobj): Add defined_count_ field. Update
14891 declarations.
14892 (class Input_objects): Add cref_ field. Update constructor.
14893 Update declarations.
14894 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14895 defined_count_.
14896 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14897 symbol counts.
14898 (Sized_dynobj::do_get_global_symbol_counts): New function.
14899 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14900 defined_count_. Update declarations. Define Symbols typedef.
14901 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14902 parameter. Change all callers.
14903 (Symbol_table::add_from_dynobj): Add sympointers and defined
14904 parameters. Change all callers.
14905 * symtab.h (class Symbol_table): Update declarations.
14906 * Makefile.am (CCFILES): Add cref.cc.
14907 (HFILES): Add cref.h.
14908 * Makefile.in: Rebuild.
14909
3f7c5e1d
CD
149102008-07-22 Simon Baldwin <simonb@google.com>
14911
14912 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14913 to zero when writing undefined symbols.
14914
e0b64032
ILT
149152008-07-22 Ian Lance Taylor <iant@google.com>
14916
14917 * output.cc (Output_section::add_input_section): Don't try to
14918 merge empty merge sections.
14919
096b02cf
CS
149202008-07-21 Craig Silverstein <csilvers@google.com>
14921
14922 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14923 Include symbol version in error message.
cd536b21 14924
1d1f116d
CD
149252008-07-20 Chris Demetriou <cgd@google.com>
14926
cd536b21 14927 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
14928 (RANDOM_SEED_CFLAGS): New substituted variable.
14929 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14930 * configure: Rebuild.
14931 * Makefile.in: Likewise.
14932 * testsuite/Makefile.in: Likewise.
14933
a18f591e
ILT
149342008-07-18 Ian Lance Taylor <iant@google.com>
14935
14936 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14937 where we see NAME/NULL and NAME/VERSION as separate symbols.
14938 * testsuite/ver_test_main.cc (main): Call t4.
14939 (t4, t4_2a): Define.
14940 * testsuite/ver_test_2.cc (t4_2): Define.
14941 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14942 * testsuite/ver_test_4.cc (t4_2a): Define.
14943 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14944 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14945
c6e3f6ed
ILT
149462008-07-17 Ian Lance Taylor <iant@google.com>
14947
14948 * dynobj.cc (Versions::add_def): If we give an error about a
14949 missing version, go ahead and create the version anyhow.
14950
ef9beddf
ILT
149512008-07-10 Ian Lance Taylor <iant@google.com>
14952
14953 Handle output sections with more than 0x7fffffff bytes.
14954 * object.h (class Relobj): Change map_to_output_ to
14955 output_sections_, and just keep a section pointer. Change all
14956 uses. Move comdat group support to Sized_relobj.
14957 (Relobj::is_section_specially_mapped): Remove.
14958 (Relobj::output_section): Remove poff parameter. Change all
14959 callers.
14960 (Relobj::output_section_offset): New function.
14961 (Relobj::set_section_offset): Rewrite.
14962 (Relobj::map_to_output): Remove.
14963 (Relobj::output_sections): New function.
14964 (Relobj::do_output_section_offset): New pure virtual function.
14965 (Relobj::do_set_section_offset): Likewise.
14966 (class Sized_relobj): Add section_offsets_ field. Add comdat
14967 group support from Relobj. Update declarations.
14968 (Sized_relobj::get_output_section_offset): New function.
14969 (Sized_relobj::do_output_section_offset): New function.
14970 (Sized_relobj::do_set_section_offset): New function.
14971 * object.cc (Relobj::output_section_address): Remove.
14972 (Sized_relobj::Sized_relobj): Initialize new fields.
14973 (Sized_relobj::include_section_group): Cast find_kept_object to
14974 Sized_relobj.
14975 (Sized_relobj::include_linkonce_section): Likewise.
14976 (Sized_relobj::do_layout): Use separate arrays for output section
14977 and output offset.
14978 (Sized_relobj::do_count_local_symbols): Change map_to_output to
14979 output_sections.
14980 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
14981 output_sections and section_offsets.
14982 (Sized_relobj::write_local_symbols): Likewise.
14983 (map_to_kept_section): Compute output address directly.
14984 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
14985 output_sections and section_offsets.
14986 (Sized_relobj::write_sections): Likewise.
14987 (Sized_relobj::relocate_sections): Likewise.
14988 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
14989 * output.h (class Output_reloc): Update declarations. Change
14990 u2_.relobj to Sized_relobj*.
14991 (class Output_data_reloc): Change add functions to use
14992 Sized_relobj*.
14993 * output.cc (Output_reloc::Output_reloc): Change relobj to
14994 Sized_relobj*.
14995 (Output_reloc::local_section_offset): Change return type to
14996 Elf_Addr. Use get_output_section_offset.
14997 (Output_reloc::get_address): Likewise.
14998 (Output_section::is_input_address_mapped): Don't call
14999 is_section_specially_mapped.
15000 (Output_section::output_offset): Likewise.
15001 (Output_section::output_address): Likewise.
15002 (Output_section::starting_output_address): Likewise.
15003 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15004 parameter to Sized_relobj*.
15005 (Copy_relocs::need_copy_reloc): Likewise.
15006 (Copy_relocs::save): Likewise.
15007 * copy-relocs.h (class Copy_relocs): Update declarations.
15008 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15009 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15010 * target-reloc.h (relocate_for_relocatable): Change
15011 offset_in_output_section type to Elf_Addr. Change code that uses
15012 it as well.
15013 * layout.cc (Layout::layout): Always set *off.
15014 * mapfile.cc (Mapfile::print_input_section): Use
15015 output_section_offset.
15016 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15017 Sized_relobj*.
15018 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15019 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15020 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15021
5cb66f97
ILT
150222008-07-03 Ian Lance Taylor <iant@google.com>
15023
15024 * layout.cc (Layout::include_section): Do not discard unrecognized
15025 SHT_STRTAB sections.
15026
afe47622
CS
150272008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15028
15029 * script.cc (Lex::can_continue_name): Make '?' allowable in
15030 version-script names.
15031 * testsuite/version_script.map: Change glob pattern to use '?'
15032
5adf9721
ILT
150332008-06-30 Manish Singh <yosh@gimp.org>
15034
15035 PR 6585
15036 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
15037 Correct typo.
15038
e6fde208
ILT
150392008-06-30 Ian Lance Taylor <iant@google.com>
15040
15041 PR 6660
15042 PR 6682
15043 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
15044 versions]: Don't try to read the value in the contents, since we
15045 don't use it. Use the template endianness when writing.
15046
3f2e6a2d
CC
150472008-06-25 Cary Coutant <ccoutant@google.com>
15048
15049 * fileread.cc (File_read::make_view): Assert on zero-length view.
15050 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
15051 symbol table when there are no symbols to read.
15052
c43d3a48
CS
150532008-06-23 Craig Silverstein <csilvers@google.com>
15054
15055 * version.cc (version_string): Bump to 1.7
15056
5f494ea0
CS
150572008-06-18 Craig Silverstein <csilvers@google.com>
15058
15059 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
15060 constant 0xFFFF to type Valtype.
15061 (Powerpc_relocate_functions::rel16_ha): Likewise.
15062
c42e122e
ILT
150632008-06-17 Ian Lance Taylor <iant@google.com>
15064
f34787f8
ILT
15065 * output.h (Output_section::Input_section): Initialize p2align_ to
15066 zero for Output_section_data constructors.
15067 (Output_section::Input_section::addralign): If not an input
15068 section, return the alignment of the Output_section_data.
15069 * testsuite/copy_test.cc: New file.
15070 * testsuite/copy_test_1.cc: New file.
15071 * testsuite/copy_test_2.cc: New file.
15072 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15073 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15074 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15075 (copy_test_1_pic.o, copy_test_1.so): New targets.
15076 (copy_test_2_pic.o, copy_test_2.so): New targets.
15077 * testsuite/Makefile.in: Rebuild.
15078
c42e122e
ILT
15079 * script-sections.cc (Script_sections::place_orphan): Initialize
15080 local variable exact.
15081
ce3ac18a
DE
150822008-06-13 David Edelsohn <edelsohn@gnu.org>
15083
15084 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15085
42cacb20
DE
150862008-06-12 David Edelsohn <edelsohn@gnu.org>
15087 David S. Miller <davem@davemloft.net>
15088
15089 * powerpc.cc: New file.
15090 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15091 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15092 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15093 * Makefile.in: Rebuild.
15094
7b308235
ILT
150952008-06-09 Ian Lance Taylor <iant@google.com>
15096
15097 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15098 <exception>.
15099 (throwing, orig_terminate): New static variables.
15100 (terminate_handler): New static function.
15101 (t2): Set terminate handler.
15102
f0b886e3
ILT
151032008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15104
15105 PR 6584
cd536b21 15106 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
15107 alignment.
15108
3e90f135
CC
151092008-05-30 Cary Coutant <ccoutant@google.com>
15110
15111 * archive.cc (Archive::include_all_members) Correct to step
15112 over symbol table and extended name table in thin archives.
15113
e09ad04a
ILT
151142008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15115
15116 PR 6407
15117 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15118 calculation.
15119
62b01cb5
ILT
151202008-05-28 Caleb Howe <cshowe@google.com>
15121
15122 * reduced_debug_output.cc: New file.
15123 * reduced_debug_output.h: New file.
92de84a6 15124 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
15125 * options.cc (General_options::finalize): Add strip_debug_non_line
15126 to the strip heirarchy.
15127 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15128 fields.
15129 * layout.cc: Include "reduced_debug_output.h".
15130 (Layout::Layout): Initialize new fields.
15131 (line_only_debug_sections): New static array.
15132 (is_lines_only_debug_sections): New static inline function.
15133 (Layout::include_section): Handle --strip-debug-non-line.
15134 (Layout::make_output_section): If --strip-debug-non-line, build
15135 new output sections for .debug_abbrev and .debug_info.
15136 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15137 gold. Warn about possible overflow.
15138 (read_signed_LEB_128): Likewise.
15139 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15140 (read_signed_LEB_128): Declare.
15141 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15142 (HFILES): Add reduced_debug_output.h.
15143 * Makefile.in: Rebuild.
15144
7d9e3d98
ILT
151452008-05-21 Ian Lance Taylor <iant@google.com>
15146
15147 * mapfile.cc: New file.
15148 * mapfile.h: New file.
15149 * options.h (class General_options): Add -M/--print-map and -Map.
15150 * options.cc (General_options::finalize): Make -M equivalent to
15151 -Map -.
15152 * main.cc: Include <cstdio> and "mapfile.h".
15153 (main): Open mapfile if requested.
15154 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15155 constructor. Change caller.
15156 (queue_initial_tasks): Add mapfile parameter. Change caller.
15157 (queue_middle_tasks): Likewise.
15158 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15159 declarations.
15160 * archive.cc: Include "mapfile.h".
15161 (Archive::add_symbols): Add mapfile parameter. Change all
15162 callers. Pass mapfile, symbol, and reason to include_member.
15163 (Archive::include_all_members): Add mapfile parameter. Change all
15164 callers.
15165 (Archive::include_member): Add mapfile, sym, and why parameters.
15166 Change all callers. Report inclusion to map file.
15167 * archive.h: Include "fileread.h".
15168 (class Archive): Update declarations.
15169 (Archive::file): New const method.
15170 (class Add_archive_symbols): Add mapfile_ field. Update
15171 constructor. Change all callers.
15172 * readsyms.h (class Read_symbols): Likewise.
15173 (class Finish_group): Likewise.
15174 (class Read_script): Likewise.
15175 * common.cc: Include "mapfile.h".
15176 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15177 all callers.
15178 (Symbol_table::do_allocate_commons): Likewise.
15179 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15180 symbol allocation to mapfile.
15181 * common.h (class Allocate_commons_task): Add mapfile_ field.
15182 Update constructor. Change all callers.
15183 * symtab.h (class Symbol_table): Update declarations.
15184 * layout.cc: Include "mapfile.h".
15185 (Layout_task_runner::run): Print information to mapfile.
15186 (Layout::create_gold_note): Change Output_data_fixed_space to
15187 Output_data_zero_fill.
15188 (Layout::create_build_id): Likewise.
15189 (Layout::print_to_mapfile): New function.
15190 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15191 constructor. Change caller.
15192 (class Layout): Declare print_to_mapfile.
15193 * output.cc (Output_section::Input_section::print_to_mapfile): New
15194 function.
15195 (Output_section::add_input_section): If producing a map, always
15196 add to input_sections_ list.
15197 (Output_section::do_print_to_mapfile): New function.
15198 (Output_segment::print_sections_to_mapfile): New function.
15199 (Output_segment::print_section_list_to_mapfile): New function.
15200 * output.h: Include "mapfile.h".
15201 (Output_data::print_to_mapfile): New function.
15202 (Output_data::do_print_to_mapfile): New virtual function.
15203 (Output_segment_headers::do_print_to_mapfile): New function.
15204 (Output_file_header::do_print_to_mapfile): New function.
15205 (Output_data_const::do_print_to_mapfile): New function.
15206 (class Output_data_const_buffer): Add map_name_ field. Update
15207 constructor. Change all callers. Add do_print_to_mapfile
15208 function.
15209 (class Output_data_fixed_space): Likewise.
15210 (class Output_data_space): Likewise.
15211 (class Output_data_zero_fill): New class.
15212 (Output_data_strtab::do_print_to_mapfile): New function.
15213 (Output_data_reloc_base::do_print_to_mapfile): New function.
15214 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15215 (Output_data_group::do_print_to_mapfile): New function.
15216 (Output_data_got::do_print_to_mapfile): New function.
15217 (Output_data_dynamic::do_print_to_mapfile): New function.
15218 (Output_symtab_xindex::do_print_to_mapfile): New function.
15219 (class Output_section): Declare do_print_to_mapflie. Declare
15220 print_to_mapfile in Input_section.
15221 (class Output_segment): Declare new functions.
15222 * object.h (Sized_relobj::symbol_count): New function.
15223 * script-sections.cc
15224 (Output_section_element_dot_assignment::set_section_addresses):
15225 Change Output_data_fixed_space to Output_data_zero_fill.
15226 (Output_data_expression::do_print_to_mapfile): New function.
15227 * script.cc (read_input_script): Add mapfile parameter. Change
15228 all callers.
15229 * script.h (read_input_script): Update declaration.
15230 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15231 (Eh_frame::do_print_to_mapfile): New function.
15232 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15233 (Output_merge_string::do_print_to_mapfile): New function.
15234 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15235 function.
15236 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15237 function.
15238 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15239 function.
15240 * Makefile.am (CCFILES): Add mapfile.cc.
15241 (HFILES): Add mapfile.h.
15242 * Makefile.in: Rebuild.
15243
9f1d377b
ILT
152442008-05-19 Ian Lance Taylor <iant@google.com>
15245
15246 * options.h (class General_options): Add -z relro.
15247 * layout.cc (Layout::Layout): Initialize relro_segment_.
15248 (Layout::add_output_section_data): Return the output section.
15249 (Layout::make_output_section): Rcognize relro sections and mark
15250 them appropriately.
15251 (Layout::attach_allocated_section_to_segment): Put relro sections
15252 in a PT_GNU_RELRO segment.
15253 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15254 section as relro.
15255 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15256 PT_TLS segments.
15257 (Layout::linkonce_mapping): Map d.rel.ro.local to
15258 .data.rel.ro.local.
15259 (Layout::output_section_name): Us .data.rel.ro.local for any
15260 section which begins with that.
15261 * layout.h (class Layout): Update add_output_section_data
15262 declaration. Add relro_segment_ field.
15263 * output.cc (Output_section::Output_section): Initialize is_relro_
15264 and is_relro_local_ fields.
15265 (Output_segment::add_output_section): Group relro sections.
15266 (Output_segment::is_first_section_relro): New function.
15267 (Output_segment::maximum_alignment): If there is a relro section,
15268 align the segment to the common page size.
15269 (Output_segment::set_section_addresses): Track whether we are
15270 looking at relro sections. If the last section is a relro
15271 section, align to the common page size.
15272 (Output_segment::set_section_list_addresses): Add in_relro
15273 parameter. Change all callers. Align to the page size when
15274 moving from relro to non-relro section.
15275 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15276 segment.
15277 * output.h (class Output_section): Add is_relro_ and
15278 is_relro_local_ fields.
15279 (Output_section::is_relro): New function.
15280 (Output_section::set_is_relro): New function.
15281 (Output_section::is_relro_local): New function.
15282 (Output_section::set_is_relro_local): New function.
15283 (class Output_segment): Update declarations.
15284 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15285 * sparc.cc (Target_sparc::got_section): Likewise.
15286 * x86_64.cc (Target_x86_64::got_section): Likewise.
15287 * testsuite/relro_test_main.cc: New file.
15288 * testsuite/relro_test.cc: New file.
15289 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15290 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15291 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15292 (relro_test.so, relro_test_pic.o): New targets.
15293 * testsuite/Makefile.in: Rebuild.
15294
a984ee1d
ILT
152952008-05-16 Ian Lance Taylor <iant@google.com>
15296
01676dcd
ILT
15297 * output.cc (Output_segment::add_output_section): Remove front
15298 parameter.
15299 * output.h (class Output_segment): Remove
15300 add_initial_output_section and overloaded add_output_section.
15301 Update declaration of remaining add_output_section.
15302 * layout.cc (Layout::create_interp): Call add_output_section
15303 rather than add_initial_output_section.
15304 (Layout::finish_dynamic_section): Likewise.
15305
497897f9
ILT
15306 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15307 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15308 know the dynamic type.
15309 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15310 field. Initialize it in constructor.
15311 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15312 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15313 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15314 reloc.
15315
a984ee1d
ILT
15316 * output.cc (Output_reloc::get_address): Change return type to
15317 Elf_Addr.
15318 * output.h (class Output_reloc): Update get_address declaration.
15319 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15320 for section addresses.
15321
55ba0940
ILT
153222008-05-09 Ian Lance Taylor <iant@google.com>
15323
15324 PR 6493
15325 * gold.cc (gold_nomem): Use return value of write.
15326
75517b77
ILT
153272008-05-08 Ian Lance Taylor <iant@google.com>
15328
15329 * symtab.c (Symbol::init_base_output_data): Add version
15330 parameter. Change all callers.
15331 (Symbol::init_base_output_segment): Likewise.
15332 (Symbol::init_base_constant): Likewise.
15333 (Symbol::init_base_undefined): Likewise.
15334 (Sized_symbol::init_output_data): Likewise.
15335 (Sized_symbol::init_output_segment): Likewise.
15336 (Sized_symbol::init_constant): Likewise.
15337 (Sized_symbol::init_undefined): Likewise.
15338 (Symbol_table::do_define_in_output_data): If the new symbol has a
15339 version, mark it as the default.
15340 (Symbol_table::do_define_in_output_segment): Likewise.
15341 (Symbol_table::do_define_as_constant): Likewise.
15342 * symtab.h (class Symbol): Update declarations.
15343 (class Sized_symbol): Likewise.
15344 * resolve.cc (Symbol::override_version): New function.
c42e122e 15345 (Symbol::override_base): Call override_version.
75517b77
ILT
15346 (Symbol::override_base_with_special): Likewise.
15347 * testsuite/ver_script_8.script: New file.
15348 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15349 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15350 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15351 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15352
f1f70eae
ILT
153532008-05-06 Ian Lance Taylor <iant@google.com>
15354
f3e9c5c5
ILT
15355 PR 6049
15356 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15357 functions.
15358 (class General_options): Remove existing --undefined, and add
15359 --no-undefined instead. Add new --undefined as synonym for -u.
15360 * archive.cc (Archive::add_symbols): Check whether symbol was
15361 named with -u.
15362 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15363 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15364 all uses. Add IS_UNDEFINED. Update declarations to split
15365 different versions of init_base. Declare init_base_undefined.
15366 (Symbol::is_defined): Handle IS_UNDEFINED.
15367 (Symbol::is_undefined): Likewise.
15368 (Symbol::is_weak_undefined): Call is_undefined.
15369 (Symbol::is_absolute): Handle IS_CONSTANT.
15370 (class Sized_symbol): Update declarations to split different
15371 versions of init. Declare init_undefined.
15372 (class Symbol_table): Declare new functions.
15373 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15374 Change all callers.
15375 (Symbol::init_base_output_data): Likewise.
15376 (Symbol::init_base_output_segment): Likewise.
15377 (Symbol::init_base_constant): Likewise.
15378 (Symbol::init_base_undefined): New function.
15379 (Sized_symbol::init_object): Rename from init. Change all
15380 callers.
15381 (Sized_symbol::init_output_data): Likewise.
15382 (Sized_symbol::init_output_segment): Likewise.
15383 (Sized_symbol::init_constant): Likewise.
15384 (Sized_symbol::init_undefined): New function.
15385 (Symbol_table::add_undefined_symbols_from_command_line): New
15386 function.
15387 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15388 function.
15389 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15390 (Symbol::output_section): Likewise.
15391 (Symbol::set_output_section): Likewise.
15392 (Symbol_table::sized_finalize_symbol): Likewise.
15393 (Symbol_table::sized_write_globals): Likewise.
15394 * resolve.cc (Symbol_table::should_override): Likewise.
15395 (Symbol::override_base_with_special): Likewise.
15396
8bdcdf2c
ILT
15397 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15398 symbol, change it to have default visibility.
15399 * testsuite/protected_1.cc: New file.
15400 * testsuite/protected_2.cc: New file.
15401 * testsuite/protected_3.cc: New file.
15402 * testsuite/protected_main_1.cc: New file.
15403 * testsuite/protected_main_2.cc: New file.
15404 * testsuite/protected_main_3.cc: New file.
15405 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15406 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15407 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15408 (protected_1.so): New target.
15409 (protected_1_pic.o, protected_2_pic.o): New targets.
15410 (protected_3_pic.o): New target.
15411 (check_PROGRAMS): Add protected_2.
15412 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15413 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15414 * testsuite/Makefile.in: Rebuild.
15415
2b706932
ILT
15416 * options.h (DEFINE_var): Add set_user_set_##varname__.
15417 (DEFINE_bool_alias): New macro.
15418 (class General_options): Define -Bstatic using DEFINE_bool_alias
15419 rather than DEFINE_special. Add --undefined as an alias for -z
15420 defs.
15421 * options.cc (General_options::parse_Bstatic): Remove.
15422
d82a5bcc
ILT
15423 * options.h (class General_options): Add --fatal-warnings.
15424 * main.cc (main): Implement --fatal-warnings.
15425 * errors.h (Errors::warning_count): New function.
15426
f1f70eae
ILT
15427 * options.h (class General_options): Add -Bsymbolic-functions.
15428 * symtab.h (Symbol::is_preemptible): Check for
15429 -Bsymbolic-functions.
15430
8825ac63
ILT
154312008-05-05 Ian Lance Taylor <iant@google.com>
15432
d98bc257
ILT
15433 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15434 as noVARNAME rather than no-VARNAME.
15435 (class General_options): Add option -z combreloc.
15436 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15437 get_address.
15438 (Output_reloc::sort_before) [SHT_REL]: New function.
15439 (Output_reloc::sort_before) [SHT_RELA]: New function.
15440 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15441 Sort_relocs_comparison.
15442 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15443 parameter. Change all callers.
15444 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15445 sort_relocs parameter. Change all callers.
15446 * output.cc (Output_reloc::get_address): New function, broken out
15447 of write_rel.
15448 (Output_reloc::write_rel): Call it.
15449 (Output_reloc::compare): New function.
15450 (Output_data_reloc_base::do_write): Optionally sort relocs.
15451
60b2b4e7
ILT
15452 * configure.ac: If targ_extra_obj is set, link it in.
15453 * configure.tgt: Initialize all variables.
15454 (x86_64*): Set targ_extra_obj and targ_extra_size.
15455 * configure: Rebuild.
15456
8825ac63
ILT
15457 * object.cc (Sized_relobj::include_section_group): Adjust section
15458 indexes read from group data. Build vector to pass to
15459 layout_group.
15460 * layout.cc (Layout::layout_group): Add flags and shndxes
15461 parameters. Remove contents parameter. Change caller. Update
15462 explicit instantiations.
15463 * layout.h (class Layout): Update layout_group declaration.
15464 * output.cc (Output_data_group::Output_data_group): Add flags and
15465 input_shndxes parameters. Remove contents parameter. Change
15466 caller.
15467 (Output_data_group::do_write): Change input_sections_ to
15468 input_shndxes_.
15469 * output.h (class Output_data_group): Update constructor
15470 declaration. Rename input_sections_ to input_shndxes_.
15471 * testsuite/many_sections_test.cc: Add template.
15472
e94cf127
CC
154732008-04-30 Cary Coutant <ccoutant@google.com>
15474
4418b2d5
CC
15475 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15476
e94cf127
CC
15477 * layout.cc (Layout::include_section): Refactored check for debug
15478 info section.
15479 (Layout::add_comdat): Add new parameters. Change type
15480 of signature parameter. Add object and shndx to signatures table.
15481 (Layout::find_kept_object): New function.
15482 * layout.h: Include <cstring>.
15483 (Layout::is_debug_info_section): New function.
15484 (Layout::add_comdat): Add new parameters.
15485 (Layout::find_kept_object): New function.
15486 (Layout::Kept_section): New struct.
15487 (Layout::Signatures): Change type of map range.
15488 * object.cc (Relobj::output_section_address): New function.
15489 (Sized_relobj::include_section_group): Add new parameters. Change
15490 calls to Layout::add_comdat. Change to build table of kept comdat
15491 groups and table mapping discarded sections to kept sections.
15492 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15493 (Sized_relobj::do_layout): Change calls to include_section_group and
15494 include_linkonce_section.
15495 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15496 value to zero when section is discarded.
15497 (Sized_relobj::map_to_kept_section): New function.
15498 * object.h (Relobj::output_section_address): New function.
15499 (Relobj::Comdat_group): New type.
15500 (Relobj::find_comdat_group): New function.
15501 (Relobj::Comdat_group_table): New type.
15502 (Relobj::Kept_comdat_section): New type.
15503 (Relobj::Kept_comdat_section_table): New type.
15504 (Relobj::add_comdat_group): New function.
15505 (Relobj::set_kept_comdat_section): New function.
15506 (Relobj::get_kept_comdat_section): New function.
15507 (Relobj::comdat_groups_): New field.
15508 (Relobj::kept_comdat_sections_): New field.
15509 (Symbol_value::input_value): Update comment.
15510 (Sized_relobj::map_to_kept_section) New function.
15511 (Sized_relobj::include_linkonce_section): Add new parameter.
15512 * target-reloc.h (Comdat_behavior): New type.
15513 (get_comdat_behavior): New function.
15514 (relocate_section): Add code to map a discarded section to the
15515 corresponding kept section when applying a relocation.
15516
e4e5049b
CS
155172008-04-30 Craig Silverstein <csilvers@google.com>
15518
15519 * dwarf_reader.cc (next_generation_count): New static var.
15520 (Addr2line_cache_entry): New struct.
15521 (addr2line_cache): New static var.
15522 (Dwarf_line_info::one_addr2line): Added caching.
15523 (Dwarf_line_info::clear_addr2line_cache): New function.
15524 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15525 cache-size parameter.
15526 (Dwarf_line_info::one_addr2line_cache): New function.
15527 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15528 new cache-size argument to one_addr2line(), and clear cache.
15529
d09e9154
CC
155302008-04-28 Cary Coutant <ccoutant@google.com>
15531
15532 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15533 R_386_PC8 relocations.
15534
7ef73768
ILT
155352008-04-23 Ian Lance Taylor <iant@google.com>
15536
55438702
ILT
15537 * object.cc (Sized_relobj::include_section_group): Check for
15538 invalid section group.
15539
c165fb93
ILT
15540 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15541 header size.
15542
7ef73768
ILT
15543 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15544 than read for file header.
15545 * archive.cc (Archive::include_member): Likewise.
15546
6194aaab
L
155472008-04-23 Paolo Bonzini <bonzini@gnu.org>
15548
15549 * aclocal.m4: Regenerate.
15550 * configure: Regenerate.
15551
d491d34e
ILT
155522008-04-19 Ian Lance Taylor <iant@google.com>
15553
5ea2bac6
ILT
15554 * version.cc (version_string): Bump to 1.6.
15555
7bc3e21a
ILT
15556 * testsuite/Makefile.am (many_sections_r_test): New target.
15557 (many_sections_r_test_SOURCES): Remove.
15558 (many_sections_r_test_DEPENDENCIES): Remove.
15559 (many_sections_r_test_LDFLAGS): Remove.
15560 (many_sections_r_test_LDADD): Remove.
15561
7fcd3aa9
ILT
15562 * object.cc (Sized_relobj::do_add_symbols): Always pass
15563 local_symbol_count_ to add_from_relobj.
15564
4c94d6ae
ILT
15565 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15566 every thousand variables.
15567 * testsuite/Makefile.in: Rebuild.
15568
d491d34e
ILT
15569 * object.cc (Xindex::initialize_symtab_xindex): New function.
15570 (Xindex::read_symtab_xindex): New function.
15571 (Xindex::sym_xindex_to_shndx): New function.
15572 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15573 available.
15574 (Sized_relobj::do_initialize_xindex): New function.
15575 (Sized_relobj::do_read_symbols): Adjust section links.
15576 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15577 parameter. Change all callers.
15578 (Sized_relobj::include_section_group): Adjust section links and
15579 symbol section indexes.
15580 (Sized_relobj::do_layout): Adjust section links.
15581 (Sized_relobj::do_count_local_symbols): Adjust section links and
15582 symbol section indexes.
15583 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15584 ordinary and special symbols.
15585 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15586 dynsym_xindex parameters. Change all callers. Adjust section
15587 links. Use SHN_XINDEX when needed.
15588 (Sized_relobj::get_symbol_location_info): Adjust section links.
15589 Don't get fooled by special symbols.
15590 * object.h (class Xindex): Define.
15591 (class Object): Add xindex_ parameter. Declare virtual functoin
15592 do_initialize_xindex.
15593 (Object::adjust_sym_shndx): New function.
15594 (Object::set_xindex): New protected function.
15595 (class Symbol_value): Add is_ordinary_shndx_ field.
15596 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15597 (Symbol_value::value): Assert ordinary section.
15598 (Symbol_value::initialize_input_to_output_map): Likewise.
15599 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15600 Change all callers.
15601 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15602 all callers.
15603 (class Sized_relobj): Update declarations.
15604 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15605 parameter. Change all callers.
15606 (Sized_relobj::adjust_shndx): New function.
15607 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15608 field.
15609 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15610 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15611 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15612 (Sized_dynobj::read_dynsym_section): Adjust section links.
15613 (Sized_dynobj::read_dynamic): Likewise.
15614 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15615 section links.
15616 (Sized_dynobj::do_initialize_xindex): New function.
15617 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15618 do_initialize_xindex.
15619 (Sized_dynobj::adjust_shndx): New function.
15620 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15621 dynsym_xindex_ fields.
15622 (Layout::finalize): Add a call to set_section_indexes before
15623 creating the symtab sections.
15624 (Layout::set_section_indexes): Don't do anything if the section
15625 already has a section index.
15626 (Layout::create_symtab_sections): Add shnum parameter. Change
15627 caller. Create .symtab_shndx section if needed.
15628 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15629 caller.
15630 (Layout::allocated_output_section_count): New function.
15631 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15632 needed.
15633 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15634 fields. Update declarations.
15635 (Layout::symtab_xindex): New function.
15636 (Layout::dynsym_xindex): New function.
15637 (class Write_symbols_task): Add layout_ field.
15638 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15639 Change caller.
15640 * output.cc (Output_section_headers::Output_section_headers): Add
15641 shstrtab_section parameter. Change all callers.
15642 (Output_section_headers::do_sized_write): Store overflow values
15643 for section count and section string table section index in
15644 section header zero.
15645 (Output_file_header::do_sized_write): Check for overflow of
15646 section count and section string table section index.
15647 (Output_symtab_xindex::do_write): New function.
15648 (Output_symtab_xindex::endian_do_write): New function.
15649 * output.h (class Output_section_headers): Add shstrtab_section_.
15650 Update declarations.
15651 (class Output_symtab_xindex): Define.
15652 (Output_section::has_out_shndx): New function.
15653 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15654 field.
15655 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15656 Change all callers.
15657 (Sized_symbol::init): Likewise.
15658 (Symbol::output_section): Check for ordinary symbol.
15659 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15660 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15661 callers.
15662 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15663 Change all callers. Simplify handling of symbols from sections
15664 not included in the link.
15665 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15666 distinction.
15667 (Weak_alias_sorter::operator()): Assert that symbols are
15668 ordinary.
15669 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15670 distinction.
15671 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15672 parameters. Change all callers.
15673 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15674 symbol distinction. Use SHN_XINDEX when needed.
15675 (Symbol_table::write_section_symbol): Add symtab_xindex
15676 parameter. Change all callers.
15677 (Symbol_table::sized_write_section_symbol): Likewise. Use
15678 SHN_XINDEX when needed.
15679 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15680 declarations.
15681 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15682 (Symbol::is_defined): Check is_ordinary.
15683 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15684 (Symbol::is_absolute, Symbol::is_common): Likewise.
15685 (class Sized_symbol): Update declarations.
15686 (class Symbol_table): Update declarations.
15687 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15688 parameters. Change all callers.
15689 (Sized_symbol::override): Likewise.
15690 (Symbol_table::override): Likewise.
15691 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15692 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15693 is_ordinary, and orig_st_shndx parameters. Change all callers.
15694 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15695 to be in an ordinary section.
15696 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15697 object and is_ordinary parameters. Change all callers.
15698 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15699 Change all callers. Don't add undefined or non-ordinary symbols
15700 to reloc_map_.
15701 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15702 Change all callers.
15703 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15704 declarations.
15705 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15706 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15707 (Sized_relobj::relocate_sections): Likewise.
15708 * target-reloc.h (scan_relocs): Adjust section symbol index.
15709 (scan_relocatable_relocs): Likewise.
15710 * i386.cc (Scan::local): Check for ordinary symbols.
15711 * sparc.cc (Scan::local): Likewise.
15712 * x86_64.cc (Scan::local): Likewise.
15713 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15714 to symbol_section_and_value.
15715 * testsuite/many_sections_test.cc: New file.
15716 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15717 (check_PROGRAMS): Add many_sections_test.
15718 (many_sections_test_SOURCES): Define.
15719 (many_sections_test_DEPENDENCIES): Define.
15720 (many_sections_test_LDFLAGS): Define.
15721 (BUILT_SOURCES): Add many_sections_define.h.
15722 (many_sections_define.h): New target.
15723 (BUILT_SOURCES): Add many_sections_check.h.
15724 (many_sections_check.h): New target.
15725 (check_PROGRAMS): Add many_sections_r_test.
15726 (many_sections_r_test_SOURCES): Define.
15727 (many_sections_r_test_DEPENDENCIES): Define.
15728 (many_sections_r_test_LDFLAGS): Define.
15729 (many_sections_r_test_LDADD): Define.
15730 (many_sections_r_test.o): New target.
15731 * testsuite/Makefile.in: Rebuild.
15732
c5818ff1
CC
157332008-04-17 Cary Coutant <ccoutant@google.com>
15734
15735 * errors.cc (Errors::info): New function.
15736 (gold_info): New function.
15737 * errors.h (Errors::info): New function.
15738 * gold.h (gold_info): New function.
15739 * object.cc (Input_objects::add_object): Print trace output.
15740 * options.cc (options::parse_set): New function.
15741 (General_options::parse_wrap): Deleted.
15742 (General_options::General_options): Deleted initializer.
15743 * options.h (options::String_set): New typedef.
15744 (options::parse_set): New function.
15745 (DEFINE_set): New macro.
15746 (General_options::wrap): Changed to use DEFINE_set. Changed
15747 callers of any_wrap_symbols and is_wrap_symbol.
15748 (General_options::trace, General_options::trace_symbol):
15749 New options.
15750 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15751 (General_options::wrap_symbols_): Deleted.
15752 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15753
b5be4a7c
DM
157542008-04-17 David S. Miller <davem@davemloft.net>
15755
15756 * options.cc (General_options::parse_V): New function.
15757 * options.h: Add entries for -V and -Qy.
15758
155a0dd7
ILT
157592008-04-17 Ian Lance Taylor <iant@google.com>
15760
15761 * common.cc (Symbol_table::allocate_commons): Remove options
15762 parameter. Change caller.
15763 (Symbol_table::do_allocate_commons): Remove options parameter.
15764 Change caller. Just call do_allocate_commons_list twice.
15765 (Symbol_table::do_allocate_commons_list): New function, broken out
15766 of do_allocate_commons.
15767 * common.h (class Allocate_commons_task): Remove options_ field.
15768 Update constructor.
15769 * symtab.cc (Symbol_table::Symbol_table): Initialize
15770 tls_commons_.
15771 (Symbol_table::add_from_object): Put TLS common symbols on
15772 tls_commons_ list.
15773 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15774 which are IN_OUTPUT_DATA.
15775 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15776 allocate_commons and do_allocate_commons declarations. Declare
15777 do_allocate_commons_list.
15778 * gold.cc (queue_middle_tasks): Update creation of
15779 Allocate_commons_task to not pass options.
15780 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15781 (TLS_TEST_C_FLAGS): New variable.
15782 (tls_test_c_pic.o): New target.
15783 (tls_test_shared.so): Link in tls_test_c_pic.o.
15784 (tls_test_c_pic_ie.o): New target.
15785 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15786 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15787 (tls_test_c.o): New target.
15788 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15789 (tls_pic_test_LDADD): Likewise.
15790 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15791 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15792 (tls_test_c_gnu2.o): New target.
15793 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15794 tls_test_c_gnu2.o.
15795 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15796 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15797 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15798 * testsuite/tls_test.cc: Include "config.h".
15799 (t_last): Call t11_last.
15800 * testsuite/tls_test.h (t11, t11_last): Declare.
15801 * testsuite/tls_test_c.c: New file.
15802 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15803 * configure.ac: Check for OpenMP support.
15804 * configure, config.in, Makefile.in: Rebuild.
15805 * testsuite/Makefile.in: Rebuild.
15806
edfbb029
CC
158072008-04-16 Cary Coutant <ccoutant@google.com>
15808
15809 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15810 (Target_i386::tls_base_symbol_defined_): New field.
15811 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15812 (Target_i386::Scan::global): Likewise.
15813 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15814 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15815 (Target_x86_64::tls_base_symbol_defined_): New field.
15816 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15817 (Target_x86_64::Scan::global): Likewise.
15818
f3c69fca
CC
158192008-04-16 Cary Coutant <ccoutant@google.com>
15820
15821 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15822 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15823 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15824 building shared libraries.
15825 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15826 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15827 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15828 * testsuite/Makefile.in: Rebuild.
15829 * testsuite/weak_undef.h: New file.
15830 * testsuite/weak_undef_file1.cc: Add extra test cases.
15831 * testsuite/weak_undef_file2.cc: Likewise.
15832 * testsuite/weak_undef_test.cc: Likewise.
15833
7c414435
DM
158342008-04-16 David S. Miller <davem@davemloft.net>
15835
32b769e1
DM
15836 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15837 Add issued_non_pic_error_ field. Declare check_non_pic.
15838 (Target_sparc::Scan::check_non_pic): New function.
15839 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15840 (Target_sparc::Scan::global): Likewise.
15841
11936fb1
DM
15842 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15843 * configure: Rebuild.
15844
7c414435
DM
15845 * options.h (DEFINE_enable): New macro.
15846 (new_dtags): New enable option.
15847 (initfirst, interpose, loadfltr, nodefaultlib,
15848 nodelete, nodlopen, nodump): New -z options.
15849 * layout.cc (Layout:finish_dynamic_section): If new
15850 dtags enabled, emit DT_RUNPATH. Also, emit a
15851 DT_FLAGS_1 containing any specified -z flags.
15852
85c7bf8b
ILT
158532008-04-16 Ian Lance Taylor <iant@google.com>
15854
12c0daef
ILT
15855 * copy-relocs.cc: New file.
15856 * copy-relocs.h: New file.
15857 * reloc.cc: Remove Copy_relocs code.
15858 * reloc.h: Likewise.
15859 * reloc-types.h (struct Reloc_types) [both versions]: Add
15860 get_reloc_addend_noerror.
15861 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15862 variants of add_global which take an addend which must be zero.
15863 * i386.cc: Include "copy-relocs.h".
15864 (class Target_i386): Change type of copy_relocs_ to variable,
15865 update initializer.
15866 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15867 Change all callers.
15868 (Target_i386::do_finalize_sections): Change handling of
15869 copy_relocs_.
15870 * sparc.cc: Include "copy-relocs.h".
15871 (class Target_sparc): Change type of copy_relocs_ to variable,
15872 update initializer.
15873 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15874 Change all callers.
15875 (Target_sparc::do_finalize_sections): Change handling of
15876 copy_relocs_.
15877 * x86_64.cc: Include "copy-relocs.h".
15878 (class Target_x86_64): Change type of copy_relocs_ to variable,
15879 update initializer.
15880 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15881 class. Change all callers.
15882 (Target_x86_64::do_finalize_sections): Change handling of
15883 copy_relocs_.
15884 * Makefile.am (CCFILES): Add copy-relocs.cc.
15885 (HFILES): Add copy-relocs.h.
15886
4f4995b6
ILT
15887 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15888
85c7bf8b
ILT
15889 * testsuite/script_test_4.sh: Permit leading zeroes.
15890
4f2a9edd
ILT
158912008-04-15 Ian Lance Taylor <iant@google.com>
15892
e6188289
ILT
15893 * script-sections.cc (Script_sections::create_segments): Use
15894 header_size_adjustment even when there is enough room for the
15895 headers.
15896 * testsuite/script_test_4.sh: New file.
15897 * testsuite/script_test_4.t: New file.
15898 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15899 (check_DATA): Add script_test_4.stdout.
15900 (MOSTLYCLEANFILES): Likewise.
15901 (script_test_4): New target.
15902 (script_test_4.stdout): New target.
15903 * testsuite/Makefile.in: Rebuild.
15904
4f2a9edd
ILT
15905 * sparc.cc: Add definitions for Output_data_plt_sparc class
15906 constants.
15907
f5314dd5
DM
159082008-04-14 David S. Miller <davem@davemloft.net>
15909
15910 * sparc.cc: New file.
15911 * Makefile.am (TARGETSOURCES): Add sparc.cc
15912 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15913 * configure.tgt: Document targ_extra_size and
15914 targ_extra_big_endian. Add entries for sparc-* and
15915 sparc64-*.
15916 * configure.ac: Handle targ_extra_size and
15917 targ_extra_big_endian.
15918 * Makefile.in: Rebuild.
15919 * configure: Likewise.
15920 * po/POTFILES.in: Likewise.
15921 * po/gold.pot: Likewise.
15922
154e0e9a
ILT
159232008-04-14 Ian Lance Taylor <iant@google.com>
15924
15925 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15926 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15927 in the name/type/flags to section mapping. Don't call
15928 allocate_output_section.
15929 (Layout::choose_output_section): Change parameter from adjust_name
15930 to is_input_section. Don't permit input sections after sections
15931 are attached to segments. Don't call allocate_output_section.
15932 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15933 not write_enable_output_section.
15934 (Layout::make_output_section): Don't push to
15935 unattached_section_list_ nor call attach_to_segment. Call
15936 attach_section_to_segment if sections are attached.
15937 (Layout::attach_sections_to_segments): New function.
15938 (Layout::attach_section_to_segment): New function.
15939 (Layout::attach_allocated_section_to_segment): Rename from
15940 attach_to_segment. Remove flags parameter.
15941 (Layout::allocate_output_section): Remove function.
15942 (Layout::write_enable_output_section): Remove function.
15943 * layout.h (class Layout): Update for above changes. Add new
15944 field sections_are_attached_.
15945 * output.h (Output_section::update_flags_for_input_section): New
15946 function.
15947 * output.cc (Output_section::add_input_section): Call
15948 update_flags_for_input_section.
15949 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15950
009a67a2
CC
159512008-04-11 Cary Coutant <ccoutant@google.com>
15952
15953 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15954 thought unnecessary.
15955 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15956
759b1a24
ILT
159572008-04-11 Ian Lance Taylor <iant@google.com>
15958
15959 * output.h (class Output_section_data): Remove inline definition
15960 of set_addralign.
15961 * output.cc (Output_section_data::set_addralign): New function.
15962
c2b45e22
CC
159632008-04-11 Cary Coutant <ccoutant@google.com>
15964
15965 Add support for TLS descriptors for i386 and x86_64.
15966 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
15967 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
15968 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
15969 GOT_TYPE_TLS_DESC.
15970 (Target_i386::got_mod_index_entry): Remove unnecessary code.
15971 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
15972 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
15973 relocations.
15974 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
15975 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
15976 Fix problem with initial-exec relocations.
15977 (Target_i386::Relocate::relocate_tls): Likewise.
15978 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
15979 relaxation.
15980 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
15981 support for section-plus-offset dynamic table entries.
15982 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
15983 (Output_data_dynamic::Dynamic_entry): Add support for
15984 section-plus-offset dynamic table entries.
15985 (Output_data_dynamic::Classification): Likewise.
15986 (Output_data_dynamic::classification_): Renamed offset_.
15987 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
15988 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
15989 (Target_x86_64::make_plt_section): New function.
15990 (Target_x86_64::reserve_tlsdesc_entries): New function.
15991 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
15992 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
15993 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
15994 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
15995 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
15996 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
15997 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
15998 add extra PLT entry for TLS descriptors.
15999 (Output_data_plt_x86_64::got_): New field.
16000 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16001 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16002 fields.
16003 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16004 descriptors.
16005 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16006 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16007 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16008 R_386_TLS_DESC_CALL relocations.
16009 (Target_x86_64::Scan::global): Likewise.
16010 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16011 for TLS descriptors.
16012 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16013 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16014 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16015 GD-to-IE relaxation.
16016 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16017 and TLS_DESCRIPTORS.
16018 * Makefile.in: Rebuild.
16019 * configure: Rebuild.
16020 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16021 (tls_test_shared2.so): New target.
16022 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16023 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16024 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16025 (tls_shared_gd_to_ie_test_LDADD): New variable.
16026 (tls_shared_gnu2_gd_to_ie_test): New target.
16027 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16028 New targets.
16029 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16030 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16031 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16032 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16033 (tls_shared_gnu2_test): New target.
16034 (tls_test_gnu2_shared.so): New target.
16035 (tls_shared_gnu2_test_SOURCES): New variable.
16036 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
16037 (tls_shared_gnu2_test_LDFLAGS): New variable.
16038 (tls_shared_gnu2_test_LDADD): New variable.
16039 * testsuite/Makefile.in: Rebuild.
16040 * testsuite/Makefile.
16041
83bfb6b7
ILT
160422008-04-11 Ian Lance Taylor <iant@google.com>
16043
16044 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
16045 justsyms.t.
16046 * testsuite/Makefile.in: Rebuild.
16047
16048 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
16049 long.
16050 * testsuite/script_test_2.cc (main): Adjust test.
16051
706e1f5e
ILT
160522008-04-11 David S. Miller <davem@davemloft.net>
16053 Ian Lance Taylor <iant@google.com>
16054
16055 * options.h (General_options): Add entries for '-Y' and
16056 '-relax'.
16057 * options.cc (General_options:finalize): If -Y was used, add those
16058 entries to the library path instead of the default "/lib" and
16059 "/usr/lib".
16060
7c98e6bb
DM
160612008-04-11 David S. Miller <davem@davemloft.net>
16062
16063 * testsuite/justsyms.t: Start at 0x100.
16064 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
16065 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16066 long.
16067 * testsuite/script_test_2.cc: Adjust string and section length
16068 checks.
7c98e6bb 16069
99a37bfd
ILT
160702008-04-09 Ian Lance Taylor <iant@google.com>
16071
2cefc357
ILT
16072 PR gold/5996
16073 * script-sections.cc (Sections_element::allocate_to_segment): Add
16074 orphan parameter.
16075 (Output_section_definition::allocate_to_segment): Likewise.
16076 (Orphan_output_section::allocate_to_segment): Likewise.
16077 (Script_sections::attach_sections_using_phdrs_clause): Don't
16078 propagate non-PT_LOAD segments to orphan sections.
16079 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16080 readelf rather than objdump.
16081 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16082 .interp section and PT_INTERP segment are the same size.
16083 * testsuite/Makefile.in: Rebuild.
16084
99a37bfd
ILT
16085 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16086 aliases for symbols defined in the same object.
16087 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16088 (weak_alias_test_SOURCES): New variable.
16089 (weak_alias_test_DEPENDENCIES): New variable.
16090 (weak_alias_test_LDFLAGS): New variable.
16091 (weak_alias_test_LDADD): New variable.
16092 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16093 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16094 (weak_alias_test_3.o): New target.
16095 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16096 * testsuite/weak_alias_test_main.cc: New file.
16097 * testsuite/weak_alias_test_1.cc: New file.
16098 * testsuite/weak_alias_test_2.cc: New file.
16099 * testsuite/weak_alias_test_3.cc: New file.
16100
780e49c5
ILT
161012008-04-08 Ian Lance Taylor <iant@google.com>
16102
cdb0b8f5
ILT
16103 * options.h (class General_options): Add --noinhibit-exec option.
16104 * main.cc (main): Check --noinhibit-exec.
16105
0864d551
ILT
16106 * options.h (class General_options): Define --wrap as a special
16107 option. Add wrap_symbols_ field.
16108 (General_options::any_wrap_symbols): New function.
16109 (General_options::is_wrap_symbol): New function.
16110 * options.cc (General_options::parse_wrap): New function.
16111 (General_options::General_options): Initialize wrap_symbols_.
16112 * symtab.cc (Symbol_table::wrap_symbol): New function.
16113 (Symbol_table::add_from_object): Handle --wrap.
16114 * symtab.h (class Symbol_table): Declare wrap_symbol.
16115 * target.h (Target::wrap_char): New function.
16116 (Target::Target_info): Add wrap_char field.
16117 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16118 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16119 * testsuite/testfile.cc (Target_test::test_target_info):
16120 Likewise.
16121
789aa6de
ILT
16122 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16123 there is one.
16124
2c38906f
ILT
16125 * layout.h (class Layout): Add added_eh_frame_data_ field.
16126 * layout.cc (Layout::Layout): Initialize new field.
16127 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16128 output section until we find a section we merged successfully.
16129 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16130 that the size be non-zero.
16131
780e49c5
ILT
16132 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16133 qualifier.
16134
7fcd0256
ILT
161352008-04-08 Craig Silverstein <csilvers@google.com>
16136
16137 * configure.ac: Export new conditional variable HAVE_ZLIB.
16138 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16139 on HAVE_ZLIB.
16140 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16141 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16142
6835af53
ILT
161432008-04-07 Ian Lance Taylor <iant@google.com>
16144
e24f324c
ILT
16145 * version.cc (version_string): Set to "1.5".
16146
a036edd8
ILT
16147 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16148 Add issued_non_pic_error_ field. Declare check_non_pic.
16149 (Target_x86_64::Scan::check_non_pic): New function.
16150 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16151 (Target_x86_64::Scan::global): Likewise.
16152
624f8810
ILT
16153 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16154 addend parameter. Change caller. Handle merge sections.
16155 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16156 Address to Addend. Don't add in the result of
16157 local_section_offset, pass down the addend and use the returned
16158 value.
16159 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16160 Update declarations of local_section_offset and symbol_value.
16161 * testsuite/two_file_test_1.cc (t18): New function.
16162 * testsuite/two_file_test_2.cc (f18): New function.
16163 * testsuite/two_file_test_main.cc (main): Call t18.
16164 * testsuite/two_file_test.h (t18, f18): Declare.
16165
6835af53
ILT
16166 * configure.ac: Don't test for objdump, c++filt, or readelf.
16167 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16168 conditionals.
16169 (TEST_READELF): New variable.
16170 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16171 (check_PROGRAMS): Add two_file_strip_test.
16172 (two_file_strip_test): New target.
16173 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16174 (two_file_same_shared_strip_test_SOURCES): New variable.
16175 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16176 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16177 (two_file_same_shared_strip_test_LDADD): New variable.
16178 (two_file_shared_strip.so): New target.
16179 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16180 (ver_test_5.syms, ver_test_7.syms): Likewise.
16181 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16182 (strip_test_3.stdout): Use TEST_OBJDUMP.
16183 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16184
86925eef
CC
161852008-04-04 Cary Coutant <ccoutant@google.com>
16186
16187 * symtab.h (Symbol::is_weak_undefined): New function.
16188 (Symbol::is_strong_undefined): New function.
16189 (Symbol::is_absolute): New function.
16190 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16191 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16192 absolute symbols.
16193 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16194 (weak_undef_test): New target.
16195 * testsuite/Makefile.in: Rebuild.
16196 * testsuite/weak_undef_file1.cc: New file.
16197 * testsuite/weak_undef_file2.cc: New file.
16198 * testsuite/weak_undef_test.cc: New file.
16199
126f3ece
ILT
162002008-04-03 Craig Silverstein <csilvers@google.com>
16201
16202 * compressed_output.h (class Output_compressed_section): Use
16203 unsigned buffer.
16204 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16205 add zlib header.
16206 (zlib_compressed_suffix): Removed.
16207 (Output_compressed_section::set_final_data_size): Use unsigned
16208 buffers.
16209 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16210 Fix linker invocation.
16211 (flagstest_o_specialfile_and_compress_debug_sections):
16212 Likewise.
16213 * testsuite/Makefile.in: Regenerated.
16214
deae2a14
DM
162152008-04-02 David S. Miller <davem@davemloft.net>
16216
16217 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16218 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16219
70752818
ILT
162202008-04-02 Craig Silverstein <csilvers@google.com>
16221
16222 * TODO: New file.
16223
39d0cb0e
ILT
162242008-04-02 Ian Lance Taylor <iant@google.com>
16225
16226 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16227 parameters. Update for new key type to views_. Change all
16228 callers.
16229 (File_read::read): Adjust for byteshift in returned view.
16230 (File_read::add_view): New function, broken out of
16231 find_and_make_view.
16232 (File_read::make_view): New function, broken out of
16233 find_and_make_view.
16234 (File_read::find_or_make_view): Add offset and aligned
16235 parameters. Rewrite accordingly. Change all callers.
16236 (File_read::get_view): Add offset and aligned parameters. Adjust
16237 for byteshift in return value.
16238 (File_read::get_lasting_view): Likewise.
16239 * fileread.h (class File_read): Update declarations.
16240 (class File_read::View): Add byteshift_ field. Add byteshift to
16241 constructor. Add byteshift method.
16242 * archive.h (Archive::clear_uncached_views): New function.
16243 (Archive::get_view): Add aligned parameter. Change all callers.
16244 * object.h (Object::get_view): Add aligned parameter. Change all
16245 callers.
16246 (Object::get_lasting_view): Likewise.
16247
16248 * fileread.cc (File_read::release): Don't call clear_views if
16249 there are multiple objects.
16250 * fileread.h (File_read::clear_uncached_views): New function.
16251 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16252 on the archive.
16253
a1207466
CC
162542008-03-31 Cary Coutant <ccoutant@google.com>
16255
16256 Add thin archive support.
16257 * archive.cc (Archive::armagt): New const.
16258 (Archive::setup): Remove task parameter and calls to unlock.
16259 (Archive::unlock_nested_archives): New function.
16260 (Archive::read_header): Add nested_off parameter. Change
16261 all callers.
16262 (Archive::interpret_header): Likewise.
16263 (Archive::include_all_members): Change to handle thin
16264 archives.
16265 (Archive::include_member): Likewise.
16266 * archive.h (Archive::Archive): Add new parameters and
16267 initializers.
16268 (Archive::armagt): New const.
16269 (Archive::setup): Remove task parameter.
16270 (Archive::unlock_nested_archives): New function.
16271 (Archive::read_header): Add nested_off parameter.
16272 (Archive::interpret_header): Likewise.
16273 (Archive::Nested_archive_table): New typedef.
16274 (Archive::is_thin_archive_): New field.
16275 (Archive::nested_archives_): New field.
16276 (Archive::options_): New field.
16277 (Archive::dirpath_): New field.
16278 (Archive::task_): New field.
16279 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16280 for thin archives. Pass additional parameters to
16281 Archive::Archive. Unlock the archive file after calling
16282 Archive::setup.
cd536b21 16283
479f6503
ILT
162842008-03-29 Ian Lance Taylor <iant@google.com>
16285
686c8caf
ILT
16286 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16287 version symbol to be local.
16288 * testsuite/ver_test_4.sh: New file.
16289 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16290 (check_DATA): Add ver_test_4.syms.
16291 (ver_test_4.syms): New target.
16292 * testsuite/Makefile.in: Rebuild.
16293
ab794b6b
ILT
16294 * output.cc
16295 (Output_section::Input_section_sort_entry::has_priority): New
16296 function.
16297 (Output_section::Input_section_sort_entry::match_file_name): New
16298 function.
16299 (Output_section::Input_section_sort_entry::match_section_name):
16300 Remove.
16301 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16302 Remove.
16303 (Output_section::Input_section_sort_entry::match_section_file):
16304 Remove.
16305 (Output_section::Input_section_sort_compare::operator()): Rewrite
16306 using new Input_section_sort_entry functions. Sort crtbegin and
16307 crtend first. Sort sections with no priority before sections with
16308 a priority.
16309 * testsuite/initpri1.c (d3): Check j != 4.
16310 (cd5): New constructor/destructor function.
16311 (main): Check j != 2.
16312
479f6503
ILT
16313 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16314 new symbol when resolving, don't call set_is_default.
16315 * testsuite/ver_test_7.cc: New file.
16316 * testsuite/ver_test_7.sh: New file.
16317 * testsuite/Makefile.am (ver_test_7.so): New target.
16318 (ver_test_7.o): New target.
16319 (check_SCRIPTS): Add ver_test_7.sh.
16320 (check_DATA): Add ver_test_7.syms.
16321 (ver_test_7.syms): New target.
16322
2fd32231
ILT
163232008-03-28 Ian Lance Taylor <iant@google.com>
16324
16325 * layout.cc (Layout::layout): If we see an input section with a
16326 name that needs sorting, set the must_sort flag for the output
16327 section.
16328 (Layout::make_output_section): If the name of the output section
16329 indicates that it might require sorting, set the may_sort flag.
16330 * output.h (Output_section::may_sort_attached_input_sections): New
16331 function.
16332 (Output_section::set_may_sort_attached_input_sections): New
16333 function.
16334 (Output_section::must_sort_attached_input_sections): New
16335 function.
16336 (Output_section::set_must_sort_attached_input_sections): New
16337 function.
16338 (class Output_section): Declare Input_section_sort_entry. Define
16339 Input_section_sort_compare. Declare
16340 sort_attached_input_sections. Add new fields:
16341 may_sort_attached_input_sections_,
16342 must_sort_attached_input_sections_,
16343 attached_input_sections_are_sorted_.
16344 * output.cc (Output_section::Output_section): Initialize new
16345 fields.
16346 (Output_section::add_input_section): Add an entry to
16347 input_sections_ if may_sort or must_sort are true.
16348 (Output_section::set_final_data_size): Call
16349 sort_attached_input_sections if necessary.
16350 (Output_section::Input_section_sort_entry): Define new class.
16351 (Output_section::Input_section_sort_compare::operator()): New
16352 function.
16353 (Output_section::sort_attached_input_sections): New function.
16354 * configure.ac: Check whether the compiler supports constructor
16355 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16356 * testsuite/initpri1.c: New file.
16357 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16358 CONSTRUCTOR_PRIORITY.
16359 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16360 (initpri1_LDFLAGS): New variable.
16361 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16362
18e6b24e
ILT
163632008-03-27 Ian Lance Taylor <iant@google.com>
16364
49bdd526
ILT
16365 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16366 * testsuite/common_test_1.c: New file.
16367 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16368 (common_test_1_SOURCES): New variable.
16369 (common_test_1_DEPENDENCIES): New variable.
16370 (common_test_1_LDFLAGS): New variable.
16371
18e6b24e
ILT
16372 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16373 and commons_ correctly when NAME/VERSION does not override
16374 NAME/NULL.
16375 * testsuite/ver_test_6.c: New file.
16376 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16377 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16378 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16379
04bf7072
ILT
163802008-03-26 Ian Lance Taylor <iant@google.com>
16381
5871526f
ILT
16382 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16383 of an undefined symbol from a version script.
16384 * testsuite/Makefile.am (ver_test_5.so): New target.
16385 (ver_test_5.o): New target.
16386 (check_SCRIPTS): Add ver_test_5.sh.
16387 (check_DATA): Add ver_test_5.syms.
16388 (ver_test_5.syms): New target.
16389 * testsuite/ver_test_5.cc: New file.
16390 * testsuite/ver_test_5.script: New file.
16391 * testsuite/ver_test_5.sh: New file.
16392 * Makefile.in, testsuite/Makefile.in: Rebuild.
16393
04bf7072
ILT
16394 PR gold/5986
16395 Fix problems building gold with gcc 4.3.0.
16396 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16397 (gold_error_at_location, gold_warning_at_location): Use it.
16398 * configure.ac: Check whether we can compile and use a template
16399 function with a printf attribute.
16400 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16401 when jumping over bytes.
16402 * object.cc: Instantiate Object::read_section_data.
16403 * debug.h: Include <cstring>
16404 * dwarf_reader.cc: Include <algorithm>
16405 * main.cc: Include <cstring>.
16406 * options.cc: Include <cstring>.
16407 * output.cc: Include <cstring>.
16408 * script.cc: Include <cstring>.
16409 * script.h: Include <string>.
16410 * symtab.cc: Include <cstring> and <algorithm>.
16411 * target-select.cc: Include <cstring>.
16412 * version.cc: Include <string>.
16413 * testsuite/testmain.cc: Include <cstdlib>.
16414 * configure, config.in: Rebuild.
16415
874c5b28
ILT
164162008-03-25 Ian Lance Taylor <iant@google.com>
16417
819d6c3a
ILT
16418 * options.cc: Include "../bfd/bfdver.h".
16419 (options::help): Print bug reporting address.
16420
f4b2c6f5
ILT
16421 * version.cc (print_version): Adjust output for current value of
16422 BFD_VERSION_STRING.
16423
16424 * NEWS: New file.
16425
e96caa79
ILT
16426 * options.cc (options::help): Print list of supported targets.
16427 * target-select.h: Include <vector>.
16428 (class Target_selector): Make machine_, size_, and is_big_endian_
16429 fields const. Add bfd_name_ and instantiated_target_ fields.
16430 (Target_selector::Target_selector): Add bfd_name parameter.
16431 (Target_selector::recognize): Make non-virtual, call
16432 do_recognize.
16433 (Target_selector::recognize_by_name): Make non-virtual, call
16434 do_recognize_by_name.
16435 (Target_selector::supported_names): New function.
16436 (Target_selector::bfd_name): New function.
16437 (Target_selector::do_instantiate_target): New pure virtual
16438 function.
16439 (Target_selector::do_recognize): New virtual function.
16440 (Target_selector::do_recognize_by_name): New virtual function.
16441 (Target_selector::instantiate_target): New private function.
16442 (supported_target_names): Declare.
16443 * target-select.cc (Target_selector::Target_selector): Update for
16444 new parameter and fields.
16445 (select_target_by_name): Check that the name matches before
16446 calling recognize_by_name.
16447 (supported_target_names): New function.
16448 * i386.cc (class Target_selector_i386): Update Target_selector
16449 constructor call. Remove recognize and recognize_by_name. Add
16450 do_instantiate_target.
16451 * x86_64.cc (class Target_selector_x86_64): Likewise.
16452 * testsuite/testfile.cc (class Target_selector_test): Update for
16453 changes to Target_selector.
16454
874c5b28
ILT
16455 * README: Rewrite, with some notes on unsupported features.
16456
0a65a3a7
CC
164572008-03-24 Cary Coutant <ccoutant@google.com>
16458
16459 * i386.cc (Target_i386::Got_type): New enum declaration.
16460 (Target_i386::Scan::local): Updated callers of Output_data_got
16461 member functions.
16462 (Target_i386::Scan::global): Likewise.
16463 (Target_i386::Relocate::relocate): Likewise.
16464 (Target_i386::Relocate::relocate_tls): Likewise.
16465 * object.h (Got_offset_list): New class.
16466 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16467 (Sized_relobj::local_got_offset): Likewise.
16468 (Sized_relobj::set_local_got_offset): Likewise.
16469 (Sized_relobj::local_has_tls_got_offset): Removed.
16470 (Sized_relobj::local_tls_got_offset): Removed.
16471 (Sized_relobj::set_local_tls_got_offset): Removed.
16472 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16473 * output.cc (Output_data_got::add_global): Added got_type parameter.
16474 (Output_data_got::add_global_with_rel): Likewise.
16475 (Output_data_got::add_global_with_rela): Likewise.
16476 (Output_data_got::add_global_pair_with_rel): New function.
16477 (Output_data_got::add_global_pair_with_rela): New function.
16478 (Output_data_got::add_local): Added got_type parameter.
16479 (Output_data_got::add_local_with_rel): Likewise.
16480 (Output_data_got::add_local_with_rela): Likewise.
16481 (Output_data_got::add_local_pair_with_rel): New function.
16482 (Output_data_got::add_local_pair_with_rela): New function.
16483 (Output_data_got::add_global_tls): Removed.
16484 (Output_data_got::add_global_tls_with_rel): Removed.
16485 (Output_data_got::add_global_tls_with_rela): Removed.
16486 (Output_data_got::add_local_tls): Removed.
16487 (Output_data_got::add_local_tls_with_rel): Removed.
16488 (Output_data_got::add_local_tls_with_rela): Removed.
16489 * output.h (Output_data_got::add_global): Added got_type parameter.
16490 (Output_data_got::add_global_with_rel): Likewise.
16491 (Output_data_got::add_global_with_rela): Likewise.
16492 (Output_data_got::add_global_pair_with_rel): New function.
16493 (Output_data_got::add_global_pair_with_rela): New function.
16494 (Output_data_got::add_local): Added got_type parameter.
16495 (Output_data_got::add_local_with_rel): Likewise.
16496 (Output_data_got::add_local_with_rela): Likewise.
16497 (Output_data_got::add_local_pair_with_rel): New function.
16498 (Output_data_got::add_local_pair_with_rela): New function.
16499 (Output_data_got::add_global_tls): Removed.
16500 (Output_data_got::add_global_tls_with_rel): Removed.
16501 (Output_data_got::add_global_tls_with_rela): Removed.
16502 (Output_data_got::add_local_tls): Removed.
16503 (Output_data_got::add_local_tls_with_rel): Removed.
16504 (Output_data_got::add_local_tls_with_rela): Removed.
16505 * resolve.cc (Symbol::override_base_with_special): Removed
16506 reference to has_got_offset_ field.
16507 * symtab.cc (Symbol::init_fields): Replaced initialization
16508 of got_offset_ with got_offsets_. Removed initialization
16509 of has_got_offset_
53fcba31 16510 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16511 (Symbol::got_offset): Likewise.
16512 (Symbol::set_got_offset): Likewise.
16513 (Symbol::has_tls_got_offset): Removed.
16514 (Symbol::tls_got_offset): Removed.
16515 (Symbol::set_tls_got_offset): Removed.
16516 (Symbol::got_offset_): Removed.
16517 (Symbol::tls_mod_got_offset_): Removed.
16518 (Symbol::tls_pair_got_offset_): Removed.
16519 (Symbol::got_offsets_): New field.
16520 (Symbol::has_got_offset): Removed.
16521 (Symbol::has_tls_mod_got_offset): Removed.
16522 (Symbol::has_tls_pair_got_offset): Removed.
16523 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16524 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16525 member functions.
16526 (Target_x86_64::Scan::global): Likewise.
16527 (Target_x86_64::Relocate::relocate): Likewise.
16528 (Target_x86_64::Relocate::relocate_tls): Likewise.
16529
bd52eafb
BE
165302008-03-25 Ben Elliston <bje@au.ibm.com>
16531
16532 * yyscript.y: Fix spelling error in comment.
16533
8b105e34
ILT
165342008-03-24 Ian Lance Taylor <iant@google.com>
16535
8ed814a9
ILT
16536 * options.h (class General_options): Define build_id option.
16537 * layout.h (class Layout): Declare write_build_id, create_note,
16538 create_build_id. Add build_id_note_ member.
16539 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16540 "libiberty.h", "md5.h", "sha1.h".
16541 (Layout::Layout): Initialize eh_frame_data_,
16542 eh_frame_hdr_section_, and build_id_note_.
16543 (Layout::finalize): Call create_build_id.
16544 (Layout::create_note): New function, broken out of
16545 Layout::create_gold_note.
16546 (Layout::create_gold_note): Call create_note.
16547 (Layout::create_build_id): New function.
16548 (Layout::write_build_id): New function.
16549 (Close_task_runner::run): Call write_build_id.
16550
8b105e34
ILT
16551 * x86_64.cc: Correct license to GPLv3.
16552
086a1841
ILT
165532008-03-23 Ian Lance Taylor <iant@google.com>
16554
16555 * options.cc: Include "demangle.h".
16556 (parse_optional_string): New function.
16557 (parse_long_option): Handle takes_optional_argument.
16558 (parse_short_option): Update dash_z initializer. Handle
16559 takes_optional_argument.
16560 (General_options::General_options): Initialize do_demangle_.
16561 (General_options::finalize): Set do_demangle_. Handle demangling
16562 style.
16563 * options.h (parse_optional_string): Declare.
16564 (struct One_option): Add optional_arg field. Update constructor.
16565 Update call constructor calls. Add takes_optional_argument
16566 function.
16567 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16568 (DEFINE_optional_string): Define.
16569 (General_options::demangle): Change from DEFINE_bool to
16570 DEFINE_optional_string.
16571 (General_options::no_demangle): New function.
16572 (General_options::do_demangle): New function.
16573 (General_options::set_do_demangle): New function.
16574 (General_options::execstack_status_): Move definition to end of
16575 class definition.
16576 (General_options::static_): Likewise.
16577 (General_options::do_demangle_): New field.
16578 * object.cc (big_endian>::get_symbol_location_info): Call
16579 Options::do_demangle, not Options::demangle.
16580 * symtab.cc (demangle): Likewise.
16581
cbb93e63
ILT
165822008-03-22 Ian Lance Taylor <iant@google.com>
16583
16584 * gold.h: Include <cstddef> and <sys/types.h>
16585 * options.h: Include <cstring>.
16586
ec531623
ILT
165872008-03-21 Ian Lance Taylor <iant@google.com>
16588
16589 * Added source code to GNU binutils.
752937aa 16590\f
b90efa5b 16591Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
16592
16593Copying and distribution of this file, with or without modification,
16594are permitted in any medium without royalty provided the copyright
16595notice and this notice are preserved.
16596
16597Local Variables:
16598mode: change-log
16599left-margin: 8
16600fill-column: 74
16601version-control: never
16602End:
This page took 1.214611 seconds and 4 git commands to generate.