Detect 64-bit-ness in PowerPC Book III-E
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
a5cd8f05
CC
12015-01-09 Cary Coutant <ccoutant@google.com>
2
3 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
4 unless alignment is larger than page size.
5
4fc1b9d4
L
62015-01-06 H.J. Lu <hongjiu.lu@intel.com>
7 Cary Coutant <ccoutant@google.com>
8
9 PR gold/17729
10 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
11 (DEFAULT_TARGET_X32): Set for x32.
12 * x86_64.cc (cmp_insn_32): New.
13 (lea_r10_insn_32): Likewise.
14 (lea_r11_insn_32): Likewise.
15 (cmp_insn_64): Likewise.
16 (lea_r10_insn_64): Likewise.
17 (lea_r11_insn_64): Likewise.
18 (Target_x86_64<size>::do_calls_non_split): Handle x32.
19 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
20 (check_DATA): Add split_x32 files.
21 (split_x32_[1234n].o): New targets.
22 (split_x32_[124]): New targets.
23 (split_x32_[1234r].stdout): New targets.
24 * testsuite/split_x32.sh: New file.
25 * testsuite/split_x32_1.s: Likewise.
26 * testsuite/split_x32_2.s: Likewise.
27 * testsuite/split_x32_3.s: Likewise.
28 * testsuite/split_x32_4.s: Likewise.
29 * testsuite/split_x32_n.s: Likewise.
30 * configure: Regenerated.
31 * testsuite/Makefile.in: Likewise.
32
e749cab8
L
332015-01-06 H.J. Lu <hongjiu.lu@intel.com>
34
35 PR gold/17809
36 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
37 x32.
38
af759df0
AM
392015-01-02 Alan Modra <amodra@gmail.com>
40
41 * version.cc (print_version): Just print current year.
42 * dwp.cc (print_version): Likewise.
43
b90efa5b
AM
442015-01-01 Alan Modra <amodra@gmail.com>
45
46 Update year range in copyright notice of all files.
47
f12d1e8a
AM
482014-12-25 Alan Modra <amodra@gmail.com>
49
50 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
51 new enums.
52 (Target_arm::merge_object_attributes, ): Likewise.
53
5c294fee
TG
542014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
55
56 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
57 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
58 AEABI_VFP_args_vfp to check that.
59 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
60 value and replace hardcoded values by enum values.
61
e30880c2
CC
622014-12-22 Cary Coutant <ccoutant@google.com>
63
64 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
65
bd040da1
L
662014-12-20 H.J. Lu <hongjiu.lu@intel.com>
67
68 PR gold/14608
69 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
70 to "return i * i * 3;".
71
e02a4046
CC
722014-12-16 Cary Coutant <ccoutant@google.com>
73
74 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
75 (Mapfile::print_output_data): Use current_data_size() to avoid
76 assert for sections requiring postprocessing; if address is not valid,
77 print 0.
78 (Mapfile::print_output_section): Use current_data_size(); print note
79 that addresses and sizes are before compression.
80
add6016b
L
812014-12-14 H.J. Lu <hongjiu.lu@intel.com>
82
83 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
84 Cast current_group_size to unsigned long when reporting error.
85
0bf32ea9
JY
862014-12-10 Jing Yu <jingyu@google.com>
87
88 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
89 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
90 Update error message.
91 (Target_aarch64::do_relax): Use absolute value of option
92 stub_group_size. Replace local variable with class member
93 stub_group_size_.
94
cbcb23fa
AM
952014-12-04 Alan Modra <amodra@gmail.com>
96
97 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
98 addend of PLTREL24 reloc when not generating a plt stub. Make
99 max_branch_offset an "Address".
fbad6518 100 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
101 (Target_powerpc::Relocate::relocate): Likewise.
102
1611bc4a
AM
1032014-12-04 Alan Modra <amodra@gmail.com>
104
105 PR 17670
106 * symtab.cc (Symbol::set_undefined): Remove assertion.
107 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
108 on symbols defined in discarded sections, instead return false.
109 Rearrange params, update all callers.
110 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
111 branches to syms in discarded sections.
112 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
113 undefined and flag as discarded.
114 (Target_powerpc::Relocate::relocate): Localize variable.
115
4759c34e
L
1162014-12-03 H.J. Lu <hongjiu.lu@intel.com>
117
118 PR gold/17675
119 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
120 * testsuite/Makefile.in: Regenerated.
121
1f98a074
AM
1222014-12-03 Alan Modra <amodra@gmail.com>
123
124 PR 17566
125 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
126 when adding dynamic relocations against section symbols.
127
fb257835
DI
1282014-12-01 Dimitry Ivanov <dimitry@google.com>
129
130 * layout.cc (Layout::finish_dynamic_section): When '-z global'
131 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
132 * options.h (General_options): New -z option (global).
133
d8e60314
CC
1342014-12-01 Cary Coutant <ccoutant@google.com>
135
136 PR gold/17578
137 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
138 is given.
139 (Layout::create_executable_stack_info): Warn when -z noexecstack is
140 given but some inputs require executable stack.
141
982bbd97
CC
1422014-11-26 Cary Coutant <ccoutant@google.com>
143
144 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
145 .debug_str_offsets; strip .debug_gnu_pubnames and
146 .debug_gnu_pubtypes.
147 (lines_only_debug_sections): Strip all four new sections.
148
bb779192
HS
1492014-11-26 Jing Yu <jingyu@google.com>
150
151 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
152 register to be x0 when to relax TLSDESC_LD64_LO12.
153
a3e60ddb
AM
1542014-11-26 Alan Modra <amodra@gmail.com>
155
156 * powerpc.cc (struct Stub_table_owner): New.
157 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
158 unsigned int vector. Update all references.
159 (powerpc_relobj::set_stub_table): Take an unsigned int param
160 rather than a Stub_table. Update callers.
161 (Powerpc_relobj::clear_stub_table): New function.
162 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
163 stub_group_size_ vars.
164 (Target_powerpc::new_stub_table): Delete.
165 (max_branch_delta): New function, extracted from..
166 (Target_powerpc::Relocate::relocate): ..here..
167 (Target_powerpc::Branch_info::make_stub): ..and here. Return
168 status on whether stub created successfully.
169 (Stub_control::Stub_control): Add "no_size_errors" param. Move
170 default sizing to..
171 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
172 reduce on relax failure.
173 (Target_powerpc::group_sections): Add "no_size_errors" param.
174 Use stub_group_size_. Set up group info in a temp vector,
175 before building Stub_table vector. Account for input sections
176 possibly already converted to relaxed sections.
177 (Stub_table::init): Delete. Merge into..
178 (Stub_table::Stub_table): ..here.
179 (Stub_table::can_reach_stub): New function.
180 (Stub_table::add_plt_call_entry): Add "from" parameter and
181 return true iff stub could be reached.
182 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
183 param too.
184 (Stub_table::clear_stubs): Add "all" param.
185
a20605cf
AM
1862014-11-26 Alan Modra <amodra@gmail.com>
187
188 * powerpc.cc (Stub_control::set_output_and_owner): New function.
189 (Target_powerpc::group_sections): Use it.
190
43b64deb
CC
1912014-11-25 Cary Coutant <ccoutant@google.com>
192
193 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
194 (Binary_to_elf::write_symbol): Add st_size parameter.
195 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
196
c924eb67
CC
1972014-11-25 Cary Coutant <ccoutant@google.com>
198
199 PR gold/17639
200 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
201 (Sized_relobj_file::do_layout): Handle deferred sections properly
202 during GC pass 1. Don't add reloc sections to deferred list twice.
203 * object.h (Sized_relobj_file::is_deferred_layout): New function.
204 (Sized_relobj_file::is_deferred_layout_): New data member.
205
9d585188
L
2062014-11-21 H.J. Lu <hongjiu.lu@intel.com>
207
208 PR gold/17619
209 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
210 Check PC-relative offset overflow in PLT entry.
211
3ffaac20
AM
2122014-11-21 Alan Modra <amodra@gmail.com>
213
214 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
215 for undefined weaks.
216
0cfb0717
AM
2172014-11-20 Alan Modra <amodra@gmail.com>
218
219 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
220 from --stub-group-size parameter divided by 1024.
221 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
222 template parameter. Update all uses.
223 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
224 has_stub_value. Set for long branches. Don't report overflow for
225 branch to undefined weak symbols. Print info message on
226 overflowing branch to stub.
227
f9dffbf0
AM
2282014-11-20 Alan Modra <amodra@gmail.com>
229
230 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
231
e88ba8d5
L
2322014-11-13 H.J. Lu <hongjiu.lu@intel.com>
233
234 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
235 entry for R_X86_64_GOTPLT64.
236 (Target_x86_64<size>::Relocate::relocate): Update comments for
237 R_X86_64_GOTPLT64.
238
d37ffe25
ED
2392014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
240
241 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
242 * plugin.h: add lock definition
243
9726c3c1
HS
2442014-10-29 Han Shen <shenhan@google.com>
245 Jing Yu <jingyu@google.com>
246
247 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
248 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
249 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
250 Symbol::TLS_REF.
251 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
252 method.
253 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
254 (Target_aarch64::tls_ld_to_le): New method.
255 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
256 for 64bit targets.
257 (Output_data_plt_aarch64::irelative_rel_): New data member.
258 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
259 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
260 (Output_data_plt_aarch64::add_relocation): New method.
261 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
262 offset. Add got_irelative size to got size.
263 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
264 type string with the new typename.
265 (AArch64_relocate_functions::update_adr): Replace parameter x with
266 immed.
267 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
268 (AArch64_relocate_functions::reloc_common): New method.
269 (AArch64_relocate_funcsions::rela_general): Extract common part out
270 into reloc_common method.
271 (AArch64_relocate_functions::rela_general): Likewise.
272 (AArch64_relocate_functions::pcrela_general): Likewise.
273 (AArch64_relocate_functions::adr): New method.
274 (AArch64_relocate_functions::adrp): Calculate immed before calling
275 update_adr.
276 (AArch64_relocate_functions::adrp): Likewise.
277 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
278 comparing x to 0. Calculate immed from ~x when x < 0.
279 (Target_aarch64::optimize_tls_reloc): Add new cases for
280 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
281 TLSLD_MOVW_DTPREL_G0_NC.
282 (Target_aarch64::possible_function_pointer_reloc): Implement this
283 method.
284 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
285 comment.
286 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
287 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
288 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
289 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
290 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
291 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
292 (Target_aarch64::make_plt_entry): Call add_entry with two more
293 parameters.
294 (Target_aarch64::make_local_ifunc_plt_entry): New method.
295 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
296 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
297 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
298 (Target_aarch64::Relocate::relocate_tls): Add cases for
299 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
300 TLSLD_MOVW_DTPREL_G0_NC.
301 * testsuite/icf_safe_so_test.cc: Correct test comment.
302 * testsuite/icf_safe_test.sh: Add AArch64 arch.
303
80272b8c
AM
3042014-10-22 Alan Modra <amodra@gmail.com>
305
306 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
307 thread_starter.
308
998a69f4
AS
3092014-10-18 Andreas Schwab <schwab@linux-m68k.org>
310
311 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
312
aed56ec5
CC
3132014-10-17 Cary Coutant <ccoutant@google.com>
314
315 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
316 Add "typename" keyword.
317
bb779192 3182014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
319 Jing Yu <jingyu@google.com>
320
321 Patch for gold aarch64 backend to support relaxation.
322 * aarch64-reloc.def: Change format.
323 * aarch64.cc (class Reloc_stub): New class.
324 (class Stub_table): New class.
325 (class AArch64_relobj): New class.
326 (class AArch64_input_section): New class.
327 (class AArch64_output_section): New class.
328 (Target_aarch64::new_stub_table): New method.
329 (Target_aarch64::new_aarch64_input_section): New method.
330 (Target_aarch64::find_aarch64_input_section): New method.
331 (Target_aarch64::scan_section_for_stubs): New method.
332 (Target_aarch64::scan_reloc_section_for_stubs): New method.
333 (Target_aarch64::relocate_stub): New method.
334 (Target_aarch64::current_target): New method.
335 (Target_aarch64::do_make_elf_object): New method.
336 (Target_aarch64::do_may_relax): New method.
337 (Target_aarch64::do_relax): New method.
338 (Target_aarch64::group_sections): New method.
339 (Target_aarch64::scan_reloc_for_stub): New method.
340 (Target_aarch64::do_make_output_section): New method.
341 (Target_aarch64::stub_tables_): New data member.
342 (Target_aarch64::aarch64_input_section_map_): New data member.
343 (AArch64_relocate_functions::maybe_apply_stub): New method.
344
db4c9594
CC
3452014-09-30 Cary Coutant <ccoutant@google.com>
346
347 PR gold/17432
348 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
349
cd6da036
KC
3502014-09-30 Kito Cheng <kito@0xlab.org>
351
352 PR gold/13597
353 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
354 hash table before sysv-style hash table.
355
5f772412
ST
3562014-09-29 Sriraman Tallam <tmsriram@google.com>
357
358 * options.h (--pic-executable): Add negative to alias to -no-pie.
359
5efeedf6
CC
3602014-09-26 Cary Coutant <ccoutant@google.com>
361
362 PR gold/16773
363 * object.cc (Sized_relobj_file): Compute value of section symbols
364 for TLS sections the same as TLS symbols.
365
1707f183
CC
3662014-09-25 Cary Coutant <ccoutant@google.com>
367
368 PR gold/17432
369 * resolve.cc (Symbol_table::resolve): Override common placeholder
370 symbols, but adjust sizes.
371 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
372 symbols to common lists.
373
00cac886
AM
3742014-09-24 Alan Modra <amodra@gmail.com>
375
376 * po/POTFILES.in: Regenerate.
377
635aa30e
CC
3782014-09-23 Taiju Tsuiki <tzik@google.com>
379 Cary Coutant <ccoutant@google.com>
380
71b9b91b 381 PR gold/14860
635aa30e
CC
382 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
383 on input_sections_blocker.
384 * layout.cc (Write_sections_task::locks): Unblock
385 input_sections_blocker_.
386 * layout.h (Write_sections_task::Write_sections_task): Add
387 input_sections_blocker.
388 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
389 to DEPENDENCIES.
390 * testsuite/Makefile.in: Regenerate.
391
c0c71592
RÁE
3922014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
393
394 * testsuite/Makefile.am (plugin_test_10): New test.
395 * testsuite/Makefile.in: Regenerate
396 * testsuite/plugin_common_test_2.c (c1): Align to 8.
397 * testsuite/plugin_test_10.sh: New file.
398
6168c2a1
RÁE
3992014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
400
401 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
402 * resolve.cc (Symbol_table::resolve): Don't override common symbols
403 during the replacement phase.
404
3a531937
JY
4052014-09-17 Han Shen <shenhan@google.com>
406 Jing Yu <jingyu@google.com>
407
408 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
409 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
410 * aarch64.cc (Target_aarch64): Add data members
411 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
412 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
413 constructor.
414 (Target_aarch64::do_reloc_symbol_index): New method.
415 (Target_aarch64::do_reloc_addend): New method.
416 (Target_aarch64::add_tlsdesc_info): New method.
417 (Target_aarch64::do_dynsym_value): New method.
418 (Target_aarch64::do_make_data_plt): Add new parameters: got,
419 got_irelative. Pass them to Output_data_plt_aarch64_standard.
420 (Target_aarch64::make_data_plt): Add new parameters: got,
421 got_irelative. Pass them to do_make_data_plt.
422 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
423 (Target_aarch64::Relocate:tls_gd_to_le): New method.
424 (Target_aarch64::Relocate:tls_ie_to_le): New method.
425 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
426 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
427 (Target_aarch64::got_tlsdesc_section): New method.
428 (Target_aarch64::make_local_ifunc_plt_entry): New method.
429 (Target_aarch64::define_tls_base_symbol): New method.
430 (Target_aarch64::reserve_tlsdesc_entries): New method.
431 (Target_aarch64::got_mod_index_entry): New method.
432 (Target_aarch64::rela_tlsdesc_section): New method.
433 (Target_aarch64::rela_irelative_section): New method.
434 (Target_aarch64::Tlsdesc_info): New struct.
435 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
436 relocations and tlsdesc relocations.
437 (Target_aarch64::optimize_tls_reloc): Implement method.
438 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
439 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
440 in constructor.
441 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
442 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
443 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
444 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
445 (Output_data_plt_aarch64::rela_tlsdesc): New method.
446 (Output_data_plt_aarch64::rela_irelative): New method.
447 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
448 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
449 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
450 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
451 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
452 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
453 (Output_data_plt_aarch64_standard): New member variables:
454 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
455 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
456 New parameter: got, got_irelative.
457 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
458 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
459 (Output_data_plt_aarch64::do_write): Replace got_address with
460 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
461 (AArch64_relocate_functions::update_movnz): New method.
462 (AArch64_relocate_functions): Correct format.
463 (AArch64_relocate_functions::movnz): New method.
464 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
465 before the switch. Add new cases to switch.
00cac886 466 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
467 tlsgd tlsdesc cases.
468 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
469 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
470 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
471 Call reloc_name_in_error_message to print unsupported reloc.
472 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
473 make_data_plt.
474 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
475 relocs. Fill in some more dynamic tags.
476 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
477 Skip call tls_get_addr when tlsgd is relaxed.
478 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
479 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
480 tlsdesc->ie relaxation.
481
62661c93
SS
4822014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
483
484 * mips.cc (Target_mips_nacl): New class.
485 (Target_selector_mips_nacl): New class.
486 (target_selector_mips32): Rename from target_selector_mips32be and use
487 Target_selector_mips_nacl instead of Target_selector_mips.
488 (target_selector_mips32el): Rename from target_selector_mips32 and use
489 Target_selector_mips_nacl instead of Target_selector_mips.
490 (target_selector_mips64): Rename from target_selector_mips64be and use
491 Target_selector_mips_nacl instead of Target_selector_mips.
492 (target_selector_mips64el): Rename from target_selector_mips64 and use
493 Target_selector_mips_nacl instead of Target_selector_mips.
494 (Target_mips::mips_info): Add const attribute.
495
54674d38
CC
4962014-09-02 Cary Coutant <ccoutant@google.com>
497
498 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
499 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
500 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
501 (Sized_incr_dynobj::do_section_name): Likewise.
502 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
503 (Sized_incr_dynobj::do_section_name): Likewise.
504 * object.h (Object::section_name): Likewise.
505 (Object::do_section_name): Likewise.
506 (Sized_relobj_file::do_section_name): Likewise.
507 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
508 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
509
9860cbcf
CC
5102014-09-02 Cary Coutant <ccoutant@google.com>
511
512 PR gold/17005
513 * ehframe.cc (Fde::write): Add output_offset parameter.
514 (Cie::write): Likewise.
515 (Eh_frame::set_final_data_size): Account for offset within output
516 section.
517 (Eh_frame::do_sized_write): Likewise.
518 * ehframe.h (Fde::write): Add output_offset parameter.
519 (Cie::write): Likewise.
520 * output.cc (Output_section::Input_section_sort_entry): Remove
521 section_has_name_; add output_section_name parameter. Use
522 output section name for non-input sections.
523 (Output_section::Input_section_sort_entry::section_has_name): Remove.
524 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
525 (Output_section::Input_section_sort_compare): Remove logic for
526 sections without names.
527 (Output_section::Input_section_sort_init_fini_compare): Likewise.
528 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
529 Likewise.
530 (Output_section::Input_section_sort_section_name_compare): Likewise.
531
8e33481e
HS
5322014-08-29 Han Shen <shenhan@google.com>
533 Jing Yu <jingyu@google.com>
534
535 * aarch64-reloc-property.cc
536 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
537 reference reloc property in the table.
538 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
539 3 other entries.
540 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
541 2 new overloaded methods.
542 (Output_data_got_aarch64::do_write): Add code to write out
543 static relocs.
544 (class Output_data_got_aarch64::Static_reloc): New class to wrap
545 static relocs.
546 (Output_data_got_aarch64::static_relocs): New vector to
547 hold static relocs.
548 (Target_aarch64::TCB_SIZE): New const static memeber.
549 (Target_aarch64::tcb_size): New method.
550 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
551 (Target_aarch64::Relocate::relocate_tls): New method.
552 (Target_aarch64::Scan::local): Add code handling new reloc types.
553 (Target_aarch64::Scan::global): Add code handling new reloc types.
554
81233653
ST
5552014-08-13 Sriraman Tallam <tmsriram@google.com>
556
557 * options.h (-no-pie): Add option.
558
9363c7c3
JY
5592014-08-08 Jing Yu <jingyu@google.com>
560 Han Shen <shenhan@google.com>
561
562 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
563 (DEFFILES): add aarch64-reloc.def.
564 (TARGETSOURCES): Add aarch64-reloc-property.cc.
565 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
566 * Makefile.in: Regenerate.
567 * aarch64-reloc-property.cc: New file.
568 * aarch64-reloc-property.h: New file.
569 * aarch64-reloc.def: New file.
570 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
571 with tab to make the format consistent.
572 (Output_data_got_aarch64::symbol_table_): New method.
573 (Target_aarch64::do_plt_address_for_global): New method.
574 (Target_aarch64::do_plt_address_for_local): New method.
575 (Target_aarch64::do_select_as_default_target): New method.
576 (Target_aarch64::do_make_data_plt): New method.
577 (Target_aarch64::make_data_plt): New method.
578 (Output_data_plt_aarch64::has_irelative_section): New method.
579 (Output_data_plt_aarch64::address_for_global): New method.
580 (Output_data_plt_aarch64::address_for_local): New method.
581 (Output_data_plt_aarch64::irelative_rel_): New parameter.
582 (Output_data_plt_aarch64::add_entry): Implement contents.
583 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
584 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
585 the got_pov entry to plt0.
586 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
587 Implement contents.
588 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
589 (AArch64_howto): New struct.
590 (aarch64_howto[]): New static const array.
591 (AArch64_relocate_functions): New class.
592 (Target_aarch64::Scan::get_reference_flags): Remove method.
593 (Target_aarch64::Scan::local): Implement to support a few relocations.
594 (Target_aarch64::Scan::global): Implement to support a few relocations.
595 (Target_aarch64::make_plt_section): Implement contents.
596 (Target_aarch64::make_plt_entry): Implement contents.
597 (Target_aarch64::do_finalize_sections): Implement contents.
598 (Target_aarch64::Relocate::relocate): Implement a few relocations.
599 (Target_aarch64::relocate_section): Implement contents.
600
ad9fe6c1
AM
6012014-08-06 Alan Modra <amodra@gmail.com>
602
603 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
604
7cd4e5b7
AM
6052014-08-06 Alan Modra <amodra@gmail.com>
606
607 PR 13227
608 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
609
5ad9b0a7
ST
6102014-07-21 Sriraman Tallam <tmsriram@google.com>
611
612 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 613 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 614
e051745c
CC
6152014-07-08 Cary Coutant <ccoutant@google.com>
616
617 * expression.cc (struct Expression::Expression_eval_info): Add
618 new fields type_pointer, vis_pointer, and nonvis_pointer.
619 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
620 nonvis_pointer parameters. Adjust all calls.
621 (Symbol_expression::value): Update type, visibility, and nonvis bits
622 in caller.
623 * script.cc (Symbol_assignment::sized_finalize): Update type,
624 visibility, and remaining st_other bits for new symbol.
625 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
626 vis_pointer, and nonvis_pointer parameters.
627 * symtab.h (Symbol::set_type): New method.
628
629 * testsuite/Makefile.am (defsym_test): New test.
630 * testsuite/Makefile.in: Regenerate.
631 * testsuite/defsym_test.c: New file.
632 * testsuite/defsym_test.sh: New file.
633
f35c4853
CC
6342014-07-08 Cary Coutant <ccoutant@google.com>
635
636 PR gold/15639
637 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
638 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
639 (Sized_dynobj::base_read_symbols): ...new method.
640 * object.h (Sized_relobj_file::base_read_symbols): New method.
641 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
642 (Sized_relobj_file::base_read_symbols): ...new method.
643 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
644 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
645 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
646
2900af2d
AM
6472014-07-04 Alan Modra <amodra@gmail.com>
648
649 * po/POTFILES.in: Regenerate.
650
053a4d68
JY
6512014-07-02 Jing Yu <jingyu@google.com>
652
653 * aarch64.cc: New file
654 * Makefile.am (TARGETSOURCES): Add aarch64.cc
655 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
656 * Makefile.in: Regenerate.
657 * configure.tgt: Add entries for aarch64*.
658 * configure.ac: Likewise.
659 * configure: Likewise.
660
7b549045
AM
6612014-06-27 Alan Modra <amodra@gmail.com>
662
663 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
664
cb818dbf
CC
6652014-06-24 Cary Coutant <ccoutant@google.com>
666
667 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
668 sections.
669 (Dwo_file::sized_read_unit_index): Likewise.
670
9810d34d
SS
6712014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
672
673 * mips.cc: New file.
674 * Makefile.am (TARGETSOURCES): Add mips.cc
675 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
676 * configure.tgt: Add entries for mips*.
677 * configure.ac: Likewise.
678 * Makefile.in: Regenerate.
679 * configure: Likewise.
680
9baa787b
CC
6812014-06-09 Cary Coutant <ccoutant@google.com>
682
683 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
684 unit_length is within section bounds.
685
8f89af0a
CC
6862014-06-09 Cary Coutant <ccoutant@google.com>
687
688 PR gold/16980
689 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
690 map.
691
a47622ac
AM
6922014-06-07 Alan Modra <amodra@gmail.com>
693
694 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
695
4320c691
CC
6962014-06-06 Cary Coutant <ccoutant@google.com>
697
698 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
699 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
700 (Dwarf_pubnames_table::read_header): Likewise.
701 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
702 .debug_gnu_pubtypes.
703
270c9937
JB
7042014-06-05 Joel Brobecker <brobecker@adacore.com>
705
706 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
707 * Makefile.in, configure: Regenerate.
708
397998fc
AM
7092014-06-03 Alan Modra <amodra@gmail.com>
710
711 * powerpc.cc (addis_12_2): Define.
712 (Stub_table::do_write): Support fusion on ELFv2 stubs.
713
61f5c66f
AM
7142014-06-03 Alan Modra <amodra@gmail.com>
715
716 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
717 st_other output.
718
f6971787
AM
7192014-06-02 Alan Modra <amodra@gmail.com>
720
721 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
722 Only ignore relocs on ELFv1.
723 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
724
f6fb8322
CC
7252014-05-30 Cary Coutant <ccoutant@google.com>
726
727 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
728 * testsuite/Makefile.in: Regenerate.
729 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
730
c23dd342
L
7312014-05-27 H.J. Lu <hongjiu.lu@intel.com>
732
733 PR gold/16945
734 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
735 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
736
5fe7ffdc
AM
7372014-05-15 Alan Modra <amodra@gmail.com>
738
739 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
740 Compare FDE contents with DW_CFA_nop rather than 0.
741
a82bef93
ST
7422014-05-13 Sriraman Tallam <tmsriram@google.com>
743
744 * symtab.h (may_need_copy_reloc): Remove check for position independent
745 code.
746 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
747 position independence before pc absolute may_need_copy_reloc call.
748 Add check for executable output befor pc relative may_need_copy_reloc
749 call.
750 * i386.cc: Ditto.
751 * arm.cc: Ditto.
752 * sparc.cc: Ditto.
753 * tilegx.cc: Ditto.
754 * powerpc.cc: Add check for no position independence before
755 may_need_copy_reloc calls.
756 * testsuite/pie_copyrelocs_test.cc: New file.
757 * testsuite/pie_copyrelocs_shared_test.cc: New file.
758 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 759 * Makefile.in: Regenerate.
a82bef93 760
53c66605
ML
7612014-05-08 Martin Liška <mliska@suse.cz>
762
763 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
764
57b2284c
CC
7652014-05-06 Cary Coutant <ccoutant@google.com>
766
767 PR gold/16900
768 * i386.cc (Output_data_got_plt_i386): New class.
769 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
770 parameter. Change all callers.
771 (Output_data_plt_i386::layout_): Remove.
772 (Output_data_plt_i386::got_plt_): Change type.
773 (Target_i386::got_plt_): Change type. Change all references.
774 (Target_i386::got_section): Create instance of new class.
775 (Output_data_got_plt_i386::do_write): New function.
776 * x86_64.cc (Output_data_got_plt_x86_64): New class.
777 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
778 parameter. Change all callers.
779 (Output_data_plt_x86_64::layout_): Remove.
780 (Output_data_plt_x86_64::got_plt_): Change type.
781 (Target_x86_64::got_plt_): Change type. Change all references.
782 (Target_x86_64::got_section): Create instance of new class.
783 (Output_data_got_plt_x86_64::do_write): New function.
784 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
785 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
786 class.
787
6b97515d 7882014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 789
6b97515d
CC
790 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
791 if we have pubnames/pubtypes.
792
d1bddd3c
CC
7932014-05-02 Cary Coutant <ccoutant@google.com>
794
5fe7ffdc
AM
795 * defstd.cc (in_segment): Define __ehdr_start here...
796 * layout.cc (Layout::finalize): ...Instead of here. Set the
797 output segment when known.
798 * resolve.cc (Symbol::override_base_with_special): Remember
799 the original binding.
800 * symtab.cc (Symbol::set_output_segment): New function.
801 (Symbol::set_undefined): New function.
802 * symtab.h (Symbol::is_weak_undefined): Check original undef
803 binding.
804 (Symbol::is_strong_undefined): New function.
805 (Symbol::set_output_segment): New function.
806 (Symbol::set_undefined): New function.
807 * target-reloc.h (is_strong_undefined): Remove.
808 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
809 Check for hidden undefs.
810 (relocate_section): Call Symbol::is_strong_undefined.
811
812 * testsuite/Makefile.am (ehdr_start_test_1)
813 (ehdr_start_test_2, ehdr_start_test_3)
814 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
815 * testsuite/Makefile.in: Regenerate.
816 * testsuite/ehdr_start_def.cc: New source file.
817 * testsuite/ehdr_start_test.cc: New source file.
818 * testsuite/ehdr_start_test.t: New linker script.
819 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 820
7849f6d8
CC
8212014-04-23 Cary Coutant <ccoutant@google.com>
822
bf2cc635 823 PR gold/16870
7849f6d8
CC
824 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
825
99fd8cff
CC
8262014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
827
828 * layout.cc (Layout::include_section): Allow a target to decide
829 whether to include a section.
830 * target.h (Target::should_include_section): New function.
831 (Target::do_should_include_section): New function.
832
91f43acd
CC
8332014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
834
835 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
836 inline into ...
837 (Copy_relocs::emit): ... here.
838 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
839 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
840 (Copy_reloc_entry::entries_): Change from private to protected.
841
c4eb27e1
ST
8422014-04-02 Sriraman Tallam <tmsriram@google.com>
843
844 * icf.cc (get_section_contents): Replace copies of reloc
845 vectors with const references.
846
ae447ddd
CC
8472014-04-02 Cary Coutant <ccoutant@google.com>
848
849 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
850 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
851 * configure: Regenerate.
852 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
853 -fno-use-linker-plugin.
854 (LINK1, CXXLINK1): Add it to the link command.
855 * testsuite/Makefile.in: Regenerate.
856
fa47fa92
AM
8572014-03-12 Alan Modra <amodra@gmail.com>
858
859 * Makefile.in: Regenerate.
860
9b12c500
CC
8612014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
862
863 * symtab.h (Symbol::set_nonvis): New function.
864
beacaa96
CC
8652014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
866
867 * symtab.cc (Sized_symbol<32>::init_output_data):
868 Instantiate the template.
869 (Sized_symbol<64>::init_output_data): Likewise.
870
800d9823
CC
8712014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
872
873 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
874 adjust dynamic symbol value.
875 * target.h (Target::adjust_dyn_symbol): New function.
876 (Target::do_adjust_dyn_symbol): New function.
877
918fc1f8 8782014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 879
918fc1f8
CC
880 * output.cc (Output_data_dynamic::Dynamic_entry::write):
881 Get the value of DYNAMIC_CUSTOM dynamic entry.
882 * output.h (Output_data_dynamic::add_custom): New function.
883 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
884 dynamic entry.
885 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
886 * target.h (Target::dynamic_tag_custom_value): New function.
887 (Target::do_dynamic_tag_custom_value): New function.
888
98ff9231
CC
8892014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
890
891 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
892 dynsym indexes.
893 * target.h (Target::has_custom_set_dynsym_indexes): New function.
894 (Target::do_has_custom_set_dynsym_indexes): New function.
895 (Target::set_dynsym_indexes): New function.
896 (Target::do_set_dynsym_indexes): New function.
897
b80eed39
AM
8982014-03-07 Alan Modra <amodra@gmail.com>
899
900 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
901 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
902 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
903 (Powerpc_relocate_functions::has_overflow_bitfield,
904 overflowed): Use the above.
905 (Target_powerpc::Relocate::relocate): Correct overflow checking
906 for a number of relocations. Modify overflow test for 16-bit
907 fields in instructions to signed/unsigned according to whether
908 the field takes a signed or unsigned value.
909
4b95cf5c
AM
9102014-03-05 Alan Modra <amodra@gmail.com>
911
912 Update copyright years.
913
45965137
AM
9142014-03-05 Alan Modra <amodra@gmail.com>
915
916 * powerpc.cc (Target_powerpc::Scan::local, global): Support
917 R_PPC64_ADDR64_LOCAL.
918 (Target_powerpc::Relocate::relocate): Likewise.
919
2c80b753
AM
9202014-03-03 Alan Modra <amodra@gmail.com>
921
922 * dwp.cc (print_version): Update copyright year to current.
923
c1c69e83
AM
9242014-02-10 Alan Modra <amodra@gmail.com>
925
926 * po/gold.pot: Regenerate.
927
dd0c4e70
CC
9282014-02-06 Cary Coutant <ccoutant@google.com>
929
930 Fix problem where -u is ignored when a weak undef is seen.
931
932 * archive.cc (Library_base::should_include_member): Reorder
933 code to check for -u option if a weak undef has already been seen.
934 * testsuite/Makefile.am (weak_undef_test_2): New test case.
935 * testsuite/Makefile.in: Regenerate.
936 * testsuite/weak_undef_file3.cc: New file.
937 * testsuite/weak_undef_file4.cc: New file.
938 * testsuite/weak_undef_test_2.cc: New file.
939
1a221d3d
CC
9402014-02-05 Cary Coutant <ccoutant@google.com>
941
942 Fix issues with gold undefined symbol diagnostics.
943
944 PR binutils/15435
945 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
946 check to here.
947 * target-reloc.h (is_strong_undefined): New function.
948 (relocate_section): Move undef vtable symbol check from here.
949 Check for is_strong_undefined.
950
e889f0a4 9512014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 952
e889f0a4
CC
953 Fix problems with the --dynamic-list option.
954
955 PR gold/13577
956 * options.cc (General_options::parse_dynamic_list):
957 Set have_dynamic_list_.
958 (General_options::General_options): Initialize have_dynamic_list_.
959 (General_options::finalize): Turn off -Bsymbolic and
960 -Bsymbolic-functions if --dynamic-list provided.
961 * options.h (General_options::have_dynamic_list): New function.
962 (General_options::have_dynamic_list_): New data member.
963 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
964 correctly.
5fe7ffdc 965
e889f0a4
CC
966 PR gold/16530
967 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
968 in --dynamic-list, mark it.
5fe7ffdc 969
e889f0a4
CC
970 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
971 (dynamic_list_2): New test case.
972 * testsuite/Makefile.in: Regenerate.
973 * testsuite/dynamic_list_2.cc: New file.
974 * testsuite/dynamic_list_2.t: New file.
975 * testsuite/dynamic_list_lib1.cc: New file.
976 * testsuite/dynamic_list_lib2.cc: New file.
977 * testsuite/gc_dynamic_list_test.c: New file.
978 * testsuite/gc_dynamic_list_test.sh: New file.
979 * testsuite/gc_dynamic_list_test.t: New file.
980
ec673e64
CC
9812014-01-28 Cary Coutant <ccoutant@google.com>
982
983 Add .gdb_index version 7 support.
984
985 * gold/dwarf_reader.cc: include <utility> (for make_pair).
986 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
987 debug sections.
988 (Dwarf_ranges_table::read_ranges_table): Likewise.
989 (Dwarf_pubnames_table::read_section): Check for GNU-style
990 sections, and for compressed debug sections.
991 (Dwarf_pubnames_table::read_header): Compute end address of table.
992 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
993 for end of list by offset, not by offset == 0.
994 (Dwarf_info_reader::do_read_string_table): Check for compressed
995 debug sections.
996 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
997 Initialize new data members.
998 (Dwarf_pubnames_table::next_name): return flag_byte.
999 (Dwarf_pubnames_table::end_of_table_): New data member.
1000 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1001 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1002 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1003 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1004 read skeleton type unit DIEs.
1005 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1006 (Gdb_index::do_write): Write flag_byte.
1007 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1008 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1009 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1010 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1011
221fd5d5
L
10122014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1013
1014 * version.cc (print_version): Update copyright year to 2014.
1015
6c09fb0b
ILT
10162013-12-19 Dimitry Andric <dimitry@andric.com>
1017
1018 * stringpool.cc (Stringpool_template::reserve): Add
1019 HAVE_UNORDERED_MAP case.
1020 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1021
8356f2d0
CC
10222013-12-18 Cary Coutant <ccoutant@google.com>
1023
1024 * configure.ac: Check for <unordered_set> and <unordered_map>.
1025 * config.in: Regenerate.
1026 * configure: Regenerate.
1027 * system.h: Use <unordered_set> and <unordered_map> if available.
1028
f2c7d7ee
RM
10292013-12-10 Roland McGrath <mcgrathr@google.com>
1030
1031 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1032 with $(INSTALL_PROGRAM_ENV).
1033 * Makefile.in: Regenerate.
1034
6632e8cc
CC
10352013-11-22 Cary Coutant <ccoutant@google.com>
1036
1037 * configure.ac: Add check for which library is needed for
1038 dlopen.
1039 * configure: Regenerate.
1040
0c075858
CC
10412013-11-22 Cary Coutant <ccoutant@google.com>
1042
1043 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1044 assembler.
1045 * testsuite/Makefile.in: Regenerate.
1046
f49fe902
L
10472013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1048
1049 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1050 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1051 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1052 (Target_x86_64<size>::Scan::local): Likewise.
1053 (Target_x86_64<size>::Scan::global): Likewise.
1054 (Target_x86_64<size>::Relocate::relocate): Likewise.
1055 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1056 Likewise.
1057 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1058 R_X86_64_PC32_BND.
1059
1060 * testsuite/Makefile.am (check_PROGRAMS): Add
1061 exception_x86_64_bnd_test.
1062 (exception_x86_64_bnd_test_SOURCES): New macro.
1063 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1064 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1065 (exception_x86_64_bnd_test_LDADD): Likewise.
1066 (exception_x86_64_bnd_1.o): New rule.
1067 (exception_x86_64_bnd_2.o): Likewise.
1068 * testsuite/Makefile.in: Regenerated.
1069
9055360d
AM
10702013-11-15 Alan Modra <amodra@gmail.com>
1071
1072 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1073 accessor.
1074 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1075 Only call ppc64_local_entry_offset for 64-bit. Restrict
1076 symval_for_branch lookup to ELFv1.
1077 (Stub_table::add_plt_call_entry): Use unsigned int off.
1078 (Output_data_glink::Address, invalid_address): New.
1079 (Output_data_glink::add_eh_frame): Move out of line. Add
1080 support for ELFv2.
1081 (Output_data_glink::add_global_entry, find_global_entry,
1082 global_entry_address): New functions.
1083 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1084 ge_size): New variables.
1085 (Output_data_glink::set_final_data_size): Add global entry
1086 stub sizing.
1087 (Output_data_glink::do_write): Write global entry stubs.
1088 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1089 parameter. Return true for ELFv2. Adjust callers.
1090 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1091 ELFv1. Similarly for ifunc and dynamic relocation processing
1092 specific to ELFv1. Recognize that symbols are defined on
1093 their plt entries for ELFv2.
1094 (Target_powerpc::symval_for_branch): Assert if called for
1095 ELFv2 or ppc32.
1096 (Target_powerpc::Relocate::relocate): Use global entry plt
1097 stub for symbol value if such exists on ELFv2.
1098 (Target_powerpc::Relocate::relocate): Don't call
1099 symval_for_branch when ELFv2. Do adjust for local entry
1100 offset when ELFv2.
1101 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1102 plt stub for ELFv2.
1103 (Target_powerpc::do_plt_address_for_global): Similarly.
1104
cafdd569
CC
11052013-11-14 Cary Coutant <ccoutant@google.com>
1106
1107 Revert patch -- this did not fix the problem, and there is
1108 no race there.
1109
1110 2013-11-14 Cary Coutant <ccoutant@google.com>
1111
1112 PR gold/14860
1113 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1114 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1115 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1116 updating fde_offsets_.
1117 (Eh_frame_hdr::lock_): New data member.
1118
94e49e16
CC
11192013-11-14 Cary Coutant <ccoutant@google.com>
1120
1121 * dwp.cc (Dwo_file_entry): New type.
1122 (File_list): Use Dwo_file_entry.
1123 (Dwo_file::verify): New function.
1124 (Dwo_file::verify_dwo_list): New function.
1125 (Dwo_file::sized_verify_dwo_list): New function.
1126 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1127 list.
1128 (Dwp_options): New enum type.
1129 (dwp_options): Add --verify-only.
1130 (usage): Likewise.
1131 (main): Likewise.
1132 * dwp.h (gold_info): Add declaration.
1133
7cdd7d57
CC
11342013-11-14 Cary Coutant <ccoutant@google.com>
1135
1136 PR gold/14860
1137 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1138 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1139 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1140 updating fde_offsets_.
1141 (Eh_frame_hdr::lock_): New data member.
1142
1d946cb3
CC
11432013-11-06 Cary Coutant <ccoutant@google.com>
1144
1145 PR gold/15758
1146 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1147 before reloc sections.
1148
4f65b40e
AM
11492013-11-04 Alan Modra <amodra@gmail.com>
1150
1151 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1152 (Symbol::needs_dynamic_reloc): Test new flag.
1153 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1154 (Target_powerpc::Scan::get_reference_flags): Add target param.
1155 Return FUNC_DESC_ABI for 64-bit ELFv1.
1156 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1157 call.
1158 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1159 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1160
908794a9
CC
11612013-10-31 Cary Coutant <ccoutant@google.com>
1162
1163 Restore support for dwp v2 DWARF package file format.
1164
1165 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1166 tu_length parameter. Adjust all callers.
1167 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1168 * dwp.cc: Include dwarf.h.
1169 (Section_bounds): New struct type.
1170 (Unit_set): New struct type.
1171 (Dwo_file::Dwo_file): Initialize new data member.
1172 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1173 Combine and rename to...
1174 (Dwo_file::read_unit_index): ...this.
1175 (Dwo_file::sized_read_compunit_index)
1176 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1177 (Dwo_file::sized_read_unit_index): ...this.
1178 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1179 parameters; add section_id parameter.
1180 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1181 (Dwo_file::add_unit_set): ...this.
1182 (Dwo_file::shndx_map_): Remove.
1183 (Dwo_file::sect_offsets_): New data member.
1184 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1185 (Dwp_output_file::add_section): Rename to...
1186 (Dwp_output_file::add_contribution): ...this.
1187 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1188 (Dwp_output_file::add_tu_set): Likewise.
1189 (Dwp_output_file::Contribution): New type.
1190 (Dwp_output_file::Section::contributions): New data member.
1191 (Dwp_output_file::Cu_or_tu_set): Remove.
1192 (Dwp_output_file::Section::Section): New ctor.
1193 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1194 (Dwp_output_file::Dwp_index::Section_table): New type.
1195 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1196 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1197 parameter.
1198 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1199 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1200 (Dwp_output_file::Dwp_index::section_table): New member function.
1201 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1202 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1203 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1204 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1205 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1206 (Dwp_output_file::Dwp_index::section_table_): New data member.
1207 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1208 (Dwp_output_file::add_output_section): New member function.
1209 (Dwp_output_file::write_new_section): New member function.
1210 (Dwp_output_file::write_contributions): New member function.
1211 (Dwp_output_file::section_id_map_): New data member.
1212 (class Dwo_id_info_reader): Remove.
1213 (class Unit_reader): New class.
1214 (get_dwarf_section_name): New function.
1215 (Dwo_file::read_executable): Adjust initializations of class data.
1216 (Dwo_file::read): Add support for v2 package file format.
1217 (Dwo_file::read_unit_index): Likewise.
1218 (Dwo_file::sized_read_unit_index): Likewise.
1219 (Dwo_file::copy_section): Likewise.
1220 (Dwo_file::add_unit_set): Likewise.
1221 (Dwp_output_file::add_output_section): Likewise.
1222 (Dwp_output_file::add_contribution): Likewise.
1223 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1224 for empty slot.
1225 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1226 file format.
1227 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1228 slot.
1229 (Dwp_output_file::initialize): Remove unused function.
1230 (Dwp_output_file::finalize): Add support for v2 package file format.
1231 (Dwp_output_file::write_index): Likewise.
1232 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1233 function prototype.
1234
2500c017
CC
12352013-10-31 Cary Coutant <ccoutant@google.com>
1236
1237 * configure.ac: Fix check for -fmerge-constants.
1238 * configure.ac: Regenerate.
1239
dd0845d7
RM
12402013-10-30 Roland McGrath <mcgrathr@google.com>
1241
1242 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1243 Correct 9-byte nop sequence to match what the assembler generates.
1244
b4f7960d
AM
12452013-10-30 Alan Modra <amodra@gmail.com>
1246
1247 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1248 ppc64_local_entry_offset, ppc64_local_entry_offset,
1249 do_read_symbols): New functions.
1250 (Powerpc_relobj::e_flags_, st_other_): New vars.
1251 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1252 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1253 (Powerpc_relobj::e_flags_): New var.
1254 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1255 and adjust for ELFv2.
1256 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1257 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1258 (Powerpc_dynobj::do_find_special_sections): Likewise.
1259 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1260 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1261 to ELFv2 local entry.
1262 (Target_powerpc::do_relax): No thread safe barriers needed for
1263 ELFv2.
1264 (Output_data_plt_powerpc::initial_plt_entry_size_,
1265 plt_entry_size): Delete. Replace all uses with
1266 first_plt_entry_offset() and plt_entry_size().
1267 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1268 reserved_size parm. Update callers.
1269 (Output_data_plt_powerpc::entry_count): Update.
1270 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1271 and use Target_powerpc::first_plt_entry_offset().
1272 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1273 rename to plt_entry_size.
1274 (Output_data_plt_powerpc::add_ifunc_entry,
1275 add_local_ifunc_entry): Adjust reloc for ELFv2.
1276 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1277 (glink_eh_frame_fde_64v2): New.
1278 (Stub_table::plt_call_size): Support ELFv2 sizing.
1279 (Output_data_glink::add_eh_frame): Use the new FDE.
1280 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1281 (Stub_table::do_write): Write ELFv2 stubs and glink.
1282 (Target_powerpc::Relocate::relocate): Replaces nop after call
1283 with ld 2,24(1) and adjust local offset destination for ELFv2.
1284
f9c6b907
AM
12852013-10-30 Alan Modra <amodra@gmail.com>
1286
1287 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1288 (Target_powerpc::Scan::global, local): Likewise.
1289 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1290 on all ppc64 @h and @ha relocs.
1291
e84fe78f
AM
12922013-10-14 Alan Modra <amodra@gmail.com>
1293
1294 * output.h (Output_data_got::add_constant): Tidy.
1295 (Output_data_got::add_constant_pair): New function.
1296 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1297 methods used so as to first call reserve_ent().
1298
679e4abf
RM
12992013-10-11 Roland McGrath <mcgrathr@google.com>
1300
44dcb735
RM
1301 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1302 add_got_entry and add_got_entry_pair.
1303
13323c49
RM
1304 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1305 (HAVE_PUBNAMES): Likewise.
1306 * configure: Regenerate.
1307
1496b446
RM
1308 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1309 * testsuite/Makefile.in: Regenerate.
1310
cc84c10b
RM
1311 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1312 Remove const from declaration.
1313 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1314 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1315 * output.h (Output_file_header): Remove const from member target_
1316 and corresponding constructor argument.
1317 * output.cc (Output_file_header::Output_file_header): Update prototype.
1318 (Output_file_header::do_sized_write): Use this->target_ in place
1319 of parameters()->target().
1320
52f66a2c
RM
1321 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1322
2b64b551
RM
1323 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1324 * configure: Regenerate.
1325 * Makefile.in: Regenerate.
1326 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1327 * testsuite/merge_string_literals_2.c: Likewise.
1328 * testsuite/Makefile.am
1329 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1330 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1331 literal -fmerge-constants.
1332 * testsuite/Makefile.in: Regenerate.
1333
43819297
RM
1334 * i386.cc (Target_i386): Remove unused member dynbss_.
1335 * arm.cc (Target_arm): Likewise.
1336 * powerpc.cc (Target_powerpc): Likewise.
1337 * sparc.cc (Target_sparc): Likewise.
1338 * tilegx.cc (Target_tilegx): Likewise.
1339 * x86_64.cc (Target_x86_64): Likewise.
1340 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1341 type_signature_, type_offset_.
1342 * plugin.h (Plugin_hook): Remove unused member layout_.
1343 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1344 mapfile_.
1345 (Read_member): Remove unused members input_objects_, symtab_,
1346 mapfile_, layout_.
1347 (Check_library): Remove unused member symtab_.
1348 * archive.h (Lib_group): Remove unused member lib_.
1349 * archive.cc (Lib_group::Lib_group): Update initializer.
1350 * incremental.h (Incremental_binary): Remove unused member target_.
1351 (Incremental_script_entry): Removed unused member script_.
1352 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1353 * icf.h (Icf): Remove unused member num_tracked_relocs.
1354
39d9ead7
RM
1355 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1356 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1357 its only use.
1358 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1359
679e4abf
RM
1360 * archive.h: Use struct rather than class for forward declaration
1361 of Read_symbols_data.
1362
54de2ea6
CC
13632013-10-07 Cary Coutant <ccoutant@google.com>
1364
1365 PR gold/16010
1366 * testsuite/Makefile.am (icf_test): Fix dependencies.
1367 (icf_safe_test): Likewise.
1368 (icf_safe_so_test): Likewise.
1369 (large_symbol_alignment): Add empty _LDADD rule.
1370 * testsuite/Makefile.in: Regenerate.
1371
b14016f0
L
13722013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1373
1374 PR gold/15927
1375 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1376 relocation for R_X86_64_32 on x32.
1377
eb426534
RM
13782013-08-27 Roland McGrath <mcgrathr@google.com>
1379
1380 * output.cc (Output_segment::set_section_addresses): Take new
1381 Target* argument. If target->isolate_execinstr() and the segment
1382 is executable and starts at a target->abi_pagesize() boundary,
1383 pad its end out to a target->abi_pagesize() boundary with code fill.
1384 * output.h (Output_segment::set_section_addresses): Update decl.
1385 * layout.h (Layout::check_output_data_for_reset_values): Take new
1386 argument RELAX_OUTPUTS.
1387 (Layout): New member relax_output_list_.
1388 (Layout::add_relax_output): New method.
1389 * layout.cc (Layout::Layout): Update constructor.
1390 (Layout::reset_relax_output): New method.
1391 (Layout::clean_up_after_relaxation): Call it.
1392 (Layout::prepare_for_relaxation): Update caller.
1393 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1394 Call reset_relax_output before re-processing segments for
1395 isolate_execinstr case.
1396 (Layout::write_data): Handle relax_output_list_.
1397 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1398 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1399
9aff4b7a
NC
14002013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1401
1402 PR binutils/15834
1403 * object.h: Fix typos.
1404
93f8221c
RM
14052013-08-16 Roland McGrath <mcgrathr@google.com>
1406
1407 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1408 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1409
e44c3715
CC
14102013-08-07 Cary Coutant <ccoutant@google.com>
1411
1412 Revert support for v2 DWP files:
1413
1414 2013-03-01 Cary Coutant <ccoutant@google.com>
1415
1416 Add dwp support for v2 DWARF package file format.
1417 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1418 tu_length parameter. Adjust all callers.
1419 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1420 * dwp.cc: Include dwarf.h.
1421 (Section_bounds): New struct type.
1422 (Unit_set): New struct type.
1423 (Dwo_file::Dwo_file): Initialize new data member.
1424 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1425 Combine and rename to...
1426 (Dwo_file::read_unit_index): ...this.
1427 (Dwo_file::sized_read_compunit_index)
1428 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1429 (Dwo_file::sized_read_unit_index): ...this.
1430 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1431 parameters; add section_id parameter.
1432 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1433 (Dwo_file::add_unit_set): ...this.
1434 (Dwo_file::shndx_map_): Remove.
1435 (Dwo_file::sect_offsets_): New data member.
1436 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1437 (Dwp_output_file::add_section): Rename to...
1438 (Dwp_output_file::add_contribution): ...this.
1439 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1440 (Dwp_output_file::add_tu_set): Likewise.
1441 (Dwp_output_file::Contribution): New type.
1442 (Dwp_output_file::Section::contributions): New data member.
1443 (Dwp_output_file::Cu_or_tu_set): Remove.
1444 (Dwp_output_file::Section::Section): New ctor.
1445 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1446 (Dwp_output_file::Dwp_index::Section_table): New type.
1447 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1448 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1449 parameter.
1450 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1451 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1452 (Dwp_output_file::Dwp_index::section_table): New member function.
1453 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1454 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1455 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1456 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1457 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1458 (Dwp_output_file::Dwp_index::section_table_): New data member.
1459 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1460 (Dwp_output_file::add_output_section): New member function.
1461 (Dwp_output_file::write_new_section): New member function.
1462 (Dwp_output_file::write_contributions): New member function.
1463 (Dwp_output_file::section_id_map_): New data member.
1464 (class Dwo_id_info_reader): Remove.
1465 (class Unit_reader): New class.
1466 (get_dwarf_section_name): New function.
1467 (Dwo_file::read_executable): Adjust initializations of class data.
1468 (Dwo_file::read): Add support for v2 package file format.
1469 (Dwo_file::read_unit_index): Likewise.
1470 (Dwo_file::sized_read_unit_index): Likewise.
1471 (Dwo_file::copy_section): Likewise.
1472 (Dwo_file::add_unit_set): Likewise.
1473 (Dwp_output_file::add_output_section): Likewise.
1474 (Dwp_output_file::add_contribution): Likewise.
1475 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1476 for empty slot.
1477 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1478 file format.
1479 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1480 slot.
1481 (Dwp_output_file::initialize): Remove unused function.
1482 (Dwp_output_file::finalize): Add support for v2 package file format.
1483 (Dwp_output_file::write_index): Likewise.
1484 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1485 function prototype.
1486
c6905c28
CC
14872013-07-31 Cary Coutant <ccoutant@google.com>
1488
1489 * object.cc (Sized_relobj::do_output_section_address): New function.
1490 (Sized_relobj): Instantiate explicitly.
1491 * object.h (Object::output_section_address): New function.
1492 (Object::do_output_section_address): New function.
1493 (Sized_relobj::do_output_section_address): New function.
1494 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1495
14962013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 1497 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
1498
1499 * parameters.cc (Parameters::entry): Return target-specific entry
1500 symbol name.
1501 * target.h (Target::entry_symbol_name): New function.
1502 (Target_info::entry_symbol_name): New data member.
1503
1504 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1505 * i386.cc (Target_i386::i386_info): Likewise.
1506 (Target_i386_nacl::i386_nacl_info): Likewise.
1507 * sparc.cc (Target_sparc::sparc_info): Likewise.
1508 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1509 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1510 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1511 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1512
234d4ab8
SA
15132013-07-22 Sterling Augustine <saugustine@google.com>
1514
1515 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1516 Convert parameter shndx to local variable. Add parameters symtab
1517 and symtab_size. Scan over section names. Find relocation
1518 section corresponding to current section. Create and initialize
1519 reloc_mapper_ and reloc_type_.
1520 (Dwarf_pubnames_table::read_header): Add assertion. Change
1521 unit_length to off_t. Initialize member unit_length_. Fill in field
1522 cu_offset_.
1523 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1524 Initialize new fields unit_length_ and cu_offset_.
1525 (Dwarf_pubnames_table::read_section): Update prototype.
1526 (Dwarf_pubnames_table::cu_offset): New member function.
1527 (Dwarf_pubnames_table::subsection_size): Likewise.
1528 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1529 New fields.
1530 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1531 member functions public.
1532 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1533 Update comment. Rework logic. Move repeated parts to...
1534 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1535 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1536 pubtypes_table_, and stmt_list_offset.
1537 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1538 Gdb_index::find_pubtype_offset,
1539 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1540 (Gdb_index::pubnames_read): Update prototype and rework logic.
1541 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1542 Forward declare.
1543 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1544 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1545 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1546 Gdb_index::map_pubtable_to_dies):
1547 Declare functions.
1548 (Gdb_index::pubnames_read): Update declaration.
1549 (Gdb_index::Pubname_offset_map): New type.
1550 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1551 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1552 Gdb_index::stmt_list_offset): Declare.
1553 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1554 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1555 Gdb_index::pubtypes_offset_): Remove.
1556
a3ed37d8
RM
15572013-07-19 Roland McGrath <mcgrathr@google.com>
1558
1559 * options.h (General_options): Add -Trodata-segment option.
1560 * parameters.cc (Parameters::check_rodata_segment): New function.
1561 (Parameters::set_target_once): Call it.
1562 * parameters.h (Parameters): Declare it (private member function).
1563 * layout.cc (load_seg_unusable_for_headers): New function, broken
1564 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1565 then validate rodata segment rather than text segment.
1566 (relaxation_loop_body): Call that.
1567 (is_text_segment): New function. Don't admit a non-executable
1568 segment if TARGET->isolate_execinstr().
1569 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1570
eb5b4ded
CC
15712013-07-15 Shawn Landden <shawnlandden@gmail.com>
1572
1573 PR gold/15070
1574 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1575 * nacl.h (Sniff_file::View::View): Request aligned view.
1576
4d5effb9
CC
15772013-07-11 Cary Coutant <ccoutant@google.com>
1578
1579 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1580 correct BRLT entry size.
1581
ba8ca3e7
AM
15822013-07-03 Alan Modra <amodra@gmail.com>
1583
1584 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1585 comment.
1586
267257d2
CC
15872013-07-01 Cary Coutant <ccoutant@google.com>
1588
1589 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1590 reloc_type_.
1591 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1592 (Dwarf_ranges_table::lookup_reloc): New function.
1593 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1594 reloc_type_.
1595 (Dwarf_ranges_table::lookup_reloc): New function.
1596 (Dwarf_ranges_table::reloc_type_): New data member.
1597
06f30c9d
CC
15982013-06-27 Jing Yu <jingyu@google.com>
1599
1600 PR gold/15662
1601 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1602 function.
1603 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1604 (Target_powerpc::do_relax): Call the above.
1605
a2d7bf59
AM
16062013-06-27 Cary Coutant <ccoutant@google.com>
1607
1608 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1609 on garbage collected .opd section.
1610
16112013-06-27 Alan Modra <amodra@gmail.com>
1612
1613 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1614 is non-zero.
1615 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1616 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1617
32364e50
CC
16182013-06-14 Cary Coutant <ccoutant@google.com>
1619
1620 * resolve.cc (Symbol::override_base): Don't override st_type
1621 from plugin placeholder symbols.
1622 (Symbol_table::resolve): Likewise.
1623 (Symbol_table::should_override): Don't complain about TLS mismatch
1624 if the TO symbol is a plugin placeholder.
1625 * testsuite/Makefile.am (plugin_test_tls): New test.
1626 * testsuite/Makefile.in: Regenerate.
1627 * testsuite/plugin_test_tls.sh: New test script.
1628 * testsuite/two_file_test_2_tls.cc: New test source.
1629 * testsuite/two_file_test_tls.cc: New test source.
1630
7fb47cc9
CC
16312013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1632
1633 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1634 the maximum segment alignment is larger than the page size.
1635 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1636 correctly aligns the symbols with large alignemnt.
1637 * testsuite/Makefile.in: Regenerate.
1638 * testsuite/large_symbol_alignment.cc: New file.
1639
6934001a
CC
16402013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1641 Sriraman Tallam <tmsriram@google.com>
1642
1643 * options.h (sort_section): New option.
1644 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1645 Rename from Input_section_sort_section_name_special_ordering_compare.
1646 (Input_section_sort_section_name_compare): New struct.
1647 * output.cc (Output_section::Input_section_sort_section_name_compare::
1648 operator()): New function.
1649 (Output_section::sort_attached_input_sections): Use new sort function
1650 for .text if --sort-section=name is specified.
1651 * layout.cc (Layout::make_output_section):
1652 Add sorting by name when --sort-section=name is specified.
1653 * testsuite/Makefile.am (text_section_grouping): Test option
1654 --sort-section=name.
1655 * testsuite/Makefile.in: Regenerate.
1656 * testsuite/section_sorting_name.cc: New file.
1657 * testsuite/section_sorting_name.sh: New file.
1658
93acabad
CC
16592013-05-21 Cary Coutant <ccoutant@google.com>
1660
1661 * symtab.h (Symbol::is_cxx_vtable): New function.
1662 * target-reloc.h (relocate_section): Check for vtable symbol.
1663 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1664 * testsuite/Makefile.in: Regenerate.
1665 * testsuite/missing_key_func.cc: New test source.
1666 * testsuite/missing_key_func.sh: New test script.
1667
60e8b3fc
CC
16682013-05-21 Cary Coutant <ccoutant@google.com>
1669
2b64b551
RM
1670 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1671 type of enclosing symbol.
1672 (Relocate_info::location): Check symbol type when describing symbol.
1673 * object.h (Symbol_location_info): Remove unused line_number;
1674 add enclosing_symbol_type.
1675 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 1676
9df9de2c
CC
16772013-05-13 Cary Coutant <ccoutant@google.com>
1678
2b64b551
RM
1679 * configure.ac: Export DEFAULT_TARGET.
1680 * configure: Regenerate.
1681 * Makefile.in: Regenerate.
1682 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1683 * testsuite/Makefile.in: Regenerate.
1684 * testsuite/debug_msg.sh: Delete duplicate tests.
1685 Don't check undef_int error message match for powerpc where the
1686 source file and line number aren't available.
9df9de2c 1687
bbc5ae17
RM
16882013-05-10 Roland McGrath <mcgrathr@google.com>
1689
1690 * options.h (General_options): Add --rosegment-gap option.
1691 * options.cc (finalize): --rosegment-gap implies --rosegment.
1692 * layout.cc (set_segment_offsets): Let user option override
1693 target->rosegment_gap().
1694
0c6e6c39
RM
16952013-05-10 Roland McGrath <mcgrathr@google.com>
1696
1697 * options.h (General_options): Remove leading space from help
1698 messages for -nostdlib and --rosegment.
1699
cde7cb01
MR
17002013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1701
1702 PR ld/15365
1703 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1704
f31ae5b8
AM
17052013-05-03 Alan Modra <amodra@gmail.com>
1706
1707 * merge.cc (Output_merge_string::do_add_input_section): Correct
1708 scan for number of strings. Rename vars to avoid shadowing.
1709 Include missing terminator in input_size_.
1710
d3a7cd45
L
17112013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1712
1713 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1714 Restore empty string handling.
1715
6ad3daba
CC
17162013-05-01 Cary Coutant <ccoutant@google.com>
1717
1718 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1719 uninitialized warning.
1720
e31908b6
CC
17212013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1722
1723 * output.cc (Output_section::add_merge_input_section): Allow
1724 to merge sections if the alignment is more than character size.
1725 * merge.h (Output_merge_string::Output_merge_string): Remove
1726 assert.
1727 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1728 only not-null strings. Check the alignment of strings.
1729 * stringpool.h
1730 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1731 alignment as the argument.
1732 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1733 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1734 Align non-zero length strings according to the addralign_.
1735 (Stringpool_template<Stringpool_char>::set_string_offsets):
1736 Updating offsets according to the given alignment.
1737 * testsuite/Makefile.am (text_section_grouping): Test if string
1738 literals are getting merged.
1739 * testsuite/Makefile.in: Regenerate.
1740 * testsuite/merge_string_literals_1.c: New file.
1741 * testsuite/merge_string_literals_2.c: Ditto.
1742 * testsuite/merge_string_literals.sh: Ditto.
1743
0e804863
ILT
17442013-04-26 Ian Lance Taylor <iant@google.com>
1745
1746 * target-reloc.h (relocate_section): If the reloc offset is out of
1747 range, pass VIEW as NULL to relocate.relocate.
1748 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1749 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1750 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1751 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1752 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1753 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1754
e7c5ea40
CC
17552013-04-26 Geoff Pike <gpike@chromium.org>
1756
1757 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1758 * layout.cc (Hash_task): New class.
1759 (Layout::queue_build_id_tasks): New function.
1760 (Layout::write_build_id): Handle single-thread portion of build ID
1761 computation. (In some cases, all of it is single-threaded.) Replace
1762 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1763 functionality in fewer lines of code.
1764 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1765 * options.h (General_options): make "--build-id" default to tree
1766 rather than sha1. Add two new options related to --build-id=tree:
1767 --build-id-chunk-size-for-treehash and
1768 --build-id-min-file-size-for-treehash.
1769 * Makefile.am: add testing of --build-id=tree and related new options
1770 (these tests will be invoked by "make check").
1771 * Makefile.in: Regenerate.
1772
49926cd0
AM
17732013-04-25 Alan Modra <amodra@gmail.com>
1774
1775 * configure.tgt: Add powerpcle and powerpc64le.
1776
a4034750
AM
17772013-04-22 Alan Modra <amodra@gmail.com>
1778
1779 PR gold/15355
1780 * layout.cc (Layout::segment_precedes): Allow more than one
1781 segment with the same type and flags.
1782
e79c84aa
CC
17832013-04-15 Cary Coutant <ccoutant@google.com>
1784
1785 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1786 allocate space in file for BSS sections.
1787
2199fbe7
CC
17882013-04-15 Cary Coutant <ccoutant@google.com>
1789
1790 * script-sections.cc (Orphan_output_section): Reset address
1791 to zero after each orphaned section for relocatable links.
1792
502e8a84
CC
17932013-04-15 Cary Coutant <ccoutant@google.com>
1794
a4034750
AM
1795 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1796 section starting address for relocatable link.
1797 * testsuite/Makefile.am (script_test_11): New test.
1798 * testsuite/Makefile.in: Regenerate.
1799 * testsuite/script_test_11.c: New source file.
1800 * testsuite/script_test_11.t: New linker script.
502e8a84 1801
0cfdc767
AM
18022013-04-13 Alan Modra <amodra@gmail.com>
1803
1804 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1805 owner when sections are not adjacent and exceed group size.
1806 (Target_powerpc::group_sections): Handle corner case.
1807 (Target_powerpc::Branch_info::make_stub): Handle case where
1808 stub table doesn't exist due to branches in non-exec sections.
1809 (Target_powerpc::Relocate::relocate): Likewise.
1810
6830ee24
AM
18112013-04-11 Alan Modra <amodra@gmail.com>
1812
1813 PR gold/15354
1814 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1815 .branch_lt to match bfd ld. Adjust comments throughout file.
1816
54a3d865
ILT
18172013-04-04 Ian Lance Taylor <iant@google.com>
1818
1819 GCC PR c++/56840
1820 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1821 sections before checking whether they are included in the link.
1822
9993ba11
ST
18232013-03-29 Sriraman Tallam <tmsriram@google.com>
1824
1825 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1826 object before calling the plugin claim_file handler. Pass the elf
1827 object of the archive to the plugin. Delete the elf object if the
1828 plugin claims the file.
1829
ebacd51e
AM
18302013-03-21 Alan Modra <amodra@gmail.com>
1831
1832 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1833 segment when omagic.
1834
117be58f
AM
18352013-03-21 Alan Modra <amodra@gmail.com>
1836
1837 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1838 comparison warning.
1839 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1840 uninitialized" warning.
1841
32e2b61d
AM
18422013-03-20 Alan Modra <amodra@gmail.com>
1843
1844 * symtab.h (Symbol::clear_version): New function.
1845 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1846 is_needed by weak references. Clear version for symbols defined
1847 in as-needed objects that are not needed.
1848
b3ccdeb5
AM
18492013-03-15 Alan Modra <amodra@gmail.com>
1850
1851 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1852 static and public. Add report_err param. Return false for data refs.
1853 (Target_powerpc::rela_dyn_section): New overloaded function.
1854 (Target_powerpc::plt_, iplt_): Elucidate.
1855 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1856 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1857 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1858 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1859 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1860 push_branch and make_plt_entry for ifunc syms when
1861 reloc_needs_plt_for_ifunc.
1862 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1863 for ifunc unless reloc_needs_plt_for_ifunc.
1864
ad3d8a2f
AM
18652013-03-15 Alan Modra <amodra@gmail.com>
1866
1867 * gc.h (gc_process_relocs): Don't look through function descriptors.
1868 * icf.cc (get_section_contents): Do so here instead.
1869
4d9aa155
AM
18702013-03-13 Alan Modra <amodra@gmail.com>
1871
1872 * powerpc.cc (is_branch_reloc): Forward declare.
1873 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
1874 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
1875 false for 64-bit, true for 32-bit non-branch relocs.
1876 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
1877 * testsuite/Makefile.am (icf_test): Use linker map file instead of
1878 nm output.
1879 (icf_safe_test): Generate linker map file as well as nm output.
1880 (icf_safe_so_test): Likewise.
1881 * testsuite/Makefile.in: Regenerate.
1882 * testsuite/icf_test.sh: Parse linker map file to determine
1883 section folding.
1884 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
1885 * testsuite/icf_safe_so_test.sh: Likewise.
1886 (X86_32_or_ARM_specific_safe_fold): Merge into..
1887 (arch_specific_safe_fold): ..this.
1888 (X86_64_specific_safe_fold): Delete unused function.
1889
57420c20
AM
18902013-03-12 Alan Modra <amodra@gmail.com>
1891
1892 * gc.h (gc_process_relocs): Look through function descriptors
1893 to determine shndx, symvalue and addend used by ICF. Tidy
1894 variable duplication.
1895
dc3714f3
AM
18962013-03-11 Alan Modra <amodra@gmail.com>
1897
1898 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
1899 * layout.cc (Layout_task_runner::run): ..to here.
1900 * symtab.h (struct Symbol_location): Extract from..
1901 (class Symbol_table): ..here.
1902 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
1903 * target.h (class Target): Add function_location and
1904 do_function_location functions.
1905 (class Sized_target): Add do_function_location.
1906 * object.h (class Sized_relobj_file): Move find_shdr..
1907 (class Object): ..to here.
1908 * object.cc: Likewise. Update to suit. Instantiate.
1909 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
1910 * powerpc.cc (class Powerpc_dynobj): New.
1911 (Target_powerpc::do_function_location): New function.
1912 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
1913 (Powerpc_dynobj::do_read_symbols): New function.
1914 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
1915
956b03bb
ILT
19162013-03-08 Ian Lance Taylor <iant@google.com>
1917
1918 * options.cc (General_options::string_to_object_format): Accept
1919 "default".
1920
4bead2d5
AM
19212013-03-08 Alan Modra <amodra@gmail.com>
1922
1923 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
1924 pointer to Post_fde.
1925 (struct Post_fde): Move definition to here..
1926 * ehframe.cc (struct Post_fde): ..from here.
1927 (Cie::write): Don't alloc Post_fde.
1928 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
1929
02e60bf7
AM
19302013-03-07 Alan Modra <amodra@gmail.com>
1931
1932 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
1933 relocation referencing .LC0.
1934 * testsuite/discard_locals_test.sh: Remove FIXMEs.
1935
8343f03a
AM
19362013-03-07 Alan Modra <amodra@gmail.com>
1937
1938 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
1939 always_inline. Add assembly for powerpc to avoid GOT.
1940
3366d57c
AM
19412013-03-07 Alan Modra <amodra@gmail.com>
1942
1943 * testsuite/script_test_10.sh: Don't test .bss section
1944 header number.
1945
6c77229c
AM
19462013-03-06 Alan Modra <amodra@gmail.com>
1947
1948 * powerpc.cc (class Powerpc_relobj): Move some member functions.
1949 (Target_powerpc::symval_for_branch): Add symtab param. Update
1950 all callers. Handle folded sections.
1951 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
1952 to Powerpc_relobj.
1953 (Global_symbol_visitor_opd::operator()): Likewise.
1954
a39e4af6
AM
19552013-03-04 Alan Modra <amodra@gmail.com>
1956
1957 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
1958 * testsuite/Makefile.in: Regenerate.
1959
d5834edb
CC
19602013-03-01 Cary Coutant <ccoutant@google.com>
1961
1962 Add dwp support for v2 DWARF package file format.
1963 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1964 tu_length parameter. Adjust all callers.
1965 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1966 * dwp.cc: Include dwarf.h.
1967 (Section_bounds): New struct type.
1968 (Unit_set): New struct type.
1969 (Dwo_file::Dwo_file): Initialize new data member.
1970 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1971 Combine and rename to...
1972 (Dwo_file::read_unit_index): ...this.
1973 (Dwo_file::sized_read_compunit_index)
1974 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1975 (Dwo_file::sized_read_unit_index): ...this.
1976 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1977 parameters; add section_id parameter.
1978 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1979 (Dwo_file::add_unit_set): ...this.
1980 (Dwo_file::shndx_map_): Remove.
1981 (Dwo_file::sect_offsets_): New data member.
1982 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1983 (Dwp_output_file::add_section): Rename to...
1984 (Dwp_output_file::add_contribution): ...this.
1985 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1986 (Dwp_output_file::add_tu_set): Likewise.
1987 (Dwp_output_file::Contribution): New type.
1988 (Dwp_output_file::Section::contributions): New data member.
1989 (Dwp_output_file::Cu_or_tu_set): Remove.
1990 (Dwp_output_file::Section::Section): New ctor.
1991 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1992 (Dwp_output_file::Dwp_index::Section_table): New type.
1993 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1994 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1995 parameter.
1996 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1997 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1998 (Dwp_output_file::Dwp_index::section_table): New member function.
1999 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2000 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2001 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2002 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2003 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2004 (Dwp_output_file::Dwp_index::section_table_): New data member.
2005 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2006 (Dwp_output_file::add_output_section): New member function.
2007 (Dwp_output_file::write_new_section): New member function.
2008 (Dwp_output_file::write_contributions): New member function.
2009 (Dwp_output_file::section_id_map_): New data member.
2010 (class Dwo_id_info_reader): Remove.
2011 (class Unit_reader): New class.
2012 (get_dwarf_section_name): New function.
2013 (Dwo_file::read_executable): Adjust initializations of class data.
2014 (Dwo_file::read): Add support for v2 package file format.
2015 (Dwo_file::read_unit_index): Likewise.
2016 (Dwo_file::sized_read_unit_index): Likewise.
2017 (Dwo_file::copy_section): Likewise.
2018 (Dwo_file::add_unit_set): Likewise.
2019 (Dwp_output_file::add_output_section): Likewise.
2020 (Dwp_output_file::add_contribution): Likewise.
2021 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2022 for empty slot.
2023 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2024 file format.
2025 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2026 slot.
2027 (Dwp_output_file::initialize): Remove unused function.
2028 (Dwp_output_file::finalize): Add support for v2 package file format.
2029 (Dwp_output_file::write_index): Likewise.
2030 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2031 function prototype.
2032
a68a081d
CC
20332013-03-01 Cary Coutant <ccoutant@google.com>
2034
2035 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2036 function into class definition in header file.
2037 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2038 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2039 New function.
2040 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2041
9d5781f8
AM
20422013-02-28 Alan Modra <amodra@gmail.com>
2043
2044 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2045 * target.cc (Target::do_plt_fde_location): New function.
2046 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2047 accessor function, and constructor param.
2048 (struct Post_fde, Post_fdes): Declare.
2049 (Cie::write): Add post_fdes param.
2050 * ehframe.cc (Fde::write): Use plt_fde_location.
2051 (struct Post_fde): Define.
2052 (Cie::write): Stash FDEs added post merge mapping.
2053 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2054 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2055 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2056 other FDEs.
2057 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2058 (Target_powerpc::has_glink): New function.
2059 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2060 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2061 glink_eh_frame_fde_32, default_fde): New data.
2062 (Stub_table::eh_frame_added_): New var.
2063 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2064 Make const.
2065 (Stub_table::add_eh_frame): New function.
2066 (Output_data_glink::add_eh_frame): New function.
2067 (Target_powerpc::make_glink_section): Call add_eh_frame.
2068
214383dd
ILT
20692013-02-15 Ian Lance Taylor <iant@google.com>
2070
2071 * options.h (DEFINE_uint64_alias): Define.
2072 (class General_options): Add -Ttext-segment as an alias for
2073 -Ttext.
2074
91c2b899
AM
20752013-02-15 Alan Modra <amodra@gmail.com>
2076
2077 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2078 (Stub_table::do_write): ..here, two places.
2079 (Stub_table::plt_call_size): Use it here too.
2080
20e2a8aa
ILT
20812013-02-11 Ian Lance Taylor <iant@google.com>
2082
2083 * descriptors.cc (Descriptors::close_all): New function.
2084 * descriptors.h (class Descriptors): Declare close_all.
2085 (close_all_descriptors): New inline function.
2086 * plugin.cc: Include "descriptors.h".
2087 (Plugin_manager::cleanup): Call close_all_descriptors.
2088
8952bc69
AM
20892013-02-06 Alan Modra <amodra@gmail.com>
2090
2091 * README: Update coding style link.
2092
29bd8b6b
CC
20932013-01-28 Cary Coutant <ccoutant@google.com>
2094
a4034750
AM
2095 * dwp.cc (File_list): New typedef.
2096 (Dwo_name_info_reader): New class.
2097 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2098 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2099 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2100 (Dwo_file::read_executable): New function.
2101 (Dwo_file::read): Move common setup code to ...
2102 (Dwo_file::make_object): ... here.
2103 (dwp_options): Add --exec/-e.
2104 (usage): Likewise.
2105 (main): Likewise.
29bd8b6b 2106
c6ac678d
ST
21072013-01-24 Sriraman Tallam <tmsriram@google.com>
2108
2109 * layout.cc (Layout::layout): Check for option text_reorder.
2110 (Layout::make_output_section): Ditto.
2111 * options.h (text_reorder): New option.
2112 * output.cc (Input_section_sort_compare): Remove special ordering
2113 of section names.
2114 (Output_section::
2115 Input_section_sort_section_name_special_ordering_compare::
2116 operator()): New function.
2117 (Output_section::sort_attached_input_sections): Use new sort function
2118 for .text.
2119 * output.h (Input_section_sort_section_name_special_ordering_compare):
2120 New struct.
2121 * testsuite/Makefile.am (text_section_grouping): Test option
2122 --no-text-reorder
2123 * testsuite/Makefile.in: Regenerate.
2124 * testsuite/text_section_grouping.sh: Check order of functions without
2125 default text reordering.
2126
50701cc1
MF
21272013-01-18 Mike Frysinger <vapier@gentoo.org>
2128
2129 * options.h (General_options): Change default to true for new_dtags.
2130
b1b00fcc
MF
21312013-01-18 Mike Frysinger <vapier@gentoo.org>
2132
2133 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2134 when enable_new_dtags is false. Only add DT_RUNPATH when
2135 enable_new_dtags is true.
2136
ec5b8187
AM
21372013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2138
2139 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2140 used in declaration and definition consistent.
2141 (Target_powerpc::symval_for_branch): Ditto.
2142
a880d4c4
ST
21432013-01-16 Sriraman Tallam <tmsriram@google.com>
2144
2145 * testsuite/plugin_final_layout.cc: Fix comment.
2146
7c381248
ST
21472013-01-16 Sriraman Tallam <tmsriram@google.com>
2148
2149 * layout.cc (Layout::layout): Do not do default sorting for
2150 text sections when section ordering is specified.
2151 (make_output_section): Ditto.
2152 * testsuite/plugin_final_layout.cc: Name the function sections
2153 to catch reordering issues.
2154
e2458743
AM
21552013-01-15 Alan Modra <amodra@gmail.com>
2156
2157 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2158 plt-thread-safe.
2159
431ed302
AM
21602013-01-15 Alan Modra <amodra@gmail.com>
2161
2162 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2163 * testsuite/Makefile.in: Regenerate.
2164
0ec6429b
AM
21652013-01-14 Alan Modra <amodra@gmail.com>
2166
2167 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2168 * testsuite/Makefile.in: Regenerate.
2169
0bf402d5
ILT
21702013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2171
36af3926 2172 PR bfd/14430
0bf402d5
ILT
2173 Fix mingw gold build with plugins enabled
2174 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2175 * configure.ac: Export DLOPEN_LIBS and add headers check.
2176 * plugin.cc: Handle non-dlfcn case.
2177 * Makefile.in: Regenerate.
2178 * config.in: Regenerate.
2179 * configure: Regenerate.
2180 * testsuite/Makefile.in: Regenerate.
2181
9e9143bc
ST
21822013-01-09 Sriraman Tallam <tmsriram@google.com>
2183
2184 * output.h (sort_attached_input_sections): Change to be public.
2185 * script-sections.cc
2186 (Output_section_definition::set_section_addresses): Sort
2187 attached input sections according to section order before linker
2188 script assigns section addresses.
2189 (Orphan_output_section::set_section_addresses): Sort
2190 attached input sections according to section order before linker
2191 script assigns section addresses.
2192 * Makefile.am (final_layout.sh): Use a simple linker script to
2193 check if section ordering still works.
2194 * Makefile.in: Regenerate.
2195
679af368
ILT
21962013-01-09 Ben Cheng <bccheng@google.com>
2197
2198 * arm.cc (Target_arm::attributes_accept_div): New function.
2199 (Target_arm::attributes_forbid_div): New function.
2200 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2201 attribute using the same new functions as what bfd/elf32_arm.c
2202 does.
2203
3136a00e
CC
22042013-01-07 Cary Coutant <ccoutant@google.com>
2205
2206 PR gold/14993
2207 * output.cc (Output_section::add_input_section): For incremental
2208 updates, don't track input sections that are allocated from patch
2209 space.
2210
f2a6224b
L
22112013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2212 Ian Lance Taylor <iant@google.com>
2213
2214 PR gold/14897
2215 * configure.ac (--enable-ld): Removed.
2216 (install_as_default): Set to yes only for --enable-gold=default
2217 or --disable-ld.
2218 * configure: Regenerated.
2219
4f46f626
L
22202013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2221
2222 * options.h (General_options): Add -fuse-ld= for GCC linker
2223 option compatibility.
2224
26e4ef59
CC
22252013-01-04 Cary Coutant <ccoutant@google.com>
2226
2227 * configure.ac: Fix typo restoring CXXFLAGS.
2228 * configure: Regenerate.
2229
3d587466
CC
22302013-01-04 Cary Coutant <ccoutant@google.com>
2231
4f46f626
L
2232 * testsuite/Makefile.am (CXXLINK_S): New macro.
2233 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2234 * testsuite/Makefile.in: Regenerate.
3d587466 2235
44db6695
L
22362013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2237
2238 * version.cc (print_version): Update copyright year to 2013.
2239
edcac0c1
ILT
22402012-12-20 Ian Lance Taylor <iant@google.com>
2241
2242 * layout.cc (Layout::special_ordering_of_input_section): New
2243 function.
2244 (Layout::layout): If input section requires special ordering, must
2245 sort input sections.
2246 (Layout::make_output_section): May sort .text input sections.
2247 (Layout::is_section_name_prefix_grouped): Remove.
2248 * layout.h (class Layout): Declare
2249 special_ordering_of_input_section. Don't declare
2250 is_section_name_prefix_grouped.
2251 * output.cc (Output_section::add_input_section): Revert last
2252 change.
2253 (Output_section::Input_section_sort::match_file_name): Don't crash
2254 if called on output section data.
2255 (Output_section::Input_section_sort_compare): Sort based on
2256 special ordering.
2257 (Output_section::Input_section_sort_section_order_index_compare):
2258 Revert last patch.
2259 (Output_section::sort_attached_input_sections): Likewise.
2260
28f2a4ac
ST
22612012-12-18 Sriraman Tallam <tmsriram@google.com>
2262
edcac0c1 2263 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2264 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2265 * output.cc (Output_section::add_input_section): Check if section
2266 name contains special prefix. Keep input sections to sort such
2267 sections.
2268 (Output_section::Input_section_sort_section_order_index_compare
2269 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2270 (Output_section::sort_attached_input_sections): Add condition to
2271 Input_section_entry constructor call.
28f2a4ac
ST
2272 * testsuite/Makefile.am (text_section_grouping): New test.
2273 * testsuite/Makefile.in: Regenerate.
2274 * testsuite/text_section_grouping.cc: New file.
2275 * testsuite/text_section_grouping.sh: New file.
2276
5bf135a7
NC
22772012-12-17 Nick Clifton <nickc@redhat.com>
2278
2279 * Makefile.am: Add copyright notice.
2280 * NEWS: Likewise.
2281 * README: Likewise.
2282 * configure.ac: Likewise.
2283 * ftruncate.c: Likewise.
2284 * Makefile.in: Regenerate.
2285
59965708
CC
22862012-12-14 Cary Coutant <ccoutant@google.com>
2287
a4034750
AM
2288 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2289 --no-as-needed flag.
2290 (exception_separate_shared_12_test): Likewise.
2291 (incremental_copy_test): Likewise.
2292 * testsuite/Makefile.in: Regenerate.
59965708 2293
2a77e2ab
CC
22942012-12-14 Cary Coutant <ccoutant@google.com>
2295
2296 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2297 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2298
e3deeb9c
AM
22992012-12-12 Alan Modra <amodra@gmail.com>
2300
2301 * powerpc.cc (class Track_tls): New.
2302 (class Relocate, class Scan): Inherit Track_tls.
2303 (Target_powerpc::Scan::local, global): Track tls optimization
2304 and avoid creating plt entry for __tls_get_addr if all uses
2305 are optimized away.
2306 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2307
d8f5a274
AM
23082012-12-12 Alan Modra <amodra@gmail.com>
2309
2310 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2311 Replace no_toc_optimize with toc_optimize.
2312 * output.h (Output_section::input_sections): Provide non-const variant.
2313 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2314 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2315 accessors.
2316 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2317 (class Sort_toc_sections): New.
2318 (Target_powerpc::do_finalize_sections): Sort toc sections.
2319 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2320
4c8a1de1
RM
23212012-12-10 Roland McGrath <mcgrathr@google.com>
2322
2323 * testsuite/binary_unittest.cc (read_all): New function.
2324 (Sized_binary_test): Use it instead of ::read.
2325 * fileread.cc (do_read): Don't assume pread always reads the whole
2326 amount in a single call.
2327
edc27beb
AM
23282012-12-10 Alan Modra <amodra@gmail.com>
2329
2330 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2331 Set EM_PPC64 or EM_PPC here.
2332 (Target_selector_powerpc::do_recognize): Delete.
2333
906b9150
AM
23342012-12-10 Alan Modra <amodra@gmail.com>
2335
2336 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2337 stub_table_.
2338 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2339
418c15ae
RM
23402012-12-07 Roland McGrath <mcgrathr@google.com>
2341
2342 * testsuite/binary_unittest.cc (Sized_binary_test):
2343 Use open_descriptor rather than ::open.
2344
decdd3bc
AM
23452012-12-07 Alan Modra <amodra@gmail.com>
2346
2347 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2348 typedef and invalid_address constant.
2349 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2350 instantiate constants.
2351
db399005
ILT
23522012-12-06 Roland McGrath <mcgrathr@google.com>
2353
2354 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2355 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2356 * aclocal.m4: Regenerate.
2357 * configure: Regenerate.
2358 * Makefile.in: Regenerate.
2359 * testsuite/Makefile.in: Regenerate.
2360
aba6bc71
AM
23612012-12-07 Alan Modra <amodra@gmail.com>
2362
2363 * options.h (General_options): Add no_toc_optimize.
2364 * powerpc.cc (ok_lo_toc_insn): New function.
2365 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2366
9e69ed50
AM
23672012-12-06 Alan Modra <amodra@gmail.com>
2368
2369 * options.h (General_options): Add plt_align, plt_static_chain,
2370 plt_thread_safe. Update stub_group_size help text.
2371 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2372 for new plt_thread_safe_ var.
2373 (use_plt_offset): Correct comments.
2374 (Target_powerpc::do_relax): Look for thread creation symbols to
2375 determine default plt_thread_safe value. Clear plt call stubs
2376 as well as branch stubs each iteration.
2377 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2378 insn constants.
2379 (l, hi, ha, write_insn): Move earlier.
2380 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2381 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2382 plt stubs too.
2383 (Stub_table::update_size): Adjust.
2384 (Stub_table::prev_size, set_prev_size): Delete.
2385 (Stub_table::stub_align): Let --plt-align affect result.
2386 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2387 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2388 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2389 (Stub_table::do_write): Support more stub variants.
2390
f43ba157
AM
23912012-12-04 Alan Modra <amodra@gmail.com>
2392
2393 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2394 (Target_powerpc::do_define_standard_symbols): New function.
2395
34171bc5
AM
23962012-12-03 Alan Modra <amodra@gmail.com>
2397
2398 * output.h: Formatting, whitespace.
2399
dc9589e9 24002012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2401
2402 * layout.h (Layout::get_executable_sections): Declare.
2403 * layout.cc (Layout::get_executable_sections): New function.
2404 * arm.cc (Target_arm::group_sections): Use it.
2405 (Arm_output_section::group_sections): Delete now redundant test.
2406 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2407 param to handle relative relocs.
2408 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2409 (Output_data_reloc::add_absolute): Adjust.
2410 (Output_data_reloc::add_relative): New function.
2411 (Output_data::reset_data_size): New function.
2412 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2413 (Output_section::set_addralign): New function.
2414 (Output_section::checkpoint_set_addralign): New function.
2415 (Output_section::clear_section_offsets_need_adjustment): New function.
2416 (Output_section::input_sections): Make public.
2417 * powerpc.cc (class Output_data_brlt_powerpc): New.
2418 (class Stub_table, class Stub_control): New.
2419 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2420 stub_table_, set_stub_table, stub_table): New vectors and accessor
2421 functions.
2422 (Target_powerpc::do_may_relax, do_relax, push_branch,
2423 new_stub_table, stub_tables, brlt_section, group_sections,
2424 add_branch_lookup_table, find_branch_lookup_table,
2425 write_branch_lookup_table, make_brlt_section): New functions.
2426 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2427 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2428 branch_info_): New vars.
2429 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2430 make call stubs here.
2431 (Output_data_glink): Remove all call stub handling from this class.
2432 (Target_powerpc::Scan::local, global): Save interesting branch
2433 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2434 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2435 functions on final link.
2436 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2437 Handle long branch destinations too.
2438 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2439 do_plt_address_for_local): Adjust lookup of plt call stubs.
2440
627b30b7
AM
24412012-11-30 Alan Modra <amodra@gmail.com>
2442
2443 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2444 relocs against protected symbols when building 32-bit shared libs.
2445
40b469d7
AM
24462012-11-30 Alan Modra <amodra@gmail.com>
2447
2448 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2449 param. Call got_section() to make .got. Update all callers
2450 and their callers and so on.
2451
bb66a627
AM
24522012-11-30 Alan Modra <amodra@gmail.com>
2453
2454 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2455 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2456 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2457 value if it already exists.
2458
d2cf1c6c
L
24592012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2460
2461 PR gold/14858
2462 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2463
edccdf7c
RM
24642012-11-14 Roland McGrath <mcgrathr@google.com>
2465
2466 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2467 than bfc instruction for data sandboxing.
2468
6febeb74
AM
24692012-11-08 Alan Modra <amodra@gmail.com>
2470
2471 * po/POTFILES.in: Regenerate.
2472
0a6f1bf2
AM
24732012-11-05 Alan Modra <amodra@gmail.com>
2474
2475 * configure.ac: Apply 2012-09-10 change to config.in here.
2476 * configure: Regenerate.
2477
26a4e9cb
AM
24782012-11-05 Alan Modra <amodra@gmail.com>
2479
2480 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2481 (struct Opd_ent): Use "Address" rather than "Offset".
2482 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2483 (Target_powerpc::got_section): Make public.
2484 (Target_powerpc::scan_relocs): Move code setting symbols..
2485 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2486 Create _SDA_BASE_ only when referenced.
2487
cc928013
RM
24882012-11-02 Roland McGrath <mcgrathr@google.com>
2489
2490 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2491 from last change.
2492
50ed5eb1
RM
24932012-11-01 Roland McGrath <mcgrathr@google.com>
2494
62fe925a
RM
2495 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2496 for offset_in_output_section parameter.
2497 (Sized_target::relocate_special_relocatable): Likewise.
2498 * arm.cc (Target_arm::relocate_relocs): Likewise.
2499 (Target_arm::relocate_special_relocatable): Likewise.
2500 * i386.cc (Target_i386::relocate_relocs): Likewise.
2501 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2502 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2503 * target-reloc.h (relocate_relocs): Likewise.
2504 * testsuite/testfile.cc (Target_test): Likewise.
2505 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2506 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2507
2508 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2509 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2510
2511 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2512 parameter, which is unused in the [!F_SETFD] case.
2513
50ed5eb1
RM
2514 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2515 SYMNDX to off_t before comparing it to this->data_size().
2516 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2517 * incremental.cc (Output_section_incremental_inputs::do_write):
2518 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2519
2cadc0bf
RM
2520 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2521
3bfcb652
NC
25222012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2523
2524 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2525 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2526 in EABI_VER5.
2527
c1a8d56e
CC
25282012-10-29 Cary Coutant <ccoutant@google.com>
2529
2530 * dwp.cc (usage): Add file and exit status parameters;
2531 add --help and --version options.
2532 (print_version): New function.
2533 (main): Add --help and --version options.
2534
b2490a7b
L
25352012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2536
2537 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2538 final_layout_sequence.txt.
2539 * testsuite/Makefile.in: Regenerated.
2540
aa543512
L
25412012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2542
2543 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2544 COMPILE generated by automake.
2545 (LINK1): Likewise.
2546 (CXXCOMPILE1): Likewise.
2547 (CXXLINK1): Likewise.
2548 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2549 (LINK): Likewise.
2550 (CXXCOMPILE): Likewise.
2551 (CXXLINK): Likewise.
2552 * testsuite/Makefile.in: Regenerated.
2553
d361fafb
L
25542012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2555
2556 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2557 on bad fwrite return.
2558
598c7410
L
25592012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2560
2561 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2562 on val.
2563
35c813e2
CC
25642012-10-23 Cary Coutant <ccoutant@google.com>
2565
2566 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2567 * testsuite/Makefile.in: Regenerate.
2568 * testsuite/dwp_test.h: New source file.
2569 * testsuite/dwp_test_1.cc: New source file.
2570 * testsuite/dwp_test_1.s: New source file.
2571 * testsuite/dwp_test_1.sh: New source file.
2572 * testsuite/dwp_test_1b.cc: New source file.
2573 * testsuite/dwp_test_1b.s: New source file.
2574 * testsuite/dwp_test_2.cc: New source file.
2575 * testsuite/dwp_test_2.s: New source file.
2576 * testsuite/dwp_test_2.sh: New source file.
2577 * testsuite/dwp_test_main.cc: New source file.
2578 * testsuite/dwp_test_main.s: New source file.
2579
77429909
CC
25802012-10-23 Cary Coutant <ccoutant@google.com>
2581
2582 * dwp.h: New header file.
2583 * dwp.cc: New source file.
2584 * gold.h: Move shared declarations to system.h.
2585 * system.h: New header file.
2586 * Makefile.am: Add dwp.
2587 * Makefile.in: Regenerate.
2588
ed5d6712
CC
25892012-10-23 Cary Coutant <ccoutant@google.com>
2590
2591 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2592 Dwarf_info_reader::read_from_pointer.
2593 (Dwarf_pubnames_table::read_header): Likewise.
2594 (Dwarf_pubnames_table::next_name): Likewise.
2595 (Dwarf_die::read_attributes): Likewise.
2596 (Dwarf_die::skip_attributes): Likewise.
2597 (Dwarf_info_reader::read_from_pointer): New function template.
2598 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2599 (Dwarf_pubnames_table): Likewise.
2600 (Dwarf_info_reader::read_from_pointer): New function template.
2601 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2602 Dwarf_pubnames_table ctor.
2603
8787852d
CC
26042012-10-23 Cary Coutant <ccoutant@google.com>
2605
2606 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2607 abbrev_shndx.
2608 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2609 abbrev_shndx_.
2610 (Dwarf_info_reader::set_abbrev_shndx): New method.
2611 (Dwarf_info_reader::abbrev_shndx_): New data member.
2612
9fc236f3
CC
26132012-10-23 Cary Coutant <ccoutant@google.com>
2614
2615 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2616 from object, not parameters.
2617 (Dwarf_info_reader::parse): Likewise.
2618 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2619 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2620 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2621 methods.
2622
effe8365
CC
26232012-10-23 Cary Coutant <ccoutant@google.com>
2624
2625 * fileread.cc (Input_file::Input_file): New constructor.
2626 * fileread.h (class Input_file): Add new constructor.
2627
1698990d
AM
26282012-10-18 Alan Modra <amodra@gmail.com>
2629
2630 PR gold/14727
2631 * object.cc (Relobj::is_section_name_included): Also match
2632 .sdata personality section.
2633
168a4726
AM
26342012-10-18 Alan Modra <amodra@gmail.com>
2635
2636 * target-reloc.h (class Default_comdat_behavior): New, package up..
2637 (get_comdat_behaviour): ..this.
2638 (relocate_section): Add Relocate_comdat_behavior template arg,
2639 adjust code to suit.
2640 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2641 (Target_arm::scan_reloc_section): Likewise.
2642 * i386.cc (Target_i386::relocate_section): Likewise.
2643 * sparc.cc (Target_sparc::relocate_section): Likewise.
2644 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2645 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2646 * powerpc.cc (class Relocate_comdat_behavior): New.
2647 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2648 gold::relocate_section with new template arg.
2649
acc276d8
AM
26502012-10-18 Alan Modra <amodra@gmail.com>
2651
2652 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2653 dynamic relocs for GOT_TPREL got entries, without symbol if
2654 resolving locally.
2655 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2656 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2657 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2658
e10f9870
AM
26592012-10-17 Alan Modra <amodra@gmail.com>
2660
2661 PR gold/14726
2662 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2663
ae034989
ST
26642012-10-16 Sriraman Tallam <tmsriram@google.com>
2665
2666 * layout.cc (Layout::include_section): Keep sections marked
2667 SHF_EXCLUDE when doing relocatable links.
2668
f3a0ed29
AM
26692012-10-16 Alan Modra <amodra@gmail.com>
2670
2671 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2672 (Target_powerpc::do_finalize_sections): Call it.
2673 (Output_data_save_res): New class and supporting functions.
2674 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2675 normal symbols defined in object files.
2676
c6de8ed4
AM
26772012-10-12 Alan Modra <amodra@gmail.com>
2678
2679 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2680 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2681 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2682 section if scan_opd_relocs not yet called.
2683 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2684
03e25981
AM
26852012-10-12 Alan Modra <amodra@gmail.com>
2686
2687 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2688 add_local_ifunc_entry): Revert last change.
2689 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2690
c9824451
AM
26912012-10-05 Alan Modra <amodra@gmail.com>
2692
2693 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2694 do_plt_address_for_global): New functions.
2695 (Output_data_got_powerpc::do_write): Don't segfault when linking
2696 statically.
2697 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2698 add_local_ifunc_entry): Return true on adding entry..
2699 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2700 glink->add_entry call. Remove unused symtab param. Adjust calls.
2701 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2702 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2703 set up symbols here.
2704 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2705 syms here. Do so even when no .iplt. Don't segfault when linking
2706 statically.
2707 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2708 new variants without reloc param.
2709 (Glink_sym_ent::Glink_sym_ent): Likewise.
2710 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2711 reloc when refs will resolve to plt call stub.
2712 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2713 R_PPC_PLTREL24 to resolve locally.
2714 (Target_powerpc::Scan::global): Correct ifunc handling.
2715 (Target_powerpc::Relocate::relocate): Correct local sym glink
2716 lookup. Don't destroy "value" when we have a plt call stub,
2717 and when checking plt call validity.
2718 (Target_powerpc::do_dynsym_value): Simplify.
2719
19fec8c1
AM
27202012-10-05 Alan Modra <amodra@gmail.com>
2721
2722 * i386.cc (Output_data_plt_i386::address_for_global,
2723 address_for_local): Add plt offset to returned value. Adjust uses.
2724 * sparc.cc (Output_data_plt_sparc::address_for_global,
2725 address_for_local): Likewise.
2726 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2727 address_for_local): Likewise.
2728 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2729 address_for_local): Likewise.
2730 * target.h (Target::plt_address_for_global, plt_address_for_local):
2731 Update comment.
2732 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2733 (Output_data_got::Got_entry::write): Nor here.
2734 * output.h: Comment fix.
2735
e867b647
WL
27362012-10-02 Jiong Wang <jiwang@tilera.com>
2737
2738 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2739 global_offset_table_ value for larget got.
2740 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2741
e5d5f5ed
AM
27422012-09-29 Alan Modra <amodra@gmail.com>
2743
2744 * powerpc.cc (Target_powerpc::iplt_): New output section.
2745 (Target_powerpc::iplt_section, make_iplt_section,
2746 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2747 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2748 Target_powerpc::plt_entry_count): Count iplt entries too.
2749 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2750 reloc section in constructor. New params.
2751 (Target_powerpc::make_plt_section): Create reloc section here instead.
2752 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2753 functions.
2754 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2755 (Output_data_glink::add_entry, find_entry): New functions to
2756 deal with local syms.
2757 (Glink_sym_ent): Add support for local syms.
2758 (Output_data_glink::do_write): Handle ifunc plt entries.
2759 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2760 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2761 (Target_powerpc::Relocate::relocate): Likewise.
2762 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2763
ec4dbad3
AM
27642012-09-25 Alan Modra <amodra@gmail.com>
2765
2766 * object.h (Sized_relobj_file::adjust_local_symbol,
2767 do_adjust_local_symbol): New functions.
2768 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2769 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2770 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2771 and irregular opd entry spacing.
2772 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2773 (Global_symbol_visitor_opd): New functor.
2774 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2775 on deleted opd entries.
2776
5c0b3823
WL
27772012-09-15 Jiong Wang <jiwang@tilera.com>
2778
2779 * tilegx.cc: New file.
2780 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2781 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2782 * configure.tgt: Add entries for tilegx*.
2783 * configure.ac: Likewise.
2784 * Makefile.in: Rebuild.
2785 * configure: Likewise.
2786 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2787 tilegx.
2788
bfdfa4cd
AM
27892012-09-13 Alan Modra <amodra@gmail.com>
2790
2791 * target-reloc.h (scan_relocs): Call scan.local for relocs
2792 against symbols in discarded sections. Pass is_discarded
2793 param.
2794 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2795 Add is_discarded param.
2796 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2797 is_discarded to flag opd entry as discarded. Don't emit dyn
2798 relocs on such entries.
2799 (Target_powerpc::Scan::global): Similarly detect and handle
2800 such opd entries.
2801 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2802 opd_ent_. Update all uses.
2803 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2804 (Target_powerpc::relocate_section): Zero out discarded opd
2805 entry relocs.
2806
d77a0555
ILT
28072012-09-12 Ian Lance Taylor <iant@google.com>
2808
2809 PR gold/14570
2810 * output.cc: Rename Output_data_got template parameter from size
2811 to got_size for all functions. Compile all variants of
2812 Output_data_got.
2813 (Output_data_got::Got_entry::write): Correct use of size for
2814 symbol value. Use local_is_tls rather than casting to
2815 Sized_relobj_file.
2816 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2817 (class Sized_relobj_file): Add do_local_is_tls.
2818 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2819
815a1205
AM
28202012-09-11 Alan Modra <amodra@gmail.com>
2821
2822 PR gold/14566
2823 * layout.cc (Layout::set_segment_offsets): When using
2824 common-page-size alignment, ensure we are on a new max-page-size
2825 page.
2826 * output.cc (Output_segment::set_section_addresses): Use
2827 abi_pagesize, not common_pagesize for relro boundary.
2828 (Output_segment::set_offset): Likewise.
2829
bd73a62d
AM
28302012-09-11 Alan Modra <amodra@gmail.com>
2831
2832 * output.h (Output_data_got::add_global_tls, add_local_tls,
2833 add_local_tls_pair): New functions.
2834 (Output_data_got::add_local_pair_with_rel): Remove second
2835 reloc param. Expand comment.
2836 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2837 use_plt_or_tls_offset_, similarly for constructor param.
2838 (Output_data_got::Got_entry::write): Add got_index param.
2839 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2840 add_local_tls_pair): New functions.
2841 (Output_data_got::Got_entry::write): Handle tls symbols
2842 with use_plt_or_tls_offset_ set specially.
2843 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2844 (Output_data_got::do_write): Replace iterator with index, pass
2845 index to entry write function.
2846 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2847 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2848 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2849 call.
2850 * i386.cc (Target_i386::Scan::local): Likewise.
2851 * sparc.cc (Target_sparc::Scan::local): Likewise.
2852 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2853 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2854 do_tls_offset_for_global): New functions.
2855 (Target_powerpc::Scan::local): Correct TLS relocations and got
2856 entry values.
2857 (Target_powerpc::Scan::global): Don't emit unnecessary
2858 dynamic relocations on TLS GOT entries.
2859
00716ab1
AM
28602012-09-10 Matthias Klose <doko@ubuntu.com>
2861
2862 * config.in: Disable sanity check for kfreebsd.
2863
c891b3f9
SA
28642012-09-10 Sterling Augustine <saugustine@google.com>
2865
2866 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2867 (Gdb_index::pubtypes_read): New parameter.
2868 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2869 to calls.
2870 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2871 pubtypes_object_.
2872
e81fea4d
AM
28732012-09-09 Alan Modra <amodra@gmail.com>
2874
2875 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
2876 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
2877 * gc.h (gc_process_relocs): Call target gc_add_reference.
2878 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
2879 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
2880 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
2881 unnecessary cast.
2882 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
2883 to cater for when we don't need code offset. Update use.
2884 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
2885 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
2886 set_opd_valid): New functions.
2887 (Target_powerpc::do_gc_add_reference): New function.
2888 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
2889 stashed refs.
2890 (Target_powerpc::do_gc_mark_symbol): New function.
2891
d2d60eef
CC
28922012-09-06 Cary Coutant <ccoutant@google.com>
2893
2894 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
2895 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
2896 (Dwarf_die::skip_attributes): Likewise.
2897 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
2898 * testsuite/gdb_index_test.cc (inline_func_1): New function.
2899 (main): Call it.
2900 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
2901
32ed4573
L
29022012-09-05 H.J. Lu <hongjiu.lu@intel.com>
2903
2904 * testsuite/script_test_3.t: Add .got.plt output section
2905 statement.
2906 * testsuite/script_test_4.t: Likewise.
2907
f4baf0d4
AM
29082012-09-05 Alan Modra <amodra@gmail.com>
2909
2910 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
2911 update all uses and lose "enum" when using type.
2912
864a1b56
AM
29132012-09-05 Alan Modra <amodra@gmail.com>
2914
2915 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
2916 * configure: Regenerate.
2917 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
2918 (plugin_final_layout.stdout): Likewise.
2919 (memory_test): Set page sizes to 0x1000.
2920 * testsuite/Makefile.in: Regenerate.
2921 * testsuite/discard_locals_test.sh: Add FIXME comment.
2922 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
2923 * testsuite/pr14265.t: Add .got output section statement.
2924 * testsuite/script_test_2.t: Likewise.
2925 * testsuite/script_test_3.t: Likewise.
2926 * testsuite/script_test_4.t: Likewise.
2927 * testsuite/script_test_5.t: Likewise.
2928 * testsuite/script_test_6.t: Likewise.
2929 * testsuite/script_test_7.t: Likewise.
2930 * testsuite/script_test_9.t: Likewise.
2931
3ea0a085
AM
29322012-09-05 Alan Modra <amodra@gmail.com>
2933
2934 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
2935 (Powerpc_relocate_functions::Status): New typedef.
2936 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2937 (Target_powerpc::Scan::local): Handle REL64.
2938 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
2939 for REL32 and REL64.
2940 (Target_powerpc::symval_for_branch): New function, extracted from..
2941 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
2942 checks. Report overflow errors.
2943
7404fe1b
AM
29442012-09-05 Alan Modra <amodra@gmail.com>
2945
2946 * object.h (Sized_relobj_file::emit_relocs): Delete.
2947 (Sized_relobj_file::emit_relocs_reltype): Delete.
2948 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
2949 relocate_relocs for --emit-relocs.
2950 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
2951 * output.h: Update comment.
2952 (Output_segment::first_section): New function.
2953 (Output_segment::first_section_load_address): Use first_section.
2954 * output.cc (Output_segment::first_section): New function extracted..
2955 (Output_segment::first_section_load_address): ..from here. Delete.
2956 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
2957 * target.h (Sized_target::relocate_for_relocatable): Likewise.
2958 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
2959 adjust call to target.h function.
2960 * i386.cc (Target_i386): Likewise.
2961 * sparc.cc (Target_sparc): Likewise.
2962 * x86_64.cc (Target_x86_64): Likewise.
2963 * powerpc.cc (Target_powerpc): Likewise.
2964 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
2965 first tls section has section symbol for optimised local dynamic
2966 output relocs.
2967 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
2968 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
2969 optimised tls code.
2970 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
2971 Rename to relocate_relocs. Update error message.
2972
957564c9
AS
29732012-09-04 Andreas Schwab <schwab@linux-m68k.org>
2974
2975 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
2976 --just-symbols.
2977
dd93cd0a
AM
29782012-08-31 Alan Modra <amodra@gmail.com>
2979
2980 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
2981 (Powerpc_relobj::toc_base_offset): New stub function.
2982 (Target_powerpc): Add tp_offset, dtp_offset. Rename
2983 got_mod_index_offset to tlsld_got_offset. Update all refs.
2984 (Target_powerpc::Relocate::enum skip_tls): New.
2985 (Target_powerpc::call_tls_get_addr_): New var.
2986 (Target_powerpc::is_branch_reloc): Move to file scope.
2987 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
2988 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
2989 New functions.
2990 (Target_powerpc::enum Got_type): Delete old values, add new ones.
2991 (powerpc_info): Correct common_pagesize for ppc64.
2992 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
2993 (Powerpc_relocate_functions): Add overflow check enums and functions.
2994 Add non-shift version of rela, rela_ua. Delete all rel public
2995 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
2996 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
2997 addr16_ha3, addr14 functions.
2998 (Output_data_got_powerpc::add_constant_pair): New function.
2999 (Output_data_got_powerpc::got_base_offset): Likewise.
3000 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3001 (instruction constants): Sort, add some more.
3002 (Output_data_glink::do_write): Add and use Address typedef. Use
3003 object->toc_base_offset() stub for 64-bit.
3004 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3005 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3006 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3007 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3008 Always treat .opd relocs as against locally defined symbol.
3009 Correct condition for RELATIVE relocs.
3010 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3011 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3012 for 32-bit syms with a plt entry. Correct ppc64 toc base
3013 calculations. Handle TLS relocs, and more. Add overflow
3014 checking and adjust for Powerpc_relocate_functions changes.
3015 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3016 Reinstate --emit-relocs code with FIXME.
3017
a1373b60
AM
30182012-08-30 Alan Modra <amodra@gmail.com>
3019
3020 * layout.cc (Layout::set_segment_offsets): Set p_align to
3021 abi_pagesize, not common_pagesize.
3022 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3023 to determine whether file header can go in segment.
3024
703d02da
AM
30252012-08-30 Alan Modra <amodra@gmail.com>
3026
3027 * output.h (Output_reloc::Output_reloc <output section>): Add
3028 is_relative param. Adjust calls.
3029 (Output_reloc::add_output_section_relative): New functions.
3030 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3031 is_relative.
3032 (Output_reloc::symbol_value): Handle SECTION_CODE.
3033
16164a6b
ST
30342012-08-24 Sriraman Tallam <tmsriram@google.com>
3035
3036 * gold.cc (queue_middle_tasks): Call layout again when unique
3037 segments for sections is desired.
3038 * layout.cc (Layout::Layout): Initialize new members.
3039 (Layout::get_output_section_flags): New function.
3040 (Layout::choose_output_section): Call get_output_section_flags.
3041 (Layout::layout): Make output section for mapping to a unique segment.
3042 (Layout::insert_section_segment_map): New function.
3043 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 3044 output sections marked so.
16164a6b
ST
3045 (Layout::segment_precedes): Check for unique segments when sorting.
3046 * layout.h (Layout::Unique_segment_info): New struct.
3047 (Layout::Section_segment_map): New typedef.
3048 (Layout::insert_section_segment_map): New function.
3049 (Layout::get_output_section_flags): New function.
3050 (Layout::is_unique_segment_for_sections_specified): New function.
3051 (Layout::set_unique_segment_for_sections_specified): New function.
3052 (Layout::unique_segment_for_sections_specified_): New member.
3053 (Layout::section_segment_map_): New member.
3054 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3055 Rename is_gc_pass_one to is_pass_one.
3056 Rename is_gc_pass_two to is_pass_two.
3057 Rename is_gc_or_icf to is_two_pass.
3058 Check for which pass based on whether symbols data is present.
3059 Make it two pass when unique segments for sections is desired.
3060 * output.cc (Output_section::Output_section): Initialize new
3061 members.
3062 * output.h (Output_section::is_unique_segment): New function.
3063 (Output_section::set_is_unique_segment): New function.
3064 (Output_section::is_unique_segment_): New member.
3065 (Output_section::extra_segment_flags): New function.
3066 (Output_section::set_extra_segment_flags): New function.
3067 (Output_section::extra_segment_flags_): New member.
3068 (Output_section::segment_alignment): New function.
3069 (Output_section::set_segment_alignment): New function.
3070 (Output_section::segment_alignment_): New member.
3071 (Output_segment::Output_segment): Initialize is_unique_segment_.
3072 (Output_segment::is_unique_segment): New function.
3073 (Output_segment::set_is_unique_segment): New function.
3074 (Output_segment::is_unique_segment_): New member.
3075 * plugin.cc (allow_unique_segment_for_sections): New function.
3076 (unique_segment_for_sections): New function.
3077 (Plugin::load): Add new functions to transfer vector.
3078 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3079 * Makefile.in: Regenerate.
3080 * testsuite/plugin_final_layout.sh: Check if unique segment
3081 functionality works.
3082 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3083 are available.
3084 (allow_unique_segment_for_sections): New global.
3085 (unique_segment_for_sections): New global.
3086 (claim_file_hook): Call allow_unique_segment_for_sections.
3087 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 3088
1e2bee4f
CC
30892012-08-22 Cary Coutant <ccoutant@google.com>
3090
3091 * layout.cc (Layout::include_section): Don't assert on GROUP
3092 sections with --emit-relocs.
3093
1d5dfe78
CC
30942012-08-21 Cary Coutant <ccoutant@google.com>
3095
3096 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3097 if --export-dynamic-symbol names an undef symbol.
3098
c9269dff
AM
30992012-08-18 Alan Modra <amodra@gmail.com>
3100
3101 * powerpc.cc: Formatting and white space.
3102 (Powerpc_relobj): Rename got2_section_ to special_.
3103 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3104 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3105 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3106 (Target_powerpc): Add Address typedef and invalid_address. Use
3107 throughout.
3108 (Target_powerpc::is_branch_reloc): New function.
3109 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3110 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3111 for dst_mask, value and addend.
3112 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3113 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3114 (Output_data_glink::do_write): Correct toc base. Don't try to use
3115 uint16_t for 24-bit offset. Use get_output_section_offset and
3116 check return.
3117 (Target_powerpc::Scan::local): Handle more relocs.
3118 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3119 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3120 Plug in toc restoring insn after plt calls. Translate branches
3121 to function descriptor symbols to corresponding entry point.
3122 (Target_powerpc::relocate_for_relocatable): Check return from
3123 get_output_section_offset.
3124 * symtab.h: Comment typo.
3125
b1759dce
ILT
31262012-08-14 Ian Lance Taylor <iant@google.com>
3127
3128 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3129 unsupported_relocal_local to call unsupported_reloc_global.
3130
b9b2ae8b
NC
31312012-08-14 Nick Clifton <nickc@redhat.com>
3132
3133 PR ld/14265
3134 * script-sections.cc (Sections_element::output_section_name): Add
3135 keep return parameter.
3136 (Output_section_element::match_name): Add keep return parameter.
3137 Return the value of the keep_ member.
3138 * script-sections.h (class Output_section): Update
3139 output_section_name prototype.
3140 * layout.cc (Layout::keep_input_section): New public member
3141 function.
3142 (Layout::choose_output_section): Pass keep parameter to
3143 output_section_name.
3144 * layout.h (class Layout): Add keep_input_section.
3145 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3146 sections.
3147 * testsuite/Makefile.am: Add a test.
3148 * testsuite/Makefile.in: Regenerate.
3149 * testsuite/pr14265.c: Source file for the test.
3150 * testsuite/pr14265.t: Linker script for the test.
3151 * testsuite/pr14265.sh: Shell script for the test.
3152
921b5322
AM
31532012-08-14 Alan Modra <amodra@gmail.com>
3154
3155 * target.h (Target::output_section_name): New function.
3156 (Target::do_output_section_name): New function.
3157 * layout.cc (Layout::choose_output_section): Call the above.
3158 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3159
6ce78956
AM
31602012-08-14 Alan Modra <amodra@gmail.com>
3161
3162 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3163 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3164 for replace_constant call.
3165 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3166 (Output_data_glink::do_print_to_mapfile): New function.
3167 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3168 (Target_powerpc::Relocate::relocate): Likewise.
3169
d1a8cabd
AM
31702012-08-14 Alan Modra <amodra@gmail.com>
3171
3172 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3173 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3174 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3175 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3176 all references to shndx_. Handle special case for R_PPC_PLTREL24
3177 here.
3178 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3179 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3180 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3181 here.
3182 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3183 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3184
d83ce4e3
AM
31852012-08-12 Alan Modra <amodra@gmail.com>
3186
3187 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3188 (glink insn constants): Use uint32_t.
3189 (Output_data_glink::add_entry): Use insert, not [] operator.
3190
cf43a2fe
AM
31912012-08-11 Alan Modra <amodra@gmail.com>
3192
3193 * object.h (Sized_relobj_file::find_shdr): New function.
3194 (Sized_relobj_file::find_special_sections): New function.
3195 * object.cc (Sized_relobj_file::find_shdr): New function.
3196 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3197 (Sized_relobj_file::find_special_sections): New function, split out..
3198 (Sized_relobj_file::do_read_symbols): ..from here.
3199 * output.h (Output_data_got::replace_constant): New function.
3200 (Output_data_got::num_entries): New function.
3201 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3202 (Output_data_got::got_offset): Protected rather than private.
3203 (Output_data_got::replace_got_entry): New function.
3204 * output.cc (Output_data_got::replace_got_entry): New function.
3205 * powerpc.cc (class Powerpc_relobj): New.
3206 (class Powerpc_relocate_functions): Delete all psymval variants or
3207 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3208 Implement _ha functions using corresponding _hi function.
3209 (Powerpc_relobj::find_special_sections): New function.
3210 (Target_powerpc::do_make_elf_object): New function.
3211 (class Output_data_got_powerpc): New.
3212 (class Output_data_glink): New.
3213 (class Powerpc_scan_relocatable_reloc): New.
3214 Many more changes througout file.
3215
3c892704
NC
32162012-08-09 Nick Clifton <nickc@redhat.com>
3217
3218 * po/vi.po: Updated Vietnamese translation.
3219
82435b3b
ILT
32202012-08-07 Ian Lance Taylor <iant@google.com>
3221
3222 * layout.cc (Layout::add_target_dynamic_tags): If
3223 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3224 plt_rel.
3225
a6dc81d2
NC
32262012-07-30 Nick Clifton <nickc@redhat.com>
3227
3228 * po/gold.pot: Updated template.
3229 * po/es.po: Updated Spanish translation.
3230
f1415016
CC
32312012-07-18 Cary Coutant <ccoutant@google.com>
3232
3233 PR gold/14344
3234 * configure.ac: Add check for -gpubnames support.
3235 * configure: Regenerate.
3236 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3237 support; force -gno-pubnames.
3238 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3239 support.
3240 (gdb_index_test_4): New test.
3241 * testsuite/Makefile.in: Regenerate.
3242 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3243 * testsuite/gdb_index_test_2.sh: Likewise.
3244 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3245 * testsuite/gdb_index_test_4.sh: New script.
3246 * testsuite/gdb_index_test_comm.sh: New script with common code;
3247 don't look for space after colon.
3248
b7fd7c37
ST
32492012-07-16 Sriraman Tallam <tmsriram@google.com>
3250
3251 * gold.cc (queue_middle_tasks): Update function order only after
3252 deferred objects due to plugins are processed.
3253
1f3212db
ILT
32542012-07-11 Ian Lance Taylor <iant@google.com>
3255
3256 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3257 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3258 (Target_arm::scan_reloc_for_stub): Likewise.
3259 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3260 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3261 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3262 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3263 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3264
81c82a68
ILT
32652012-07-10 Dodji Seketeli <dodji@redhat.com>
3266 Ian Lance Taylor <iant@google.com>
3267
3268 PR gold/14309
3269 * configure.ac: Test whether std::tr1::hash<off_t> works.
3270 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3271 needed.
3272 * output.h (class Output_fill): Add virtual destructor.
3273 * configure, config.in: Rebuild.
3274
eabc84f4
RM
32752012-06-22 Roland McGrath <mcgrathr@google.com>
3276
3277 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3278
370e30b6
RÁE
32792012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3280
3281 * plugin.cc (Plugin::load): Handle position independent executables.
3282
fb1b895d
CC
32832012-06-06 Cary Coutant <ccoutant@google.com>
3284
3285 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3286 add .debug_macro.
3287 (lines_only_debug_sections): Likewise.
3288 (gdb_fast_lookup_sections): New static array.
3289 (is_gdb_debug_section): Rename formal parameter.
3290 (is_lines_only_debug_section): Likewise.
3291 (is_gdb_fast_lookup_section): New function.
3292 (Layout::include_section): Check for ".zdebug_" prefix; pass
3293 section name suffix to is_gdb_debug_section, et al.; check for
3294 fast-lookup sections when building .gdb_index.
3295 * options.h (--strip-debug-gdb): Update GDB version number.
3296
7c0640fa
CC
32972012-06-06 Cary Coutant <ccoutant@google.com>
3298
3299 * configure.ac: Add check for fallocate.
3300 * configure: Regenerate.
3301 * config.in: Regenerate.
3302
3303 * options.h (class General_options): Add --mmap-output-file and
3304 --posix-fallocate options.
3305 * output.cc: (posix_fallocate): Remove; replace with...
3306 (gold_fallocate): New function.
3307 (Output_file::map_no_anonymous): Call gold_fallocate.
3308 (Output_file::map): Check --mmap-output-file option.
3309
2a49eb69
DK
33102012-06-05 Jing Yu <jingyu@google.com>
3311
3312 * gold.h (textdomain): Add do {} to empty while(0).
3313 (bindtextdomain): Likewise.
3314
fad072ac
CC
33152012-06-04 Cary Coutant <ccoutant@google.com>
3316
3317 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3318 has_dynsym_index.
3319
8cc69fb6
ST
33202012-05-25 Sriraman Tallam <tmsriram@google.com>
3321
3322 * symtab.cc (Symbol_table::define_special_symbol):
3323 Initialize *poldsym to prevent uninitialized variable errors.
3324
1be75daa
CC
33252012-05-23 Cary Coutant <ccoutant@google.com>
3326
3327 * layout.cc (Layout::section_name_mapping): Add rules to handle
3328 exact match on .data.rel.ro.local or .data.rel.ro.
3329 (Layout::output_section_name): Check for exact matches.
3330
9b689de0
CC
33312012-05-23 Cary Coutant <ccoutant@google.com>
3332
3333 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3334 more carefully.
3335
b24fdbf5
CC
33362012-05-22 Cary Coutant <ccoutant@google.com>
3337
3338 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3339 object before exporting symbol.
3340
e550e1a2
L
33412012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3342
3343 * testsuite/tls_test.cc: Include "config.h" first.
3344 * testsuite/tls_test_c.c: Likewise.
3345
df7b86aa
NC
33462012-05-17 Daniel Richard G. <skunk@iskunk.org>
3347 Nick Clifton <nickc@redhat.com>
3348
3349 PR 14072
3350 * configure.in: Add check that sysdep.h has been included before
3351 any system header files.
3352 * configure: Regenerate.
3353 * config.in: Regenerate.
3354
1007b503
CC
33552012-05-14 Cary Coutant <ccoutant@google.com>
3356
3357 * layout.cc (Layout::make_output_section): Mark .tdata section
3358 as RELRO.
3359 * testsuite/relro_test.cc: Add a TLS variable.
3360
fd885f3a
L
33612012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3362
3363 PR gold/14091
3364 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3365 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3366 R_X86_64_64.
3367
80f5885c
CC
33682012-05-08 Cary Coutant <ccoutant@google.com>
3369
3370 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3371 (lines_only_debug_sections): Likewise.
3372
2e702c99
RM
33732012-05-02 Roland McGrath <mcgrathr@google.com>
3374
3375 * nacl.cc: New file.
3376 * nacl.h: New file.
3377 * Makefile.am (CCFILES, HFILES): Add them.
3378 * Makefile.in: Regenerate.
3379 * i386.cc (Output_data_plt_i386_nacl): New class.
3380 (Output_data_plt_i386_nacl_exec): New class.
3381 (Output_data_plt_i386_nacl_dyn): New class.
3382 (Target_i386_nacl): New class.
3383 (Target_selector_i386_nacl): New class.
3384 (target_selector_i386): Use it instead of Target_selector_i386.
3385 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3386 (Target_x86_64_nacl): New class.
3387 (Target_selector_x86_64_nacl): New class.
3388 (target_selector_x86_64, target_selector_x32): Use it instead of
3389 Target_selector_x86_64.
3390 * arm.cc (Output_data_plt_arm_nacl): New class.
3391 (Target_arm_nacl): New class.
3392 (Target_selector_arm_nacl): New class.
3393 (target_selector_arm, target_selector_armbe): Use it instead of
3394 Target_selector_arm.
3395
3396 * target-select.cc (select_target): Take new Input_file* and off_t
3397 arguments, pass them on to recognize method of selector.
3398 * object.cc (make_elf_sized_object): Update caller.
3399 * parameters.cc (parameters_force_valid_target): Likewise.
3400 * incremental.cc (make_sized_incremental_binary): Likewise.
3401 * target-select.h: Update decl.
3402 (Target_selector::recognize): Take new Input_file* argument,
3403 pass it on to do_recognize.
3404 (Target_selector::do_recognize): Take new Input_file* argument.
3405 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3406 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3407 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3408 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3409
3410 * target.h (Target::Target_info): New members isolate_execinstr
3411 and rosegment_gap.
3412 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3413 * arm.cc (Target_arm::arm_info): Update initializer.
3414 * i386.cc (Target_i386::i386_info): Likewise.
3415 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3416 * sparc.cc (Target_sparc::sparc_info): Likewise.
3417 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3418 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3419 * layout.cc (Layout::attach_allocated_section_to_segment):
3420 Take new const Target* argument. If target->isolate_execinstr(), act
3421 like --rosegment.
3422 (Layout::find_first_load_seg): Take new const Target* argument;
3423 if target->isolate_execinstr(), reject PF_X segments.
3424 (Layout::relaxation_loop_body): Update caller.
3425 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3426 reset file offset to zero when we hit LOAD_SEG, and then do a second
3427 loop over the segments before LOAD_SEG to reassign offsets after
3428 addresses have been determined. Handle target->rosegment_gap().
3429 (Layout::attach_section_to_segment): Take new const Target* argument;
3430 pass it to attach_allocated_section_to_segment.
3431 (Layout::make_output_section): Update caller.
3432 (Layout::attach_sections_to_segments): Take new const Target* argument;
3433 pass it to attach_section_to_segment.
3434 * gold.cc (queue_middle_tasks): Update caller.
3435 * layout.h (Layout): Update method decls with new arguments.
3436
3437 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3438 Target_info pointer to use.
3439 (Target_arm::do_make_data_plt): New virtual method.
3440 (Target_arm::make_data_plt): New method that calls it.
3441 (Target_arm::make_plt_entry): Use it.
3442 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3443 for the section alignment.
3444 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3445 method.
3446 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3447 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3448 method.
3449 (Output_data_plt_arm::get_plt_entry_size): Call it.
3450 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3451 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3452 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3453 method.
3454 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3455 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3456 method instead of sizeof(plt_entry).
3457 (Output_data_plt_arm::add_entry): Likewise.
3458 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3459 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3460 than static method.
3461 (Target_arm::plt_entry_size): Likewise.
3462 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3463 Move to ...
3464 (Output_data_plt_arm_standard): ... here, new class.
3465 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3466 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3467 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3468
3469 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3470 Take additional argument for the PLT entry size.
3471 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3472 Use get_plt_entry_size method rather than plt_entry_size variable.
3473 (Output_data_plt_x86_64::reserve_slot): Likewise.
3474 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3475 (Output_data_plt_x86_64::add_entry): Likewise.
3476 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3477 (Output_data_plt_x86_64::address_for_global): Likewise.
3478 (Output_data_plt_x86_64::address_for_local): Likewise.
3479 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3480 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3481 Make method non-static.
3482 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3483 method.
3484 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3485 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3486 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3487 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3488 virtual method.
3489 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3490 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3491 virtual method.
3492 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3493 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3494 virtual method.
3495 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3496 (Output_data_plt_x86_64::plt_entry_size)
3497 (Output_data_plt_x86_64::first_plt_entry)
3498 (Output_data_plt_x86_64::plt_entry)
3499 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3500 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3501 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3502 (Output_data_plt_x86_64_standard): ... here, new class.
3503 (Target_x86_64::Target_x86_64): Take optional argument for the
3504 Target_info pointer to use.
3505 (Target_x86_64::do_make_data_plt): New virtual method.
3506 (Target_x86_64::make_data_plt): New method to call it.
3507 (Target_x86_64::init_got_plt_for_update): Use that.
3508 Call this->plt_->add_eh_frame method here.
3509 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3510 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3511 rather than static method.
3512 (Target_x86_64::plt_entry_size): Likewise.
3513 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3514 rather than plt_entry_size variable. Move guts of PLT filling to...
3515 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3516 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3517 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3518
3519 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3520 additional argument for the section alignment.
3521 Don't do add_eh_frame_for_plt here.
3522 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3523 non-static. Use get_plt_entry_size method rather than plt_entry_size
3524 variable.
3525 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3526 method.
3527 (Output_data_plt_i386::get_plt_entry_size): Call it.
3528 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3529 (Output_data_plt_i386::add_eh_frame): New method to call it.
3530 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3531 method.
3532 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3533 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3534 method.
3535 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3536 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3537 method instead of plt_entry_size.
3538 (Output_data_plt_i386::plt_entry_size)
3539 (Output_data_plt_i386::plt_eh_frame_fde_size)
3540 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3541 (Output_data_plt_i386_standard): ... here, new class.
3542 (Output_data_plt_i386_exec): New class.
3543 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3544 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3545 (Output_data_plt_i386::exec_plt_entry): Move to ...
3546 (Output_data_plt_i386_exec::plt_entry): ... here.
3547 (Output_data_plt_i386_dyn): New class.
3548 (Output_data_plt_i386::first_plt_entry): Move to ...
3549 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3550 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3551 (Output_data_plt_i386_dyn::plt_entry): ... here.
3552 (Target_i386::Target_i386): Take optional argument for the Target_info
3553 pointer to use.
3554 (Target_i386::do_make_data_plt): New virtual method.
3555 (Target_i386::make_data_plt): New method to call it.
3556 (Target_i386::make_plt_section): Use that.
3557 Call this->plt_->add_eh_frame method here.
3558 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3559 rather than plt_entry_size variable.
3560 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3561 (Output_data_plt_i386::address_for_local): Likewise.
3562 (Output_data_plt_i386::do_write): Likewise.
3563 Move guts of PLT filling to...
3564 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3565 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3566 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3567 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3568
b9b9f2ee
CC
35692012-05-01 Cary Coutant <ccoutant@google.com>
3570
3571 * dwarf_reader.cc (Dwarf_die::read_attributes)
3572 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3573 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3574 * reduced_debug_output.cc
3575 (Output_reduced_debug_info_section::get_die_end): Remove
3576 DW_FORM_GNU_ref_index. Add default case.
3577
57923f48
MW
35782012-04-26 Mark Wielaard <mjw@redhat.com>
3579
3580 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3581 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3582 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3583 DW_AT_high_pc as offset from DW_AT_low_pc.
3584
3585 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3586 * testsuite/Makefile.in: Regenerate.
3587 * testsuite/gdb_index_test_3.c: New test source file.
3588 * testsuite/gdb_index_test_3.sh: New test source file.
3589
2c54b4f4
ILT
35902012-04-25 Ian Lance Taylor <iant@google.com>
3591
3592 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3593 pointer.
3594 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3595 as a class, not a struct.
3596 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3597 (Target_arm::apply_cortex_a8_workaround): Likewise.
3598 * gc.h: Declare Reloc_types as a struct, not a class.
3599 * object.h: Declare Symbols_data as a struct.
3600 * reloc.h: Declare Read_relocs_data as a struct.
3601 * target.h: Declare Relocate_info as a struct.
3602
a5a5f7a3
DM
36032012-04-24 David S. Miller <davem@davemloft.net>
3604
3605 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3606 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3607 and R_SPARC_WPLT30.
3608
f038d496
CC
36092012-04-24 Cary Coutant <ccoutant@google.com>
3610
3611 * incremental-dump.cc (find_input_containing_global): Replace
3612 magic number with symbolic constant.
3613 (dump_incremental_inputs): Update version number.
3614 * incremental.cc (Output_section_incremental_inputs): Update version
3615 number; import symbolic constants from Incremental_inputs_reader.
3616 (Incremental_inputs::create_data_sections): Align relocations
3617 section correctly for 64-bit targets.
3618 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3619 constants; add padding.
3620 (Output_section_incremental_inputs::write_header): Add assert for
3621 header_size.
3622 (Output_section_incremental_inputs::write_input_files): Add assert
3623 for input_entry_size.
3624 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3625 add assert for object_info_size, input_section_entry_size,
3626 global_sym_entry_size.
3627 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3628 for data structure sizes; use them.
3629 (Incremental_input_entry_reader): Import symbolic constants from
3630 Incremental_inputs_reader; use them.
3631
a4d85145
DM
36322012-04-23 David S. Miller <davem@davemloft.net>
3633
3634 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3635 and elf_flags_set_.
3636 (Target_sparc::Target_sparc): Initialize new fields.
3637 (Target_sparc::do_make_elf_object): New function.
3638 (Target_sparc::do_adjust_elf_header): New function.
3639
1d509098
CC
36402012-04-23 Cary Coutant <ccoutant@google.com>
3641
3642 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3643 CU range table of gdb index.
3644
7ebeff7f
DM
36452012-04-20 David S. Miller <davem@davemloft.net>
3646
3647 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3648 instead of false.
3649
13cf9988
DM
36502012-04-16 David S. Miller <davem@davemloft.net>
3651
2a1079e8
DM
3652 * sparc.cc (Target_sparc::got_address): New function.
3653 (Sparc_relocate_functions::gdop_hix22): New function.
3654 (Sparc_relocate_functions::gdop_lox10): New function.
3655 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3656 relocs.
3657 (Target_sparc::Scan::local): Likewise if the global symbol is not
3658 preemptible and is not IFUNC.
3659 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3660 transformations for local and non-preemptible non-IFUNC global
3661 symbols.
3662
0bc964fc
DM
3663 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3664 writing out 64-bit part of ranges.
3665
661d7a80
DM
3666 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3667 -fpic and -fpie respectively.
3668 * Makefile.in: Regenerate.
3669
8c2bf391
DM
3670 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3671 (Target_sparc::Target_sparc): Initialize new field.
3672 (Target_sparc::do_plt_section_for_global): New function.
3673 (Target_sparc::do_plt_section_for_local): New function.
3674 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3675 (Target_sparc::make_plt_section): New function, broken out of
3676 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3677 (Target_sparc::make_plt_entry): Call make_plt_section.
3678 (Target_sparc::make_local_ifunc_plt_entry): New function.
3679 (Target_sparc::rela_ifunc_section): New function.
3680 (Target_sparc::plt_section): Remove const.
3681 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3682 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3683 and ifunc_count_ fields.
3684 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3685 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3686 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3687 (Output_data_plt_sparc::rela_ifunc): New function.
3688 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3689 (Output_data_plt_sparc::has_ifunc_section): New function.
3690 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3691 (Output_data_plt_sparc::address_for_global): New function.
3692 (Output_data_plt_sparc::address_for_local): New function.
3693 (Output_data_plt_sparc::plt_index_to_offset): New function.
3694 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3695 and entry_count.
3696 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3697 entry_count.
3698 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3699 R_SPARC_JMP_IREL to switch.
3700 (Target_sparc::Scan::check_non_pic): Likewise.
3701 (Target_sparc::Scan::local): Handle IFUNC symbols.
3702 (Target_sparc::Scan::local): Likewise.
3703 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3704 and plt_address_for_local.
3705 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3706 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3707
13cf9988
DM
3708 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3709 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3710 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3711 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3712 global relocs too.
3713 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3714 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3715 calls.
3716 * sparc.cc (Target_sparc::Scan::global): Likewise.
3717 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3718
31821be0
CC
37192012-04-16 Cary Coutant <ccoutant@google.com>
3720
3721 * archive.cc (Library_base::should_include_member): Check for
3722 --export-dynamic-symbol.
3723 * options.h (class General_options): Add --export-dynamic-symbol.
3724 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3725 --export-dynamic-symbol.
3726 (Symbol_table::gc_mark_undef_symbols): Likewise.
3727 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3728
2615994e
DM
37292012-04-12 David S. Miller <davem@davemloft.net>
3730
3731 * sparc.cc (Reloc::wdisp10): New relocation method.
3732 (Reloc::h34): Likewise.
3733 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3734 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3735 R_SPARC_WDISP10.
3736 (Target_sparc::Scan::local): Likewise.
3737 (Target_sparc::Scan::global): Likewise.
3738 (Target_sparc::Relocate::relocate): Likewise.
3739
6782735d
CC
37402012-04-09 Cary Coutant <ccoutant@google.com>
3741
3742 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3743 low_pc == 0.
3744
8c7a0b00
ILT
37452012-04-06 Ian Lance Taylor <iant@google.com>
3746
3747 * timer.cc: #include <unistd.h>.
3748
58797674
RM
37492012-04-06 Roland McGrath <mcgrathr@google.com>
3750
3751 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3752 * config.in: Regenerate.
3753 * configure: Regenerate.
3754
44350750
NC
37552012-04-05 Nick Clifton <nickc@redhat.com>
3756
3757 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3758 (AM_LC_MESSAGES): Add.
3759 * aclocal.m4: Regenerate.
3760 * config.in: Regenerate.
3761 * configure: Regenerate.
3762
c1027032
CC
37632012-03-21 Cary Coutant <ccoutant@google.com>
3764
3765 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3766 * Makefile.in: Regenerate.
3767 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3768 (Sized_elf_reloc_mapper::symbol_section): New function.
3769 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3770 (make_elf_reloc_mapper): New function.
3771 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3772 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3773 (Dwarf_abbrev_table::do_get_abbrev): New function.
3774 (Dwarf_ranges_table::read_ranges_table): New function.
3775 (Dwarf_ranges_table::read_range_list): New function.
3776 (Dwarf_pubnames_table::read_section): New function.
3777 (Dwarf_pubnames_table::read_header): New function.
3778 (Dwarf_pubnames_table::next_name): New function.
3779 (Dwarf_die::Dwarf_die): New function.
3780 (Dwarf_die::read_attributes): New function.
3781 (Dwarf_die::skip_attributes): New function.
3782 (Dwarf_die::set_name): New function.
3783 (Dwarf_die::set_linkage_name): New function.
3784 (Dwarf_die::attribute): New function.
3785 (Dwarf_die::string_attribute): New function.
3786 (Dwarf_die::int_attribute): New function.
3787 (Dwarf_die::uint_attribute): New function.
3788 (Dwarf_die::ref_attribute): New function.
3789 (Dwarf_die::child_offset): New function.
3790 (Dwarf_die::sibling_offset): New function.
3791 (Dwarf_info_reader::check_buffer): New function.
3792 (Dwarf_info_reader::parse): New function.
3793 (Dwarf_info_reader::do_parse): New function.
3794 (Dwarf_info_reader::do_read_string_table): New function.
3795 (Dwarf_info_reader::lookup_reloc): New function.
3796 (Dwarf_info_reader::get_string): New function.
3797 (Dwarf_info_reader::visit_compilation_unit): New function.
3798 (Dwarf_info_reader::visit_type_unit): New function.
3799 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3800 Sized_elf_reloc_mapper.
3801 (Sized_dwarf_line_info::symbol_section): Remove function.
3802 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3803 (Sized_dwarf_line_info::read_line_mappings): Remove object
3804 parameter, adjust callers.
3805 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3806 * dwarf_reader.h: Include <sys/types.h>.
3807 (class Track_relocs): Remove forward declaration.
3808 (class Elf_reloc_mapper): New class.
3809 (class Sized_elf_reloc_mapper): New class.
3810 (class Dwarf_abbrev_table): New class.
3811 (class Dwarf_range_list): New class.
3812 (class Dwarf_ranges_table): New class.
3813 (class Dwarf_pubnames_table): New class.
3814 (class Dwarf_die): New class.
3815 (class Dwarf_info_reader): New class.
3816 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3817 (Sized_dwarf_line_info::symbol_section): Remove member function.
3818 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3819 base class.
3820 * gdb-index.cc: New source file.
3821 * gdb-index.h: New source file.
3822 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3823 and .debug_types sections, call Layout::add_to_gdb_index.
3824 (Sized_relobj_incr::do_section_name): Implement.
3825 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3826 return type; Implement.
3827 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3828 return type.
3829 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3830 parameter list and return type.
3831 (Sized_incr_dynobj::do_section_contents): Likewise.
3832 * layout.cc: Include gdb-index.h.
3833 (Layout::Layout): Initialize gdb_index_data_.
3834 (Layout::init_fixed_output_section): Check for .gdb_index section.
3835 (Layout::add_to_gdb_index): New function. Instantiate.
3836 * layout.h: Add forward declaration for class Gdb_index.
3837 (Layout::add_to_gdb_index): New member function.
3838 (Layout::gdb_index_data_): New data member.
3839 * main.cc: Include gdb-index.h.
3840 (main): Print statistics for gdb index.
3841 * object.cc (Object::section_contents): Move code into
3842 do_section_contents.
3843 (need_decompressed_section): Check for sections needed when building
3844 gdb index.
3845 (build_compressed_section_map): Likewise.
3846 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3847 gdb index.
3848 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3849 sections; call Layout::add_to_gdb_index.
3850 (Sized_relobj_file::do_decompressed_section_contents): Call
3851 do_section_contents directly.
3852 * object.h (Object::do_section_contents): Adjust parameter list and
3853 return type.
3854 (Object::do_decompressed_section_contents): Call do_section_contents
3855 directly.
3856 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3857 return type.
3858 * options.h (class General_options): Add --gdb-index option.
3859 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3860 list and return type.
3861 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3862 * reloc.h (Track_relocs::checkpoint): New function.
3863 (Track_relocs::reset): New function.
3864
3865 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3866 New test cases.
3867 * testsuite/Makefile.in: Regenerate.
3868 * testsuite/gdb_index_test.cc: New test source file.
3869 * testsuite/gdb_index_test_1.sh: New test source file.
3870 * testsuite/gdb_index_test_2.sh: New test source file.
3871
647f1574
DK
38722012-03-19 Doug Kwan <dougkwan@google.com>
3873
3874 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 3875 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
3876 __exidx_start and __exidx_end. Make symbol table parameter
3877 anonymous as it is not used.
3878 * gold.cc (queue_middle_tasks): Call target hook to define any
3879 target-specific symbols.
3880 * target.h (Target::define_standard_symbols): New method.
3881 (Target::do_define_standard_symbols): Same.
3882 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
3883 * testsuite/Makefile.in: Regenerate.
3884 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
3885 and __exidx_end.
3886 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
3887 relocations are generated for __exidx_start and __exidx_end.
3888
7c6109da
DK
38892012-03-16 Doug Kwan <dougkwan@google.com>
3890
3891 * testsuite/Makefile.am: Disable test initpri3b.
3892 * testsuite/Makefile.in: Regenerate.
3893
7b8957f8
DK
38942012-03-15 Doug Kwan <dougkwan@google.com>
3895
3896 * arm.cc (Target_arm::got_section): Make .got section read-only
3897 if -z now is given.
3898
14dc9ef7
ILT
38992012-03-15 Ian Lance Taylor <iant@google.com>
3900
3901 PR gold/13850
3902 * layout.cc (Layout::make_output_section): Correctly mark
3903 SHT_INIT_ARRAY, et. al., as relro.
3904
fa40b62a
DK
39052012-03-14 Doug Kwan <dougkwan@google.com>
3906
3907 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
3908 dynamic relocations for protected symbols in shared objects.
3909
fd325007
ILT
39102012-03-13 Ian Lance Taylor <iant@google.com>
3911
3912 * resolve.cc (Symbol_table::resolve): When merging common symbols,
3913 keep the larger alignment.
3914
e8dd54e1
CC
39152012-03-12 Cary Coutant <ccoutant@google.com>
3916
3917 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
3918 handling of DW_LNE_define_file.
3919
feb5f3b0
CC
39202012-03-12 Cary Coutant <ccoutant@google.com>
3921
3922 * reduced_debug_output.cc
3923 (Output_reduced_debug_info_section::get_die_end): Add new FORM
3924 codes to switch.
3925
a1fb4256
CC
39262012-02-29 Cary Coutant <ccoutant@google.com>
3927
3928 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
3929
5dd8762a
CC
39302012-02-29 Cary Coutant <ccoutant@google.com>
3931
3932 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3933 Call Object::decompressed_section_contents.
3934 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
3935 New dtor.
3936 (Sized_dwarf_line_info::buffer_start_): New data member.
3937 * merge.cc (Output_merge_data::do_add_input_section): Call
3938 Object::decompressed_section_contents.
3939 (Output_merge_string::do_add_input_section): Likewise.
3940 * object.cc (need_decompressed_section): New function.
3941 (build_compressed_section_map): Decompress sections needed later.
3942 (Sized_relobj_file::do_decompressed_section_contents): New function.
3943 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3944 * object.h (Object::decompressed_section_contents): New function.
3945 (Object::discard_decompressed_sections): New function.
3946 (Object::do_decompressed_section_contents): New function.
3947 (Object::do_discard_decompressed_sections): New function.
3948 (Compressed_section_info): New type.
3949 (Compressed_section_map): Include decompressed section contents.
3950 (Sized_relobj_file::do_decompressed_section_contents): New function.
3951 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3952
7b5de7ee
CC
39532012-02-16 Cary Coutant <ccoutant@google.com>
3954
3955 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
3956 * testsuite/Makefile.in: Regenerate.
3957
f9fa4a63
CC
39582012-02-14 Cary Coutant <ccoutant@google.com>
3959
3960 * options.cc (General_options::finalize): Disallow -pie and -static.
3961
2c175ebc
DK
39622012-02-03 Doug Kwan <dougkwan@google.com>
3963
3964 * arm.cc (Arm_relocate_functions::abs8,
3965 Arm_relocate_functions::abs16): Use
3966 Bits::has_signed_unsigned_overflow32.
3967 (Arm_relocate_functions::thm_abs8): Correct range of
3968 overflow check.
3969 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
3970 in assertions.
3971
90cff06f
DK
39722012-02-02 Doug Kwan <dougkwan@google.com>
3973
3974 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
3975 position independent outputs, not just shared objects.
3976
63887f3d
L
39772012-01-30 H.J. Lu <hongjiu.lu@intel.com>
3978
3979 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
3980 * configure: Regenerated.
3981
bef2b434
ILT
39822012-01-27 Ian Lance Taylor <iant@google.com>
3983
3984 * reloc.h (Bits): New class with static functions, copied from
3985 namespace utils in arm.cc.
3986 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
3987 instead.
3988
c335b55d
L
39892012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3990
3991 * incremental.cc (write_info_blocks): Correct relocation offset.
3992
41194d9f
L
39932012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3994
3995 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
3996 (Relocate::tls_gd_to_le): Likewise.
3997
1bae613c
L
39982012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3999
4000 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4001
24482ca0
L
40022012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4003
4004 * configure.ac: Check if -mcmodel=medium works.
4005 * configure: Regenerated.
4006
c2c7840a
CC
40072012-01-24 Cary Coutant <ccoutant@google.com>
4008
4009 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4010 definition and ...
4011 (read_unsigned_LEB_128_x): ... this new function.
4012 (read_signed_LEB_128): Replaced with inline definition and ...
4013 (read_signed_LEB_128_x): ... this new function.
4014 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4015 (read_unsigned_LEB_128): Add inline definition.
4016 (read_signed_LEB_128_x): New function.
4017 (read_signed_LEB_128): Add inline definition.
4018 * testsuite/Makefile.am (leb128_unittest): New unit test.
4019 * testsuite/Makefile.in: Regenerate.
4020 * testsuite/leb128_unittest.cc: New unit test.
4021
833de760 40222012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
4023
4024 PR gold/13617
4025 * i386.cc (Target_i386::do_code_fill): When using a jmp
4026 instruction, pad with nop instructions.
4027 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4028
618d6666
L
40292012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4030
4031 * x86_64.cc (gc_process_relocs): Add typename on types used in
4032 template.
4033 (scan_relocs): Likewise.
4034 (relocate_section): Likewise.
4035 (apply_relocation): Likewise.
4036
3660ff06
L
40372012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4038
4039 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4040 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4041 under x32.
4042
fc51264f
L
40432012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4044
4045 * x86_64.cc: Initial support for x32.
4046
dd74ae06
CC
40472012-01-03 Cary Coutant <ccoutant@google.com>
4048
4049 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4050 Use abstract base class for GOT.
4051 * gold/output.h (class Output_data_got_base): New abstract base class.
4052 (class Output_data_got): Derive from new base class, adjust ctors.
4053 (Output_data_got::reserve_slot): Make virtual; rename to
4054 do_reserve_slot; Adjust callers.
4055 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4056 pointer to abstract base class.
4057 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4058
83896202
ILT
40592011-12-18 Ian Lance Taylor <iant@google.com>
4060
4061 * object.h (Relobj::local_symbol_value): New function.
4062 (Relobj::local_plt_offset): New function.
4063 (Relobj::local_has_got_offset): New function.
4064 (Relobj::local_got_offset): New function.
4065 (Relobj::set_local_got_offset): New function.
4066 (Relobj::do_local_symbol_value): New pure virtual function.
4067 (Relobj::do_local_plt_offset): Likewise.
4068 (Relobj::do_local_has_got_offset): Likewise.
4069 (Relobj::do_local_got_offset): Likewise.
4070 (Relobj::do_set_local_got_offset): Likewise.
4071 (Sized_relobj::do_local_has_got_offset): Rename from
4072 local_has_got_offset.
4073 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4074 (Sized_relobj::do_set_local_got_offset): Rename from
4075 set_local_got_offset.
4076 (Sized_relobj_file::do_local_plt_offset): Rename from
4077 local_plt_offset.
4078 (Sized_relobj_file::do_local_symbol_value): New function.
4079 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4080 local_plt_offset.
4081 * output.cc (Output_data_got::Got_entry::write): Change object to
4082 Relobj. Use local_symbol_value.
4083 (Output_data_got::add_global_with_rel): Change rel_dyn to
4084 Output_data_reloc_generic*. Use add_global_generic.
4085 (Output_data_got::add_global_with_rela): Remove. Change all
4086 callers to use add_global_with_rel.
4087 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4088 Output_data_reloc_generic*. Use add_global_generic.
4089 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4090 callers to use add_global_pair_with_rel.
4091 (Output_data_got::add_local): Change object to Relobj*.
4092 (Output_data_got::add_local_plt): Likewise.
4093 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4094 change rel_dyn to Output_data_reloc_generic*. Use
4095 add_local_generic.
4096 (Output_data_got::add_local_with_rela): Remove. Change all
4097 callers to use all_local_with_rel.
4098 (Output_data_got::add_local_pair_with_rel): Change object to
4099 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4100 add_output_section_generic.
4101 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4102 callers to use add_local_pair_with_rel.
4103 (Output_data_got::reserve_local): Change object to Relobj*.
4104 * output.h: (class Output_data_reloc_generic): Add pure virtual
4105 declarations for add_global_generic, add_local_generic,
4106 add_output_section_generic.
4107 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4108 functions for Output_data_reloc_generic. Update declarations for
4109 changes listed in output.cc.
4110 (class Output_data_got): Change template parameter to got_size.
4111 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4112 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4113 function.
4114 (Sized_relobj_incr::do_local_plt_offset): New function.
4115 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4116 add_global_generic.
4117
76677ad0
CC
41182011-12-17 Cary Coutant <ccoutant@google.com>
4119
4120 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4121 * resolve.cc (Symbol_table::resolve): Likewise.
4122 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4123 arrays.
4124 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4125
8b8dd8d5
ILT
41262011-12-16 Ian Lance Taylor <iant@google.com>
4127
4128 * output.h (Output_data_reloc_generic::add): Only call
4129 add_dynamic_reloc if this is a dynamic reloc section.
4130
d55525b9
L
41312011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4132
4133 PR gold/13505
4134 * target-reloc.h (apply_relocation): Replace <64, false> with
4135 <size, big_endian>.
4136
ff81c7c1
NC
41372011-11-25 Nick Clifton <nickc@redhat.com>
4138
4139 * po/it.po: New Italian translation.
4140
628f39be
SA
41412011-11-17 Sterling Augustine <saugustine@google.com>
4142
4143 * script.cc (script_include_directive): Implement.
4144 (read_script_file): New local variables name and search_path. Update
4145 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4146 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4147 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4148
98ef3ea4
SA
41492011-11-11 Sterling Augustine <saugustine@google.com>
4150
4151 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4152 (file_or_sections_cmd): Likewise.
4153
f4a8b6d7
DK
41542011-11-11 Doug Kwan <dougkwan@google.com>
4155
4156 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4157 if --just-symbols is given.
4158
29ab395d
DK
41592011-11-10 Doug Kwan <dougkwan@google.com>
4160
4161 PR gold/13362
4162 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4163 when processing data relocs.
4164 * reloc.h (Relocate_functions::rel_unaligned): New method.
4165 (Relocate_functions::pcrel_unaligned): Ditto.
4166 (Relocate_functions::rel32_unaligned): Ditto.
4167 (Relocate_functions::pcrel32_unaligned): Ditto.
4168
2c339f71
DK
41692011-11-09 Doug Kwan <dougkwan@google.com>
4170
4171 PR gold/13362
4172 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4173 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4174 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4175 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4176 (Relocate_functions::rel_unaligned): New.
4177 (Relocate_functions::rel32_unaligned): New.
4178 * target-reloc.h (relocate_for_relocatable): Add code to handle
4179 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4180 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4181 arm_unaligned_reloc_r): New targets.
4182 * testsuite/Makefile.in: Regenerate.
4183 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4184 linking.
4185
3f3cddf1
ILT
41862011-11-02 Ian Lance Taylor <iant@google.com>
4187
4188 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4189 NATIVE_LINKER.
4190 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4191 * options.cc (General_options::finalize): Use library search path
4192 from configure script if specified. If not native and no sysroot,
4193 only search TOOLLIBDIR.
4194 * options.h (Search_directory::Search_directory): Change name to
4195 const std::string&.
4196 (General_options::add_to_library_path_with_sysroot): Change arg to
4197 const std::string&.
4198 * configure, Makefile.in, config.in: Rebuild.
4199
a8e2273b
ILT
42002011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4201
4202 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4203 we are working around the ARM1176 Erratum.
4204 * options.h (General_options::fix_arm1176): Add option.
4205 * testsuite/Makefile.am: Add testcases, and keep current ones
4206 working.
4207 * testsuite/Makefile.in: Regenerate.
4208 * testsuite/arm_fix_1176.s: New file.
4209 * testsuite/arm_fix_1176.sh: Likewise.
4210
cd6eab1c
ILT
42112011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4212
4213 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4214 may_use_blx_.
4215 (Target_arm::may_use_blx): Remove method.
4216 (Target_arm::set_may_use_blx): Likewise.
4217 (Target_arm::may_use_v4t_interworking): New method.
4218 (Target_arm::may_use_v5t_interworking): Likewise.
4219 (Target_arm::may_use_blx_): Remove member variable.
4220 (Arm_relocate_functions::arm_branch_common): Check for v5T
4221 interworking.
4222 (Arm_relocate_functions::thumb_branch_common): Likewise.
4223 (Reloc_stub::stub_type_for_reloc): Likewise.
4224 (Target_arm::do_finalize_sections): Correct interworking checks.
4225 * testsuite/Makefile.am: Add new tests.
4226 * testsuite/Makefile.in: Regenerate.
4227 * testsuite/arm_farcall_arm_arm.s: New test.
4228 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4229 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4230 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4231 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4232 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4233 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4234 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4235
286adcf4
CC
42362011-10-31 Cary Coutant <ccoutant@google.com>
4237
4238 PR gold/13023
4239 * expression.cc (Expression::eval_with_dot): Add
4240 is_section_dot_assignment parameter.
4241 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4242 absolute and assigning to dot within a section.
4243 * script-sections.cc
4244 (Output_section_element_assignment::set_section_addresses): Pass
4245 dot_section to set_if_absolute.
4246 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4247 as is_section_dot_assignment flag to eval_with_dot.
4248 (Output_section_element_dot_assignment::set_section_addresses):
4249 Likewise.
4250 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4251 parameter. Also set value if relative to dot_section; set the
4252 symbol's output_section.
4253 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4254 parameter. Adjust all callers.
4255 (Expression::eval_maybe_dot): Likewise.
4256 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4257 Adjust all callers.
4258 * testsuite/script_test_2.t: Test assignment of an absolute value
4259 to dot within an output section element.
4260
9634ed06
CC
42612011-10-31 Cary Coutant <ccoutant@google.com>
4262
4263 * options.h (class General_options): Add --[no-]gnu-unique options.
4264 * symtab.cc (Symbol_table::sized_write_globals): Convert
4265 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4266
de4101c7
CC
42672011-10-31 Cary Coutant <ccoutant@google.com>
4268
4269 PR gold/13359
4270 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4271 unnecessary assertion.
4272 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4273
7257cc92
ST
42742011-10-31 Sriraman Tallam <tmsriram@google.com>
4275
4276 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4277 gc_mark_symbol.
4278 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4279 gc_mark_symbol.
4280 Change to just keep the section associated with symbol.
4281 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4282 they are externally visible and --export-dynamic is turned on.
4283 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4284
bfc34b3f
ILT
42852011-10-19 Ian Lance Taylor <iant@google.com>
4286
4287 PR gold/13163
4288 * script-sections.cc
4289 (Output_section_element_dot_assignment::needs_output_section): New
4290 function.
4291
ea0d8c47
ILT
42922011-10-19 Ian Lance Taylor <iant@google.com>
4293
4294 PR gold/13204
4295 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4296 --section-start option was seen.
4297 * options.h (General_options::any_section_start): New function.
4298
abd242a9
DM
42992011-10-18 David S. Miller <davem@davemloft.net>
4300
4301 PR binutils/13301
4302 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4303 member to track relocation locations that have moved during TLS
4304 reloc optimizations.
4305 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4306 (Target_sparc::Relocate::relocate): Adjust view down by 4
4307 bytes if it matches reloc_adjust_addr_.
4308 (Target_sparc::Relocate::relocate_tls): Always move the
4309 __tls_get_addr call delay slot instruction forward 4 bytes when
4310 performing relaxation.
4311
bab9090f
CC
43122011-10-18 Cary Coutant <ccoutant@google.com>
4313
4314 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4315 (Output_file::map_no_anonymous): Check for non-zero
4316 return code from posix_fallocate.
4317
f7c5b166
CC
43182011-10-17 Cary Coutant <ccoutant@google.com>
4319
4320 PR gold/13245
4321 * plugin.cc (is_visible_from_outside): Check for symbols
4322 referenced from dynamic objects.
4323 * resolve.cc (Symbol_table::resolve): Don't count references
4324 from dynamic objects as references from real ELF files.
4325 * testsuite/plugin_test_2.sh: Adjust expected result.
4326
b490c0bb
CC
43272011-10-17 Cary Coutant <ccoutant@google.com>
4328
4329 * gold.cc: Include timer.h.
4330 (queue_middle_tasks): Stamp time.
4331 (queue_final_tasks): Likewise.
4332 * main.cc (main): Store timer in parameters. Print timers
4333 for each pass.
4334 * parameters.cc (Parameters::Parameters): Initialize timer_.
4335 (Parameters::set_timer): New function.
4336 (set_parameters_timer): New function.
4337 * parameters.h (Parameters::set_timer): New function.
4338 (Parameters::timer): New function.
4339 (Parameters::timer_): New data member.
4340 (set_parameters_timer): New function.
4341 * timer.cc (Timer::stamp): New function.
4342 (Timer::get_pass_time): New function.
4343 * timer.h (Timer::stamp): New function.
4344 (Timer::get_pass_time): New function.
4345 (Timer::pass_times_): New data member.
4346
f475cf7b
CC
43472011-10-17 Cary Coutant <ccoutant@google.com>
4348
4349 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4350 task for members of lib groups.
4351
cdd7e244
CC
43522011-10-17 Cary Coutant <ccoutant@google.com>
4353
4354 PR gold/13288
4f95c8b4 4355 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
4356 (File_read::make_view): Move bounds check (replace with assert)...
4357 (File_read::find_or_make_view): ... to here.
4358
dfb45471
CC
43592011-10-12 Cary Coutant <ccoutant@google.com>
4360
4f95c8b4 4361 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
4362 ::read returns less than requested size.
4363
53bbcc1b
CC
43642011-10-10 Cary Coutant <ccoutant@google.com>
4365
4f95c8b4 4366 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
4367 Initialize defined_count_.
4368 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4369 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4370 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4371 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4372 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4373 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4374 member.
4375 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4376 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4377 Return zeroes instead of internal error.
4378
397b129b
CC
43792011-10-10 Cary Coutant <ccoutant@google.com>
4380
4381 PR gold/13249
4f95c8b4 4382 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4383 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4384 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4385 (Output_reloc::type_): Adjust size of bit field.
4386 (Output_reloc::use_plt_offset_): New bit field.
4387 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4388 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4389 flag. Adjust all callers.
4f95c8b4 4390 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4391 creating RELATIVE relocations.
4392
d5698657
NC
43932011-10-10 Nick Clifton <nickc@redhat.com>
4394
4395 * po/es.po: Updated Spanish translation.
4396 * po/fi.po: Updated Finnish translation.
4397
6a59a5c2
DN
43982011-10-03 Diego Novillo <dnovillo@google.com>
4399
4400 * options.cc (parse_uint): Fix dereference of RETVAL.
4401
f0558624
ST
44022011-09-29 Sriraman Tallam <tmsriram@google.com>
4403
4404 * layout.h (section_order_map_): New member.
4405 (get_section_order_map): New member function.
4406 * output.cc (Output_section::add_input_section): Check for patterns
4407 only when --section-ordering-file is specified.
4408 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4409 output_sections have been formed.
4410 * layout.cc (Layout_Layout): Initialize section_order_map_.
4411 * plugin.cc (update_section_order): Store order in order_map. Do not
4412 update the order.
4413 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4414 * testsuite/Makefile.in: Regenerate.
4415 * testsuite/plugin_section_order.c: New file.
4416 * testsuite/plugin_final_layout.cc: New file.
4417 * testsuite/plugin_final_layout.sh: New file.
4418
a7dac153
CC
44192011-09-29 Cary Coutant <ccoutant@google.com>
4420
4f95c8b4 4421 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4422 Check for NULL.
4f95c8b4 4423 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4424 symbols during incremental update.
4425 (Symbol_table::add_from_dynobj): Likewise.
4426
eebd87a5
ILT
44272011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4428 Ian Lance Taylor <iant@google.com>
4429
4430 * symtab.cc (Symbol_table::define_special_symbol): Always
4431 canonicalize version string.
4432
403a3331
CC
44332011-09-26 Cary Coutant <ccoutant@google.com>
4434
4f95c8b4
CC
4435 * gold.cc (queue_initial_tasks): Move option checks ...
4436 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
4437 some options; make others fatal.
4438
235061c2
CC
44392011-09-26 Cary Coutant <ccoutant@google.com>
4440
4441 gcc PR lto/47247
4442 * plugin.cc (get_symbols_v2): New function.
4443 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4444 (is_referenced_from_outside): New function.
4445 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4446 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4447 (get_symbols): Pass version parameter.
4448 (get_symbols_v2): New function.
4449 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4450 parameter.
4451 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4452 (onload): Add LDPT_GET_SYMBOLS_V2.
4453 (all_symbols_read_hook): Use get_symbols_v2; check for
4454 LDPR_PREVAILING_DEF_IRONLY_EXP.
4455 * testsuite/plugin_test_3.sh: Update expected results.
4456
dc87f620
ILT
44572011-09-23 Simon Baldwin <simonb@google.com>
4458
4459 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4460 configuration options.
4461 * configure: Regenerate.
4462 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4463 * Makefile.in: Regenerate.
4464 * testsuite/Makefile.in: Regenerate.
4465
a8279f82
ST
44662011-09-19 Sriraman Tallam <tmsriram@google.com>
4467
4468 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4469
0c9350c8
CC
44702011-09-19 Cary Coutant <ccoutant@google.com>
4471
4472 * incremental.cc (can_incremental_update): Fix typo in comment.
4473 * incremental.h (can_incremental_update): Likewise.
4474
aa06ae28
CC
44752011-09-18 Cary Coutant <ccoutant@google.com>
4476
4477 * incremental.cc (can_incremental_update): New function.
4478 * incremental.h (can_incremental_update): New function.
4479 * layout.cc (Layout::init_fixed_output_section): Call it.
4480 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4481 * object.cc (Sized_relobj_file::do_layout): Call
4482 can_incremental_update.
4483
ebb300b2
CC
44842011-09-13 Cary Coutant <ccoutant@google.com>
4485
4486 * configure.ac: Check for glibc support for gnu_indirect_function
4487 support with static linking, setting automake conditional
4488 IFUNC_STATIC.
4489 * Makefile.in: Regenerate.
4490 * configure: Regenerate.
4491
4492 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4493 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4494 for IFUNC_STATIC.
4495 * testsuite/Makefile.in: Regenerate.
4496
1206d0d5
CC
44972011-09-13 Cary Coutant <ccoutant@google.com>
4498
4499 * incremental.cc (Sized_relobj_incr::do_layout): Call
4500 report_comdat_group for kept comdat sections.
4501 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4502 * testsuite/Makefile.in: Regenerate.
4503 * testsuite/incr_comdat_test_1.cc: New source file.
4504 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4505 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4506 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4507
40b29874
ILT
45082011-09-13 Ian Lance Taylor <iant@google.com>
4509
4510 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4511 variable external_symbols_offset.
4512
1b045aac
ILT
45132011-09-12 Ian Lance Taylor <iant@google.com>
4514
4515 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4516 triggered if object has no symbols.
4517
24c6c55a
DM
45182011-09-09 David S. Miller <davem@davemloft.net>
4519
4520 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4521 (Output_fill_debug_line::do_write): Likewise.
4522
66570254
CC
45232011-08-29 Cary Coutant <ccoutant@google.com>
4524
4525 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4526 casts to match formatting specs.
4527 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4528
8ea8cd50
CC
45292011-08-26 Cary Coutant <ccoutant@google.com>
4530
4531 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4532 remaining hole size when allocating.
4533 (Layout::make_output_section): Set fill methods for debug sections.
4534 * layout.h (Free_list::Free_list_node): Move from private to
4535 public.
4536 (Free_list::set_min_hole_size): New function.
4537 (Free_list::begin, Free_list::end): New functions.
4538 (Free_list::min_hole_): New data member.
4539 * output.cc: Include dwarf.h.
4540 (Output_fill_debug_info::do_minimum_hole_size): New function.
4541 (Output_fill_debug_info::do_write): New function.
4542 (Output_fill_debug_line::do_minimum_hole_size): New function.
4543 (Output_fill_debug_line::do_write): New function.
4544 (Output_section::Output_section): Initialize new data member.
4545 (Output_section::set_final_data_size): Ensure patch space is larger
4546 than minimum hole size.
4547 (Output_section::do_write): Fill holes in debug sections.
4548 * output.h (Output_fill): New class.
4549 (Output_fill_debug_info): New class.
4550 (Output_fill_debug_line): New class.
4551 (Output_section::set_free_space_fill): New function.
4552 (Output_section::free_space_fill_): New data member.
4553 * testsuite/Makefile.am (incremental_test_3): Add
4554 --incremental-patch option.
4555 (incremental_test_4): Likewise.
4556 (incremental_test_5): Likewise.
4557 (incremental_test_6): Likewise.
4558 (incremental_copy_test): Likewise.
4559 (incremental_common_test_1): Likewise.
4560 * testsuite/Makefile.in: Regenerate.
4561
7cf80422
NC
45622011-08-26 Nick Clifton <nickc@redhat.com>
4563
4564 * po/es.po: Updated Spanish translation.
4565
c3f7b0e5
CC
45662011-08-01 Cary Coutant <ccoutant@google.com>
4567
4568 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4569 * gold/testsuite/Makefile.in: Regenerate.
4570 * gold/testsuite/justsyms_exec.c: New source file.
4571 * gold/testsuite/justsyms_lib.c: New source file.
4572
9590bf25
CC
45732011-08-01 Cary Coutant <ccoutant@google.com>
4574
4575 * layout.cc (Layout::set_segment_offsets): Don't realign text
4576 segment if -Ttext was specified.
4577 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4578 file type.
4579 * object.h (Sized_relobj_file::e_type): New function.
4580 (Sized_relobj_file::e_type_): New data member.
4581 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4582 base address for ET_EXEC files.
4583 * target.cc (Target::do_make_elf_object_implementation): Allow
4584 ET_EXEC files with --just-symbols option.
4585
dcd8d12e
CC
45862011-07-28 Cary Coutant <ccoutant@google.com>
4587
4588 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4589 Add thread_number parameter.
4590 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4591 * workqueue-threads.cc
4592 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4593 current thread if its thread number is greater than desired thread
4594 count.
4595 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4596 Add thread_number parameter.
4597 (Workqueue::should_cancel_thread): Likewise.
4598 (Workqueue::find_runnable_or_wait): Pass thread_number to
4599 should_cancel_thread.
4600 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4601 parameter.
4602
804eb480
ST
46032011-07-22 Sriraman Tallam <tmsriram@google.com>
4604
4605 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4606 only after checking if it cannot be forced local.
4607 * symtab.h (is_externally_visible): Check if the symbol is not forced
4608 local.
4609
f1ddb600
ILT
46102011-07-15 Ian Lance Taylor <iant@google.com>
4611
4612 * options.h (class General_options): Add --print-output-format.
4613 Move -EL next to -EB, for better --help output.
4614 * target-select.cc: Include <cstdio>, "options.h", and
4615 "parameters.h".
4616 (Target_selector::do_target_bfd_name): New function.
4617 (print_output_format): New function.
4618 * target-select.h (class Target_selector): Update declarations.
4619 (Target_selector::target_bfd_name): New function.
4620 (print_output_format): Declare.
4621 * main.cc: Include "target-select.h".
4622 (main): Handle --print-output-format.
4623 * gold.cc: Include "target-select.h".
4624 (queue_initial_tasks): Handle --print-output-format when there are
4625 no input files.
4626 * parameters.cc (parameters_force_valid_target): Give a better
4627 error message if -EB/-EL does not match target.
4628 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4629 function.
4630
7d172687
ILT
46312011-07-15 Ian Lance Taylor <iant@google.com>
4632
4633 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4634 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4635 (Output_data_plt_i386::do_write): Write address of .dynamic
4636 section to first entry in .got.plt section.
4637 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4638 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4639 Initialize layout_.
4640 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4641 section to first entry in .got.plt section.
4642 * layout.h (Layout::dynamic_section): New function.
4643
e9552f7e
ST
46442011-07-13 Sriraman Tallam <tmsriram@google.com>
4645
4646 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4647 to claim_file call.
4648 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4649 input_section_position_, and input_section_glob_.
4650 (read_layout_from_file): Call function section_ordering_specified.
4651 * layout.h (is_section_ordering_specified): New function.
4652 (section_ordering_specified): New function.
4653 (section_ordering_specified_): New boolean member.
4654 * main.cc(main): Call load_plugins after layout object is defined.
4655 * output.cc (Output_section::add_input_section): Use
4656 function section_ordering_specified to check if section ordering is
4657 needed.
4658 * output.cc (Output_section::add_relaxed_input_section): Use
4659 function section_ordering_specified to check if section ordering is
4660 needed.
4661 (Output_section::update_section_layout): New function.
4662 (Output_section::sort_attached_input_sections): Check if input section
4663 must be reordered.
4664 * output.h (Output_section::update_section_layout): New function.
4665 * plugin.cc (get_section_count): New function.
4666 (get_section_type): New function.
4667 (get_section_name): New function.
4668 (get_section_contents): New function.
4669 (update_section_order): New function.
58797674 4670 (allow_section_ordering): New function.
e9552f7e
ST
4671 (Plugin::load): Add the new interfaces to the transfer vector.
4672 (Plugin_manager::load_plugins): New parameter.
4673 (Plugin_manager::all_symbols_read): New parameter.
4674 (Plugin_manager::claim_file): New parameter. Save the elf object for
4675 unclaimed objects.
4676 (Plugin_manager::get_elf_object): New function.
4677 (Plugin_manager::get_view): Change to directly use the bool to check
4678 if get_view is called from claim_file_hook.
4679 * plugin.h (input_objects): New function
4680 (Plugin__manager::load_plugins): New parameter.
4681 (Plugin_manager::claim_file): New parameter.
4682 (Plugin_manager::get_elf_object): New function.
4683 (Plugin_manager::in_claim_file_handler): New function.
4684 (Plugin_manager::in_claim_file_handler_): New member.
4685 (layout): New function.
4686 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4687 handler with an extra parameter. Make the elf object before calling
4688 claim_file handler.
4689 * testsuite/plugin_test.c (get_section_count): New function pointer.
4690 (get_section_type): New function pointer.
4691 (get_section_name): New function pointer.
4692 (get_section_contents): New function pointer.
4693 (update_section_order): New function pointer.
4694 (allow_section_ordering): New function pointer.
4695 (onload): Check if the new interfaces exist.
4696
9446efde
ILT
46972011-07-13 Ian Lance Taylor <iant@google.com>
4698
4699 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4700 relro section.
4701 * x86_64.cc (Target_x86_64::got_section): Likewise.
4702 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4703 (relro_now_test_SOURCES): New variable.
4704 (relro_now_test_DEPENDENCIES): New variable.
4705 (relro_now_test_LDFLAGS): New variable.
4706 (relro_now_test_LDADD): New variable.
4707 (relro_now_test.so): New target.
4708 * testsuite/Makefile.in: Rebuild.
4709
07aa62f2
ILT
47102011-07-12 Ian Lance Taylor <iant@google.com>
4711
4712 PR gold/12980
4713 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4714 GLOB_DAT relocation rather than a RELATIVE relocation for a
4715 protected symbol when creating a shared library.
4716 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4717 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4718 * testsuite/protected_main_1.cc (main): Test that protected
4719 function has same address.
4720
e2153196
ILT
47212011-07-11 Ian Lance Taylor <iant@google.com>
4722
4723 PR gold/12979
4724 * options.h (class General_options): Add -Bgroup.
4725 * options.cc (General_options::finalize): If -Bgroup is set,
4726 default to --unresolved-symbols=report-all.
4727 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4728 * target-reloc.h (issue_undefined_symbol_error): Handle
4729 --unresolved-symbols=report-all.
4730
6daf5215
ILT
47312011-07-08 Ian Lance Taylor <iant@google.com>
4732
4733 PR gold/11985
4734 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4735 if linker script discards key sections.
4736 (Layout::create_dynamic_symtab): Likewise.
4737 (Layout::assign_local_dynsym_offsets): Likewise.
4738 (Layout::sized_create_version_sections): Likewise.
4739 (Layout::create_interp): Likewise.
4740 (Layout::finish_dynamic_section): Likewise.
4741 (Layout::set_dynamic_symbol_size): Likewise.
4742
beabb2c6
ILT
47432011-07-08 Ian Lance Taylor <iant@google.com>
4744
4745 PR gold/12386
4746 * options.h (class General_options): Add --unresolved-symbols.
4747 * target-reloc.h (issue_undefined_symbol_error): Check
4748 --unresolved-symbols. Add comments.
4749
9c16daf1
ILT
47502011-07-08 Ian Lance Taylor <iant@google.com>
4751
4752 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4753 expression more complex.
4754
191f1a2d
ILT
47552011-07-08 Ian Lance Taylor <iant@google.com>
4756
4757 PR gold/11317
4758 * target-reloc.h (issue_undefined_symbol_error): New inline
4759 function, broken out of relocate_section.
4760 (relocate_section): Call issue_undefined_symbol_error.
4761 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4762 there is no TLS segment if we are about to issue an undefined
4763 symbol error.
4764 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4765
62855347
ILT
47662011-07-08 Ian Lance Taylor <iant@google.com>
4767
4768 PR gold/12279
4769 * resolve.cc (Symbol_table::should_override): Add fromtype
4770 parameter. Change all callers. Give error when linking together
4771 TLS and non-TLS symbol.
4772 (Symbol_table::should_override_with_special): Add fromtype
4773 parameter. Change all callers.
4774 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4775 there is no TLS segment if we have reported some errors.
4776 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4777
67181c72
ILT
47782011-07-08 Ian Lance Taylor <iant@google.com>
4779
4780 PR gold/12372
4781 * target.h (Target::plt_address_for_global): New function.
4782 (Target::plt_address_for_local): New function.
4783 (Target::plt_section_for_global): Remove.
4784 (Target::plt_section_for_local): Remove.
4785 (Target::do_plt_address_for_global): New virtual function.
4786 (Target::do_plt_address_for_local): New virtual function.
4787 (Target::do_plt_section_for_global): Remove.
4788 (Target::do_plt_section_for_local): Remove.
4789 (Target::register_global_plt_entry): Add Symbol_table and Layout
4790 parameters.
4791 * output.cc (Output_data_got::Got_entry::write): Use
4792 plt_address_for_global and plt_address_for_local.
4793 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4794 address of output section.
4795 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4796 got_irelative_, and irelative_count_ fields. Update
4797 declarations.
4798 (Output_data_plt_i386::has_irelative_section): New function.
4799 (Output_data_plt_i386::entry_count): Add irelative_count_.
4800 (Output_data_plt_i386::set_final_data_size): Likewise.
4801 (class Target_i386): Add got_irelative_ and rel_irelative_
4802 fields. Update declarations.
4803 (Target_i386::Target_i386): Initialize new fields.
4804 (Target_i386::do_plt_address_for_global): New function replacing
4805 do_plt_section_for_global.
4806 (Target_i386::do_plt_address_for_local): New function replacing
4807 do_plt_section_for_local.
4808 (Target_i386::got_section): Create got_irelative_.
4809 (Target_i386::rel_irelative_section): New function.
4810 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4811 fields. Don't define __rel_iplt_{start,end}.
4812 (Output_data_plt_i386::add_entry): Add symtab and layout
4813 parameters. Change all callers. Use different PLT and GOT for
4814 IFUNC symbols.
4815 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4816 layout parameters. Change all callers. Use different PLT and
4817 GOT.
4818 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4819 (Output_data_plt_i386::rel_irelative): New function.
4820 (Output_data_plt_i386::address_for_global): New function.
4821 (Output_data_plt_i386::address_for_local): New function.
4822 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4823 IRELATIVE GOT when changing IFUNC GOT entries.
4824 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4825 reloc.
4826 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4827 if we didn't create an IRELATIVE GOT.
4828 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4829 plt_address_for_local.
4830 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4831 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4832 got_irelative_, and irelative_count_ fields. Update
4833 declarations.
4834 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4835 Initialize new fields. Remove symtab parameter. Change all
4836 callers.
4837 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4838 irelative_count_.
4839 (Output_data_plt_x86_64::has_irelative_section): New function.
4840 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4841 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4842 fields. Update declarations.
4843 (Target_x86_64::Target_x86_64): Initialize new fields.
4844 (Target_x86_64::do_plt_address_for_global): New function replacing
4845 do_plt_section_for_global.
4846 (Target_x86_64::do_plt_address_for_local): New function replacing
4847 do_plt_section_for_local.
4848 (Target_x86_64::got_section): Create got_irelative_.
4849 (Target_x86_64::rela_irelative_section): New function.
4850 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4851 all callers. Don't create __rel_iplt_{start,end}.
4852 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4853 parameters. Change all callers. Use different PLT and GOT for
4854 IFUNC symbols.
4855 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4856 layout parameters. Change all callers. Use different PLT and
4857 GOT.
4858 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4859 parameters. Change all callers. Use different PLT and GOT for
4860 IFUNC symbols.
4861 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4862 (Output_data_plt_x86_64::rela_irelative): New function.
4863 (Output_data_plt_x86_64::address_for_global): New function.
4864 (Output_data_plt_x86_64::address_for_local): New function.
4865 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4866 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4867 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4868 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4869 parameters.
4870 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4871 reloc.
4872 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4873 symbols if we didn't create an IRELATIVE GOT.
4874 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
4875 plt_address_for_local.
4876 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
4877 * testsuite/ifuncvar1.c: New test file.
4878 * testsuite/ifuncvar2.c: New test file.
4879 * testsuite/ifuncvar3.c: New test file.
4880 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
4881 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
4882 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
4883 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
4884 * testsuite/Makefile.in: Rebuild.
4885
33c15b45
CC
48862011-07-07 Cary Coutant <ccoutant@google.com>
4887
4888 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
4889 (two_file_test_1_ndebug.o): Likewise.
4890 (two_file_test_1b_ndebug.o): Likewise.
4891 (two_file_test_2_ndebug.o): Likewise.
4892 (two_file_test_main_ndebug.o): Likewise.
4893 (incremental_test_2): Link with no-debug versions.
4894
f48b5fb7
CC
48952011-07-06 Cary Coutant <ccoutant@google.com>
4896
4897 * gold/incremental.cc
4898 (Output_section_incremental_inputs::write_info_blocks): Check for
4899 hidden and internal symbols.
4900
221597a5
CC
49012011-07-06 Cary Coutant <ccoutant@google.com>
4902
4903 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
4904 Check disposition for startup file.
4905 (Incremental_inputs::report_command_line): Ignore
4906 --incremental-startup-unchanged option.
4907 * options.cc (General_options::parse_incremental_startup_unchanged):
4908 New function.
4909 (General_options::General_options): Initialize new data member.
4910 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
4911 (General_options): Add --incremental-startup-unchanged option.
4912 (General_options::incremental_startup_disposition): New function.
4913 (General_options::incremental_startup_disposition_): New data member.
4914
e24719f6
CC
49152011-07-06 Cary Coutant <ccoutant@google.com>
4916
4917 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
4918 input file index to Script_info ctor.
4919 (Sized_incremental_binary::do_file_has_changed): Find the
4920 command-line argument for files named in scripts.
4921 * incremental.h (Script_info::Script_info): New ctor
4922 with input file index.
4923 (Script_info::input_file_index): New function.
4924 (Script_info::input_file_index_): New data member.
4925 (Incremental_binary::get_library): Add const.
4926 (Incremental_binary::get_script_info): Add const.
4927 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
4928 * testsuite/Makefile.am (incremental_test_5): New test case.
4929 (incremental_test_6): New test case.
4930 * testsuite/Makefile.in: Regenerate.
4931
8f7c81e8
CC
49322011-07-06 Cary Coutant <ccoutant@google.com>
4933
4934 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
4935 debug output when command lines differ.
4936
9fbd3822
CC
49372011-07-06 Cary Coutant <ccoutant@google.com>
4938
4939 * incremental.cc (Incremental_inputs::report_command_line): Ignore
4940 --incremental-patch option.
4941 * layout.cc (Free_list::allocate): Extend allocation beyond original
4942 end if enabled.
4943 (Layout::make_output_section): Mark sections that should get
4944 patch space.
4945 * options.cc (parse_percent): New function.
4946 * options.h (parse_percent): New function.
4947 (DEFINE_percent): New macro.
4948 (General_options): Add --incremental-patch option.
4949 * output.cc (Output_section::Output_section): Initialize new data
4950 members.
4951 (Output_section::add_input_section): Print section name when out
4952 of patch space.
4953 (Output_section::add_output_section_data): Likewise.
4954 (Output_section::set_final_data_size): Add patch space when
4955 doing --incremental-full.
4956 (Output_section::do_reset_address_and_file_offset): Remove patch
4957 space.
4958 (Output_segment::set_section_list_addresses): Print debug output
4959 only if --incremental-update.
4960 * output.h (Output_section::set_is_patch_space_allowed): New function.
4961 (Output_section::is_patch_space_allowed_): New data member.
4962 (Output_section::patch_space_): New data member.
4963 * parameters.cc (Parameters::incremental_full): New function.
4964 * parameters.h (Parameters::incremental_full): New function
4965 * testsuite/Makefile.am (incremental_test_2): Add test for
4966 --incremental-patch option.
4967 * testsuite/Makefile.in: Regenerate.
4968 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
4969 (t18): Remove function body.
4970
f6cccc2c
DK
49712011-07-05 Doug Kwan <dougkwan@google.com>
4972
4973 PR gold/12771
4974 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
4975 Arm_Address type for relocation result.
4976 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
4977 overflow check.
4978 (Arm_relocate_functions::abs32): Use unaligned access.
4979 (Arm_relocate_functions::rel32): Ditto.
4980 (Arm_relocate_functions::prel31): Ditto.
4981 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
4982 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
4983 static data relocations.
4984 * testsuite/Makefile.in: Regnerate.
4985 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
4986
28a13fec
ILT
49872011-07-05 Ian Lance Taylor <iant@google.com>
4988
4989 PR gold/12392
4990 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
4991 symbols if necessary.
4992 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4993
24d47b34
ILT
49942011-07-05 Ian Lance Taylor <iant@google.com>
4995
4996 PR gold/12952
4997 * resolve.cc (Symbol::override_base_with_special): Simply override
4998 version with special symbol version, ignoring previous version.
4999
41f9cbbe
ILT
50002011-07-05 Ian Lance Taylor <iant@google.com>
5001
5002 * object.cc (Sized_relobj_file::include_section_group): Add
5003 information to comment about signature location.
5004
886288f1
ILT
50052011-07-02 Ian Lance Taylor <iant@google.com>
5006
5007 PR gold/12957
5008 * options.h (class General_options): Add -f and -F.
5009 * options.cc (General_options::finalize): Fatal error if -f/-F
5010 are used without -shared.
5011 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5012
ae3a6d4f
ILT
50132011-07-02 Ian Lance Taylor <iant@google.com>
5014
5015 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5016
21131061
ILT
50172011-07-01 Ian Lance Taylor <iant@google.com>
5018
5019 PR gold/12525
5020 PR gold/12952
5021 * resolve.cc (Symbol::override_base_with_special): Don't override
5022 the version if the overriding symbol has a different name.
5023 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5024 all callers. If we give an error about an undefined version,
5025 define the base version if necessary.
5026 * dynobj.h (class Versions): Update declaration.
5027 * testsuite/weak_alias_test_5.cc: New file.
5028 * testsuite/weak_alias_test.script: New file.
5029 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5030 and versioned_alias have the right value, and call t2.
5031 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5032 weak_alias_test_5.so.
5033 (weak_alias_test_LDADD): Likewise.
5034 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5035 * testsuite/Makefile.in: Rebuild.
5036
611062c0
ILT
50372011-07-01 Ian Lance Taylor <iant@google.com>
5038
5039 PR gold/12525
5040 * options.h (class General_options): Support -z notext.
5041 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5042 -Wl,-z,notext.
5043 (two_file_shared_nonpic.so): Likewise.
5044 (two_file_shared_mixed.so): Likewise.
5045 (two_file_shared_mixed_1.so): Likewise.
5046 (weak_undef_lib_nonpic.so): Likewise.
5047 (alt/weak_undef_lib_nonpic.so): Likewise.
5048 (tls_test_shared_nonpic.so): Likewise.
5049 * testsuite/Makefile.in: Rebuild.
5050
328c7c2f
ILT
50512011-07-01 Ian Lance Taylor <iant@google.com>
5052
5053 PR gold/12525
5054 * configure.ac: Test whether static linking works, setting
5055 the automake conditional HAVE_STATIC.
5056 * testsuite/Makefile.am: Disable tests using -static if
5057 HAVE_STATIC is not true.
5058 * configure, testsuite/Makefile.in: Rebuild.
5059
02d7cd44
ILT
50602011-07-01 Ian Lance Taylor <iant@google.com>
5061
5062 PR gold/12525
5063 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5064 Assert if we see DW_EH_PE_indirect.
5065 * target.h (Target::ehframe_datarel_base): New function.
5066 (Target::do_ehframe_datarel_base): New target function.
5067 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5068 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5069 function.
5070
07a60597
ILT
50712011-07-01 Ian Lance Taylor <iant@google.com>
5072
5073 PR gold/12571
5074 * options.h (class General_options): Add
5075 --ld-generated-unwind-info.
5076 * ehframe.cc (Fde::write): Add address parameter. Change all
5077 callers. If associated with PLT, fill in address and size.
5078 (Cie::set_output_offset): Only add merge mapping if there is an
5079 object.
5080 (Cie::write): Add address parameter. Change all callers.
5081 (Eh_frame::add_ehframe_for_plt): New function.
5082 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5083 input_offset_ fields into union u_, with new plt field.
5084 (Fde::Fde): Adjust for new union field.
5085 (Fde::Fde) [Output_data version]: New constructor.
5086 (Fde::add_mapping): Only add merge mapping if there is an object.
5087 (class Cie): Update declarations.
5088 (class Eh_frame): Declare add_ehframe_for_plt.
5089 * layout.cc (Layout::layout_eh_frame): Break out code into
5090 make_eh_frame_section, and call it.
5091 (Layout::make_eh_frame_section): New function.
5092 (Layout::add_eh_frame_for_plt): New function.
5093 * layout.h (class Layout): Update declarations.
5094 * merge.cc (Merge_map::add_mapping): Add assertion.
5095 * i386.cc: Include "dwarf.h".
5096 (class Output_data_plt_i386): Make first_plt_entry,
5097 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5098 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5099 and plt_eh_frame_fde.
5100 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5101 boundary. Call add_eh_frame_for_plt if appropriate.
5102 * x86_64.cc: Include "dwarf.h".
5103 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5104 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5105 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5106 and plt_eh_frame_fde.
5107 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5108 appropriate.
5109
14788a3f
ILT
51102011-06-29 Ian Lance Taylor <iant@google.com>
5111
5112 PR gold/12629
5113 * object.cc (Sized_relobj_file::layout_section): Change shdr
5114 parameter to be const.
5115 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5116 out of do_layout.
5117 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5118 appropriate. Call layout_eh_frame_section.
5119 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5120 sections.
5121 * object.h (class Sized_relobj_file): Update declarations.
5122
6c21fce1
ILT
51232011-06-29 Ian Lance Taylor <iant@google.com>
5124
37e41b03 5125 PR gold/12652
6c21fce1
ILT
5126 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5127 modifier.
5128 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5129
4d5e4e62
ILT
51302011-06-29 Ian Lance Taylor <iant@google.com>
5131
5132 PR gold/12675
5133 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5134 SHT_X86_64_UNWIND.
5135 * layout.cc (Layout::layout_eh_frame): Likewise.
5136
886f533a
ILT
51372011-06-29 Ian Lance Taylor <iant@google.com>
5138
5139 PR gold/12695
5140 * layout.cc (Layout::symtab_section_shndx): New function.
5141 * layout.h (class Layout): Declare symtab_section_shndx.
5142 * output.cc (Output_section::write_header): Call it.
5143
f3ae1b28
ILT
51442011-06-29 Ian Lance Taylor <iant@google.com>
5145
5146 PR gold/12818
5147 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5148 symbols which are not used in a relocation.
5149
aecf301f
ILT
51502011-06-28 Ian Lance Taylor <iant@google.com>
5151
5152 PR gold/12898
5153 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5154 script create indistinguishable segments.
5155 (Layout::set_segment_offsets): Use stable_sort when sorting
5156 segments. Pass this to Compare_segments constructor.
5157 * layout.h (class Layout): Make segment_precedes non-static.
5158 (class Compare_segments): Change from struct to class. Add
5159 layout_ field. Add constructor.
5160 * script-sections.cc
5161 (Script_sections::attach_sections_using_phdrs_clause): Rename
5162 local orphan to is_orphan. Don't report failure to put empty
5163 section in segment. On attachment failure, report name of
5164 section, and attach to first PT_LOAD segment.
5165
03ef7571
ILT
51662011-06-28 Ian Lance Taylor <iant@google.com>
5167
5168 PR gold/12934
5169 * target-select.cc (Target_selector::Target_selector): Add
5170 emulation parameter. Change all callers.
5171 (select_target_by_bfd_name): Rename from select_target_by_name.
5172 Change all callers.
5173 (select_target_by_emulation): New function.
5174 (supported_emulation_names): New function.
5175 * target-select.h (class Target_selector): Add emulation_ field.
5176 Update declarations.
5177 (Target_selector::recognize_by_bfd_name): Rename from
5178 recognize_by_name. Change all callers.
5179 (Target_selector::supported_bfd_names): Rename from
5180 supported_names. Change all callers.
5181 (Target_selector::recognize_by_emulation): New function.
5182 (Target_selector::supported_emulations): New function.
5183 (Target_selector::emulation): New function.
5184 (Target_selector::do_recognize_by_bfd_name): Rename from
5185 do_recognize_by_name. Change all callers.
5186 (Target_selector::do_supported_bfd_names): Rename from
5187 do_supported_names. Change all callers.
5188 (Target_selector::do_recognize_by_emulation): New function.
5189 (Target_selector::do_supported_emulations): New function.
5190 (select_target_by_bfd_name): Change name in declaration.
5191 (select_target_by_emulation): Declare.
5192 (supported_emulation_names): Declare.
5193 * parameters.cc (parameters_force_valid_target): Try to find
5194 target based on emulation from -m option.
5195 * options.h (class General_options): Change doc string for -m.
5196 * options.cc (help): Print emulations.
5197 (General_options::parse_V): Likewise.
5198 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5199 Add emulation parameter. Change all callers.
5200
200b2bb9
ILT
52012011-06-28 Ian Lance Taylor <iant@google.com>
5202
5203 * target.h (class Target): Add osabi_ field.
5204 (Target::osabi): New function.
5205 (Target::set_osabi): New function.
5206 (Target::Target): Initialize osabi_.
5207 (Target::do_adjust_elf_header): Make pure virtual.
5208 (Sized_target::do_adjust_elf_header): Declare.
5209 * target.cc (Sized_target::do_adjust_elf_header): New function.
5210 (class Sized_target): Instantiate all versions.
5211 * freebsd.h (class Target_freebsd): Remove.
5212 (Target_selector_freebsd::do_recognize): Call set_osabi on
5213 Target.
5214 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5215 (Target_selector_freebsd::set_osabi): Remove.
5216 * i386.cc (class Target_i386): Inherit from Sized_target rather
5217 than Target_freebsd.
5218 * x86_64.cc (class Target_x86_64): Likewise.
5219
b3ce541e
ILT
52202011-06-28 Ian Lance Taylor <iant@google.com>
5221
5222 * target.h (Target::can_check_for_function_pointers): Rewrite.
5223 Make non-virtual.
5224 (Target::can_icf_inline_merge_sections): Likewise.
5225 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5226 (Target::Target_info): Add can_icf_inline_merge_sections field.
5227 (Target::do_can_check_for_function_pointers): New virtual
5228 function.
5229 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5230 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5231 from can_check_for_function_pointers, move in file.
5232 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5233 section_may_have_icf_unsafe_poineters, move in file.
5234 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5235 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5236 Rename from can_check_for_function_pointers, move in file.
5237 (Target_i386::can_icf_inline_merge_sections): Remove.
5238 (Target_i386::i386_info): Initialize
5239 can_icf_inline_merge_sections.
5240 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5241 Initialize can_icf_inline_merge_sections.
5242 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5243 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5244 Rename from can_check_for_function_pointers, move in file.
5245 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5246 (Target_x86_64::x86_64_info): Initialize
5247 can_icf_inline_merge_sections.
5248 * testsuite/testfile.cc (Target_test::test_target_info):
5249 Likewise.
5250 * icf.cc (get_section_contents): Correct formatting.
5251
6d1c4efb
ILT
52522011-06-27 Ian Lance Taylor <iant@google.com>
5253
5254 * symtab.cc (Symbol::versioned_name): New function.
5255 (Symbol_table::add_to_final_symtab): Use versioned_name when
5256 appropriate.
5257 (Symbol_table::sized_write_symbol): Likewise.
5258 * symtab.h (class Symbol): Declare versioned_name.
5259 * stringpool.h (class Stringpool_template): Add variant of add
5260 which takes a std::basic_string.
5261 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5262 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5263 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5264 (ver_test_12.o): New target.
5265 * testsuite/Makefile.in: Rebuild.
5266
57eb9b50
DK
52672011-06-27 Doug Kwan <dougkwan@google.com>
5268
5269 * arm.cc (Arm_relocate_functions::thm_jump8,
5270 Arm_relocate_functions::thm_jump11): Use a wider signed
5271 type to compute offset.
5272 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5273 arm_thm_jump8.
5274 * testsuite/Makefile.in: Regenerate.
5275 * testsuite/arm_branch_in_range.sh: Check test results of
5276 arm_thm_jump11 and arm_thm_jump8.
5277 * testsuite/arm_thm_jump11.s: New test source file.
5278 * testsuite/arm_thm_jump11.t: New linker script.
5279 * testsuite/arm_thm_jump8.s: New test source file.
5280 * testsuite/arm_thm_jump8.t: New linker script.
5281
487b39df
ILT
52822011-06-24 Ian Lance Taylor <iant@google.com>
5283
5284 * layout.cc: Include "object.h".
5285 (ctors_sections_in_init_array): New static variable.
5286 (Layout::is_ctors_in_init_array): New function.
5287 (Layout::layout): Add entry to ctors_sections_in_init_array if
5288 appropriate.
5289 * layout.h (class Layout): Declare is_ctors_in_init_array.
5290 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5291 is_ctors_reverse_view is set.
5292 (Sized_relobj_file::write_sections): Add layout parameter. Change
5293 all callers. Set is_ctors_reverse_view field of View_size.
5294 (Sized_relobj_file::reverse_words): New function.
5295 * object.h (Sized_relobj_file::View_size): Add
5296 is_ctors_reverse_view field.
5297 (class Sized_relobj_file): Update declarations.
5298 * testsuite/initpri3.c: New test.
5299 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5300 initpri3b.
5301 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5302 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5303 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5304 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5305 * testsuite/Makefile.in: Rebuild.
5306
472076e4
CC
53072011-06-24 Cary Coutant <ccoutant@google.com>
5308
5309 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5310 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5311 (debug_msg_cdebug.err): New targets.
5312 * testsuite/Makefile.in: Regenerate.
5313 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5314 Fix checks for link with shared library.
5315
a60af0db
DK
53162011-06-24 Doug Kwan <dougkwan@google.com>
5317
5318 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5319 skip empty text sections.
5320 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5321
5393d741
ILT
53222011-06-22 Ian Lance Taylor <iant@google.com>
5323
5324 PR gold/12910
5325 * options.h (class General_options): Add --ctors-in-init-array.
5326 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5327 friends as SHT_PROGBITS for merging sections.
5328 (Layout::layout): Remove special handling of .init_array and
5329 friends. Don't sort if doing relocatable link. Sort for .ctors
5330 and .dtors if ctors_in_init_array.
5331 (Layout::make_output_section): Force correct section types for
5332 .init_array and friends. Don't sort if doing relocatable link,
5333 Don't sort .ctors and .dtors if ctors_in_init_array.
5334 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5335 (Layout::output_section_name): Add relobj parameter. Change all
5336 callers. Handle .ctors. and .dtors. in code rather than table.
5337 Handle .ctors and .dtors if ctors_in_init_array.
5338 (Layout::match_file_name): New function, moved from output.cc.
5339 * layout.h (class Layout): Update declarations.
5340 * output.cc: Include "layout.h".
5341 (Input_section_sort_entry::get_priority): New function.
5342 (Input_section_sort_entry::match_file_name): Just call
5343 Layout::match_file_name.
5344 (Output_section::Input_section_sort_init_fini_compare::operator()):
5345 Handle .ctors and .dtors. Sort by explicit priority rather than
5346 by name.
5347 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5348 * testsuite/initpri2.c: New test.
5349 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5350 (check_PROGRAMS): Add initpri2.
5351 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5352 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5353 * configure, testsuite/Makefile.in: Rebuild.
5354
e1f74f98
ILT
53552011-06-19 Ian Lance Taylor <iant@google.com>
5356
5357 PR gold/12880
5358 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5359 .interp section to a PT_INTERP segment even if we have seen a
5360 --dynamic-linker option. Don't do it if we have seen a PHDRS
5361 clause in a linker script.
5362 (Layout::finalize): Don't create a .interp section if we've
5363 already create a PT_INTERP segment.
5364 (Layout::create_interp): Always call choose_output_section (revert
5365 patch of 2011-06-17). Don't create PT_INTERP segment.
5366 * script-sections.cc
5367 (Script_sections::create_note_and_tls_segments): Add a .interp
5368 section to a PT_INTERP segment even if we have seen a
5369 --dynamic-linker option.
5370
766f91bb
ILT
53712011-06-18 Ian Lance Taylor <iant@google.com>
5372
5373 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5374 merely because a non-PT_LOAD segment has a dynamic reloc.
5375
0d212c3a
ILT
53762011-06-18 Ian Lance Taylor <iant@google.com>
5377
5378 * layout.cc (Layout::finish_dynamic_section): Don't create
5379 DT_FLAGS entry if not needed.
5380
911a5072
ILT
53812011-06-18 Ian Lance Taylor <iant@google.com>
5382
5383 PR gold/12745
5384 * layout.cc (Layout::layout_eh_frame): Correct handling of
5385 writable .eh_frame section.
5386
534b4e5f
ILT
53872011-06-17 Ian Lance Taylor <iant@google.com>
5388
5389 PR gold/12893
5390 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5391 symbol is redefined with the exact same object and value.
5392
10b4f102
ILT
53932011-06-17 Ian Lance Taylor <iant@google.com>
5394
5395 PR gold/12880
5396 * layout.h (class Layout): Add interp_segment_ field.
5397 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5398 (Layout::attach_allocated_section_to_segment): If making shared
5399 library, put .interp section in PT_INTERP segment.
5400 (Layout::finalize): Also call create_interp if -dynamic-linker
5401 option was used.
5402 (Layout::create_interp): Assert that there is no PT_INTERP
5403 segment. If not using a SECTIONS clause, use make_output_section.
5404 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5405 * script-sections.cc
5406 (Script_sections::create_note_and_tls_segments): If making shared
5407 library, put .interp section in PT_INTERP segment.
5408
a29b0dad
ILT
54092011-06-17 Ian Lance Taylor <iant@google.com>
5410
e588ea8d
ILT
5411 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5412 when making a shared library.
5413
54142011-06-17 Ian Lance Taylor <iant@google.com>
5415
5416 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5417 parameter. Change all callers. Don't issue warning about PC32
5418 against locally defined symbol.
a29b0dad 5419
9d3b0698
ILT
54202011-06-16 Ian Lance Taylor <iant@google.com>
5421
5422 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5423 occurs in same object.
5424
85b0f90c
AM
54252011-06-14 Alan Modra <amodra@gmail.com>
5426
5427 * po/POTFILES.in: Regenerate.
5428
a94907d9
ILT
54292011-06-09 Ian Lance Taylor <iant@google.com>
5430
5431 * script-sections.cc
5432 (Orphan_output_section::set_section_addresses): For a relocatable
5433 link set address to 0.
5434
4fb3a1c3
CC
54352011-06-09 Cary Coutant <ccoutant@google.com>
5436
5437 PR gold/12804
5438 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5439 used with --compress-debug-sections.
5440 * gold/object.cc (Sized_relobj_file::do_layout): Report
5441 uncompressed size of compressed input sections.
5442
61220854
CC
54432011-06-08 Cary Coutant <ccoutant@google.com>
5444
5445 PR gold/12804
5446 * testsuite/two_file_test_2_v1.cc: Change initialization of
5447 v2 to keep it in .data.
5448
e6455dfb
CC
54492011-06-07 Cary Coutant <ccoutant@google.com>
5450
5451 * common.cc (Symbol_table::do_allocate_commons_list): Call
5452 gold_fallback.
5453 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5454 (Errors::fallback): New function.
5455 (gold_fallback): New function.
5456 * errors.h (Errors::fallback): New function.
5457 * gold.cc (gold_exit): Change status parameter to enum; adjust
5458 all callers.
5459 (queue_initial_tasks): Call gold_fallback.
5460 * gold.h: Include cstdlib.
5461 (Exit_status): New enum type.
5462 (gold_exit): Change status parameter to enum.
5463 (gold_fallback): New function.
5464 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5465 (Layout::create_symtab_sections): Likewise.
5466 (Layout::create_shdrs): Likewise.
5467 * main.cc (main): Adjust call to gold_exit.
5468 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5469 (Output_data_got::add_got_entry_pair): Likewise.
5470 (Output_section::add_input_section): Likewise.
5471 (Output_section::add_output_section_data): Likewise.
5472 (Output_segment::set_section_list_addresses): Likewise.
5473 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5474
fb0e076f
CC
54752011-06-07 Cary Coutant <ccoutant@google.com>
5476
5477 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5478 for incremental links.
5479 * output.cc (Output_segment::set_section_list_addresses): Remove
5480 FIXME and test for TLS or BSS.
5481
a5ee4d5d
CC
54822011-06-07 Cary Coutant <ccoutant@google.com>
5483
5484 * testsuite/Makefile.am: Add incremental_copy_test,
5485 incremental_common_test_1.
5486 * testsuite/Makefile.in: Regenerate.
5487 * testsuite/common_test_1_v1.c: New source file.
5488 * testsuite/common_test_1_v2.c: New source file.
5489 * testsuite/copy_test_v1.cc: New source file.
5490
5146f448
CC
54912011-06-07 Cary Coutant <ccoutant@google.com>
5492
5493 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5494 update, allocate common from bss section's free list.
5495 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5496 linker-defined symbols.
5497 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5498 Skip GOT and PLT entries that are no longer referenced.
5499 (Output_section_incremental_inputs::write_info_blocks): Mark
5500 linker-defined symbols.
5501 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5502 * output.cc (Output_section::allocate): New function.
5503 * output.h (Output_section::allocate): New function.
5504 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5505 linker-defined symbols.
5506 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5507 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5508 (Symbol::init_base_output_data): Likewise.
5509 (Symbol::init_base_output_segment): Likewise.
5510 (Symbol::init_base_constant): Likewise.
5511 (Sized_symbol::init_output_data): Likewise.
5512 (Sized_symbol::init_output_segment): Likewise.
5513 (Sized_symbol::init_constant): Likewise.
5514 (Symbol_table::do_define_in_output_data): Likewise.
5515 (Symbol_table::do_define_in_output_segment): Likewise.
5516 (Symbol_table::do_define_as_constant): Likewise.
5517 * symtab.h (Symbol::is_predefined): New function.
5518 (Symbol::init_base_output_data): Add is_predefined parameter.
5519 (Symbol::init_base_output_segment): Likewise.
5520 (Symbol::init_base_constant): Likewise.
5521 (Symbol::is_predefined_): New data member.
5522 (Sized_symbol::init_output_data): Add is_predefined parameter.
5523 (Sized_symbol::init_output_segment): Likewise.
5524 (Sized_symbol::init_constant): Likewise.
5525 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5526
26d3c67d
CC
55272011-06-07 Cary Coutant <ccoutant@google.com>
5528
5529 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5530 instead of emit_copy_reloc.
5531 (Copy_relocs::emit_copy_reloc): Refactor.
5532 (Copy_relocs::make_copy_reloc): New function.
5533 (Copy_relocs::add_copy_reloc): Remove.
5534 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5535 section.
5536 (Copy_relocs::make_copy_reloc): New function.
5537 (Copy_relocs::add_copy_reloc): Remove.
5538 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5539 unchanged input files.
5540 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5541 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5542 Reserve BSS space for COPY relocations.
5543 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5544 (Output_section_incremental_inputs::write_info_blocks): Record
5545 whether a symbol is copied from a shared object.
5546 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5547 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5548 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5549 (Incremental_input_entry_reader::get_output_symbol_index): Add
5550 is_copy parameter.
5551 (Incremental_binary::emit_copy_relocs): New function.
5552 (Incremental_binary::do_emit_copy_relocs): New function.
5553 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5554 new data member.
5555 (Sized_incremental_binary::add_copy_reloc): New function.
5556 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5557 (Sized_incremental_binary::Copy_reloc): New struct.
5558 (Sized_incremental_binary::Copy_relocs): New typedef.
5559 (Sized_incremental_binary::copy_relocs_): New data member.
5560 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5561 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5562 * target.h (Sized_target::emit_copy_reloc): New function.
5563 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5564
7cdb37d9
CC
55652011-06-02 Cary Coutant <ccoutant@google.com>
5566
5567 PR gold/12163
5568 * gold/archive.cc (Archive::Archive): Initialize new data member.
5569 (Archive::include_all_members): Return if archive has already been
5570 included.
5571 * gold/archive.h (Archive::include_all_members_): New data member.
5572
cc643b88
NC
55732011-06-02 Nick Clifton <nickc@redhat.com>
5574
5575 * dynobj.h: Fix spelling mistake in comment.
5576 * output.cc: Likewise.
5577
f62a3ca7 55782011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 5579 Asier Llano
f62a3ca7
DK
5580
5581 PR gold/12826
cc643b88 5582 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
5583 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5584 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5585 redundant arm_exidx_test.so.
5586 * testsuite/Makefile.in: Regenerate.
5587 (check_SCRIPTS): Add pr12826.sh
5588 (check_DATA): Add pr12826.stdout
5589 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5590 * testsuite/pr12826.sh: New file.
5591 * testsuite/pr12826_1.s: Ditto.
5592 * testsuite/pr12826_1.s: Ditto.
5593
8dbe1edc
ILT
55942011-05-30 Ian Lance Taylor <iant@google.com>
5595
5596 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5597 sections.
5598
c49875be
ILT
55992011-05-29 Ian Lance Taylor <iant@google.com>
5600
5601 PR gold/12804
5602 * testsuite/Makefile.am: Use different file name for two_file_test
5603 temporary file for each incremental test.
5604 * testsuite/Makefile.in: Rebuild.
5605
69d53f7a
ILT
56062011-05-29 Ian Lance Taylor <iant@google.com>
5607
5608 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5609 binary input file is empty.
5610
41d0ab5f
ILT
56112011-05-27 Ian Lance Taylor <iant@google.com>
5612
5613 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5614 (ver_test_9.so): Likewise.
5615 * testsuite/Makefile.in: Rebuild.
5616
89d8a36b
CC
56172011-05-26 Cary Coutant <ccoutant@google.com>
5618
5619 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5620 * incremental.cc (Incremental_inputs::report_input_section): Fix
5621 comment, indentation.
5622 (Incremental_inputs::report_comdat_group): New function.
5623 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5624 of data for incremental input file entry.
5625 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5626 group count, COMDAT group signatures.
5627 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5628 an unchanged input file.
5629 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5630 Initialize new data member.
5631 (Incremental_object_entry::add_comdat_group): New function.
5632 (Incremental_object_entry::get_comdat_group_count): New function.
5633 (Incremental_object_entry::get_comdat_signature_key): New function.
5634 (Incremental_object_entry::groups_): New data member.
5635 (Incremental_inputs::report_comdat_group): New function.
5636 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5637 data for incremental input file entry.
5638 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5639 (Incremental_input_entry_reader::get_input_section): Adjust size of
5640 data for incremental input file entry.
5641 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5642 (Incremental_input_entry_reader::get_comdat_group_signature): New
5643 function.
5644 * object.cc (Sized_relobj::include_section_group): Report kept
5645 COMDAT groups for incremental links.
5646
1706a06f
ILT
56472011-05-24 David Meyer <pdox@google.com>
5648
5649 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5650 with name parameter. Add found_name parameter.
5651 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5652 * dirsearch.h (class Dirsearch): Update declaration.
5653
a10ae760
ILT
56542011-05-24 Ian Lance Taylor <iant@google.com>
5655
5656 * archive.cc (Library_base::should_include_member): Pull in object
5657 from archive if it defines the entry symbol.
5658 * parameters.cc (Parameters::entry): New function.
5659 * parameters.h (class Parameters): Declare entry.
5660 * output.h (class Output_file_header): Remove entry_ field.
5661 * output.cc (Output_file_header::Output_file_header): Remove entry
5662 parameter. Change all callers.
5663 (Output_file_header::entry): Use parameters->entry.
5664 * gold.cc (queue_middle_tasks): Likewise.
5665 * plugin.cc (Plugin_hook::run): Likewise.
5666
aa92d6ed
CC
56672011-05-24 Cary Coutant <ccoutant@google.com>
5668
5669 * gold.cc (queue_initial_tasks): Pass incremental base filename
5670 to Output_file::open_base_file; don't print error message.
5671 * incremental-dump.cc (main): Adjust call to
5672 Output_file::open_for_modification.
5673 * incremental-dump.cc (main): Likewise.
5674 * incremental.cc (Incremental_inputs::report_command_line):
5675 Ignore --incremental-base option when comparing command lines.
5676 Ignore parameter when given as separate argument.
5677 * options.h (class General_options): Add --incremental-base.
5678 * output.cc (Output_file::Output_file):
5679 (Output_file::open_base_file): Add base_name and writable parameters;
5680 read base file into new file; print error message here.
5681 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5682 callers.
5683 * output.h (Output_file::open_for_modification): Rename to...
5684 (Output_file::open_base_file): ...this; add base_name and
5685 writable parameters; adjust all callers.
5686 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5687 callers.
5688 * testsuite/Makefile.am (incremental_test_4): Test
5689 --incremental-base.
5690 * testsuite/Makefile.in: Regenerate.
5691
2eedd706
CC
56922011-05-24 Cary Coutant <ccoutant@google.com>
5693
5694 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5695 incremental_test_4.
5696 * testsuite/Makefile.in: Regenerate.
5697 * testsuite/two_file_test_1_v1.cc: New test source file.
5698 * testsuite/two_file_test_1b_v1.cc: New test source file.
5699 * testsuite/two_file_test_2_v1.cc: New test source file.
5700
0f1c85a6
CC
57012011-05-24 Cary Coutant <ccoutant@google.com>
5702
5703 * dynobj.h (Dynobj::do_dynobj): New function.
5704 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5705 flag and soname for shared objects.
5706 * incremental.cc (Incremental_inputs::report_object): Make
5707 either Incremental_object_entry or Incremental_dynobj_entry; add
5708 soname to string table.
5709 (Incremental_inputs::report_input_section): Add assertion.
5710 (Output_section_incremental_inputs::set_final_data_size): Adjust
5711 type of input file entry for shared libraries; adjust size of
5712 shared library info entry.
5713 (Output_section_incremental_inputs::write_input_files): Write
5714 as_needed flag for shared libraries.
5715 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5716 of input file entry for shared libraries; write soname.
5717 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5718 soname from incremental info.
5719 * incremental.h (enum Incremental_input_flags): Add
5720 INCREMENTAL_INPUT_AS_NEEDED.
5721 (Incremental_input_entry::Incremental_input_entry): Initialize new
5722 data member.
5723 (Incremental_input_entry::set_as_needed): New function.
5724 (Incremental_input_entry::as_needed): New function.
5725 (Incremental_input_entry::do_dynobj_entry): New function.
5726 (Incremental_input_entry::as_needed_): New data member.
5727 (Incremental_object_entry::Incremental_object_entry): Don't check
5728 for shared library.
5729 (Incremental_object_entry::do_type): Likewise.
5730 (class Incremental_dynobj_entry): New class.
5731 (Incremental_input_entry_reader::as_needed): New function.
5732 (Incremental_input_entry_reader::get_soname): New function.
5733 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5734 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5735 size of shared library info entry.
58797674 5736 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
5737 incremental link when adding DT_NEEDED entries.
5738 * object.h (Object::Object): Initialize new data member.
5739 (Object::dynobj): New function.
5740 (Object::set_as_needed): New function.
5741 (Object::as_needed): New function.
5742 (Object::do_dynobj): New function.
5743 (Object::as_needed_): New data member.
5744
6fa2a40b
CC
57452011-05-24 Cary Coutant <ccoutant@google.com>
5746
5747 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5748 info; adjust display of GOT entries.
5749 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5750 vector of input objects; remove file_status_.
5751 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5752 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5753 got_plt reader; call target hooks to reserve GOT entries.
5754 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5755 of input file info header and GOT info entry.
5756 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5757 relocation info.
5758 (Got_plt_view_info::got_descriptor): Remove.
5759 (Got_plt_view_info::sym_index): New data member.
5760 (Got_plt_view_info::input_index): New data member.
5761 (Local_got_offset_visitor::visit): Write input file index.
5762 (Global_got_offset_visitor::visit): Write 0 for input file index.
5763 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5764 with sym_index and input_index.
5765 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5766 incremental info GOT entry; replace got_descriptor with input_index.
5767 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5768 map from input file index to object.
5769 (Sized_relobj_incr::do_layout): Replace direct data member reference
5770 with accessor function.
5771 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5772 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5773 Adjust size of input file info header.
5774 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5775 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5776 (Incremental_input_entry_reader::get_input_section): Adjust size of
5777 input file info header.
5778 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5779 of incremental info GOT entry.
5780 (Incremental_got_plt_reader::get_got_desc): Remove.
5781 (Incremental_got_plt_reader::get_got_symndx): New function.
5782 (Incremental_got_plt_reader::get_got_input_index): New function.
5783 (Sized_incremental_binary::Sized_incremental_binary): Remove
5784 file_status_; add input_objects_.
5785 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5786 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5787 (Sized_incremental_binary::file_is_unchanged): Remove.
5788 (Sized_incremental_binary::set_input_object): New function.
5789 (Sized_incremental_binary::input_object): New function.
5790 (Sized_incremental_binary::file_status_): Remove.
5791 (Sized_incremental_binary::input_objects_): New data member.
5792 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5793 references.
5794 (Sized_relobj_incr::invalid_address): Move to base class.
5795 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5796 class.
5797 (Sized_relobj_incr::do_output_section_offset): Likewise.
5798 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5799 (Sized_relobj_incr::section_offsets_): Likewise.
5800 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5801 function.
5802 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5803 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5804 with accessor function.
5805 (Sized_relobj_file::do_layout): Likewise.
5806 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5807 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5808 (Sized_relobj_file::compute_final_local_value): Replace refs to
5809 section_offsets_ with accessor function.
5810 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5811 * object.h (Relobj::Relobj): Initialize new data members.
5812 (Relobj::add_dyn_reloc): New function.
5813 (Relobj::first_dyn_reloc): New function.
5814 (Relobj::dyn_reloc_count): New function.
5815 (Relobj::first_dyn_reloc_): New data member.
5816 (Relobj::dyn_reloc_count_): New data member.
5817 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5818 references.
5819 (Sized_relobj::Address): New typedef.
5820 (Sized_relobj::invalid_address): Move here from child class.
5821 (Sized_relobj::Sized_relobj): Initialize new data members.
5822 (Sized_relobj::sized_relobj): New function.
5823 (Sized_relobj::is_output_section_offset_invalid): Move here from
5824 child class.
5825 (Sized_relobj::get_output_section_offset): Likewise.
5826 (Sized_relobj::local_has_got_offset): Likewise.
5827 (Sized_relobj::local_got_offset): Likewise.
5828 (Sized_relobj::set_local_got_offset): Likewise.
5829 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5830 (Sized_relobj::clear_got_offsets): New function.
5831 (Sized_relobj::section_offsets): Move here from child class.
5832 (Sized_relobj::do_output_section_offset): Likewise.
5833 (Sized_relobj::do_set_section_offset): Likewise.
5834 (Sized_relobj::Local_got_offsets): Likewise.
5835 (Sized_relobj::local_got_offsets_): Likewise.
5836 (Sized_relobj::section_offsets_): Likewise.
5837 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5838 references.
5839 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5840 class.
5841 (Sized_relobj_file::sized_relobj): New function
5842 (Sized_relobj_file::local_has_got_offset): Move to base class.
5843 (Sized_relobj_file::local_got_offset): Likewise.
5844 (Sized_relobj_file::set_local_got_offset): Likewise.
5845 (Sized_relobj_file::get_output_section_offset): Likewise.
5846 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5847 (Sized_relobj_file::do_output_section_offset): Likewise.
5848 (Sized_relobj_file::do_set_section_offset): Likewise.
5849 (Sized_relobj_file::Local_got_offsets): Likewise.
5850 (Sized_relobj_file::local_got_offsets_): Likewise.
5851 (Sized_relobj_file::section_offsets_): Likewise.
5852 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5853 (all constructors).
5854 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5855 (Output_reloc::get_symbol_index): Likewise.
5856 (Output_reloc::local_section_offset): Likewise.
5857 (Output_reloc::get_address): Likewise.
5858 (Output_reloc::symbol_value): Likewise.
5859 (Output_data_got::reserve_slot): Move to class definition.
5860 (Output_data_got::reserve_local): New function.
5861 (Output_data_got::reserve_slot_for_global): Remove.
5862 (Output_data_got::reserve_global): New function.
5863 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5864 (all constructors, two instantiations).
5865 (Output_reloc::get_relobj): New function (two instantiations).
5866 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5867 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5868 (Output_data_reloc::add_global): Adjust type of relobj.
5869 (Output_data_reloc::add_global_relative): Likewise.
5870 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5871 (Output_data_reloc::add_local): Likewise.
5872 (Output_data_reloc::add_local_relative): Likewise.
5873 (Output_data_reloc::add_symbolless_local_addend): Likewise.
5874 (Output_data_reloc::add_local_section): Likewise.
5875 (Output_data_reloc::add_output_section): Likewise.
5876 (Output_data_reloc::add_absolute): Likewise.
5877 (Output_data_reloc::add_target_specific): Likewise.
5878 (Output_data_got::reserve_slot): Move definition here.
5879 (Output_data_got::reserve_local): New function.
5880 (Output_data_got::reserve_global): New function.
5881 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
5882 section_offsets_ with accessor function.
5883 (Sized_relobj_file::write_sections): Likewise.
5884 (Sized_relobj_file::do_relocate_sections): Likewise.
5885 * target.h (Sized_target::reserve_local_got_entry): New function.
5886 (Sized_target::reserve_global_got_entry): New function.
5887 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
5888 (Target_x86_64::reserve_global_got_entry): New function.
5889 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
5890
4829d394
CC
58912011-05-23 Cary Coutant <ccoutant@google.com>
5892
5893 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
5894 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
5895 bit when checking got_type.
5896 * incremental.cc (Sized_incremental_binary::setup_readers):
5897 Store symbol table and string table locations; initialize bit vector
5898 of file status flags.
5899 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
5900 unchanged files.
5901 (Sized_incremental_binary::do_process_got_plt): New function.
5902 (Sized_incremental_binary::get_symtab_view): Use stored locations.
5903 (Output_section_incremental_inputs::set_final_data_size): Record
5904 file index for each input file.
5905 (Output_section_incremental_inputs::write_got_plt): Store file index
5906 instead of input entry offset for each GOT entry.
5907 * incremental.h
5908 (Incremental_input_entry::Incremental_input_entry): Initialize new
5909 data member.
5910 (Incremental_input_entry::set_offset): Store file index.
5911 (Incremental_input_entry::get_file_index): New function.
5912 (Incremental_input_entry::file_index_): New data member.
5913 (Incremental_binary::process_got_plt): New function.
5914 (Incremental_binary::do_process_got_plt): New function.
5915 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5916 data members.
5917 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
5918 (Sized_incremental_binary::set_file_is_unchanged): New function.
5919 (Sized_incremental_binary::file_is_unchanged): New function.
5920 (Sized_incremental_binary::do_process_got_plt): New function.
5921 (Sized_incremental_binary::file_status_): New data member.
5922 (Sized_incremental_binary::main_symtab_loc_): New data member.
5923 (Sized_incremental_binary::main_strtab_loc_): New data member.
5924 * output.cc (Output_data_got::Got_entry::write): Add case
5925 RESERVED_CODE.
5926 (Output_data_got::add_global): Call add_got_entry.
5927 (Output_data_got::add_global_plt): Likewise.
5928 (Output_data_got::add_global_with_rel): Likewise.
5929 (Output_data_got::add_global_with_rela): Likewise.
5930 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
5931 (Output_data_got::add_global_pair_with_rela): Likewise.
5932 (Output_data_got::add_local): Call add_got_entry.
5933 (Output_data_got::add_local_plt): Likewise.
5934 (Output_data_got::add_local_with_rel): Likewise.
5935 (Output_data_got::add_local_with_rela): Likewise.
5936 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
5937 (Output_data_got::add_local_pair_with_rela): Likewise.
5938 (Output_data_got::reserve_slot): New function.
5939 (Output_data_got::reserve_slot_for_global): New function.
5940 (Output_data_got::add_got_entry): New function.
5941 (Output_data_got::add_got_entry_pair): New function.
5942 (Output_section::add_output_section_data): Edit FIXME.
5943 * output.h
5944 (Output_section_data_build::Output_section_data_build): New
5945 constructor with size parameter.
5946 (Output_data_space::Output_data_space): Likewise.
5947 (Output_data_got::Output_data_got): Initialize new data member; new
5948 constructor with size parameter.
5949 (Output_data_got::add_constant): Call add_got_entry.
5950 (Output_data_got::reserve_slot): New function.
5951 (Output_data_got::reserve_slot_for_global): New function.
5952 (class Output_data_got::Got_entry): Add RESERVED_CODE.
5953 (Output_data_got::add_got_entry): New function.
5954 (Output_data_got::add_got_entry_pair): New function.
5955 (Output_data_got::free_list_): New data member.
5956 * target.h (Sized_target::init_got_plt_for_update): New function.
5957 (Sized_target::register_global_plt_entry): New function.
5958 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5959 Initialize new data member; call init; add constructor with PLT count.
5960 (Output_data_plt_x86_64::init): New function.
5961 (Output_data_plt_x86_64::add_relocation): New function.
5962 (Output_data_plt_x86_64::reserve_slot): New function.
5963 (Output_data_plt_x86_64::free_list_): New data member.
5964 (Target_x86_64::init_got_plt_for_update): New function.
5965 (Target_x86_64::register_global_plt_entry): New function.
5966 (Output_data_plt_x86_64::add_entry): Allocate from free list for
5967 incremental updates.
5968 (Output_data_plt_x86_64::add_relocation): New function.
5969 * testsuite/object_unittest.cc (Object_test): Set default options.
5970
ec69d6da
ILT
59712011-05-16 Ian Lance Taylor <iant@google.com>
5972
5973 * options.h (class General_options): Make -i a synonym for -r.
5974
732e31de
ILT
59752011-05-16 Ian Lance Taylor <iant@google.com>
5976
5977 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
5978
403676b5
CC
59792011-05-10 Cary Coutant <ccoutant@google.com>
5980
5981 * object.cc (Sized_relobj::do_count_local_symbols): Check for
5982 strip_all (-s).
5983
5b7b7d6e
ILT
59842011-05-06 Ian Lance Taylor <iant@google.com>
5985
5986 * layout.cc (Layout::layout): If the output section flags change,
5987 update the ordering.
5988
f0f9babf
CC
59892011-04-25 Cary Coutant <ccoutant@google.com>
5990
5991 * incremental-dump.cc (dump_incremental_inputs): Print local
5992 symbol info for each input file.
5993 * incremental.cc
5994 (Output_section_incremental_inputs::set_final_data_size): Add local
5995 symbol info to input file entries in incremental info.
5996 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5997 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
5998 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
5999 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6000 implementation.
6001 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6002 (Sized_incr_relobj::do_relocate): Write the local symbols.
6003 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6004 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6005 Adjust size of input file header.
6006 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6007 (Incremental_inputs_reader::get_local_symbol_count): New function.
6008 (Incremental_inputs_reader::get_input_section): Adjust size of input
6009 file header.
6010 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6011 (Sized_incr_relobj::This): New typedef.
6012 (Sized_incr_relobj::sym_size): New const data member.
6013 (Sized_incr_relobj::Local_symbol): New struct.
6014 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6015 (Sized_incr_relobj::do_local_symbol_offset): New function.
6016 (Sized_incr_relobj::local_symbol_count_): New data member.
6017 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6018 (Sized_incr_relobj::local_symbol_index_): New data member.
6019 (Sized_incr_relobj::local_symbol_offset_): New data member.
6020 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6021 (Sized_incr_relobj::local_symbols_): New data member.
6022 * object.h (Relobj::output_local_symbol_count): New function.
6023 (Relobj::local_symbol_offset): New function.
6024 (Relobj::do_output_local_symbol_count): New function.
6025 (Relobj::do_local_symbol_offset): New function.
6026 (Sized_relobj::do_output_local_symbol_count): New function.
6027 (Sized_relobj::do_local_symbol_offset): New function.
6028
d0a9ace3
ILT
60292011-04-22 Vladimir Simonov <sv@sw.ru>
6030
6031 * descriptors.cc (set_close_on_exec): New function.
6032 (Descriptors::open): Use set_close_on_exec.
6033 * output.cc (S_ISLNK): Define if not defined.
6034
94a3fc8b
CC
60352011-04-22 Cary Coutant <ccoutant@google.com>
6036
6037 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6038 global symbol map.
6039 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6040 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6041 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6042 relocations.
6043 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6044 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6045 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6046 * incremental.h
6047 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6048 function.
6049 (Incremental_binary::apply_incremental_relocs): New function.
6050 (Incremental_binary::do_apply_incremental_relocs): New function.
6051 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6052 data member.
6053 (Sized_incremental_binary::add_global_symbol): New function.
6054 (Sized_incremental_binary::global_symbol): New function.
6055 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6056 (Sized_incremental_binary::symbol_map_): New data member.
6057 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6058 * target.h (Sized_target::apply_relocation): New function.
6059 * target-reloc.h (apply_relocation): New function.
6060 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6061
c87e4302
DK
60622011-04-22 Doug Kwan <dougkwan@google.com>
6063
6064 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6065 flag of a SHT_ARM_EXIDX section.
2e702c99 6066 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
6067 * testsuite/Makefile.in: Regenerate.
6068 * testsuite/arm_exidx_test.s: New file.
6069 * testsuite/arm_exidx_test.sh: Same.
6070
e7782cf6
CC
60712011-04-20 Cary Coutant <ccoutant@google.com>
6072
6073 PR gold/12689
6074 * archive.h (Incremental_archive_entry::Archive_member):
6075 Initialize arg_serial_ (second constructor).
6076
308ecdc7
ILT
60772011-04-17 Ian Lance Taylor <iant@google.com>
6078
6079 * object.cc (Relocate_info::location): Simplify location string.
6080 * errors.cc (Errors::error_at_location): Don't print program
6081 name.
6082 (Errors::warning_at_location): Likewise.
6083 (Errors::undefined_symbol): Likewise.
6084 * testsuite/debug_msg.sh: Update accordingly.
6085
bec5b579
CC
60862011-04-14 Cary Coutant <ccoutant@google.com>
6087
6088 * gold/layout.cc (Layout::symtab_section_offset): New function.
6089 * gold/layout.h (Layout::symtab_section_offset): New function.
6090 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6091
88597d34
ILT
60922011-04-12 Ian Lance Taylor <iant@google.com>
6093
6094 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6095 with MREMAP_MAYMOVE.
6096 * output.h (class Output_file): Add map_is_allocated_ field.
6097 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6098 not available, provide stubs. If mremap is not available, #define
6099 it to gold_mremap.
6100 (MREMAP_MAYMOVE): Define if not defined.
6101 (Output_file::Output_file): Initialize map_is_allocated_.
6102 (Output_file::resize): Check map_is_allocated_.
6103 (Output_file::map_anonymous): If mmap fails, use malloc.
6104 (Output_file::unmap): Don't do anything for an anonymous map.
6105 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6106 is not available, provide stubs.
6107 (File_read::View::~View): Use free rather than delete[].
6108 (File_read::make_view): Use malloc rather than new[]. If mmap
6109 fails, use malloc.
6110 (File_read::find_or_make_view): Use malloc rather than new[].
6111 * gold.h: Remove HAVE_REMAP code.
6112 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6113 exists. Rename mremap to gold_mremap. If mmap is not available
6114 don't do anything.
6115 * configure, config.in: Rebuild.
6116
11e361bc
ILT
61172011-04-11 Ian Lance Taylor <iant@google.com>
6118
6119 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6120 initialize local variable v.
6121
cdc29364
CC
61222011-04-11 Cary Coutant <ccoutant@google.com>
6123
6124 * archive.cc (Archive::include_member): Adjust call to
6125 report_object.
6126 (Add_archive_symbols::run): Track argument serial numbers.
6127 (Lib_group::include_member): Likewise.
6128 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6129 * archive.h (Incremental_archive_entry::Archive_member):
6130 Initialize arg_serial_.
6131 (Archive_member::arg_serial_): New data member.
6132 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6133 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6134 incremental link.
6135 (Sized_dynobj::do_for_all_local_got_entries): New function.
6136 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6137 function.
6138 * fileread.cc (get_mtime): New function.
6139 * fileread.h (get_mtime): New function.
6140 * gold.cc (queue_initial_tasks): Check for incremental update.
6141 (process_incremental_input): New function.
6142 (queue_middle_tasks): Don't force valid target for incremental
6143 update.
6144 * incremental-dump.cc (find_input_containing_global): Adjust
6145 size of symbol info entry.
6146 (dump_incremental_inputs): Dump argument serial number and
6147 in_system_directory flag; bias shndx by 1; print symbol names
6148 when dumping per-file symbol lists; use new symbol info readers.
6149 * incremental.cc
6150 (Output_section_incremental_inputs:update_data_size): New function.
6151 (Sized_incremental_binary::setup_readers): Setup input readers
6152 for each input file; build maps for files added from libraries
6153 and scripts.
6154 (Sized_incremental_binary::check_input_args): New function.
6155 (Sized_incremental_binary::do_check_inputs): Build map of argument
6156 serial numbers to input arguments.
6157 (Sized_incremental_binary::do_file_has_changed): Rename
6158 do_file_is_unchanged to this; compare file modification times.
6159 (Sized_incremental_binary::do_init_layout): New function.
6160 (Sized_incremental_binary::do_reserve_layout): New function.
6161 (Sized_incremental_binary::do_get_input_reader): Remove.
6162 (Sized_incremental_binary::get_symtab_view): New function.
6163 (Incremental_checker::can_incrementally_link_output_file): Remove.
6164 (Incremental_inputs::report_command_line): Exclude --debug options.
6165 (Incremental_inputs::report_archive_begin): Add parameter; track
6166 argument serial numbers; don't put input file entry for archive
6167 before archive members.
6168 (Incremental_inputs::report_archive_end): Put input file entry
6169 for archive after archive members.
6170 (Incremental_inputs::report_object): Add parameter; track argument
6171 serial numbers and in_system_directory flag.
6172 (Incremental_inputs::report_script): Add parameter; track argument
6173 serial numbers.
6174 (Output_section_incremental_inputs::set_final_data_size): Adjust
6175 size of symbol info entry; check for forwarding symbols.
6176 (Output_section_incremental_inputs::write_input_files): Write
6177 in_system_directory flag and argument serial number.
6178 (Output_section_incremental_inputs::write_info_blocks): Map section
6179 indices between incremental info and original input file; store
6180 input section index for each symbol.
6181 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6182 change operator() to visit().
6183 (class Global_got_offset_visitor): Likewise.
6184 (class Global_symbol_visitor_got_plt):
6185 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6186 classes.
6187 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6188 (Sized_incr_relobj::do_read_symbols): New function.
6189 (Sized_incr_relobj::do_layout): New function.
6190 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6191 (Sized_incr_relobj::do_add_symbols): New function.
6192 (Sized_incr_relobj::do_should_include_member): New function.
6193 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6194 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6195 (Sized_incr_relobj::do_section_size): New function.
6196 (Sized_incr_relobj::do_section_name): New function.
6197 (Sized_incr_relobj::do_section_contents): New function.
6198 (Sized_incr_relobj::do_section_flags): New function.
6199 (Sized_incr_relobj::do_section_entsize): New function.
6200 (Sized_incr_relobj::do_section_address): New function.
6201 (Sized_incr_relobj::do_section_type): New function.
6202 (Sized_incr_relobj::do_section_link): New function.
6203 (Sized_incr_relobj::do_section_info): New function.
6204 (Sized_incr_relobj::do_section_addralign): New function.
6205 (Sized_incr_relobj::do_initialize_xindex): New function.
6206 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6207 (Sized_incr_relobj::do_read_relocs): New function.
6208 (Sized_incr_relobj::do_gc_process_relocs): New function.
6209 (Sized_incr_relobj::do_scan_relocs): New function.
6210 (Sized_incr_relobj::do_count_local_symbols): New function.
6211 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6212 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6213 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6214 (Sized_incr_relobj::do_relocate): New function.
6215 (Sized_incr_relobj::do_set_section_offset): New function.
6216 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6217 (Sized_incr_dynobj::do_read_symbols): New function.
6218 (Sized_incr_dynobj::do_layout): New function.
6219 (Sized_incr_dynobj::do_add_symbols): New function.
6220 (Sized_incr_dynobj::do_should_include_member): New function.
6221 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6222 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6223 (Sized_incr_dynobj::do_section_size): New function.
6224 (Sized_incr_dynobj::do_section_name): New function.
6225 (Sized_incr_dynobj::do_section_contents): New function.
6226 (Sized_incr_dynobj::do_section_flags): New function.
6227 (Sized_incr_dynobj::do_section_entsize): New function.
6228 (Sized_incr_dynobj::do_section_address): New function.
6229 (Sized_incr_dynobj::do_section_type): New function.
6230 (Sized_incr_dynobj::do_section_link): New function.
6231 (Sized_incr_dynobj::do_section_info): New function.
6232 (Sized_incr_dynobj::do_section_addralign): New function.
6233 (Sized_incr_dynobj::do_initialize_xindex): New function.
6234 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6235 (make_sized_incremental_object): New function.
6236 (Incremental_library::copy_unused_symbols): New function.
6237 (Incremental_library::do_for_all_unused_symbols): New function.
6238 * incremental.h (enum Incremental_input_flags): New type.
6239 (class Incremental_checker): Remove.
6240 (Incremental_input_entry::Incremental_input_entry): Add argument
6241 serial number.
6242 (Incremental_input_entry::arg_serial): New function.
6243 (Incremental_input_entry::set_is_in_system_directory): New function.
6244 (Incremental_input_entry::is_in_system_directory): New function.
6245 (Incremental_input_entry::arg_serial_): New data member.
6246 (Incremental_input_entry::is_in_system_directory_): New data member.
6247 (class Script_info): Move here from script.h.
6248 (Script_info::Script_info): Add filename parameter.
6249 (Script_info::filename): New function.
6250 (Script_info::filename_): New data member.
6251 (Incremental_script_entry::Incremental_script_entry): Add argument
6252 serial number.
6253 (Incremental_object_entry::Incremental_object_entry): Likewise.
6254 (Incremental_object_entry::add_input_section): Build list of input
6255 sections with map to original shndx.
6256 (Incremental_object_entry::get_input_section_index): New function.
6257 (Incremental_object_entry::shndx_): New data member.
6258 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6259 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6260 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6261 serial number.
6262 (Incremental_inputs::report_archive_begin): Likewise.
6263 (Incremental_inputs::report_object): Likewise.
6264 (Incremental_inputs::report_script): Likewise.
6265 (class Incremental_global_symbol_reader): New class.
6266 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6267 and store flags and input file type.
6268 (Incremental_input_entry_reader::arg_serial): New function.
6269 (Incremental_input_entry_reader::type): Extract type from flags.
6270 (Incremental_input_entry_reader::is_in_system_directory): New function.
6271 (Incremental_input_entry_reader::get_input_section_count): Call
6272 accessor function for type.
6273 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6274 function for type; adjust size of global symbol entry.
6275 (Incremental_input_entry_reader::get_global_symbol_count): Call
6276 accessor function for type.
6277 (Incremental_input_entry_reader::get_object_count): Likewise.
6278 (Incremental_input_entry_reader::get_object_offset): Likewise.
6279 (Incremental_input_entry_reader::get_member_count): Likewise.
6280 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6281 (Incremental_input_entry_reader::get_member_offset): Likewise.
6282 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6283 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6284 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6285 (Incremental_input_entry_reader::get_global_symbol_reader): New
6286 function.
6287 (Incremental_input_entry_reader::get_output_symbol_index): New
6288 function.
6289 (Incremental_input_entry_reader::type_): Remove.
6290 (Incremental_input_entry_reader::flags_): New data member.
6291 (Incremental_inputs_reader::input_file_offset): New function.
6292 (Incremental_inputs_reader::input_file_index): New function.
6293 (Incremental_inputs_reader::input_file): Call input_file_offset.
6294 (Incremental_inputs_reader::input_file_at_offset): New function.
6295 (Incremental_relocs_reader::get_r_type): Reformat.
6296 (Incremental_relocs_reader::get_r_shndx): Reformat.
6297 (Incremental_relocs_reader::get_r_offset): Reformat.
6298 (Incremental_relocs_reader::data): New function.
6299 (Incremental_binary::Incremental_binary): Initialize new data members.
6300 (Incremental_binary::check_inputs): Add cmdline parameter.
6301 (Incremental_binary::file_is_unchanged): Remove.
6302 (Input_reader::arg_serial): New function.
6303 (Input_reader::get_unused_symbol_count): New function.
6304 (Input_reader::get_unused_symbol): New function.
6305 (Input_reader::do_arg_serial): New function.
6306 (Input_reader::do_get_unused_symbol_count): New function.
6307 (Input_reader::do_get_unused_symbol): New function.
6308 (Incremental_binary::input_file_count): New function.
6309 (Incremental_binary::get_input_reader): Change signature to use
6310 index instead of filename.
6311 (Incremental_binary::file_has_changed): New function.
6312 (Incremental_binary::get_input_argument): New function.
6313 (Incremental_binary::get_library): New function.
6314 (Incremental_binary::get_script_info): New function.
6315 (Incremental_binary::init_layout): New function.
6316 (Incremental_binary::reserve_layout): New function.
6317 (Incremental_binary::output_file): New function.
6318 (Incremental_binary::do_check_inputs): New function.
6319 (Incremental_binary::do_file_is_unchanged): Remove.
6320 (Incremental_binary::do_file_has_changed): New function.
6321 (Incremental_binary::do_init_layout): New function.
6322 (Incremental_binary::do_reserve_layout): New function.
6323 (Incremental_binary::do_input_file_count): New function.
6324 (Incremental_binary::do_get_input_reader): Change signature.
6325 (Incremental_binary::input_args_map_): New data member.
6326 (Incremental_binary::library_map_): New data member.
6327 (Incremental_binary::script_map_): New data member.
6328 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6329 new data members.
6330 (Sized_incremental_binary::output_section): New function.
6331 (Sized_incremental_binary::inputs_reader): Add const.
6332 (Sized_incremental_binary::symtab_reader): Add const.
6333 (Sized_incremental_binary::relocs_reader): Add const.
6334 (Sized_incremental_binary::got_plt_reader): Add const.
6335 (Sized_incremental_binary::get_symtab_view): New function.
6336 (Sized_incremental_binary::Inputs_reader): New typedef.
6337 (Sized_incremental_binary::Input_entry_reader): New typedef.
6338 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6339 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6340 (Sized_incremental_binary::do_file_has_changed): New function.
6341 (Sized_incremental_binary::do_init_layout): New function.
6342 (Sized_incremental_binary::do_reserve_layout): New function.
6343 (Sized_input_reader::Inputs_reader): Remove.
6344 (Sized_input_reader::Input_entry_reader): Remove.
6345 (Sized_input_reader::do_arg_serial): New function.
6346 (Sized_input_reader::do_get_unused_symbol_count): New function.
6347 (Sized_input_reader::do_get_unused_symbol): New function.
6348 (Sized_incremental_binary::do_input_file_count): New function.
6349 (Sized_incremental_binary::do_get_input_reader): Change signature;
6350 use index instead of filename.
6351 (Sized_incremental_binary::section_map_): New data member.
6352 (Sized_incremental_binary::input_entry_readers_): New data member.
6353 (class Sized_incr_relobj): New class.
6354 (class Sized_incr_dynobj): New class.
6355 (make_sized_incremental_object): New function.
6356 (class Incremental_library): New class.
6357 * layout.cc (Free_list::num_lists): New static data member.
6358 (Free_list::num_nodes): New static data member.
6359 (Free_list::num_removes): New static data member.
6360 (Free_list::num_remove_visits): New static data member.
6361 (Free_list::num_allocates): New static data member.
6362 (Free_list::num_allocate_visits): New static data member.
6363 (Free_list::init): New function.
6364 (Free_list::remove): New function.
6365 (Free_list::allocate): New function.
6366 (Free_list::dump): New function.
6367 (Free_list::print_stats): New function.
6368 (Layout_task_runner::run): Resize output file for incremental updates.
6369 (Layout::Layout): Initialize new data members.
6370 (Layout::set_incremental_base): New function.
6371 (Layout::init_fixed_output_section): New function.
6372 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6373 incremental updates.
6374 (Layout::create_gold_note): Do not create gold note section for
6375 incremental updates.
6376 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6377 for incremental updates.
6378 (Layout::set_section_offsets): For incremental updates, allocate space
6379 from free list.
6380 (Layout::create_symtab_sections): Layout with offsets relative to
6381 start of section; for incremental updates, allocate space from free
6382 list.
6383 (Layout::create_shdrs): For incremental updates, allocate space from
6384 free list.
6385 (Layout::finish_dynamic_section): For incremental updates, do not
6386 check --as-needed (fixed in subsequent patch).
6387 * layout.h (class Free_list): New class.
6388 (Layout::set_incremental_base): New function.
6389 (Layout::incremental_base): New function.
6390 (Layout::init_fixed_output_section): New function.
6391 (Layout::allocate): New function.
6392 (Layout::incremental_base_): New data member.
6393 (Layout::free_list_): New data member.
6394 * main.cc (main): Print Free_list statistics.
6395 * object.cc (Relobj::finalize_incremental_relocs): Add
6396 clear_counts parameter; clear counts only when clear_counts is set.
6397 (Sized_relobj::Sized_relobj): Initialize new base class.
6398 (Sized_relobj::do_layout): Don't report special sections.
6399 (Sized_relobj::do_for_all_local_got_entries): New function.
6400 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6401 symtab_off to all symbol table offsets.
6402 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6403 * object.h (class Got_offset_list): Move to top of file.
6404 (Object::Object): Allow case where input_file == NULL.
6405 (Object::~Object): Likewise.
6406 (Object::input_file): Assert that input_file != NULL.
6407 (Object::lock): Allow case where input_file == NULL.
6408 (Object::unlock): Likewise.
6409 (Object::is_locked): Likewise.
6410 (Object::token): Likewise.
6411 (Object::release): Likewise.
6412 (Object::is_incremental): New function.
6413 (Object::get_mtime): New function.
6414 (Object::for_all_local_got_entries): New function.
6415 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6416 (Object::set_is_in_system_directory): New function.
6417 (Object::is_in_system_directory): New function.
6418 (Object::do_is_incremental): New function.
6419 (Object::do_get_mtime): New function.
6420 (Object::do_for_all_local_got_entries): New function.
6421 (Object::is_in_system_directory_): New data member.
6422 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6423 (class Sized_relobj_base): New class.
6424 (class Sized_relobj): Derive from Sized_relobj_base.
6425 (class Sized_relobj::Symbols): Redeclare from base class.
6426 (class Sized_relobj::local_got_offset_list): Remove.
6427 (class Sized_relobj::Output_sections): Redeclare from base class.
6428 (class Sized_relobj::do_for_all_local_got_entries): New function.
6429 (class Sized_relobj::write_local_symbols): Add offset parameter.
6430 (class Sized_relobj::local_symbol_offset_): Update comment.
6431 (class Sized_relobj::local_dynsym_offset_): Update comment.
6432 * options.cc (Input_arguments::add_file): Remove const.
6433 * options.h (Input_file_argument::Input_file_argument):
6434 Initialize arg_serial_ (all constructors).
6435 (Input_file_argument::set_arg_serial): New function.
6436 (Input_file_argument::arg_serial): New function.
6437 (Input_file_argument::arg_serial_): New data member.
6438 (Input_arguments::Input_arguments): Initialize file_count_.
6439 (Input_arguments::add_file): Remove const.
6440 (Input_arguments::number_of_input_files): New function.
6441 (Input_arguments::file_count_): New data member.
6442 (Command_line::number_of_input_files): Call
6443 Input_arguments::number_of_input_files.
6444 * output.cc (Output_segment_headers::Output_segment_headers):
6445 Set current size.
6446 (Output_section::Input_section::current_data_size): New function.
6447 (Output_section::Output_section): Initialize new data members.
6448 (Output_section::add_input_section): Don't do merge sections for
6449 an incremental link; allocate space from free list for an
6450 incremental update.
6451 (Output_section::add_output_section_data): Allocate space from
6452 free list for an incremental update.
6453 (Output_section::update_data_size): New function.
6454 (Output_section::set_fixed_layout): New function.
6455 (Output_section::reserve): New function.
6456 (Output_segment::set_section_addresses): Remove const.
6457 (Output_segment::set_section_list_addresses): Remove const; allocate
6458 space from free list for an incremental update.
6459 (Output_segment::set_offset): Adjust size of RELRO segment for an
6460 incremental update.
6461 * output.h (Output_data::current_data_size): Move here from
6462 child classes.
6463 (Output_data::pre_finalize_data_size): New function.
6464 (Output_data::update_data_size): New function.
6465 (Output_section_headers::update_data_size): new function.
6466 (Output_section_data_build::current_data_size): Move to Output_data.
6467 (Output_data_strtab::update_data_size): New function.
6468 (Output_section::current_data_size): Move to Output_data.
6469 (Output_section::set_fixed_layout): New function.
6470 (Output_section::has_fixed_layout): New function.
6471 (Output_section::reserve): New function.
6472 (Output_section::update_data_size): New function.
6473 (Output_section::has_fixed_layout_): New data member.
6474 (Output_section::free_list_): New data member.
6475 (Output_segment::set_section_addresses): Remove const.
6476 (Output_segment::set_section_list_addresses): Remove const.
6477 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6478 New function.
6479 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6480 New function.
6481 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6482 parameter when calling Add_symbols constructor; store argument
6483 serial number for members of a lib group.
6484 (Add_symbols::locks): Allow case where token == NULL.
6485 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6486 (Read_member::~Read_member): New function.
6487 (Read_member::is_runnable): New function.
6488 (Read_member::locks): New function.
6489 (Read_member::run): New function.
6490 (Check_script::~Check_script): New function.
6491 (Check_script::is_runnable): New function.
6492 (Check_script::locks): New function.
6493 (Check_script::run): New function.
6494 (Check_library::~Check_library): New function.
6495 (Check_library::is_runnable): New function.
6496 (Check_library::locks): New function.
6497 (Check_library::run): New function.
6498 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6499 (Add_symbols::library_): New data member.
6500 (class Read_member): New class.
6501 (class Check_script): New class.
6502 (class Check_library): New class.
6503 * reloc.cc (Read_relocs::is_runnable): Allow case where
6504 token == NULL.
6505 (Read_relocs::locks): Likewise.
6506 (Scan_relocs::locks): Likewise.
6507 (Relocate_task::locks): Likewise.
6508 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6509 to clear counters.
6510 (Sized_relobj::incremental_relocs_scan): Fix comment.
6511 (Sized_relobj::do_relocate): Pass output file offset to
6512 write_local_symbols.
6513 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6514 from class declaration.
6515 * script.cc (read_input_script): Allocate Script_info; pass
6516 argument serial number to report_script.
6517 * script.h (class Script_info): Move to incremental.h.
6518 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6519 * symtab.h (Symbol_table::add_from_incrobj): New function.
6520 (Symbol_table::set_file_offset): New function.
6521
b961d0d7
CC
65222011-04-05 Cary Coutant <ccoutant@google.com>
6523
6524 * incremental-dump.cc (dump_incremental_inputs): Change signature
6525 to take a Sized_incremental_binary; change caller. Use readers
6526 in Sized_incremental_binary.
6527 * incremental.cc
6528 (Sized_incremental_binary::find_incremental_inputs_sections):
6529 Rename do_find_incremental_inputs_sections to this.
6530 (Sized_incremental_binary::setup_readers): New function.
6531 (Sized_incremental_binary::do_check_inputs): Check
6532 has_incremental_info_ flag; move setup code to setup_readers;
6533 use input readers.
6534 (Sized_incremental_binary::do_file_is_unchanged): New function.
6535 (Sized_incremental_binary::do_get_input_reader): New function.
6536 * incremental.h (class Incremental_binary): Move to end of file.
6537 (Incremental_binary::file_is_unchanged): New function.
6538 (Incremental_binary::do_file_is_unchanged): New function.
6539 (Incremental_binary::Input_reader): New class.
6540 (Incremental_binary::get_input_reader): New function.
6541 (class Sized_incremental_binary): Move to end of file.
6542 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6543 input section reader classes.
6544 (Sized_incremental_binary::has_incremental_info): New function.
6545 (Sized_incremental_binary::inputs_reader): New function.
6546 (Sized_incremental_binary::symtab_reader): New function.
6547 (Sized_incremental_binary::relocs_reader): New function.
6548 (Sized_incremental_binary::got_plt_reader): New function.
6549 (Sized_incremental_binary::do_file_is_unchanged): New function.
6550 (Sized_incremental_binary::Sized_input_reader): New class.
6551 (Sized_incremental_binary::get_input_reader): New function.
6552 (Sized_incremental_binary::find_incremental_inputs_sections):
6553 Rename do_find_incremental_inputs_sections to this.
6554 (Sized_incremental_binary::setup_readers): New function.
6555 (Sized_incremental_binary::has_incremental_info_): New data member.
6556 (Sized_incremental_binary::inputs_reader_): New data member.
6557 (Sized_incremental_binary::symtab_reader_): New data member.
6558 (Sized_incremental_binary::relocs_reader_): New data member.
6559 (Sized_incremental_binary::got_plt_reader_): New data member.
6560 (Sized_incremental_binary::current_input_file_): New data member.
6561
a869183f
PP
65622011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6563
6564 PR gold/12640
6565 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6566 violation.
6567
65682011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
6569
6570 * archive.cc (Archive::include_member): Adjust call to report_object.
6571 (Add_archive_symbols::run): Add script_info to call to
6572 report_archive_begin.
6573 (Lib_group::include_member): Adjust call to report_object.
6574 (Add_lib_group_symbols::run): Adjust call to report_object.
6575 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6576 blocks. Add object count for script input files.
6577 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6578 script_info parameter; change all callers.
6579 (Incremental_inputs::report_object): Add script_info parameter;
6580 change all callers.
6581 (Incremental_inputs::report_script): Store backpointer to
6582 incremental info entry.
6583 (Output_section_incremental_inputs::set_final_data_size): Record
6584 additional information for scripts.
6585 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6586 * incremental.h (Incremental_script_entry::add_object): New function.
6587 (Incremental_script_entry::get_object_count): New function.
6588 (Incremental_script_entry::get_object): New function.
6589 (Incremental_script_entry::objects_): New data member; adjust
6590 constructor.
6591 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6592 (Incremental_inputs::report_object): Add script_info parameter.
6593 (Incremental_inputs_reader::get_object_count): New function.
6594 (Incremental_inputs_reader::get_object_offset): New function.
6595 * options.cc (Input_arguments::add_file): Return reference to
6596 new input argument.
6597 * options.h (Input_argument::set_script_info): New function.
6598 (Input_argument::script_info): New function.
6599 (Input_argument::script_info_): New data member; adjust all
6600 constructors.
6601 (Input_file_group::add_file): Return reference to new input argument.
6602 (Input_file_lib::add_file): Likewise.
6603 (Input_arguments::add_file): Likewise.
6604 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6605 * script.cc (Parser_closure::Parser_closure): Add script_info
6606 parameter; adjust all callers.
6607 (Parser_closure::script_info): New function.
6608 (Parser_closure::script_info_): New data member.
6609 (read_input_script): Report scripts earlier to incremental info.
6610 (script_add_file): Set script_info in Input_argument.
6611 (script_add_library): Likewise.
6612 * script.h (Script_options::Script_info): Rewrite class.
6613
a869183f 66142011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
6615
6616 * archive.cc (Library_base::should_include_member): Move
6617 method here from class Archive.
6618 (Archive::Archive): Initialize base class.
6619 (Archive::should_include_member): Move to base class.
6620 (Archive::do_for_all_unused_symbols): New function.
6621 (Add_archive_symbols::run): Remove redundant access to
6622 incremental_inputs.
6623 (Lib_group::Lib_group): Initialize base class.
6624 (Lib_group::do_filename): New function.
6625 (Lib_group::include_member): Pass pointer to Lib_group to
6626 report_object.
6627 (Lib_group::do_for_all_unused_symbols): New function.
6628 (Add_lib_group_symbols::run): Report archive information for
6629 incremental links.
6630 * archive.h (class Library_base): New base class.
6631 (class Archive): Derive from Library_base.
6632 (Archive::filename): Move to base class.
6633 (Archive::set_incremental_info): Likewise.
6634 (Archive::incremental_info): Likewise.
6635 (Archive::Should_include): Likewise.
6636 (Archive::should_include_member): Likewise.
6637 (Archive::Armap_entry): Remove.
6638 (Archive::Unused_symbol_iterator): Remove.
6639 (Archive::unused_symbols_begin): Remove.
6640 (Archive::unused_symbols_end): Remove.
6641 (Archive::do_filename): New function.
6642 (Archive::do_get_mtime): New function.
6643 (Archive::do_for_all_unused_symbols): New function.
6644 (Archive::task_): Move to base class.
6645 (Archive::incremental_info_): Likewise.
6646 (class Lib_group): Derive from Library_base.
6647 (Lib_group::do_filename): New function.
6648 (Lib_group::do_get_mtime): New function.
6649 (Lib_group::do_for_all_unused_symbols): New function.
6650 (Lib_group::task_): Move to base class.
6651 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6652 function.
6653 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6654 function.
6655 * incremental.cc (Incremental_inputs::report_archive_begin):
6656 Use Library_base; call library's get_mtime; add incremental inputs
6657 entry before members.
6658 (class Unused_symbol_visitor): New class.
6659 (Incremental_inputs::report_archive_end): Use Library_base; use
6660 visitor class to record unused symbols; don't add incremental inputs
6661 entry after members.
6662 (Incremental_inputs::report_object): Use Library_base.
6663 * incremental.h
6664 (Incremental_archive_entry::Incremental_archive_entry): Remove
6665 unused Archive parameter.
6666 (Incremental_inputs::report_archive_begin): Use Library_base.
6667 (Incremental_inputs::report_archive_end): Likewise.
6668 (Incremental_inputs::report_object): Likewise.
6669 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6670 function.
6671 * object.h (Object::for_all_global_symbols): New function.
6672 (Object::do_for_all_global_symbols): New function.
6673 (Sized_relobj::do_for_all_global_symbols): New function.
6674 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6675 function.
6676 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6677 function.
6678
61ab3e40
ILT
66792011-03-27 Ian Lance Taylor <iant@google.com>
6680
6681 * archive.cc (Archive::interpret_header): Return -1 if something
6682 goes wrong. Change callers accordingly.
6683
30e1f9e6
CC
66842011-03-25 Cary Coutant <ccoutant@google.com>
6685
6686 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6687 * testsuite/Makefile.in: Regenerate.
6688
9370ce59 66892011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
6690
6691 * plugin.cc (get_view): New.
6692 (Plugin::load): Pass get_view to the plugin.
6693 (Plugin_manager::get_view): New.
6694
9312bb0a
ILT
66952011-03-21 Ian Lance Taylor <iant@google.com>
6696
6697 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 6698 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 6699
7e12ba9e
ST
67002011-03-21 Sriraman Tallam <tmsriram@google.com>
6701
6702 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6703 Change == to -eq.
6704 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6705 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6706 Change == to -eq.
6707 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6708 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6709
fd7a005d
ILT
67102011-03-14 Ian Lance Taylor <iant@google.com>
6711
6712 * script-sections.cc (Sort_output_sections::script_compare):
6713 Rename from is_before, change return type.
6714 (Sort_output_sections::operator()): Adjust accordingly.
6715
ed16fd1b
ILT
67162011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6717
6718 PR gold/12572
6719 * testsuite/odr_violation2.cc: Add comment to make all error line
6720 numbers double digits.
6721 * testsuite/debug_msg.sh: Adjust expected errors.
6722
71ff8986
ILT
67232011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6724
6725 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6726 but mark earlier ones as non-canonical
6727 (offset_to_iterator): Update search target and example
6728 (do_addr2line): Return extra lines in a vector*
6729 (format_file_lineno): Extract from do_addr2line
6730 (one_addr2line): Add vector* out-param
6731 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6732 when a lineno entry appeared last for its instruction
6733 (Dwarf_line_info): Add vector* out-param
6734 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6735 * symtab.cc (Odr_violation_compare): Include the lineno in the
6736 comparison again.
6737 (linenos_from_loc): New. Combine the canonical line for an
6738 address with its other lines.
6739 (True_if_intersect): New. Helper functor to make
6740 std::set_intersection a query.
6741 (detect_odr_violations): Compare sets of lines instead of just
6742 one line for each function. This became less deterministic, but
6743 has fewer false positives.
6744 * symtab.h: Declarations.
6745 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6746 mix an optimized and non-optimized object in the same binary
6747 (odr_violation2.so): Same.
6748 * testsuite/Makefile.in: Regenerate from Makefile.am.
6749 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6750 * testsuite/debug_msg.sh: Update line numbers and add
6751 assertions.
6752 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6753 non-optimized context.
6754 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6755 isn't inlined, and use OdrDerived in an optimized context.
6756 * testsuite/odr_header1.h: Defines OdrDerived, where
6757 optimization will change the
6758 first-instruction-in-the-destructor's file and line number.
6759 * testsuite/odr_header2.h: Defines OdrBase.
6760
a19fefdc
ILT
67612011-03-09 Ian Lance Taylor <iant@google.com>
6762
6763 * fileread.cc (File_read::clear_views): Don't delete the whole
6764 file view.
6765
ecb351e9
ILT
67662011-03-08 Ian Lance Taylor <iant@google.com>
6767
6768 PR gold/12525
6769 * fileread.cc: #include <climits>.
6770 (GOLD_IOV_MAX): Define.
6771 (File_read::read_multiple): Limit number of entries by iov_max.
6772 * fileread.h (class File_read): Always set max_readv_entries to
6773 128.
6774
b821d13c
ILT
67752011-03-07 Ian Lance Taylor <iant@google.com>
6776
6777 PR gold/12525
6778 * options.h (class General_options): Add -dy and -dn.
6779
89243142
CC
67802011-03-02 Cary Coutant <ccoutant@google.com>
6781
6782 * testsuite/script_test_9.t: Add TLS segment.
6783
d0773f31
ILT
67842011-03-02 Simon Baldwin <simonb@google.com>
6785
6786 * configure.ac: Add check for gnu_indirect_function support in
6787 the toolchain building binutils.
6788 * configure: Rebuild.
6789
9370ce59 67902011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
6791
6792 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6793 plugin only symbols.
6794 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6795 in plugin files as not needed in the symbol table.
6796
4cf7a849
ST
67972011-02-11 Sriraman Tallam <tmsriram@google.com>
6798
6799 * output.cc (Output_section::add_input_section): Delay fill
6800 generation for section ordering.
6801
b578bd7d
ILT
68022011-02-09 Ian Lance Taylor <iant@google.com>
6803
6804 PR gold/12316
6805 * object.h (class Sized_relobj): Remove clear_local_symbols.
6806 * reloc.cc (Sized_relobj::do_relocate): Don't call
6807 clear_local_symbols.
6808
9370ce59 68092011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
6810
6811 * plugin.cc (is_visible_from_outside): Return true for symbols
6812 in the -u option.
6813
55382fb7
ILT
68142011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6815
6816 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6817 filename.
6818
4e271fff
ST
68192011-02-02 Sriraman Tallam <tmsriram@google.com>
6820
6821 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 6822 to std::string.
4e271fff 6823 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 6824 section_name to be std::string.
4e271fff
ST
6825 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6826
d433c3ac
ILT
68272011-01-25 Ian Lance Taylor <iant@google.com>
6828
6829 * script.cc (script_add_extern): Rewrite to use
6830 add_symbol_reference.
6831
880473a6
DK
68322011-01-25 Doug Kwan <dougkwan@google.com>
6833
d433c3ac 6834 * icf.cc (get_section_contents): Always lock section's object.
880473a6 6835
f30f86fa
ILT
68362011-01-24 Ian Lance Taylor <iant@google.com>
6837
6838 * options.h (class General_options): Accept
6839 --no-detect-odr-violations.
6840
8e51a0b9
ILT
68412011-01-24 Ian Lance Taylor <iant@google.com>
6842
6843 * version.cc (version_string): Bump to 1.11.
6844
0f3b89d8
ILT
68452011-01-24 Ian Lance Taylor <iant@google.com>
6846
6847 * plugin.cc (class Plugin_rescan): Define new class.
6848 (Plugin_manager::claim_file): Set any_claimed_.
6849 (Plugin_manager::save_archive): New function.
6850 (Plugin_manager::save_input_group): New function.
6851 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6852 necessary.
6853 (Plugin_manager::new_undefined_symbol): New function.
6854 (Plugin_manager::rescan): New function.
6855 (Plugin_manager::rescannable_defines): New function.
6856 (Plugin_manager::add_input_file): Set any_added_.
6857 * plugin.h (class Plugin_manager): define new fields rescannable_,
6858 undefined_symbols_, any_claimed_, and any_added_. Declare
6859 Plugin_rescan as friend. Declare new functions.
6860 (Plugin_manager::Rescannable): Define type.
6861 (Plugin_manager::Rescannable_list): Define type.
6862 (Plugin_manager::Undefined_symbol_list): Define type.
6863 (Plugin_manager::Plugin_manager): Initialize new fields.
6864 * archive.cc (Archive::defines_symbol): New function.
6865 (Add_archive_symbols::run): Pass archive to plugins if any.
6866 * archive.h (class Archive): Declare defines_symbol.
6867 * readsyms.cc (Input_group::~Input_group): New function.
6868 (Finish_group::run): Pass input_group to plugins if any.
6869 * readsyms.h (class Input_group): Declare destructor.
6870 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6871 any.
6872
3bb951e5
ILT
68732011-01-10 Ian Lance Taylor <iant@google.com>
6874
6875 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
6876 section as relro.
6877 (Layout::set_segment_offsets): Reset increase_relro before calling
6878 set_section_addresses a second time.
6879
0aa45fac
CC
68802011-01-04 Cary Coutant <ccoutant@google.com>
6881
6882 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
6883 sections before NOBITS sections.
6884
0db46eb4
L
68852011-01-01 H.J. Lu <hongjiu.lu@intel.com>
6886
6887 * version.cc (print_version): Update copyright to 2011.
6888
829c9745
CC
68892010-12-23 Cary Coutant <ccoutant@google.com>
6890
6891 * output.h (Output_data_reloc::add_output_section): Pass OD instead
6892 of OS to this->add. Add OD parameter to second form of the function.
6893
7500420b
ILT
68942010-12-20 Ian Lance Taylor <iant@google.com>
6895
6896 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
6897 second of two consecutive entries with same offset.
6898
f8e9a930
RW
68992010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6900
6901 * testsuite/Makefile.am (ifuncmain2static_LDADD)
6902 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
6903 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
6904 to avoid unneeded links against $(LDADD).
6905 * testsuite/Makefile.in: Regenerate.
6906
2fbb4320
ILT
69072010-12-15 Ian Lance Taylor <iant@google.com>
6908
6909 PR gold/12324
6910 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
6911 for R_X86_64_32 and R_X86_64_PC32.
6912 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
6913 ver_matching_def_pic.o.
6914 (ver_matching_def_pic.o): New target.
6915
fedb228d
RW
69162010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6917
6918 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
6919 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
6920 Move definition before File_read::View member definitions.
6921 (File_read::View::~View): Initialize and hold lock before
6922 updating current_mapped_bytes.
6923
9b547ce6
RW
69242010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6925
6926 * dwarf_reader.cc: Remove outdated comment.
6927 * gold-threads.cc: Fix typo in error message.
6928 * archive.cc: Fix typos in comments.
6929 * archive.h: Likewise.
6930 * arm-reloc-property.cc: Likewise.
6931 * arm-reloc-property.h: Likewise.
6932 * arm-reloc.def: Likewise.
6933 * arm.cc: Likewise.
6934 * attributes.h: Likewise.
6935 * cref.cc: Likewise.
6936 * ehframe.cc: Likewise.
6937 * fileread.h: Likewise.
6938 * gold.h: Likewise.
6939 * i386.cc: Likewise.
6940 * icf.cc: Likewise.
6941 * incremental.h: Likewise.
6942 * int_encoding.cc: Likewise.
6943 * layout.h: Likewise.
6944 * main.cc: Likewise.
6945 * merge.h: Likewise.
6946 * object.cc: Likewise.
6947 * object.h: Likewise.
6948 * options.cc: Likewise.
6949 * readsyms.cc: Likewise.
6950 * reduced_debug_output.cc: Likewise.
6951 * reloc.cc: Likewise.
6952 * script-sections.cc: Likewise.
6953 * sparc.cc: Likewise.
6954 * symtab.h: Likewise.
6955 * target-reloc.h: Likewise.
6956 * target.cc: Likewise.
6957 * target.h: Likewise.
6958 * timer.cc: Likewise.
6959 * timer.h: Likewise.
6960 * x86_64.cc: Likewise.
6961
83e17bd5
CC
69622010-12-09 Cary Coutant <ccoutant@google.com>
6963
6964 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
6965 stack.
6966 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
6967 parameter; change all callers.
6968 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
6969 * options.h (warn_execstack): New option.
6970
017257f8
DK
69712010-12-07 Doug Kwan <dougkwan@google.com>
6972
6973 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
6974 like function call relocations.
6975
c20cbc06
ILT
69762010-12-07 Ian Lance Taylor <iant@google.com>
6977
6978 * archive.cc (Archive::get_elf_object_for_member): Permit
6979 punconfigured to be NULL.
6980 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
6981 (Archive::include_member): Pass NULL to get_elf_object_for_member
6982 if we searched for the archive and this is the first included
6983 object.
6984
4dbfafcc
ILT
69852010-12-01 Ian Lance Taylor <iant@google.com>
6986
6987 * dwarf_reader.h (class Sized_dwarf_line_info): Add
6988 track_relocs_type_ field.
6989 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6990 Set track_relocs_type_.
6991 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
6992 contents when using RELA relocs.
6993 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
6994 reloc_map_.
6995 * reloc.cc (Track_relocs::next_addend): New function.
6996 * reloc.h (class Track_relocs): Declare next_addend.
6997
e5e19edd
ILT
69982010-12-01 Ian Lance Taylor <iant@google.com>
6999
7000 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7001 virtual destructor.
7002
9a5ce24c
ILT
70032010-12-01 Ian Lance Taylor <iant@google.com>
7004
7005 * README: Update compilers known to work and fail.
7006
c7791212
NC
70072010-11-23 Matthias Klose <doko@ubuntu.com>
7008
7009 * configure.in: For --enable-gold, handle value `default' instead of
7010 `both*'. Always install ld as ld.bfd, install as ld if gold is
7011 not the default.
7012 * configure: Regenerate.
7013
0ad220c9
DK
70142010-11-18 Doug Kwan <dougkwan@google.com>
7015
7016 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7017 and right_alignment to be zero. Store result alignment only if it is
7018 greater than existing alignment.
7019
ab8056e0
CC
70202010-11-16 Cary Coutant <ccoutant@google.com>
7021
7022 PR gold/12220
7023 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7024 Check for ".zdebug_line".
7025
fd064a5b
CC
70262010-11-16 Doug Kwan <dougkwan@google.com>
7027 Cary Coutant <ccoutant@google.com>
7028
7029 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7030 by reference; adjust all callers.
7031 * output.cc (Output_segment::set_section_addresses): Adjust references
7032 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7033 list is empty.
7034 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7035 end at page boundary.
7036
6fc6ea19
CC
70372010-11-16 Cary Coutant <ccoutant@google.com>
7038
7039 PR gold/12220
7040 * layout.cc (Layout::choose_output_section): Transform names of
7041 compressed sections even when using a script with a SECTIONS clause.
7042 (Layout::output_section_name): Remove code to transform
7043 compressed debug section names.
7044 * output.cc (Output_section::add_input_section): Use uncompressed
7045 section size when tracking input sections.
7046
95a2c8d6
RS
70472010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7048
7049 * symtab.h (Symbol::NON_PIC_REF): Remove.
7050 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7051 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7052 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7053 (Symbol::use_plt_offset): Take a flags argument and pass it
7054 directly to needs_dynamic_reloc. Restrict check for undefined
7055 weak symbols to function calls.
7056 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7057 (Target_arm::Scan::global): Use it.
7058 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7059 (Target_arm::Relocate::relocate): Likewise.
7060 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7061 parameter with an r_type parameter. Use get_reference_flags
7062 to get the flags.
7063 (Target_arm::Relocate::relocate): Update accordingly.
7064 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7065 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7066 (Target_i386::Scan::global): Likewise.
7067 (Target_i386::Relocate::relocate): Likewise.
7068 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7069 parameter with an r_type parameter. Use get_reference_flags
7070 to get the flags.
7071 (Target_i386::Relocate::relocate): Update accordingly.
7072 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7073 (Target_powerpc::Scan::global): Use it.
7074 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7075 (Target_powerpc::Relocate::relocate): Likewise.
7076 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7077 (Target_sparc::Scan::global): Use it.
7078 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7079 (Target_sparc::Relocate::relocate): Likewise.
7080 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7081 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7082 (Target_x86_64::Scan::global): Likewise.
7083 (Target_x86_64::Relocate::relocate): Likewise.
7084
f625ae50
DK
70852010-11-08 Doug Kwan <dougkwan@google.com>
7086 Cary Coutant <ccoutant@google.com>
7087
7088 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7089 (Arm_exidx_merge_section::section_contents_): New data member.
7090 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7091 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 7092 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
7093 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7094 in parameters instead of calling Object::section_contents without
7095 locking.
7096 (Arm_output_section::group_section): New parameter TASK. Pass it
7097 to callees that need locking objects.
7098 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7099 to lock EXIDX input sections. Fix a formatting issue. Call
7100 Arm_exidx_merged_section::build_contents to create merged section
7101 contents.
7102 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7103 to lock object of stub table owner.
7104 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7105 TEXT_SIZE to initialize data member TEXT_SIZE_.
7106 (Arm_exidx_input_section::addralign): Fix typo in comment.
7107 (Arm_exidx_input_section::text_size): New method.
7108 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7109 that require locking objects. Lock objects before scanning for stubs
7110 and updating local symbols.
7111 (Arm_input_section<big_endian>::init): Copy contents of original
7112 input section.
2e702c99 7113 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
7114 original input section instead of calling Object::section_contents
7115 without locking.
7116 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7117 size without calling Object::section_size().
7118 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7119 for size. Allocate a buffer for merged EXIDX entries.
7120 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7121 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7122 building code to Arm_exidx_merged_section::build_contetns. Write
7123 out contetns in buffer instead of building it on the fly.
7124 (Arm_relobj::make_exidx_input_section): Also pass text section size
7125 to Arm_exidx_input_section constructor.
7126 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7127 (Arm_dynobj::do_read_symbols): Fix memory leak.
7128 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7129 * target.h: (class Task): Add forward declaration.
7130 (Target::relax): Add new parameter TASK and pass it to
7131 Target::do_relax().
7132 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7133
5f9bcf58
CC
71342010-11-05 Cary Coutant <ccoutant@google.com>
7135
7136 PR gold/10708
7137 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7138 object when reading from the file.
7139 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7140 second layout pass.
7141 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7142 when reading section contents.
7143 (get_section_contents): Likewise.
7144 (icf::find_identical_sections): Likewise.
7145 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7146 object when reading from the file.
7147 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7148 the object when doing deferred section layout.
7149
e597fa08
NC
71502010-11-03 Nick Clifton <nickc@redhat.com>
7151
7152 PR gold/12001
7153 * script.h (class Symbol_assignment: name): New member. Returns
7154 the name of the symbol.
7155 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7156 Returns true if the given symbol name is on the list of
7157 assignments wating to be processed.
7158 * archive.cc (should_incldue_member): If the symbol is undefined,
7159 check to see if it is on the list of symbols pending assignment.
7160
3f9a3278
ILT
71612010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7162
7163 * script-sections.cc (Script_sections::find_memory_region): Check
7164 for a NULL output section pointer.
7165
d06fb4d1
DK
71662010-10-29 Doug Kwan <dougkwan@google.com>
7167
7168 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7169 Output_section::add_relaxed_input_section.
7170 * output.cc (Output_section::add_relaxed_input_section): Add new
7171 arguments LAYOUT and NAME. Set section order index.
7172 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7173 Copy section order index.
7174 * output.h (Output_section::add_relaxed_input_section): Add new
7175 arguments LAYOUT and NAME.
7176
90e24de5
ILT
71772010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7178
7179 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7180 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7181 * testsuite/Makefile.in: Regenerate.
7182
c9484ea5
DK
71832010-10-20 Doug Kwan <dougkwan@google.com>
7184
7185 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7186 without SHF_LINK_ORDER flags.
7187 * layout.cc (Layout::choose_output_section): Do not filter
7188 SHF_LINK_ORDER flag in a relocatable link.
7189
5bc2f5be
CC
71902010-10-17 Cary Coutant <ccoutant@google.com>
7191
7192 * output.h (Output_segment::set_section_addresses): Change function
7193 signature. Update all callers.
7194 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7195 sections.
7196 (Output_segment::set_section_addresses): Align after last TLS
7197 section. Add padding before last relro section instead of after.
7198
0c91cf04
DK
71992010-10-17 Doug Kwan <dougkwan@google.com>
7200
7201 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7202 GOT output section to be writable.
7203
8c21d9d3
CC
72042010-10-14 Cary Coutant <ccoutant@google.com>
7205
7206 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7207 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7208 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7209 mode.
7210 * incremental.cc (report_command_line): Ignore all forms of
7211 --incremental.
7212 * layout.cc (Layout::Layout): Check parameters for incremental link
7213 mode.
7214 * options.cc (General_options::parse_incremental): New function.
7215 (General_options::parse_no_incremental): New function.
7216 (General_options::parse_incremental_full): New function.
7217 (General_options::parse_incremental_update): New function.
7218 (General_options::incremental_mode_): New data member.
7219 (General_options::finalize): Check incremental_mode_.
7220 * options.h (General_options): Update help text for --incremental.
7221 Add --no-incremental, --incremental-full, --incremental-update.
7222 (General_options::Incremental_mode): New enum type.
7223 (General_options::incremental_mode): New function.
7224 (General_options::incremental_mode_): New data member.
7225 * parameters.cc (Parameters::incremental_mode_): New data member.
7226 (Parameters::set_options): Set incremental_mode_.
7227 (Parameters::set_incremental_full): New function.
7228 (Parameters::incremental): New function.
7229 (Parameters::incremental_update): New function.
7230 (set_parameters_incremental_full): New function.
7231 * parameters.h (Parameters::set_incremental_full): New function.
7232 (Parameters::incremental): New function.
7233 (Parameters::incremental_update): New function.
7234 (Parameters::incremental_mode_): New data member.
7235 (set_parameters_incremental_full): New function.
7236 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7237 incremental link mode.
7238 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7239 (Sized_relobj::do_relocate_sections): Likewise.
7240 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7241 option.
7242 * testsuite/Makefile.in: Regenerate.
7243 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7244
bb32aa18 72452010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7246
7247 * script-sections.h (class Script_sections): Make
7248 Sections_elements typedef public.
7249 * script-sections.cc (class Sort_output_sections): Add elements_
7250 field. Add constructor which sets it; change all callers.
7251 (Sort_output_sections::is_before): New function.
7252 (Sort_output_sections::operator()): Call is_before.
7253 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7254 conditional.
7255 * testsuite/script_test_10.sh: New test. Test script section
7256 order.
7257 * testsuite/script_test_10.t: Likewise.
7258 * testsuite/script_test_10.s: Likewise.
7259 * testsuite/Makefile.am: Wrap the cross linker tests and the
7260 common tests into NATIVE_OR_CROSS_LINKER.
7261 (check_SCRIPTS): Add script_test_10.sh.
7262 (check_DATA): Add script_test_10.stdout.
7263 (script_test_10.o, script_test_10): New targets.
7264 (script_test_10.stdout): New target.
7265 * configure, testsuite/Makefile.in: Regenerate.
7266
3cef7179
ILT
72672010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7268
7269 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7270 error for the deprecated relocations.
7271 (Target_arm::Scan::global): Likewise.
7272 (Target_arm::Relocate::relocate): Likewise.
7273
7411e9a8
RS
72742010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7275
7276 * fileread.cc (Input_file::find_file): Initialize *found_name
7277 and *namep when using the fallback search for case 4.
7278
6a9da32a
CC
72792010-10-11 Cary Coutant <ccoutant@google.com>
7280
7281 * options.h (class General_options): Redefine -z lazy as an alias for
7282 the negation of -z now.
7283
ac897c20
ILT
72842010-10-11 Ian Lance Taylor <iant@google.com>
7285
7286 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7287 binding.
7288
ea5cae92
NC
72892010-10-06 Nick Clifton <nickc@redhat.com>
7290
7291 * script-sections.cc(class Memory_region): Remove
7292 current_lma_offset_ field. Rename current_vma_offset_ to
7293 current_offset_. Add last_section_ field.
7294 (Memory_region::get_current_vma_address): Rename to
7295 get_current_address.
7296 (Memory_region::get_current_lma_address): Delete.
7297 (Memory_region::increment_vma_offset): Rename to
7298 increment_offset.
7299 (Memory_region::increment_lma_offset): Delete.
7300 (Memory_region::attributes_compatible): New method. Returns
7301 true if the provided section is compatible with the region.
7302 (Memory_region::get_last_section): New method. Returns the last
7303 section to use the region.
7304 (Memory_region::set_last_section): New method. Stores the last
7305 section to use the region.
7306 (Script_sections::block_in_region): New method. Returns true if
7307 a block of memory is contained within a region.
7308 (Script_sections::find_memory_region): New method. Locates a
7309 memory region to be used to set a VMA or LMA address.
7310 (Output_section_definition::set_section_addresses): Add code to
7311 check for addresses set by memory regions.
7312 (Output_segment::set_section_addresses): Remove memory region
7313 walking code.
7314 (Script_sections::create_segment): Add a warning if a header
7315 segment is created outside of any region.
7316 * script-sections.h (class Script_sections): Add prototypes for
7317 find_memory_region and block_in_region methods.
7318 * testsuite/memory_test.s: Use .long instead of .word.
7319 * testsuite/memory_test.t: Add some more output sections.
7320 * testsuite/memory_test.sh: Update expected output.
7321
a9bfd952
DK
73222010-10-02 Doug Kwan <dougkwan@google.com>
7323
7324 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7325 defintion to symtab.h
7326 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7327 declaration to defintion.
7328
bacff3ab
NC
73292010-10-01 Nick Clifton <nickc@redhat.com>
7330
7331 * expression.cc (eval): Replace dummy argument with NULL.
7332 (eval_maybe_dot): Check for a NULL result section pointer.
7333 (Symbol_expression::value): Likewise.
7334 (Dot_expression::value): Likewise.
7335 (BINARY_EXPRESSION): Likewise.
7336 (Max_expression::value): Likewise.
7337 (Min_expression::value): Likewise.
7338 (Absolute_expression::value): Likewise.
7339 (Addr_expression::value_from_output_section): Likewise.
7340 (Loaddddr_expression::value_from_output_section): Likewise.
7341 (Segment_start_expression::value): Likewise.
7342 * script-sections.cc
7343 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7344 argument with NULL.
7345 (Sections_elememt_dot_assignment::set_section_addresses):
7346 Likewise.
7347 (Output_data_expression::do_write_to_buffer): Likewise.
7348 (Output_section_definition::finalize_symbols): Likewise.
7349 (Output_section_definition::set_section_addresses): Likewise.
7350
f81bc8b5
DK
73512010-09-30 Doug Kwan <dougkwan@google.com>
7352
7353 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7354
c95e9f27
ST
73552010-09-28 Sriraman Tallam <tmsriram@google.com>
7356
7357 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 7358 function.
c95e9f27
ST
7359 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7360 virtual function.
7361 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7362 virtual function.
7363 * icf.cc (get_section_contents): Inline merge sections only when
7364 target allows it.
7365
3cac54d2
RW
73662010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7367
7368 * configure: Regenerate.
7369
2904037a
ILT
73702010-09-17 Ian Lance Taylor <iant@google.com>
7371
7372 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7373 * testsuite/Makefile.am (memory_test.o): New target.
7374 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7375 memory_test.t.
7376 * testsuite/Makefile.in: Rebuild.
2904037a 7377
bca7fb63
DK
73782010-09-17 Doug Kwan <dougkwan@google.com>
7379
7380 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7381 defintion if relocation uses GOT entries of the symbol.
7382 * testsuite/icf_safe_test.sh: Fix test.
7383 * testsuite/icf_safe_so_test.sh: Fix test.
7384
4ef28648
CC
73852010-09-16 Cary Coutant <ccoutant@google.com>
7386
7387 * script_sections.cc (class Memory_region): Remove "NULL" from
7388 vector initializations.
7389
793990de
CC
73902010-09-15 Cary Coutant <ccoutant@google.com>
7391
7392 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7393 Resolve forwarding symbols.
7394
81e015e2
DK
73952010-09-15 Doug Kwan <dougkwan@google.com>
7396
7397 * gold/testsuite/script_test_3.t: Add ARM special sections.
7398 * gold/testsuite/script_test_4.t: Same.
7399 * gold/testsuite/script_test_5.t: Same.
7400 * gold/testsuite/script_test_6.t: Same.
7401 * gold/testsuite/script_test_7.t: Same.
7402 * gold/testsuite/script_test_7.t: Same.
7403 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7404
36171d64
CC
74052010-09-14 Cary Coutant <ccoutant@google.com>
7406
7407 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7408 (Target_x86_64::Relocate::relocate_tls): Replace check for
7409 saw_tls_block_reloc_ with test for executable section.
7410
d89051bd
CC
74112010-09-12 Cary Coutant <ccoutant@google.com>
7412
7413 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7414 position-independent executables to shared libraries need dynamic
7415 relocations.
7416 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7417 position-independent executables.
7418 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7419 * testsuite/Makefile.in: Regenerate.
7420
fca41f0f
NC
74212010-09-10 Nick Clifton <nickc@redhat.com>
7422
7423 PR gold/11997
7424 * testsuite/memory_test.t: Discard any sections that are not
7425 needed.
7426
6695e4b3
L
74272010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7428
7429 PR gold/11996
7430 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7431 "This::" to work around a bug in gcc 4.2.
7432
7433 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7434
0f72bf6f
RÁE
74352010-09-09 Rafael Espindola <espindola@google.com>
7436
7437 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7438 sections with different PF_X flags in the same segment.
7439 (Layout::find_first_load_seg): Search all segments to find the first
7440 one.
7441 * options.h (rosegment): New.
7442
74432010-09-08 Rafael Espindola <espindola@google.com>
a6577478 7444
05a79166 7445 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 7446
aa98ff75
DK
74472010-09-08 Doug Kwan <dougkwan@google.com>
7448
7449 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7450 (Arm_relobj::do_relocate_sections): Add new parameter for output
7451 file to match the parent.
7452 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7453 of local symbols instead of input values. Update code to track
7454 changes in gold::relocate_section.
7455 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7456 (Sized_relobj::compute_final_local_value_internal): New methods.
7457 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7458 body into private version of Sized_relobj::compute_final_local_value.
7459 Call the inline method.
7460 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7461 merged symbol value if there is one.
7462 (Symbol_value::has_output_value): New method defintiion.
7463 (Sized_relobj::Compute_final_local_value_status): New enum type.
7464 (Sized_relobj::compute_final_local_value): New methods.
7465 (Sized_relobj::compute_final_local_value_internal): New methods.
7466 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7467 and arm_cortex_a8.sh.
7468 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7469 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7470 New tests.
7471 * Makefile.in: Regenerate.
7472 * testsuite/arm_bl_out_of_range.s: Update test.
7473 * testsuite/thumb_bl_out_of_range.s: Ditto.
7474 * testsuite/thumb_blx_out_of_range.s: Ditto.
7475 * testsuite/arm_branch_out_of_range.sh: New file.
7476 * testsuite/arm_cortex_a8.sh: Ditto.
7477 * testsuite/arm_cortex_a8_b.s: Ditto.
7478 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7479 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7480 * testsuite/arm_cortex_a8_bl.s: Ditto.
7481 * testsuite/arm_cortex_a8_blx.s: Ditto.
7482 * testsuite/arm_cortex_a8_local.s: Ditto.
7483 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7484 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7485
05a79166
L
74862010-09-08 Rafael Espindola <espindola@google.com>
7487
7488 * Makefile.am (memory_test.stdout): Run readelf with -W.
7489 * Makefile.in: Regenerate.
7490 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7491 64 bit output.
7492
33dbc701
RÁE
74932010-09-08 Rafael Espindola <espindola@google.com>
7494
7495 * script-sections.cc (Script_sections::add_memory_region): Convert
7496 field precision to int.
7497 * script.cc (script_set_section_region, script_set_section_region):
7498 Convert field precision to int.
7499
731ca54a
RÁE
75002010-09-08 Rafael Espindola <espindola@google.com>
7501
7502 * arm.cc (do_finalize_sections): Create the __exidx_start and
7503 __exdix_end symbols even when the section is missing.
7504
7f8cd844
NC
75052010-09-08 Nick Clifton <nickc@redhat.com>
7506
7507 * README: Remove claim that MEMORY is not supported.
7508 * expression.cc (script_exp_function_origin)
7509 (script_exp_function_length): Move from here to ...
7510 * script.cc: ... here.
7511 (script_set_section_region, script_add_memory)
7512 (script_parse_memory_attr, script_include_directive): New
7513 functions.
7514 * script-sections.cc
7515 (class Memory_region): New class.
7516 (class Output_section_definition): Add set_memory_region,
7517 set_section_vma, set_section_lma and get_section_name methods.
7518 (class Script_Sections): Add add_memory_region,
7519 find_memory_region, find_memory_region_origin,
7520 find_memory_region_length and set_memory_region methods.
7521 Have set_section_addresses method walk the list of set memory
7522 regions.
7523 Extend the print methos to display memory regions.
7524 * script-sections.h: Add prototypes for new methods.
7525 Add enum for MEMORY region attributes.
7526 * yyscript.y: Add support for parsing MEMORY regions.
7527 * script-c.h: Add prototypes for new functions.
7528 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7529 * testsuite/Makefile.in: Regenerate.
7530 * testsuite/memory_test.sh: New script.
7531 * testsuite/memory_test.s: New assembler source file.
7532 * testsuite/memory_test.t: New linker script.
7533
a4649286
DK
75342010-08-27 Doug Kwan <dougkwan@google.com>
7535
7536 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7537 reference override an existing dynamic weak reference.
7538 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7539 * testsuite/Makefile.in: Regenerate.
7540 * testsuite/dyn_weak_ref.sh: New file.
7541 * testsuite/dyn_weak_ref_1.c: Ditto.
7542 * testsuite/dyn_weak_ref_2.c: Ditto.
7543
b56648ad
ILT
75442010-08-27 Ian Lance Taylor <iant@google.com>
7545
7546 * incremental.h (class Incremental_input_entry): Add virtual
7547 destructor.
7548
809313cb
ILT
75492010-08-27 Ian Lance Taylor <iant@google.com>
7550
7551 * testsuite/start_lib_test_3.c: Mark t3 as used.
7552
11e32464
NC
75532010-08-27 Nick Clifton <nickc@redhat.com>
7554
7555 * options.cc (version_script): Fix small typo in previous
7556 whitespace tidyup.
7557
ca09d69a
NC
75582010-08-25 Nick Clifton <nickc@redhat.com>
7559
7560 * archive.cc: Formatting fixes: Remove whitespace between
7561 typename and following asterisk. Remove whitespace between
7562 function name and opening parenthesis.
7563 * archive.h: Likewise.
7564 * arm.cc: Likewise.
7565 * attributes.cc: Likewise.
7566 * attributes.h: Likewise.
7567 * common.cc: Likewise.
7568 * copy-relocs.cc: Likewise.
7569 * dirsearch.h: Likewise.
7570 * dynobj.cc: Likewise.
7571 * ehframe.cc: Likewise.
7572 * ehframe.h: Likewise.
7573 * expression.cc: Likewise.
7574 * fileread.cc: Likewise.
7575 * fileread.h: Likewise.
7576 * gc.h: Likewise.
7577 * gold-threads.cc: Likewise.
7578 * gold.cc: Likewise.
7579 * i386.cc: Likewise.
7580 * icf.h: Likewise.
7581 * incremental-dump.cc: Likewise.
7582 * incremental.cc: Likewise.
7583 * layout.cc: Likewise.
7584 * layout.h: Likewise.
7585 * main.cc: Likewise.
7586 * merge.cc: Likewise.
7587 * merge.h: Likewise.
7588 * object.cc: Likewise.
7589 * object.h: Likewise.
7590 * options.cc: Likewise.
7591 * options.h: Likewise.
7592 * output.cc: Likewise.
7593 * output.h: Likewise.
7594 * plugin.cc: Likewise.
7595 * plugin.h: Likewise.
7596 * powerpc.cc: Likewise.
7597 * reloc.cc: Likewise.
7598 * script-c.h: Likewise.
7599 * script-sections.cc: Likewise.
7600 * script.cc: Likewise.
7601 * stringpool.cc: Likewise.
7602 * symtab.cc: Likewise.
7603 * symtab.h: Likewise.
7604 * target.cc: Likewise.
7605 * timer.cc: Likewise.
7606 * timer.h: Likewise.
7607 * version.cc: Likewise.
7608 * x86_64.cc: Likewise.
7609
b8fa8750
NC
76102010-08-24 Nick Clifton <nickc@redhat.com>
7611
7612 PR 11899
7613 * layout.cc (segment_precedes): Sort segments by their physical
7614 addresses, if they have been set.
7615
9919d93b
CC
76162010-08-23 Cary Coutant <ccoutant@google.com>
7617
7618 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7619 symbols data.
7620 (Lib_group::include_member): Unlock object after deleting its
7621 symbols data.
7622 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7623 the bug fixed here.
7624
97b4be1c
CC
76252010-08-19 Neil Vachharajani <nvachhar@google.com>
7626 Cary Coutant <ccoutant@google.com>
7627
7628 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7629 constructor, and set_blocker.
7630 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7631 readsyms_blocker_.
7632 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7633 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7634 * testsuite/Makefile.am (start_lib_test): New test case.
7635 * testsuite/Makefile.in: Regenerate.
7636 * testsuite/start_lib_test_main.c: New file.
7637 * testsuite/start_lib_test_1.c: New file.
7638 * testsuite/start_lib_test_2.c: New file.
7639 * testsuite/start_lib_test_3.c: New file.
7640
dd0b1884
ILT
76412010-08-19 Ian Lance Taylor <iant@google.com>
7642
7643 * Makefile.in: Rebuild with automake 1.11.1.
7644 * aclocal.m4: Likewise.
7645 * testsuite/Makefile.in: Likewise.
7646
7223e9ca
ILT
76472010-08-19 Ian Lance Taylor <iant@google.com>
7648
7649 PR 10893
7650 * i386.cc (class Output_data_plt_i386): Update declarations.
7651 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7652 local_ifuncs_ fields.
7653 (Target_i386::do_plt_section_for_global): New function.
7654 (Target_i386::do_plt_section_for_local): New function.
7655 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7656 parameter; change all callers. Initialize global_ifuncs_ and
7657 local_ifuncs_. If doing a static link define __rel_iplt_start and
7658 __rel_iplt_end.
7659 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7660 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7661 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7662 symbols.
7663 (Target_i386::make_plt_section): New function, broken out of
7664 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7665 (Target_i386::make_plt_entry): Call make_plt_section.
7666 (Target_i386::make_local_ifunc_plt_entry): New function.
7667 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7668 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7669 R_386_IRELATIVE to switch.
7670 (Target_i386::Scan::global): Likewise.
7671 (Target_i386::Relocate::relocate): Likewise.
7672 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7673 switch.
7674 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7675 (Target_x86_64::do_plt_section_for_global): New function.
7676 (Target_x86_64::do_plt_section_for_local): New function.
7677 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7678 parameter; change all callers. If doing a static link define
7679 __rela_iplt_start and __rela_iplt_end.
7680 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7681 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7682 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7683 to point to .plt.
7684 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7685 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7686 switch.
7687 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7688 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7689 R_X86_64_IRELATIVE to switch.
7690 (Target_x86_64::Scan::global): Likewise.
7691 (Target_x86_64::Relocate::relocate): Likewise.
7692 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7693 switch.
7694 * target.h (class Target): Add plt_section_for_global and
7695 plt_section_for_local functions. Add do_plt_section_for_global
7696 and do_plt_section_for_local virtual functions.
7697 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7698 clarifying comments.
7699 (Symbol::use_plt_offset): Handle IFUNC symbol.
7700 * object.cc (Sized_relobj::Sized_relobj): Initialize
7701 local_plt_offsets_.
7702 (Sized_relobj::local_has_plt_offset): New function.
7703 (Sized_relobj::local_plt_offset): New function.
7704 (Sized_relobj::set_local_plt_offset): New function.
7705 (Sized_relobj::do_count): Handle IFUNC symbol.
7706 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7707 a bit away from input_shndx_ field. Add set_is_func_symbol and
7708 is_ifunc_symbol functions.
7709 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7710 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7711 local_plt_offsets_ field.
7712 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7713 * output.h (class Output_section_data): Add non-const
7714 output_section function.
7715 (class Output_data_got): Update declarations.
7716 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7717 Add use_plt_offset parameter to global and local constructors.
7718 Change all callers. Change local_sym_index_ field to 31 bits.
7719 Change GSYM_CODE and CONSTANT_CODE accordingly.
7720 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7721 doing a static link don't set sh_link field.
7722 (Output_data_got::Got_entry::write): Use PLT offset if
7723 appropriate.
7724 (Output_data_got::add_global_plt): New function.
7725 (Output_data_got::add_local_plt): New function.
7726 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7727 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7728 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7729 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7730 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7731 IFUNC conditional.
7732 * testsuite/ifunc-sel.h: New file.
7733 * testsuite/ifuncmain1.c: New file.
7734 * testsuite/ifuncmain1vis.c: New file.
7735 * testsuite/ifuncmod1.c: New file.
7736 * testsuite/ifuncdep2.c: New file.
7737 * testsuite/ifuncmain2.c: New file.
7738 * testsuite/ifuncmain3.c: New file.
7739 * testsuite/ifuncmod3.c: New file.
7740 * testsuite/ifuncmain4.c: New file.
7741 * testsuite/ifuncmain5.c: New file.
7742 * testsuite/ifuncmod5.c: New file.
7743 * testsuite/ifuncmain6pie.c: New file.
7744 * testsuite/ifuncmod6.c: New file.
7745 * testsuite/ifuncmain7.c: New file.
7746 * configure, testsuite/Makefile.in: Rebuild.
7747
56f75c03
ILT
77482010-08-18 Ian Lance Taylor <iant@google.com>
7749
7750 * incremental.cc
7751 (Output_section_incremental_inputs::write_input_files): Add cast
7752 to avoid signed/unsigned comparison warning.
7753 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7754
55455f89
CC
77552010-08-12 Cary Coutant <ccoutant@google.com>
7756
7757 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7758
e2054bcb
ILT
77592010-08-13 Ian Lance Taylor <iant@google.com>
7760
7761 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7762
74f67560
DK
77632010-08-12 Cary Coutant <ccoutant@google.com>
7764 Doug Kwan <dougkwan@google.com>
7765
7766 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7767 defintion overrides non-weak undef, remember that the original undef
7768 is not weak.
7769 * symtab.cc (Symbol_table::sized_write_global): For undef without
7770 an original weak binding, set binding to global in output.
7771 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7772 * testsuite/Makefile.in: Regenerate.
7773 * testsuite/strong_ref_weak_def.sh: New file.
7774 * testsuite/strong_ref_weak_def_1.c: Ditto.
7775 * testsuite/strong_ref_weak_def_2.c: Ditto.
7776
d1238d12
CC
77772010-08-12 Cary Coutant <ccoutant@google.com>
7778
7779 * testsuite/incremental_test.sh: Rewrite.
7780 * testsuite/incremental_test_1.c: Rewrite.
7781 * testsuite/incremental_test_2.c: Rewrite.
7782
0e70b911
CC
77832010-08-12 Cary Coutant <ccoutant@google.com>
7784
7785 * arm.cc (Target_arm::got_size): Add const.
7786 (Target_arm::got_entry_count): New function.
7787 (Target_arm::plt_entry_count): New function.
7788 (Target_arm::first_plt_entry_offset): New function.
7789 (Target_arm::plt_entry_size): New function.
7790 (Output_data_plt_arm::entry_count): New function.
7791 (Output_data_plt_arm::first_plt_entry_offset): New function.
7792 (Output_data_plt_arm::get_plt_entry_size): New function.
7793 * i386.cc (Target_i386::got_size): Add const.
7794 (Target_i386::got_entry_count): New function.
7795 (Target_i386::plt_entry_count): New function.
7796 (Target_i386::first_plt_entry_offset): New function.
7797 (Target_i386::plt_entry_size): New function.
7798 (Output_data_plt_i386::entry_count): New function.
7799 (Output_data_plt_i386::first_plt_entry_offset): New function.
7800 (Output_data_plt_i386::get_plt_entry_size): New function.
7801 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7802 find_incremental_inputs_sections. Dump incremental_got_plt section.
7803 * incremental.cc: Include target.h.
7804 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7805 parameter. Adjust all callers. Find incremental_got_plt section.
7806 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7807 section.
7808 (Output_section_incremental_inputs::set_final_data_size): Calculate
7809 size of incremental_got_plt section.
7810 (Output_section_incremental_inputs::do_write): Write the
7811 incremental_got_plt section.
7812 (Got_plt_view_info): New struct.
7813 (Local_got_offset_visitor): New class.
7814 (Global_got_offset_visitor): New class.
7815 (Global_symbol_visitor_got_plt): New class.
7816 (Output_section_incremental_inputs::write_got_plt): New function.
7817 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7818 Add parameter. Adjust all callers.
7819 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7820 (Incremental_inputs::got_plt_section): New function.
7821 (Incremental_inputs::got_plt_section_): New data member.
7822 (Incremental_got_plt_reader): New class.
7823 * layout.cc (Layout::create_incremental_info_sections): Add the
7824 incremental_got_plt section.
7825 * object.h (Got_offset_list::get_list): New function.
7826 (Got offset_list::for_all_got_offsets): New function.
7827 (Sized_relobj::local_got_offset_list): New function.
7828 * powerpc.cc (Target_powerpc::got_size): Add const.
7829 (Target_powerpc::got_entry_count): New function.
7830 (Target_powerpc::plt_entry_count): New function.
7831 (Target_powerpc::first_plt_entry_offset): New function.
7832 (Target_powerpc::plt_entry_size): New function.
7833 (Output_data_plt_powerpc::entry_count): New function.
7834 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7835 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7836 * sparc.cc (Target_sparc::got_size): Add const.
7837 (Target_sparc::got_entry_count): New function.
7838 (Target_sparc::plt_entry_count): New function.
7839 (Target_sparc::first_plt_entry_offset): New function.
7840 (Target_sparc::plt_entry_size): New function.
7841 (Output_data_plt_sparc::entry_count): New function.
7842 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7843 (Output_data_plt_sparc::get_plt_entry_size): New function.
7844 * symtab.h (Symbol::got_offset_list): New function.
7845 (Symbol_table::for_all_symbols): New function.
7846 * target.h (Sized_target::got_entry_count): New function.
7847 (Sized_target::plt_entry_count): New function.
7848 (Sized_target::plt_entry_size): New function.
7849 * x86_64.cc (Target_x86_64::got_size): Add const.
7850 (Target_x86_64::got_entry_count): New function.
7851 (Target_x86_64::plt_entry_count): New function.
7852 (Target_x86_64::first_plt_entry_offset): New function.
7853 (Target_x86_64::plt_entry_size): New function.
7854 (Output_data_plt_x86_64::entry_count): New function.
7855 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7856 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7857
09ec0418
CC
78582010-08-12 Cary Coutant <ccoutant@google.com>
7859
7860 * archive.cc: Include incremental.h.
7861 (Archive::Archive): Initialize incremental_info_.
7862 (Archive::include_member): Record archive members in incremental info.
7863 (Add_archive_symbols::run): Record begin and end of an archive in
7864 incremental info.
7865 (Lib_group::include_member): Record objects in incremental info.
7866 * archive.h (Incremental_archive_entry): Forward declaration.
7867 (Archive::set_incremental_info): New member function.
7868 (Archive::incremental_info): New member function.
7869 (Archive::Unused_symbol_iterator): New class.
7870 (Archive::unused_symbols_begin): New member function.
7871 (Archive::unused_symbols_end): New member function.
7872 (Archive::incremental_info_): New data member.
7873 * incremental-dump.cc (find_input_containing_global): New function.
7874 (dump_incremental_inputs): Dump new incremental info sections.
7875 * incremental.cc: Include symtab.h.
7876 (Output_section_incremental_inputs): New class.
7877 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
7878 new incremental info sections.
7879 (Sized_incremental_binary::do_check_inputs): Likewise.
7880 (Incremental_inputs::report_archive): Remove.
7881 (Incremental_inputs::report_archive_begin): New function.
7882 (Incremental_inputs::report_archive_end): New function.
7883 (Incremental_inputs::report_object): New function.
7884 (Incremental_inputs::finalize_inputs): Remove.
7885 (Incremental_inputs::report_input_section): New function.
7886 (Incremental_inputs::report_script): Rewrite.
7887 (Incremental_inputs::finalize): Do nothing but finalize string table.
7888 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7889 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7890 (Incremental_inputs::create_data_sections): New function.
7891 (Incremental_inputs::relocs_entsize): New function.
7892 (Output_section_incremental_inputs::set_final_data_size): New function.
7893 (Output_section_incremental_inputs::do_write): New function.
7894 (Output_section_incremental_inputs::write_header): New function.
7895 (Output_section_incremental_inputs::write_input_files): New function.
7896 (Output_section_incremental_inputs::write_info_blocks): New function.
7897 (Output_section_incremental_inputs::write_symtab): New function.
7898 * incremental.h (Incremental_script_entry): Forward declaration.
7899 (Incremental_object_entry): Forward declaration.
7900 (Incremental_archive_entry): Forward declaration.
7901 (Incremental_inputs): Forward declaration.
7902 (Incremental_inputs_header_data): Remove.
7903 (Incremental_inputs_header): Remove.
7904 (Incremental_inputs_header_write): Remove.
7905 (Incremental_inputs_entry_data): Remove.
7906 (Incremental_inputs_entry): Remove.
7907 (Incremental_inputs_entry_write): Remove.
7908 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
7909 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
7910 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7911 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
7912 Likewise.
7913 (Incremental_input_entry): New class.
7914 (Incremental_script_entry): New class.
7915 (Incremental_object_entry): New class.
7916 (Incremental_archive_entry): New class.
7917 (Incremental_inputs::Incremental_inputs): Initialize new data members.
7918 (Incremental_inputs::report_inputs): Remove.
7919 (Incremental_inputs::report_archive): Remove.
7920 (Incremental_inputs::report_archive_begin): New function.
7921 (Incremental_inputs::report_archive_end): New function.
7922 (Incremental_inputs::report_object): Change prototype.
7923 (Incremental_inputs::report_input_section): New function.
7924 (Incremental_inputs::report_script): Change prototype.
7925 (Incremental_inputs::get_reloc_count): New function.
7926 (Incremental_inputs::set_reloc_count): New function.
7927 (Incremental_inputs::create_data_sections): New function.
7928 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7929 (Incremental_inputs::inputs_section): New function.
7930 (Incremental_inputs::symtab_section): New function.
7931 (Incremental_inputs::relocs_section): New function.
7932 (Incremental_inputs::get_stringpool): Add const.
7933 (Incremental_inputs::command_line): Add const.
7934 (Incremental_inputs::inputs): Remove.
7935 (Incremental_inputs::command_line_key): New function.
7936 (Incremental_inputs::input_file_count): New function.
7937 (Incremental_inputs::input_files): New function.
7938 (Incremental_inputs::relocs_entsize): New function.
7939 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7940 (Incremental_inputs::finalize_inputs): Remove.
7941 (Incremental_inputs::Input_info): Remove.
7942 (Incremental_inputs::lock_): Remove.
7943 (Incremental_inputs::inputs_): Change type.
7944 (Incremental_inputs::inputs_map_): Remove.
7945 (Incremental_inputs::current_object_entry_): New data member.
7946 (Incremental_inputs::inputs_section_): New data member.
7947 (Incremental_inputs::symtab_section_): New data member.
7948 (Incremental_inputs::relocs_section_): New data member.
7949 (Incremental_inputs::reloc_count_): New data member.
7950 (Incremental_inputs_reader): New class.
7951 (Incremental_symtab_reader): New class.
7952 (Incremental_relocs_reader): New class.
7953 * layout.cc (Layout::finalize): Move finalization of incremental info
7954 and creation of incremental info sections to follow finalization of
7955 symbol table. Set offsets for postprocessing sections.
7956 (Layout::create_incremental_info_sections): Call
7957 Incremental_inputs::create_data_sections. Add incremental symtab
7958 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
7959 sections to layout after input sections.
7960 * layout.h (struct Timespec): Forward declaration.
7961 (Layout::incremental_inputs): Add const.
7962 (Layout::create_incremental_info_sections): Add parameter.
7963 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
7964 * object.cc: Include incremental.h.
7965 (Relobj::finalize_incremental_relocs): New function.
7966 (Sized_relobj::do_layout): Record input sections in incremental info.
7967 * object.h (Object::output_section): New function.
7968 (Object::output_section_offset): Moved from Relobj.
7969 (Object::get_incremental_reloc_base): New function.
7970 (Object::get_incremental_reloc_count): New function.
7971 (Object::do_output_section): New function.
7972 (Object::do_output_section_offset): Moved from Relobj.
7973 (Object::do_get_incremental_reloc_base): New function.
7974 (Object::do_get_incremental_reloc_count): New function.
7975 (Object::Object): Initialize new data members.
7976 (Relobj::output_section): Renamed do_output_section and moved to
7977 protected.
7978 (Relobj::output_section_offset): Moved to Object.
7979 (Relobj::do_get_incremental_reloc_base): New function.
7980 (Relobj::do_get_incremental_reloc_count): New function.
7981 (Relobj::allocate_incremental_reloc_counts): New function.
7982 (Relobj::count_incremental_reloc): New function.
7983 (Relobj::finalize_incremental_relocs): New function.
7984 (Relobj::next_incremental_reloc_index): New function.
7985 (Relobj::reloc_counts_): New data member.
7986 (Relobj::reloc_bases_): New data member.
7987 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
7988 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
7989 (Sized_relobj::incremental_relocs_scan): New function.
7990 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7991 (Sized_relobj::incremental_relocs_write): New function.
7992 (Sized_relobj::incremental_relocs_write_reltype): New function.
7993 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
7994 incremental link.
7995 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
7996 archives and object files elsewhere.
7997 (Add_symbols::run): Report object files here.
7998 (Finish_group::run): Report end of archive at end of group.
7999 * reloc.cc: Include layout.h, incremental.h.
8000 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8001 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8002 (Sized_relobj::incremental_relocs_scan): New function.
8003 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8004 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8005 (Sized_relobj::incremental_relocs_write): New function.
8006 (Sized_relobj::incremental_relocs_write_reltype): New function.
8007 * script.cc (read_input_script): Rewrite test for incremental link.
8008 Change call to Incremental_inputs::report_script.
8009 * symtab.h (Symbol_table::first_global_index): New function.
8010 (Symbol_table::output_count): New function.
8011
ce0d1972
DK
80122010-08-12 Doug Kwan <dougkwan@google.com>
8013
8014 * arm.cc (Target_arm::merge_object_attributes): Check command line
8015 options --no-wchar-size-warning and --no-enum-size-warning.
8016 * options.h (General_options): Add ld-compatible options
8017 --no-enum-size-warning and --no-wchar-size-warning.
8018
6e5710ce
ILT
80192010-08-04 Ian Lance Taylor <iant@google.com>
8020
8021 * x86_64.cc (Target_x86_64::Scan::local): Use
8022 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8023 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8024 (Target_x86_64::Scan::global): Likewise.
8025 (Target_x86_64::Relocate::relocate): Likewise.
8026 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8027 Likewise.
8028
fef830db
CC
80292010-08-03 Cary Coutant <ccoutant@google.com>
8030
8031 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8032 to reserve space in merged_strings vector. Keep total input size
8033 for stats.
8034 (Output_merge_string::do_print_merge_stats): Print total input size.
8035 * merge.h (Output_merge_string): Add input_size_ field.
8036 * stringpool.cc (Stringpool_template::string_length): Move
8037 implementations out of Stringpool_template class and place in
8038 stringpool.h.
8039 * stringpool.h (string_length): Move out of Stringpool_template.
8040
1e3811b0
ILT
80412010-08-03 Ian Lance Taylor <iant@google.com>
8042
8043 PR 11712
8044 * layout.cc (relaxation_loop_body): If address of load segment is
8045 set, adjust address to include headers if possible.
8046
7af0c620
ILT
80472010-08-03 Ian Lance Taylor <iant@google.com>
8048
8049 * version.cc (version_string): Bump to 1.10.
8050
22f0da72
ILT
80512010-08-03 Ian Lance Taylor <iant@google.com>
8052
8053 PR 11805
8054 * layout.h (enum Output_section_order): Define.
8055 (class Layout): Update declarations.
8056 * layout.cc (Layout::get_output_section): Add order parameter.
8057 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8058 is_first_non_relro parameters. Change all callers.
8059 (Layout::choose_output_section): Likewise.
8060 (Layout::add_output_section_data): Likewise.
8061 (Layout::make_output_section): Likewise. Set order.
8062 (Layout::default_section_order): New function.
8063 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8064 * output.cc (Output_section::Output_section): Initialize order_.
8065 Don't initialize deleted fields.
8066 (Output_segment::Output_segment): Don't initialize deleted
8067 fields.
8068 (Output_segment::add_output_section_to_load): New function
8069 replacing add_output_section. Change all callers to call this or
8070 add_output_section_to_nonload.
8071 (Output_segment::add_output_section_to_nonload): New function.
8072 (Output_segment::remove_output_section): Rewrite.
8073 (Output_segment::add_initial_output_data): Likewise.
8074 (Output_segment::has_any_data_sections): Likewise.
8075 (Output_segment::is_first_section_relro): Likewise.
8076 (Output_segment::maximum_alignment): Likewise.
8077 (Output_segment::has_dynamic_reloc): New function replacing
8078 dynamic_reloc_count. Change all callers.
8079 (Output_segment::has_dynamic_reloc_list): New function replacing
8080 dynamic_reloc_count_list. Change all callers.
8081 (Output_segment::set_section_addresses): Rewrite.
8082 (Output_segment::set_offset): Rewrite.
8083 (Output_segment::find_first_and_last_list): Remove.
8084 (Output_segment::set_tls_offsets): Rewrite.
8085 (Output_segment::first_section_load_address): Likewise.
8086 (Output_segment::output_section_count): Likewise.
8087 (Output_segment::section_with_lowest_load_address): Likewise.
8088 (Output_segment::write_section_headers): Likewise.
8089 (Output_segment::print_sections_to_map): Likewise.
8090 * output.h (class Output_data): Remove dynamic_reloc_count_
8091 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8092 (Output_data::add_dynamic_reloc): Rewrite.
8093 (Output_data::has_dynamic_reloc): New function.
8094 (Output_data::dynamic_reloc_count): Remove.
8095 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8096 is_last_relro_, is_first_non_relro_, is_interp_,
8097 is_dynamic_linker_section_ fields. Add order and set_order
8098 functions. Remove is_relro_local, set_is_relro_local,
8099 is_last_relro, set_is_last_relro, is_first_non_relro,
8100 set_is_first_non_relro functions, is_interp, set_is_interp,
8101 is_dynamic_linker_section, and set_is_dynamic_linker_section
8102 functions.
8103 (class Output_segment): Change Output_data_list from std::list to
8104 std:;vector. Add output_lists_ field. Remove output_data_ and
8105 output_bss_ fields. Update declarations.
8106
3ff2ccb0
ILT
81072010-08-02 Ian Lance Taylor <iant@google.com>
8108
8109 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8110 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8111 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8112
88a4108b
ILT
81132010-08-02 Ian Lance Taylor <iant@google.com>
8114
8115 PR 11855
8116 * script.cc (Script_options::Script_options): Initialize
8117 symbol_definitions_ and symbol_references_.
8118 (Script_options::add_symbol_assignment): Update
8119 symbol_definitions_ and symbol_references_.
8120 (Script_options::add_symbol_reference): New function.
8121 (script_symbol): New function.
8122 * script.h (class Script_options): Add symbol_definitions_ and
8123 symbol_references_ fields.
8124 (Script_options::referenced_const_iterator): New type.
8125 (Script_options::referenced_begin): New function.
8126 (Script_options::referenced_end): New function.
8127 (Script_options::is_referenced): New function.
8128 (Script_options::any_unreferenced): New function.
8129 * script-c.h (script_symbol): Declare.
8130 * yyscript.y (exp): Call script_symbol.
8131 * symtab.cc: Include "script.h".
8132 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8133 Change all callers. Check symbols referenced by scripts.
8134 (Symbol_table::add_undefined_symbols_from_command_line): Add
8135 layout parameter. Change all callers.
8136 (Symbol_table::do_add_undefined_symbols_from_command_line):
8137 Likewise. Break out loop body. Check symbols referenced by
8138 scripts.
8139 (Symbol_table::add_undefined_symbol_from_command_line): New
8140 function broken out of
8141 do_add_undefined_symbols_from_command_line.
8142 * symtab.h (class Symbol_table): Update declarations.
8143 * archive.cc: Include "layout.h".
8144 (Archive::should_include_member): Add layout parameter. Change
8145 all callers. Check for symbol mentioned in expression.
8146 * archive.h (class Archive): Update declaration.
8147 * object.cc (Sized_relobj::do_should_include_member): Add layout
8148 parameter.
8149 * object.h (Object::should_include_member): Add layout parameter.
8150 Change all callers.
8151 (Object::do_should_include_member): Add layout parameter.
8152 (class Sized_relobj): Update declaration.
8153 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8154 parameter.
8155 * dynobj.h (class Sized_dynobj): Update declaration.
8156 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8157 layout parameter.
8158 * plugin.h (class Sized_pluginobj): Update declaration.
8159
5f1ab67a
ILT
81602010-08-02 Ian Lance Taylor <iant@google.com>
8161
8162 PR 11866
8163 * output.cc (Output_segment::set_offset): Search for the first and
8164 last sections rather than assuming that the list is in order.
8165 (Output_segment::find_first_and_last_list): New function.
8166 * output.h (class Output_segment): Update declarations.
8167 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8168 (relro_strip_test_SOURCES): New variable.
8169 (relro_strip_test_DEPENDENCIES): New variable.
8170 (relro_strip_test_LDFLAGS): New variable.
8171 (relro_strip_test_LDADD): New variable.
8172 (relro_strip_test.so): New target.
8173
a8df5856
ILT
81742010-08-02 Ian Lance Taylor <iant@google.com>
8175
8176 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8177 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8178 (Target_i386::got_tlsdesc_section): New function.
8179 (Target_i386::got_section): Create space for GOT entries for
8180 TLSDESC relocations.
8181 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8182 R_386_TLS_GOTDESC.
8183 (Target_i386::Scan::global): Likewise.
8184 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8185 using TLSDESC GOT.
8186 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8187 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8188 (Target_x86_64::got_tlsdesc_section): New function.
8189 (Target_x86_64::got_section): Create space for GOT entries for
8190 TLSDESC relocations.
8191 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8192 R_386_TLS_GOTDESC.
8193 (Target_x86_64::Scan::global): Likewise.
8194 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8195 using TLSDESC GOT.
8196
0c10a0a6
ILT
81972010-08-02 Ian Lance Taylor <iant@google.com>
8198
8199 * testsuite/final_layout.sh: Use dc to convert from hex to
8200 decimal.
8201
41cbeecc
ST
82022010-07-29 Sriraman Tallam <tmsriram@google.com>
8203
8204 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8205 paramter to the call to gold::gc_process_relocs.
8206 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8207 paramter to the call to gold::gc_process_relocs.
8208 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8209 parameter to the call to gold::gc_process_relocs.
8210 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8211 template parameter to the call to gold::gc_process_relocs.
8212 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8213 paramter to the call to gold::gc_process_relocs.
8214 * gc.h (get_embedded_addend_size): New function.
8215 (gc_process_relocs): Save the size of the reloc for use by ICF.
8216 * icf.cc (get_section_contents): Get the addend from the text section
8217 for SHT_REL relocation sections.
8218 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8219 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8220 * int_encoding.h (read_from_pointer): New overloaded function.
8221 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8222 * testsuite/icf_sht_rel_addend_test.sh: New file.
8223 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8224 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8225
6ea55b82
RW
82262010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8227
8228 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8229 * Makefile.in: Regenerate.
8230 * testsuite/Makefile.in: Regenerate.
8231
9691462b
ILT
82322010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8233
8234 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8235 * gold/testsuite/debug_msg.cc: Likewise.
8236 * gold/testsuite/odr_violation1.cc
8237 * gold/testsuite/odr_violation2.cc
8238
76897331
CC
82392010-07-21 Cary Coutant <ccoutant@google.com>
8240
8241 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8242 string, and length fields.
8243 (Output_merge_string::Merged_strings_list): New type.
8244 (Output_merge_string::Merged_strings_lists): New typedef.
8245 (Output_merge_string): Replace merged_strings_ with
8246 merged_strings_lists_.
8247 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8248 Merged_strings_list per input object and section. Don't store pointer
8249 to the string. Don't store length with each merged string entry.
8250 (Output_merge_string::finalize_merged_data): Loop over list of merged
8251 strings lists. Recompute length of each merged string.
8252
78384e8f
CC
82532010-07-15 Cary Coutant <ccoutant@google.com>
8254
8255 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8256 here.
8257
783659f9
ILT
82582010-07-14 Ian Lance Taylor <iant@google.com>
8259
8260 * descriptors.cc (Descriptors::open): Report correct name in error
8261 message.
8262
131687b4
DK
82632010-07-13 Doug Kwan <dougkwan@google.com>
8264
8265 * arm.cc (Arm_input_section::Arm_input_section): For a
8266 SHT_ARM_EXIDX section, always keeps the input sections.
8267 (Arm_input_section::set_exidx_section_link): New method.
8268 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8269 has_errors_ to false.
8270 (Arm_exidx_input_section::has_errors,
8271 Arm_exidx_input_section::set_has_errors): New methods.
8272 (Arm_exidx_input_section::has_errors_): New data member.
8273 (Arm_relobj::get_exidx_shndx_list): New method.
8274 (Arm_output_section::append_text_sections_to_list): Do not skip
8275 section without SHF_EXECINSTR.
8276 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8277 errors.
2e702c99 8278 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8279 section header. Make error messages more verbose. Check for
8280 a non-executable section linked to an EXIDX section.
8281 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8282 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8283 check that there is no deferred EXIDX section if we exit early.
8284 Instead of not making an EXIDX section in case of an error, make one
8285 and set the has_errors flag of it.
8286 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8287 in a relocatable link.
8288 (Target_arm::do_relax): Look for the EXIDX output section instead of
8289 assuming that it is called .ARM.exidx.
2e702c99 8290 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8291 section list. Do not check for SHF_EXECINSTR section flags but
8292 skip any input section with errors.
8293 * output.cc (Output_section::Output_section): Initialize
8294 always_keeps_input_sections_ to false.
8295 (Output_section::add_input_section): Check for
8296 always_keeps_input_sections_.
8297 * output.h (Output_section::always_keeps_input_sections,
8298 Output_section::set_always_keeps_input_sections): New methods.
8299 (Output_section::always_keeps_input_sections): New data member.
8300
69517287
RÁE
83012010-07-13 Rafael Espindola <espindola@google.com>
8302
8303 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8304 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8305
82742395
ILT
83062010-07-13 Philip Herron <herron.philip@googlemail.com>
8307 Ian Lance Taylor <iant@google.com>
8308
8309 * output.h (Output_section_lookup_maps::add_merge_section):
8310 Correct check of whether value was inserted.
8311 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8312 (Output_section_lookup_maps::add_relaxed_input_section):
8313 Likewise.
8314 * arm.cc (Target_arm::got_section): Remove used local os.
8315 * i386.cc (Target_i386::got_section): Likewise.
8316 * x86_64.cc (Target_x86_64::got_section): Likewise.
8317 * sparc.cc (Target_sparc::got_section): Likewise.
8318 (Target_sparc::relocate): Remove unused local have_got_offset.
8319 * powerpc.cc (Target_powerpc::relocate): Likewise.
8320
f2d707b5
ILT
83212010-07-13 Ian Lance Taylor <iant@google.com>
8322
241531d6
ILT
8323 * compressed_output.cc (zlib_decompress): Fix signature in
8324 !HAVE_ZLIB_H case.
8325
f2d707b5
ILT
8326 * archive.cc (Archive::include_member): Unlock an external member
8327 of a thin archive. Don't bother to delete an object we know is
8328 NULL.
8329
a2e47362
CC
83302010-07-12 Cary Coutant <ccoutant@google.com>
8331
8332 * compressed_output.cc (zlib_decompress): New function.
8333 (get_uncompressed_size): New function.
8334 (decompress_input_section): New function.
8335 * compressed_output.h (get_uncompressed_size): New function.
8336 (decompress_input_section): New function.
8337 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8338 Handle compressed debug sections.
8339 * layout.cc (is_compressed_debug_section): New function.
8340 (Layout::output_section_name): Map compressed section names to
8341 canonical names.
8342 * layout.h (is_compressed_debug_section): New function.
8343 (is_debug_info_section): Recognize compressed debug sections.
8344 * merge.cc: Include compressed_output.h.
8345 (Output_merge_data::do_add_input_section): Handle compressed
8346 debug sections.
8347 (Output_merge_string::do_add_input_section): Handle compressed
8348 debug sections.
8349 * object.cc: Include compressed_output.h.
8350 (Sized_relobj::Sized_relobj): Initialize new data members.
8351 (build_compressed_section_map): New function.
8352 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8353 * object.h (Object::section_is_compressed): New method.
8354 (Object::do_section_is_compressed): New method.
8355 (Sized_relobj::Compressed_section_map): New type.
8356 (Sized_relobj::do_section_is_compressed): New method.
8357 (Sized_relobj::compressed_sections_): New data member.
8358 * output.cc (Output_section::add_input_section): Handle compressed
8359 debug sections.
8360 * reloc.cc: Include compressed_output.h.
8361 (Sized_relobj::write_sections): Handle compressed debug sections.
8362
ce279a62
CC
83632010-07-08 Cary Coutant <ccoutant@google.com>
8364
8365 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8366 weak when resolving to a dynamic def.
8367 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8368 for weak undef/dynamic def cases. Adjust callers.
8369 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8370 undef_binding_weak_.
8371 (Symbol_table::sized_write_globals): Adjust symbol binding.
8372 (Symbol_table::sized_write_symbol): Add binding parameter.
8373 * symtab.h (Symbol::set_undef_binding): New method.
8374 (Symbol::is_undef_binding_weak): New method.
8375 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8376 (Symbol_table::should_override): Add new parameter.
8377 (Symbol_table::sized_write_symbol): Add new parameter.
8378
8379 * testsuite/weak_undef_file1.cc: Add new test case.
8380 * testsuite/weak_undef_file2.cc: Fix header comment.
8381 * testsuite/weak_undef_test.cc: Add new test case.
8382
b2286c10
DK
83832010-06-29 Doug Kwan <dougkwan@google.com>
8384
8385 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8386 Initialize USE_SYMBOL_.
8387 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8388 definition.
8389 (Arm_reloc_property::uses_symbol_): New data member declaration.
8390 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8391 uses symbol value and symbol is undefined but not weakly undefined.
8392
4802450a
RÁE
83932010-06-28 Rafael Espindola <espindola@google.com>
8394
8395 * plugin.cc (Plugin::load): Use dlerror.
8396
e5ca47ba
ILT
83972010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8398
8399 * symtab.cc (detect_odr_violations): When reporting an ODR
8400 violation, report an object where the symbol is defined.
8401
8a75a161
DK
84022010-06-25 Doug Kwan <dougkwan@google.com>
8403
8404 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8405 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8406 definition.
8407 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8408 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8409 target hook to detect function points.
8410 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8411 * icf.h (Icf::check_section_for_function_pointers): Change type of
8412 parameter SECTION_NAME to const reference to std::string. Use
8413 target hook to determine if section may have unsafe pointers.
8414 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8415 method definition.
8416
42218b9f
RÁE
84172010-06-21 Rafael Espindola <espindola@google.com>
8418
8419 * fileread.cc (Input_file::find_fie): New
8420 (Input_file::open): Use Input_file::find_fie.
8421 * fileread.h (Input_file::find_fie): New
8422 * plugin.cc (set_extra_library_path): New.
8423 (Plugin::load): Add set_extra_library_path to the transfer vector.
8424 (Plugin_manager::set_extra_library_path): New.
8425 (Plugin_manager::add_input_file): Use the extra search path if set.
8426 (set_extra_library_path(): New.
8427 * plugin.h (Plugin_manager): Add set_extra_library_path and
8428 extra_search_path_.
8429
a0506cca
CC
84302010-06-19 Cary Coutant <ccoutant@google.com>
8431
8432 * layout.cc (gdb_sections): Add .debug_types.
8433 (lines_only_debug_sections): Likewise.
8434
6508b958
RÁE
84352010-06-18 Rafael Espindola <espindola@google.com>
8436
8437 * plugin.cc (add_input_file,add_input_library)
8438 (Plugin_manager::add_input_file): Make filename arguments const.
8439 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8440 const.
8441
3e235302
DK
84422010-06-16 Doug Kwan <dougkwan@google.com>
8443
8444 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8445 .ARM.attributes section if we have not merged any input
8446 attributes sections.
8447
106e8a6c
DK
84482010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8449
8450 * arm.cc: Allow combining objects with no EABI version
8451 information.
8452
91ff43fe
RÁE
84532010-06-15 Rafael Espindola <espindola@google.com>
8454
8455 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8456
68ed838c
ILT
84572010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8458
8459 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8460 (struct iovec): Correct !HAVE_READV definition.
8461
f3a2388f
CC
84622010-06-10 Cary Coutant <ccoutant@google.com>
8463
8464 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8465 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8466 reloc sections.
8467 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8468
8469 PR 11683
8470 * symtab.h (Symbol::is_placeholder): New member function.
8471 * target-reloc.h (relocate_section): Check for placeholder symbols.
8472
8473 * testsuite/Makefile.am (plugin_test_8): New test.
8474 (plugin_test_9): New test.
8475 * testsuite/Makefile.in: Regenerate.
8476
e1df38aa
NC
84772010-06-09 Nick Clifton <nickc@redhat.com>
8478
8479 * yyscript.y (input_list_element): Allow strings prefixed with
8480 the '-' character. Treat these as libraries.
8481 * script.cc (script_add_library): New function. Adds a library
8482 specified by "-l<name>" found in an input script.
8483 * script-c.h: Add prototype for script_add_library.
8484
25bbe950
DK
84852010-06-07 Doug Kwan <dougkwan@google.com>
8486
8487 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8488 Restrict stub-group size to be within long conditional branch
8489 range when working around cortex-A8 erratum.
8490
0f32ea4c
ILT
84912010-06-07 Damien Diederen <dd@crosstwine.com>
8492
8493 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8494 #ifdef typo.
8495
8fe2a369
ST
84962010-06-03 Sriraman Tallam <tmsriram@google.com>
8497
8498 PR gold/11658
8499 * output.cc
8500 (Output_section::Input_section_sort_entry::compare_section_ordering):
8501 Change to return non-zero correctly.
8502 (Output_section::Input_section_sort_section_order_index_compare
8503 ::operator()): Change to fix ambiguity in comparisons.
8504
6e9ba2ca
ST
85052010-06-01 Sriraman Tallam <tmsriram@google.com>
8506
8507 * gold.h (is_wildcard_string): New function.
8508 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8509 (Layout::layout_eh_frame): Ditto.
8510 (Layout::find_section_order_index): New method.
8511 (Layout::read_layout_from_file): New method.
8512 * layout.h (Layout::find_section_order_index): New method.
8513 (Layout::read_layout_from_file): New method.
8514 (Layout::input_section_position_): New private member.
8515 (Layout::input_section_glob_): New private member.
8516 * main.cc (main): Call read_layout_from_file here.
8517 * options.h (--section-ordering-file): New option.
8518 * output.cc (Output_section::input_section_order_specified_): New
8519 member.
8520 (Output_section::Output_section): Initialize new member.
8521 (Output_section::add_input_section): Add new parameter.
8522 Keep input sections when --section-ordering-file is used.
8523 (Output_section::set_final_data_size): Sort input sections when
8524 section ordering file is specified.
8525 (Output_section::Input_section_sort_entry): Add new parameter.
8526 Check sorting type.
8527 (Output_section::Input_section_sort_entry::compare_section_ordering):
8528 New method.
8529 (Output_section::Input_section_sort_compare::operator()): Change to
8530 consider section_order_index.
8531 (Output_section::Input_section_sort_init_fini_compare::operator()):
8532 Change to consider section_order_index.
8533 (Output_section::Input_section_sort_section_order_index_compare
8534 ::operator()): New method.
8535 (Output_section::sort_attached_input_sections): Change to sort
8536 according to section order when specified.
e1df38aa
NC
8537 (Output_section::add_input_section<32, true>): Add new parameter.
8538 (Output_section::add_input_section<64, true>): Add new parameter.
8539 (Output_section::add_input_section<32, false>): Add new parameter.
8540 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
8541 * output.h (Output_section::add_input_section): Add new parameter.
8542 (Output_section::input_section_order_specified): New
8543 method.
8544 (Output_section::set_input_section_order_specified): New method.
8545 (Input_section::Input_section): Initialize section_order_index_.
8546 (Input_section::section_order_index): New method.
8547 (Input_section::set_section_order_index): New method.
8548 (Input_section::section_order_index_): New member.
8549 (Input_section::Input_section_sort_section_order_index_compare): New
8550 struct.
8551 (Output_section::input_section_order_specified_): New member.
8552 * script-sections.cc (is_wildcard_string): Delete and move modified
8553 method to gold.h.
8554 (Output_section_element_input::Output_section_element_input): Modify
8555 call to is_wildcard_string.
8556 (Output_section_element_input::Input_section_pattern
8557 ::Input_section_pattern): Ditto.
8558 (Output_section_element_input::Output_section_element_input): Ditto.
8559 * testsuite/Makefile.am (final_layout): New test case.
8560 * testsuite/Makefile.in: Regenerate.
8561 * testsuite/final_layout.cc: New file.
8562 * testsuite/final_layout.sh: New file.
8563
3537c84b
RÁE
85642010-06-01 Rafael Espindola <espindola@google.com>
8565
8566 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8567
105b6afd
RÁE
85682010-06-01 Rafael Espindola <espindola@google.com>
8569
8570 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8571 visibility of symbols.
8572
29e11421
DK
85732010-05-27 Doug Kwan <dougkwan@google.com>
8574
8575 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8576 from start of output section instead of address for a local symbol
8577 in a merged or relaxed section when doing a relocatable link.
8578
5e0f337e
RÁE
85792010-05-26 Rafael Espindola <espindola@google.com>
8580
703d02da 8581 PR 11604
5e0f337e
RÁE
8582 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8583 adding sections the garbage collector removed.
8584 * gold/testsuite/Makefile.am: Add test.
8585 * gold/testsuite/Makefile.in: Regenerate.
8586 * gold/testsuite/plugin_test_7.sh: New.
8587 * gold/testsuite/plugin_test_7_1.c: New.
8588 * gold/testsuite/plugin_test_7_2.c: New.
8589
f4187277
RÁE
85902010-05-26 Rafael Espindola <espindola@google.com>
8591
8592 * script-sections.cc (Output_section_definition::set_section_addresses):
8593 Check for --section-start.
8594
5c388529
DK
85952010-05-26 Doug Kwan <dougkwan@google.com>
8596
8597 * arm.cc (Arm_scan_relocatable_relocs): New class.
8598 (Target_arm::relocate_special_relocatable): New method.
8599 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8600 (Arm_relocate_functions::thumb_branch_common): Same.
8601 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8602 instead of Default_scan_relocatable_relocs.
8603 * target-reloc.h (relocate_for_relocatable): Let target handle
8604 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8605 * target.h (Sized_target::relocate_special_relocatable): New method.
8606
bca1c3ae
ILT
86072010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8608
8609 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8610
0439c796
DK
86112010-05-23 Doug Kwan <dougkwan@google.com>
8612
8613 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8614 instead of a cast.
8615 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8616 with a direct branch, not a conditional branch, to a stub.
8617 * merge.cc (Output_merge_base::record_input_section): New method
8618 defintion.
8619 (Output_merge_data::do_add_input_section): Record input section if
8620 keeps-input-sections flag is set.
8621 (Output_merge_string::do_add_input_section): Ditto.
8622 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8623 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8624 INPUT_SECTIONS_.
8625 (Output_merge_base::keeps_input_sections,
8626 Output_merge_base::set_keeps_input_sections,
8627 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8628 method definitions.
8629 (Output_merge_base::Input_sections): New type declaration.
8630 (Output_merge_base::input_sections_begin,
8631 Output_merge_base::input_sections_end,
8632 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8633 (Output_merge_base::bool keeps_input_sections_,
8634 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8635 Output_merge_base::input_sections_): New data members.
8636 (Output_merge_data::do_set_keeps_input_sections): New method
8637 defintion.
8638 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8639 * output.cc (Output_section::Input_section::relobj): Move method
8640 defintion from class declaration to here and handle merge sections.
8641 (Output_section::Input_section::shndx): Ditto.
8642 (Output_section::Output_section): Remove initializations of removed
8643 data members and initialize new data member LOOKUP_MAPS_.
8644 (Output_section::add_input_section): Set keeps-input-sections flag
8645 for a newly created merge output section as appropriate. Adjust code
8646 to use Output_section_lookup_maps class.
8647 (Output_section::add_relaxed_input_section): Adjst code for lookup
8648 maps code refactoring.
2e702c99 8649 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
8650 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8651 class. If adding input section to a newly created merge output
8652 section fails, remove the new merge section.
8653 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 8654 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 8655 (Output_section::find_merge_section): Ditto.
0439c796 8656 (Output_section::build_lookup_maps): New method defintion.
2e702c99 8657 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
8658 Output_section_lookup_maps class.
8659 (Output_section::get_input_sections): Export merge sections. Adjust
8660 code to use Output_section_lookup_maps class.
8661 (Output_section:::add_script_input_section): Adjust code to use
8662 Output_section_lookup_maps class. Update lookup maps for merge
8663 sections also.
8664 (Output_section::discard_states): Use Output_section_lookup_maps.
8665 (Output_section::restore_states): Same.
8666 * output.h (Merge_section_properties): Move class defintion out of
8667 Output_section.
8668 (Output_section_lookup_maps): New class.
8669 (Output_section::Input_section::is_merge_section): New method
8670 defintion.
8671 (Output_section::Input_section::relobj): Move defintion out of class
8672 defintion. Declare method only.
8673 (Output_section::Input_section::shndx): Ditto.
8674 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 8675 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
8676 (Output_section::Merge_section_by_properties_map,
8677 Output_section::Output_section_data_by_input_section_map,
8678 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8679 Remove types.
2e702c99 8680 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
8681 KEEPS_INPUT_SECTIONS.
8682 (Output_section::build_lookup_maps): New method declaration.
8683 (Output_section::merge_section_map_,
8684 Output_section::merge_section_by_properties_map_,
8685 Output_section::relaxed_input_section_map_,
8686 Output_section::is_relaxed_input_section_map_valid_): Remove data
8687 members.
8688 (Output_section::lookup_maps_): New data member.
8689
76295588
L
86902010-05-21 Doug Kwan <dougkwan@google.com>
8691
8692 PR gold/11619
8693 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8694 avoid a compilation error.
8695
d103a984
RÁE
86962010-05-19 Rafael Espindola <espindola@google.com>
8697
8698 * script-sections.cc (Output_section_definition::allocate_to_segment):
8699 Update the phdrs_list even when the output section is NULL.
8700 * testsuite/Makefile.am: Add test.
8701 * testsuite/Makefile.in: Regenerate.
8702 * testsuite/script_test_9.cc: New.
8703 * testsuite/script_test_9.sh: New.
8704 * testsuite/script_test_9.t: New.
8705
6625d24e
DK
87062010-05-19 Doug Kwan <dougkwan@google.com>
8707
8708 * arm.cc (Arm_input_section::original_size): New method.
8709 (Arm_input_section::do_addralign): Add a cast.
8710 (Arm_input_section::do_output_offset): Remove static cast.
8711 (Arm_input_section::original_addralign,
8712 Arm_input_section::original_size_): Change type to uint32_t.
8713 (Arm_input_section::init): Add safe casts for section alignment
8714 and size.
8715 (Arm_input_section::set_final_data_size): Do not set address and
8716 offset of stub table.
8717 (Arm_output_section::fix_exidx_coverage): Change use of of
8718 Output_section::Simple_input_section to that of
8719 Output_section::Input_section.
8720 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8721 except for the first pass.
8722 * output.cc (Output_section::get_input_sections): Change type of
8723 input_sections to std::list<Input_section>.
8724 (Output_section::add_script_input_section): Rename from
8725 Output_section::add_simple_input_section. Change type of SIS
8726 parameter from Simple_input_section to Input_section.
8727 * output.h (Output_section::Simple_input_section): Remove class.
8728 (Output_section::Input_section): Change class visibility to public.
8729 (Output_section::Input_section::addralign): Use stored alignments
8730 for special input sections if set.
8731 (Output_section::Input_section::set_addralign): New method.
8732 (Output_section::get_input_sections): Change parameter type from
8733 list of Simple_input_section to list of Input_section.
8734 (Output_section::add_script_input_section): Rename from
8735 Output_section::add_simple_input_section. Change first parameter's
8736 type from Simple_input_section to Input_section and remove the
8737 second and third parameters.
8738 * script-sections.cc (Input_section::Input_section_list): Change
8739 type to list of Output_section::Input_section/
8740 (Input_section_info::Input_section_info): Change parameter type of
8741 INPUT_SECTION to Output_section::Input_section.
8742 (Input_section_info::input_section): Change return type.
8743 (Input_section_info::input_section_): Change type to
8744 Output_section::Input_section.
8745 (Output_section_element_input::set_section_addresses): Adjust code
8746 to use Output_section::Input_section instead of
8747 Output_section::Simple_input_section. Adjust code for renaming
8748 of Output_section::add_simple_input_section.
8749 (Orphan_output_section::set_section_addresses): Ditto.
8750
e1e82ea4
RW
87512010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8752
8753 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8754 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8755
91e75c8a
RÁE
87562010-05-18 Rafael Espindola <espindola@google.com>
8757
8758 * options.cc (General_options::finalize): Handle -nostdlib.
8759 * options.h (nostdlib): New option.
8760 * script.cc (script_add_search_dir): Handle -nostdlib.
8761
da59ad79
DK
87622010-05-12 Doug Kwan <dougkwan@google.com>
8763
8764 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8765 attributes section only if there no attributes section after merging.
8766 (Target_arm::merge_object_attributes): Move value of
e1df38aa 8767 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
8768 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8769 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8770 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8771 and arm_attr_merge_7.stdout.
8772 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8773 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8774 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8775 arm_attr_merge_7b.o): New rules.
8776 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8777 arm_attr_merge_7
8778 * testsuite/Makefile.in: Regenerate.
8779 * testsuite/arm_attr_merge.sh: New file.
8780 * testsuite/arm_attr_merge_[67][ab].s: Same.
8781
3e01a7fd
NC
87822010-05-05 Nick Clifton <nickc@redhat.com>
8783
8784 * po/es.po: Updated Spanish translation.
8785
7ad2014a
L
87862010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8787
8788 * Makefile.am (install-exec-local): Properly install gold as
8789 default cross linker.
8790 * Makefile.in: Regenerated.
8791
4fda8867
NC
87922010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8793 Nick Clifton <nickc@redhat.com>
8794
8795 * configure.ac (install_as_default): Define and set to false
8796 unless --enable-gold or --enable-gold=both/gold has been
8797 specified.
8798 * configure: Regenerate.
8799
8800 * Makefile.am (install-exec-local): Install the executable as
8801 'ld.gold'. If install_as_default is true then also install it as
8802 'ld'.
8803 * Makefile.in: Regenerated.
8804
bd288ea2
ILT
88052010-04-24 Ian Lance Taylor <iant@google.com>
8806
8807 * layout.cc (Layout::layout_reloc): In relocatable link don't
8808 combine reloc sections for grouped sections.
8809
ef38fd8a
ST
88102010-04-23 Sriraman Tallam <tmsriram@google.com>
8811
8812 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8813 sections that are not ordinary to icf.
8814 * icf.cc (get_section_contents): Handle relocation pointing to section
8815 with no object or shndx information.
8816 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8817 * testsuite/Makefile.in: Regenerate.
8818 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8819 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8820
f6973bdc
ILT
88212010-04-22 Ian Lance Taylor <iant@google.com>
8822
8823 * expression.cc (Expression::Expression_eval_info): Add
8824 result_alignment_pointer field.
8825 (Expression::eval_with_dot): Add result_alignment_pointer
8826 parameter. Change all callers.
8827 (Expression::eval_maybe_dot): Likewise.
8828 (class Binary_expression): Add alignment_pointer parameter to
8829 left_value and right_value. Change all callers.
8830 (BINARY_EXPRESSION): Set result alignment.
8831 (class Trinary_expression): Add alignment_pointer parameter to
8832 arg2_value and arg3_value. Change all callers.
8833 (Trinary_cond::value): Set result alignment.
8834 (Max_expression::value, Min_expression::value): Likewise.
8835 (Align_expression::value): Likewise.
8836 * script-sections.cc (class Sections_element): Add dot_alignment
8837 parameter to set_section_addresses virtual function. Update
8838 instantiations.
8839 (class Output_section_element): Likewise.
8840 (Script_sections::create_segments): Add dot_alignment parameter.
8841 Change all callers.
8842 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8843 (Script_sections::set_phdrs_clause_addresses): Likewise.
8844 * script-sections.h: Update declarations.
8845 * script.h: Update declarations.
8846 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8847 min_p_align.
8848 * testsuite/script_test_3.t: Set large alignment.
8849 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8850 segment has expected alignment.
8851
9c9c98a5
NC
88522010-04-22 Nick Clifton <nickc@redhat.com>
8853
8854 * po/gold.pot: Updated by the Translation project.
8855 * po/vi.po: Updated Vietnamese translation.
8856
2253bfba
L
88572010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8858
8859 * testsuite/Makefile.am (check_PROGRAMS): Add
8860 icf_virtual_function_folding_test.
8861 * testsuite/Makefile.in: Regenerated.
8862
85fdf906
AH
88632010-04-15 Andrew Haley <aph@redhat.com>
8864
8865 * options.h (merge_exidx_entries): New option.
8866 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8867 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8868 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8869 (Target_arm::merge_exidx_entries): New function.
8870 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8871 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8872 to Arm_exidx_fixup constructor.
8873 Add new arg, merge_exidx_entries.
8874 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
8875 Arm_output_section::fix_exidx_coverage.
8876
ce97fa81
ST
88772010-04-18 Sriraman Tallam <tmsriram@google.com>
8878
8879 * icf.cc (get_section_contents): Check for preemptible functions.
8880 Ignore addend when appropriate.
8881 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
8882 section folded.
8883 (add_from_relobj): Check for section folded.
8884 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
8885 * symtab.h (should_add_dynsym_entry): Add new parameter.
8886 * target-reloc.h (scan_relocs): Check for section folded.
8887 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
8888 Check reloc types for function pointers in shared objects.
8889 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
8890 case.
8891 (icf_preemptible_functions_test): New test case.
8892 (icf_string_merge_test): New test case.
8893 * testsuite.Makefile.in: Regenerate.
8894 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
8895 bar_glob. Refactor code.
8896 * testsuite/icf_preemptible_functions_test.cc: New file.
8897 * testsuite/icf_preemptible_functions_test.sh: New file.
8898 * testsuite/icf_string_merge_test.cc: New file.
8899 * testsuite/icf_string_merge_test.sh: New file.
8900 * testsuite/icf_virtual_function_folding_test.cc: New file.
8901 * testsuite/icf_virtual_function_folding_test.sh: New file.
8902
04ceb17c
DK
89032010-04-14 Doug Kwan <dougkwan@google.com>
8904
8905 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
8906 for local symbol recounting if we remove a section due to ICF.
8907 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
8908 there are no regular objects in input.
8909
153e7da4
DK
89102010-04-13 Doug Kwan <dougkwan@google.com>
8911
8912 * arm.cc (Arm_input_section::set_final_data_size): Compute
8913 accurate final data size instead of using current data size.
8914
4dbd9faf
DK
89152010-04-09 Doug Kwan <dougkwan@google.com>
8916
8917 * layout.cc (Layout::choose_output_section): Handle script section
8918 types.
8919 (Layout::make_output_section_for_script): Add section type parameter.
8920 Handle script section types.
8921 * layout.h (Layout::make_output_section_for_script): Add section
8922 type parameter.
8923 * output.cc (Output_section::Output_section): Initialize data member
8924 is_noload_.
8925 (Output_section::do_reset_address_and_file_offset): Do not set address
8926 to 0 if section is a NOLOAD section.
8927 * output.h (Output_section::is_noload): New method.
8928 (Output_section::set_is_noload): Ditto.
8929 (Output_section::is_noload_): New data member.
8930 * script-c.h (Script_section_type): New enum type.
8931 (struct Parser_output_section_header): Add new file section_type.
8932 * script-sections.cc (Sections_element::output_section_name): Add
8933 parameter for returning script section type.
8934 (Output_section_definition::output_section_name): Ditto.
8935 (Output_section_definition::section_type)P; New method.
8936 (Output_section_definiton::script_section_type_name): Ditto.
8937 (Output_section_definition::script_section_type_): New data member.
8938 (Output_section_definition::Output_section_definition): Initialize
8939 data member Output_section_definition::script_section_type_.
8940 (Output_section_definition::create_sections): Pass script section type
8941 to Layout::make_output_section_for_script.
8942 (Output_section_definition::output_section_name): Return script
8943 section type to caller.
8944 (Output_section_definition::set_section_address): Do not advance
8945 dot value and load address if section type is NOLOAD. Set address
8946 of NOLOAD sections regardless of section flags.
8947 (Output_section_definition::print): Print section type if it is
8948 not SCRIPT_SECTION_TYPE_NONE.
8949 (Output_section_definition::section_type): New method.
8950 (Output_section_definition::script_section_type_name): Ditto.
8951 (Script_sections::output_section_name): Add new parameter
8952 PSECTION_TYPE for returning script section type. Pass it to
8953 section elements. Handle discard sections.
8954 (Sort_output_sections::operator()): Handle NOLOAD sections.
8955 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 8956 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
8957 returning script section type.
8958 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
8959 INFO and NOLOAD.
8960 * yyscript.y (union): Add new field SECTION_TYPE.
8961 (COPY, DSECT, INFO, NOLOAD): New tokens.
8962 (opt_address_and_section_type): Change type to output_section_header.
8963 (section_type): New non-terminal
8964 (section_header): Handle section type.
2253bfba 8965 (opt_address_and_section_type): Return section type value.
4dbd9faf 8966
721ea635
L
89672010-04-09 H.J. Lu <hongjiu.lu@intel.com>
8968
8969 * testsuite/plugin_common_test_1.c (foo): Add prototype.
8970 * testsuite/plugin_common_test_2.c (foo): Likewise.
8971
6bf924b0
DK
89722010-04-08 Doug Kwan <dougkwan@google.com>
8973
8974 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
8975 Output_merge_data.
8976 * output.cc (Output_section::add_merge_input_section): Simplify
8977 code and return status of Output_merge_base::add_input_section.
e1df38aa 8978 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
8979 returns true.
8980
24af6f92
DK
89812010-04-07 Doug Kwan <dougkwan@google.com>
8982
8983 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
8984 if section is marked as containing instructions but has no mapping
8985 symbols.
8986 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
8987 correct section index.
8988 (Arm_relobj::find_linked_text_section): Ditto.
8989
00698fc5
CC
89902010-04-07 Cary Coutant <ccoutant@google.com>
8991
8992 * archive.cc (include_member): Destroy Read_symbols_data object before
8993 releasing file.
8994 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
8995 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
8996 (Read_symbols_data::~Read_symbols_data) New destructor.
8997 (Section_relocs::Section_relocs) New constructor.
8998 (Section_relocs::~Section_relocs) New destructor.
8999 (Read_relocs_data::Read_relocs_data) New constructor.
9000 (Read_relocs_data::~Read_relocs_data) New destructor.
9001 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9002 pointers to NULL after deleting.
9003
7296d933
DK
90042010-04-07 Doug Kwan <dougkwan@google.com>
9005
9006 * arm.cc: Replace "endianity" with "endianness" in comments.
9007 (Arm_exidx_cantunwind): Ditto.
9008 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9009 (Arm_relobj::merge_flags_and_attributes): New method.
9010 (Arm_relobj::merge_flags_and_attributes_): New data member.
9011 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9012 (Arm_relobj::scan_sections_for_stubs): Ditto.
9013 (Arm_relobj::do_read_symbols): Check to see if we really want to
9014 merge processor-specific flags and attributes. Exit early if
9015 an object is empty except for section names and the undefined symbol.
9016 (Target_arm::do_finalize_sections): Move check for ELF format to
9017 Arm_relobj::do_read_symbols. Merge processor specific flags and
9018 attributes from a regular object only when we have determined that
9019 it is aapropriate. Do not create an .ARM.attributes section in
9020 output if there is no regular input object.
9021 (Target_arm::merge_processor_specific_flags): Check
9022 --warn-mismatch before printing any error.
9023 (Target_arm::merge_object_attributes): Ditto.
9024 * gold.cc (queue_middle_tasks): Handle the case in which there is
9025 no regular object in input.
9026 * options.cc (General_options::parse_EB): New method.
9027 (General_options::parse_EL): Same.
9028 (General_options::General_options): Initialize endianness_.
9029 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9030 New options.
9031 (General_options::Endianness): New enum.
9032 (General_options::endianness): New method.
9033 (General_options::endianness_): New data member.
9034 * parameters.cc (Parameters::set_options): Check target endianness.
9035 (Parameters::set_target_once): Ditto.
9036 (Parameters::check_target_endianness): New method.
9037 (parameters_force_valid_target): If either -EL or -EB is specified,
9038 use it to define endianness of default target.
9039 * parameters.h (Parameters::check_target_endianness): New method
9040 declaration.
9041 * target.h (class Target): Change "endianity" to "endianness"
9042 in comments.
9043
efc8d4f2
RW
90442010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9045
9046 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9047 * configure: Regenerate.
9048 * Makefile.in: Regenerate.
9049 * testsuite/Makefile.in: Regenerate.
9050
be234d88
CC
90512010-04-06 Cary Coutant <ccoutant@google.com>
9052
9053 gcc PR lto/42757
9054 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9055 prevailing definitions of common symbols.
9056 * testsuite/plugin_test_6.sh: New test case.
9057 * testsuite/plugin_common_test_1.c: New test case.
9058 * testsuite/plugin_common_test_2.c: New test case.
9059 * testsuite/Makefile.am (plugin_test_6): New test case.
9060 * testsuite/Makefile.in: Regenerate.
9061
bd32c6bd
NC
90622010-04-06 Nick Clifton <nickc@redhat.com>
9063
9064 * po/vi.po: New Vietnamese translation.
9065
323c532f
DK
90662010-03-30 Doug Kwan <dougkwan@google.com>
9067
9068 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9069
4fcd97eb
DK
90702010-03-25 Doug Kwan <dougkwan@google.com>
9071
9072 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9073 to avoid a conversion warning on a 32-bit host.
9074
4ebf39db
ILT
90752010-03-24 Ian Lance Taylor <iant@google.com>
9076
9077 * testsuite/script_test_3.t: Add a TLS segment.
9078 * testsuite/Makefile.am (check_PROGRAMS): Add
9079 tls_phdrs_script_test.
9080 (tls_phdrs_script_test_SOURCES): Define.
9081 (tls_phdrs_script_test_DEPENDENCIES): Define.
9082 (tls_phdrs_script_test_LDFLAGS): Define.
9083 (tls_phdrs_script_test_LDADD): Define.
9084 * testsuite/Makefile.in: Rebuild.
9085
4a599bdd
CC
90862010-03-23 Cary Coutant <ccoutant@google.com>
9087
9088 * fileread.cc (find_or_make_view): Fix comment.
9089
6c93b22c
ILT
90902010-03-23 Ian Lance Taylor <iant@google.com>
9091
9092 * script-sections.cc (class Orphan_section_placement): Define
9093 PLACE_TLS and PLACE_TLS_BSS.
9094 (Orphan_section_placement::Orphan_section_placement): Initialize
9095 new places.
9096 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9097 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9098 (tls_script_test_SOURCES): Define.
9099 (tls_script_test_DEPENDENCIES): Define.
9100 (tls_script_test_LDFLAGS): Define.
9101 (tls_script_test_LDADD): Define.
9102 * testsuite/Makefile.in: Rebuild.
9103
a2c7281b
DK
91042010-03-22 Doug Kwan <dougkwan@google.com>
9105
9106 * arm.cc (Arm_relocate_functions::abs8,
9107 Arm_relocate_functions::abs16): Use correct check for overflow
9108 specified in the ARM ELF specs.
9109 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9110 target of a BLX instruction specially.
9111 (Reloc_stub::stub_type_for_reloc): Ditto.
9112 (Relocate::relocate): Use symbolic names instead of numeric relocation
9113 codes to report error.
9114 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9115 workaround.
9116 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9117 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9118 thumb2_blx_out_of_range.stdout
9119 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9120 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9121 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9122 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9123 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9124 thumb2_blx_in_range, thumb2_blx_in_range.o,
9125 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9126 thumb2_blx_out_of_range.o): New rules.
2e702c99 9127 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
9128 thumb2_blx_in_range and thumb2_blx_out_of_range.
9129 * testsuite/Makefile.in: Regenerate.
9130 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9131 * testsuite/thumb_blx_in_range.s: New file.
9132 * testsuite/thumb_blx_out_of_range.s: New file.
9133
b0193076
RÁE
91342010-03-22 Rafael Espindola <espindola@google.com>
9135
9136 * archive.cc (Should_include): Move to archive.h.
9137 (should_include_member): Make it a member of Archive.
9138 (Lib_group): New.
9139 (Add_lib_group_symbols): New.
9140 * archive.h: Include options.h.
9141 (Archive_member): Moved from Archive.
9142 (Should_include): Moved from archive.cc.
9143 (Lib_group): New.
9144 (Add_lib_group_symbols): New.
9145 * dynobj.cc (do_should_include_member): New.
9146 * dynobj.h (do_should_include_member): New.
9147 * gold.cc (queue_initial_tasks): Update call to queue.
9148 * main.cc (main): Print lib group stats.
9149 * object.cc (do_should_include_member): New.
9150 * object.h: Include archive.h.
9151 (Object::should_include_member): New.
9152 (Object::do_should_include_member): New.
9153 (Sized_relobj::do_should_include_member): New.
9154 * options.cc (General_options::parse_start_lib): New.
9155 (General_options::parse_end_lib): New.
9156 (Input_arguments::add_file): Handle lib groups.
9157 (Input_arguments::start_group): Check we are not in a lib.
9158 (Input_arguments::start_lib): New.
9159 (Input_arguments::end_lib): New.
9160 * options.h (General_options): Add start_lib and end_lib.
9161 (Input_argument::lib_): New.
9162 (Input_argument::lib): New.
9163 (Input_argument::is_lib): New.
9164 (Input_file_lib): New.
9165 (Input_arguments::in_lib_): New.
9166 (Input_arguments::in_lib): New.
9167 (Input_arguments::start_lib): New.
9168 (Input_arguments::end_lib_): New.
9169 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9170 in unused members as preempted.
9171 (Sized_pluginobj::do_should_include_member): New.
9172 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9173 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9174 return the blocker.
9175 (Read_symbols::do_whole_lib_group): New.
9176 (Read_symbols::do_lib_group): New.
9177 (Read_symbols::do_read_symbols): Handle lib groups.
9178 (Read_symbols::get_name): Handle lib groups.
9179 * readsyms.h (Read_symbols): Add an archive member pointer.
9180 (Read_symbols::do_whole_lib_group): New.
9181 (Read_symbols::do_lib_group): New.
9182 (Read_symbols::member_): New.
9183 * script.cc (read_input_script): Update call to queue_soon.
9184
d099120c
DK
91852010-03-19 Doug Kwan <dougkwan@google.com>
9186
9187 * arm.cc (Stub_table::Stub_table): Initialize new data members
9188 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9189 (Stub_table::add_reloc_stub): Assign stub offset and update
9190 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9191 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9192 New data members.
2e702c99 9193 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9194 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9195 instead of going over all reloc stubs.
2e702c99 9196 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9197 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9198 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9199 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9200 Stringpool_template::offset_.
9201 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9202 Stringpool_template::offset_ to zero.
9203
1aa37384
DK
92042010-03-15 Doug Kwan <dougkwan@google.com>
9205
9206 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9207 offset_.
9208 (Stringpool_template::new_key_offset): New method.
9209 (Stringpool_template::add_string): Assign offsets when adding new
9210 strings.
9211 (Stringpool_template::set_string_offsets): Do not set string offsets
9212 when not optimizing.
9213 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9214 member size_.
2e702c99
RM
9215 (Chunked_vector::clear): Clear size_.
9216 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9217 (Chunked_vector::size): Return size_.
9218 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9219 (Chunked_vector::size_): New data member.
1aa37384
DK
9220 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9221 (Stringpool_template::new_key_offset): New method declaration.
9222 (Stringpool_template::offset_): New data member.
9223
b672b057
RÁE
92242010-03-15 Rafael Espindola <espindola@google.com>
9225
9226 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9227 Add_symbols' constructor.
9228 * readsyms.h (Add_symbols): Remove the input_group member.
9229
b6848d3c
ILT
92302010-03-10 Ian Lance Taylor <iant@google.com>
9231
9232 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9233 target to ask whether a reference to a symbol requires a stack
9234 split.
9235 * target.h (Target::is_call_to_non_split): New function.
9236 (Target::do_is_call_to_non_split): Declare virtual function.
9237 * target.cc: Include "symtab.h".
9238 (Target::do_is_call_to_non_split): New function.
9239 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9240
a2a5469e
CC
92412010-03-10 Cary Coutant <ccoutant@google.com>
9242
9243 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9244 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9245 (File_read::open[2]): Add whole_file_view_ to list of views.
9246 (File_read::make_view): Remove test of whole_file_view_.
9247 (File_read::find_or_make_view): Create whole_file_view_ if
9248 necessary.
9249 (File_read::clear_views): Replace bool parameter with enum;
9250 adjust all callers. Don't delete views with permanent data;
9251 do delete cached views and views from archives if
9252 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9253 if clearing the corresponding view.
9254 * fileread.h (File_read::Clear_views_mode): New enum.
9255 (File_read::View::is_permanent_view): New method.
9256 (File_read::clear_views): Replace bool parameter
9257 with enum; adjust all callers.
9258 * options.h (General_options): Change keep_files_mapped option;
9259 add map_whole_files.
9260 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9261 releasing the file.
9262 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9263 the file.
9264
8861f32b
DM
92652010-03-10 David S. Miller <davem@davemloft.net>
9266
9267 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9268
d62d0f5f
ST
92692010-03-09 Sriraman Tallam <tmsriram@google.com>
9270
9271 * icf.cc (get_section_contents): Add '@' marker after processing the
9272 merge reloc.
9273
9177756d
DK
92742010-03-08 Doug Kwan <dougkwan@google.com>
9275
9276 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9277 due to a conversion warning.
9278 (Arm_relobj::update_output_local_symbol_count): Check for local
9279 symbol with unset output index.
9280
9e9e071b
ILT
92812010-03-05 Ian Lance Taylor <iant@google.com>
9282
9283 * options.h (class General_options): Add --spare-dynamic-tags.
9284 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9285 --spare-dynamic-tags.
9286
a81ee015
ILT
92872010-03-05 Ian Lance Taylor <iant@google.com>
9288
9289 * incremental.cc: Include "libiberty.h".
9290
44ec90b9
RO
92912010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9292
9293 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9294 function, is_info_ member.
9295 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9296 (Versions::Versions): Update caller.
9297 (Versions::define_base_version): Likewise.
9298 (Versions::add_def): Likewise.
9299
0897ed3b
ST
93002010-03-03 Sriraman Tallam <tmsriram@google.com>
9301
9302 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9303 (Scan::possible_function_pointer_reloc): New function.
9304 (Scan::local_reloc_may_be_function_pointer): Change to call
9305 possible_function_pointer_reloc.
9306 (Scan::global_reloc_may_be_function_pointer): Ditto.
9307 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9308 relocations in ".data.rel.ro._ZTV" section.
9309 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9310 * testsuite/icf_safe_so_test.cc: Ditto.
9311 * testsuite/icf_safe_test.cc: Ditto.
9312 * testsuite/icf_safe_test.sh: Ditto.
9313
d3bbad62
ILT
93142010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9315 Ian Lance Taylor <iant@google.com>
9316
9317 * target-reloc.h (relocate_section): Check the symbol table index
9318 for -1U before setting the local symbol index.
9319 (scan_relocatable_relocs): If copying the relocation, record that
9320 the local symbol is required.
9321 * object.h (Symbol_value::is_output_symtab_index_set): New
9322 function.
9323 (Symbol_value::may_be_discarded_from_output_symtab): New
9324 function.
9325 (Symbol_value::has_output_symtab_entry): New function.
9326 (Symbol_value::needs_output_symtab_entry): Remove.
9327 (Symbol_value::output_symtab_index): Make sure the symbol index is
9328 set.
9329 (Symbol_value::set_output_symtab_index): Make sure the symbol
9330 index is not set. Make sure the new index is valid.
9331 (Symbol_value::set_must_have_output_symtab_entry): New function.
9332 (Symbol_value::has_output_dynsym_entry): New function.
9333 (Symbol_value::set_output_dynsym_index): Make sure the new index
9334 is valid.
9335 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9336 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9337 local symbol if permitted.
9338 (Sized_relobj::do_finalize_local_symbols): Call
9339 is_output_symtab_index_set rather than needs_output_symtab_entry.
9340 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9341 rather than needs_output_symtab_entry. Call
9342 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9343 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9344 is_output_symtab_index_set rather than needs_output_symtab_entry.
9345 * testsuite/discard_locals_relocatable_test.c: New file.
9346 * testsuite/discard_locals_test.sh: Test -r.
9347 * testsuite/Makefile.am (check_DATA): Add
9348 discard_locals_relocatable_test1.syms,
9349 discard_local_relocatable_test2.syms.
9350 (MOSTLYCLEANFILES): Likewise. Also add
9351 discard_locals_relocatable_test1.lout and
9352 discard_locals_relocatable_test2.out.
9353 (discard_locals_relocatable_test1.syms): New target.
9354 (discard_locals_relocatable_test.o): New target.
9355 (discard_locals_relocatable_test1.out): New target.
9356 (discard_locals_relocatable_test2.syms): New target.
9357 (discard_locals_relocatable_test2.out): New target.
9358 (various): Add missing ../ld-new dependencies.
9359 * testsuite/Makefile.in: Rebuild.
9360
7e8ccf26
NC
93612010-03-03 Nick Clifton <nickc@redhat.com>
9362
9363 * po/fi.po: New Finnish translation.
9364
2a0ff005
DK
93652010-03-01 Doug Kwan <dougkwan@google.com>
9366
9367 * layout.cc (Layout::Layout): Force section types of .init_array*,
9368 .preinit_array* and .fini_array* sections.
9369 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9370 Fix check of return value of std::string::find.().
9371 (Output_section::Input_section_sort_compare::operator()): Remove
9372 comment about .init_array.
9373 (Output_section::Input_section_sort_init_fini_compare::operator()):
9374 New method.
9375 (Output_section::sort_attached_input_sections): Handle .init_array
9376 and .fini_array specially.
9377 * output.h (Output_section::Inut_section_sort_compare): Update
9378 comment.
9379 (Output_section::Input_section_sort_init_fini_compare): New struct.
9380
c3e4ae29
DK
93812010-02-26 Doug Kwan <dougkwan@google.com>
9382
9383 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9384 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9385 * testsuite/debug_msg.sh: Avoid matching source line number for
9386 use of global variable undef_int.
9387
2fd9ae7a
DK
93882010-02-26 Doug Kwan <dougkwan@google.com>
9389
9390 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9391 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9392 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9393 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9394 * options.cc (General_options::General_options): Initialize member
9395 fix_v4bx_.
9396 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9397 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9398 and rm_no_fix_v4bx.stdout
9399 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9400 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9401 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9402 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9403 and arm_no_fix_v4bx.
9404 * Makefile.in: Regenerate.
9405 * testsuite/arm_fix_v4bx.s: New file.
9406 * testsuite/arm_fix_v4bx.sh: Ditto.
9407
67ec7d0b
DK
94082010-02-24 Doug Kwan <dougkwan@google.com>
9409
9410 * arm.cc (Target_arm::got_section): Make the .got section the first
9411 non RELRO section in the data segment.
9412 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9413 suffixes of section names.
9414
10165461
DK
94152010-02-24 Doug Kwan <dougkwan@google.com>
9416
9417 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9418 flags and attributes merging if an input file is a binary file.
9419 * fileread.cc (Input_file::open): Record format of original file.
9420 * fileread.h (Input_file::Format): New enum type.
2e702c99 9421 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9422 (Input_file::format): New method definition.
9423 (Input_file::format_):: New data member.
9424
4a54abbb
DK
94252010-02-24 Doug Kwan <dougkwan@google.com>
9426
9427 * arm.cc (Arm_output_data_got): New class.
9428 (ARM_TCB_SIZE): New constant
9429 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9430 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9431 If user uses a script with a SECTIONS clause, issue only a warning
9432 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9433 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9434 garbage collection.
9435 (Target_arm::got_mode_index_entry): Handle static linking.
9436 (Target_arm::Scan::local): Ditto.
9437 (Target_arm::Scan::global): Ditto.
9438 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9439 all incorrectly implemented relocations.
e1df38aa 9440 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
9441 Arm_output_section::fix_exidx_coverage.
9442 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9443 from ".ARM.exidx." and ".ARM.extab.".
9444
ca419a6f
ILT
94452010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9446
9447 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9448 section if it does not already exist.
9449 * attributes.cc (Attributes_section_data::Attributes_section_data):
9450 Don't crash if size is zero.
9451
135b9c78
ILT
94522010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9453 Ian Lance Taylor <iant@google.com>
9454
9455 * gold.cc (queue_middle_tasks): If no input files were opened,
9456 exit.
9457 * workqueue.h (Task_function::Task_function): Assert that there is
9458 a blocker.
9459
bb0bfe4f
DK
94602010-02-22 Doug Kwan <dougkwan@google.com>
9461
9462 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9463 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9464 types to avoid warnings due to different uint64_t implementations
9465 on different hosts.
9466
2a2b6d42
DK
94672010-02-21 Doug Kwan <dougkwan@google.com>
9468
9469 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9470 handling of the maximum backward branch offset.
2e702c99 9471 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
9472 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9473 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 9474 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
9475 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9476 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9477 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9478 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9479 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9480 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9481 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9482 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9483 thumb2_bl_out_of_range.o): New rules.
9484 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9485 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9486 thumb2_bl_out_of_range
9487 * testsuite/Makefile.in: Regenerate.
9488 * testsuite/arm_bl_in_range.s: New file.
9489 * testsuite/arm_bl_out_of_range.s: Ditto.
9490 * testsuite/arm_branch_in_range.sh: Ditto.
9491 * testsuite/arm_branch_range.t: Ditto.
9492 * testsuite/thumb2_branch_range.t: Ditto.
9493 * testsuite/thumb_bl_in_range.s: Ditto.
9494 * testsuite/thumb_bl_out_of_range.s: Ditto.
9495 * testsuite/thumb_branch_range.t: Ditto.
9496
b487ad64
ST
94972010-02-20 Sriraman Tallam <tmsriram@google.com>
9498
9499 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9500 Add reloc offset information.
9501 * icf.cc (get_section_contents): Change iterators to point to the new
9502 vectors. Add reloc offset information to the contents.
9503 * icf.h (Icf::Sections_reachable_info): New typedef.
9504 (Icf::Sections_reachable_list): New typedef.
9505 (Icf::Offset_info): New typedef.
9506 (Icf::Reloc_info): New struct typedef.
9507 (Icf::Reloc_info_list): New typedef.
9508 (Icf::symbol_reloc_list): Delete method.
9509 (Icf::addend_reloc_list): Delete method.
9510 (Icf::section_reloc_list): Delete method.
9511 (Icf::reloc_info_list): New method.
9512 (Icf::reloc_info_list_): New member.
9513
f96accdf
DK
95142010-02-19 Doug Kwan <dougkwan@google.com>
9515
9516 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9517 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9518 * arm.cc (Arm_relocation_functions): New forward declaration.
9519 (Target_arm::Target_arm): Initialize new data members
9520 got_mod_index_offset_ and tls_base_symbol_defined_.
9521 (Target_arm::Relocate::relocate_tls): New method.
9522 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9523 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9524 New methods.
2e702c99 9525 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
9526 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9527 (Target_arm::got_mod_index_offset_,
9528 Target_arm::tls_base_symbol_defined_): New data members.
9529 (Target_arm::Scan::local, Target::Scan::global,
9530 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9531 relocations.
9532
c8761b9a
DK
95332010-02-18 Doug Kwan <dougkwan@google.com>
9534
9535 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9536 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9537 text section as a parameter becuase some broken tools may not set
9538 the link in section header.
9539 (Target_arm::has_got_section): New method.
9540 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9541 without any mapping symbol as data only. Remove warning.
9542 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9543 link in its section header, try to discover the link by inspecting the
9544 REL31 relocation at the beginning of the section.
9545 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9546 in error message.
9547 (Target_arm::Scan::global): Treat any reference to the symbol
9548 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9549
21bb3914
ST
95502010-02-12 Sriraman Tallam <tmsriram@google.com>
9551
9552 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9553 (Scan::global_reloc_may_be_function_pointer): New function.
9554 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9555 (Scan::global_reloc_may_be_function_pointer): New function.
9556 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9557 (Scan::global_reloc_may_be_function_pointer): New function.
9558 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9559 (Scan::global_reloc_may_be_function_pointer): New function.
9560 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9561 (Scan::global_reloc_may_be_function_pointer): New function.
9562 (Scan::possible_function_pointer_reloc): New function.
9563 (Target_x86_64::can_check_for_function_pointers): New function.
9564 * gc.h (gc_process_relocs): Scan relocation types to determine if
9565 function pointers were taken for targets that support it.
9566 * icf.cc (Icf::find_identical_sections): Include functions for
9567 folding in safe ICF whose pointer is not taken.
9568 * icf.h (Secn_fptr_taken_set): New typedef.
9569 (fptr_section_id_): New member.
9570 (section_has_function_pointers): New function.
9571 (set_section_has_function_pointers): New function.
9572 (check_section_for_function_pointers): New function.
9573 * options.h: Fix comment for safe ICF option.
9574 * target.h (can_check_for_function_pointers): New function.
9575 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9576 Modify icf_safe_test for X86-64.
9577 * testsuite/Makefile.in: Regenerate.
9578 * testsuite/icf_safe_so_test.cc: New file.
9579 * testsuite/icf_safe_so_test.sh: New file.
9580 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9581 (main): Change to take pointer to function kept_func_3.
9582 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9583 folding is done correctly for X86-64.
9584
0da6fa6c
DM
95852010-02-12 David S. Miller <davem@davemloft.net>
9586
9587 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9588 is_symbolless parameter.
9589 (Output_reloc<SHT_REL>::is_symbolless): New.
9590 (Output_reloc<SHT_REL>::is_symbolless_): New.
9591 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9592 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9593 (Output_reloc<SHT_RELA>::is_symbolless): New.
9594 (Output_data_reloc::add_global): Handle is_symbolless.
9595 (Output_data_reloc::add_global_relative): Likewise.
9596 (Output_data_reloc::add_local): Likewise.
9597 (Output_data_reloc::add_local_relative): Likewise.
9598 (Output_data_reloc::add_symbolless_global_addend): New.
9599 (Output_data_reloc::add_symbolless_local_addend): New.
9600 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9601 is_symbolless.
9602 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9603 instead of ->is_relative_
9604 (Output_reloc::write): Likewise.
9605 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9606 (Output_reloc::write_rel): Simplify.
9607
9608 * sparc.cc (Target_sparc::Scan::local): Use
9609 ->add_symbolless_local_addend as needed.
9610 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9611 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9612 based upon relocation offset.
9613
e4782e83
DK
96142010-02-11 Doug Kwan <dougkwan@google.com>
9615
9616 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9617 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9618 beginning of function.
9619 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9620 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9621 parameter is_32bit in calls to should_apply_static_reloc.
9622 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9623 (check_DATA): Add arm_abs_global.stdout.
9624 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9625 arm_abs_global.stdout): New rules.
9626 (MOSTLLYCLEANFILES): Add arm_abs_global
9627 * Makefile.in: Regenerate.
9628 * testsuite/arm_abs_global.s: New file.
9629 * testsuite/arm_abs_global.sh: Ditto.
9630 * testsuite/arm_abs_lib.s: Ditto.
9631
93ceb764
ILT
96322010-02-11 Ian Lance Taylor <iant@google.com>
9633
9634 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9635 Read_relocs task.
9636 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9637 Allocate_commons_task first.
9638 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9639 task, rather than symtab_lock_.
9640 (Gc_process_relocs::~Gc_process_relocs): New function.
9641 (Gc_process_relocs::is_runnable): Check this_blocker_.
9642 (Gc_process_relocs::locks): Use next_blocker_ rather than
9643 blocker_.
9644 (Scan_relocs::~Scan_relocs): New function.
9645 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9646 symtab_lock_.
9647 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9648 next_blocker_.
9649 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9650 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9651 constructor accordingly.
9652 (class Gc_process_relocs): Likewise.
9653 (class Scan_relocs): Likewise.
9654 * common.h (class Allocate_commons_task): Remove symtab_lock_
9655 field, and corresponding constructor parameter.
9656 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9657 symtab_lock_.
9658 (Allocate_commons_task::locks): Likewise.
9659
114dfbe1
ILT
96602010-02-11 Ian Lance Taylor <iant@google.com>
9661
9662 * gold-threads.h (class Once): Define.
9663 (class Initialize_lock): Rewrite as child of Once.
9664 * gold-threads.cc (class Once_initialize): Define.
9665 (once_pointer_control): New static variable.
9666 (once_pointer, once_arg): New static variables.
9667 (c_run_once): New static function.
9668 (Once::Once, Once::run_once, Once::internal_run): New functions.
9669 (class Initialize_lock_once): Remove.
9670 (initialize_lock_control): Remove.
9671 (initialize_lock_pointer): Remove.
9672 (initialize_lock_once): Remove.
9673 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9674 (Initialize_lock::initialize): Rewrite.
9675 (Initialize_lock::do_run_once): New function.
9676 * archive.cc (Archive::interpret_header): Only clear name if it is
9677 not already empty.
9678 * fileread.cc: Include "gold-threads.h"
9679 (file_counts_lock): New static variable.
9680 (file_counts_initialize_lock): Likewise.
9681 (File_read::release): Only increment counts when using --stats.
9682 Use a lock around the increment.
9683 * parameters.cc (class Set_parameters_target_once): Define.
9684 (set_parameters_target_once): New static variable.
9685 (Parameters::Parameters): Move here from parameters.h.
9686 (Parameters::set_target): Rewrite.
9687 (Parameters::set_target_once): New function.
9688 (Parameters::clear_target): Move here and rewrite.
9689 * parameters.h (class Parameters): Update declarations. Add
9690 set_parameters_target_once_ field.
9691 (Parameters::Parameters): Move to parameters.cc.
9692 (Parameters::clear_target): Likewise.
9693 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9694 task.
9695 (Start_group::~Start_group): New function.
9696 (Start_group::is_runnable): New function.
9697 (Start_group::locks, Start_group::run): New functions.
9698 (Finish_group::run): Change saw_undefined to size_t.
9699 * readsyms.h (class Start_group): Define.
9700 (class Finish_group): Change saw_undefined_ field to size_t.
9701 (Finish_group::Finish_group): Remove saw_undefined and
9702 this_blocker parameters. Change all callers.
9703 (Finish_group::set_saw_undefined): New function.
9704 (Finish_group::set_blocker): New function.
9705 * symtab.h (class Symbol_table): Change saw_undefined to return
9706 size_t. Change saw_undefined_ field to size_t.
9707 * target-select.cc (Set_target_once::do_run_once): New function.
9708 (Target_selector::Target_selector): Initialize set_target_once_
9709 field. Don't initialize lock_ and initialize_lock_ fields.
9710 (Target_selector::instantiate_target): Rewrite.
9711 (Target_selector::set_target): New function.
9712 * target-select.h (class Set_target_once): Define.
9713 (class Target_selector): Update declarations. Make
9714 Set_target_once a friend. Remove lock_ and initialize_lock_
9715 fields. Add set_target_once_ field.
9716
fa17a3f4
ILT
97172010-02-10 Ian Lance Taylor <iant@google.com>
9718
9719 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9720 queueing any tasks.
9721 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9722 (queue_middle_tasks): Add all blockers before queueing any tasks.
9723 (queue_final_tasks): Likewise.
9724 * token.h (Task_token::add_blockers): New function.
9725 * object.h (Input_objects::number_of_relobjs): New function.
9726
c7177d31
ILT
97272010-02-10 Ian Lance Taylor <iant@google.com>
9728
5de0e392
ILT
9729 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9730 shared, not if not position independent.
9731 * x86_64.cc (Relocate::relocate_tls): Likewise.
9732 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9733 (tls_pie_pic_test): New target.
9734 * testsuite/Makefile.in: Rebuild.
9735
c7177d31
ILT
9736 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9737 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9738 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9739 * testsuite/Makefile.in: Rebuild.
9740
684b268a
DM
97412010-02-09 David S. Miller <davem@davemloft.net>
9742
9743 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9744 R_SPARC_RELATIVE using ->add_local_relative().
9745 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9746
612a8d3d
DM
9747 * output.h (Output_data_dynamic::add_section_size): New method
9748 that takes two Output_data objects.
9749 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9750 entry param. Handle it in initializers.
9751 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9752 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9753 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9754 arg.
9755 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9756 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9757 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9758 for dynrel_includes_plt.
9759 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9760 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9761 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9762 before .rela.plt
9763 (Target_sparc::do_finalize_sections): Update to pass true for
9764 dynrel_includes_plt.
9765 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9766 output before .rela.plt
9767 (Target_powerpc::do_finalize_sections): Update to pass true for
9768 dynrel_includes_plt when 32-bit.
9769
cb1be87e
DK
97702010-02-08 Doug Kwan <dougkwan@google.com>
9771
9772 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9773 method.
9774 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9775 Arm_relobj::scan_section_for_cortex_a8_stubs,
9776 Arm_relobj::do_relocation_section): Instead of calling
9777 Output_section::output_address, use faster
9778 Arm_relobj::simple_input_section_output_address.
9779
705b5121
DM
97802010-02-08 David S. Miller <davem@davemloft.net>
9781
9782 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9783 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9784 relocation helper function.
9785
024c4466
DM
9786 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9787 just like R_SPARC_GOT{10,13,22}.
9788 (Target_sparc::Scan::local): Likewise.
9789 (Target_sparc::Relocate:relocate): Likewise.
9790
9109c078
ILT
97912010-02-06 Ian Lance Taylor <iant@google.com>
9792
9793 * configure.ac: Rewrite targetobjs duplicate removal code to use
9794 only shell constructs.
9795 * configure: Rebuild.
9796
cf846138
DK
97972010-02-05 Doug Kwan <dougkwan@google.com>
9798
9799 PR 11247
9800 * arm.cc (Arm_relobj::section_is_scannable): New method.
9801 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9802 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9803
6cfaf60b
DK
98042010-02-04 Doug Kwan <dougkwan@google.com>
9805
9806 PR 11247
9807 * arm-reloc-property.cc (cstdio): Include.
9808 * configure.ac (targetobjs): Remove duplicates.
9809 * configure: Regenerate.
9810 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9811 big and little endian version for a given address size.
9812
5c57f1be
DK
98132010-02-03 Doug Kwan <dougkwan@google.com>
9814
9815 * arm-reloc-property.cc
9816 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9817 definition.
9818 * arm-reloc-property.h
9819 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9820 New method definition.
9821 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9822 declaration.
9823 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9824 overflow to N.
9825 (GOT_PREL): Change implemented to Y.
9826 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9827 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9828 (Arm_relocate_functions::movw_abs_nc): Remove method.
9829 (Arm_relocate_functions::movt_abs): Ditto.
9830 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9831 (Arm_relocate_functions::thm_movt_abs): Ditto.
9832 (Arm_relocate_functions::movw_rel_nc): Ditto.
9833 (Arm_relocate_functions::movw_rel): Ditto.
9834 (Arm_relocate_functions::movt_rel): Ditto.
9835 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9836 (Arm_relocate_functions:thm_movw_rel): Ditto.
9837 (Arm_relocate_functions:thm_movt_rel): Ditto.
9838 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9839 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9840 New method definitions.
9841 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9842 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9843 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9844 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9845 (Target_arm::Relocate::relocate): Check for non-static or
9846 unimplemented relocation code and exit early. Change calls to
9847 Target_arm::reloc_uses_thumb_bit and
9848 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9849 instead. Refactor code to handle similar relocations to increase
9850 code sharing. Remove check for unsupported relocation code in switch
9851 statement.
9852 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9853 relocation property table to find out size. Change error message to
9854 print out the name of a relocation code instead of the numeric value.
9855 (Target_arm::scan_reloc_for_stub): Use relocation property table
9856 instead of calling Target_arm::reloc_uses_thumb_bit().
9857
218c5831
DK
98582010-02-02 Doug Kwan <dougkwan@google.com>
9859
9860 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9861 types of relaxed input section.
9862
0d31c79d
DK
98632010-02-02 Doug Kwan <dougkwan@google.com>
9864
9865 * Makefile.am (HFILES): Add arm-reloc-property.h.
9866 (DEFFILES): New.
2e702c99
RM
9867 (TARGETSOURCES): Add arm-reloc-property.cc
9868 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
9869 (libgold_a_SOURCES): $(DEFFILES)
9870 * Makefile.in: Regenerate.
9871 * arm-reloc-property.cc: New file.
9872 * arm-reloc-property.h: New file.
9873 * arm-reloc.def: New file.
9874 * arm.cc: Update comments.
9875 (arm-reloc-property.h): New included header.
9876 (arm_reloc_property_table): New global variable.
9877 (Target_arm::do_select_as_default_target): New method definition.
9878 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
9879 arm-reloc-property to targ_extra_obj.
9880 * parameters.cc (set_parameters_target): Call
9881 Target::select_as_default_target().
9882 * target.h (Target::select_as_default_target): New method definition.
9883 (Target::do_select_as_default_target): Same.
9884
546c7457
DK
98852010-02-01 Doug Kwan <dougkwan@google.com>
9886
9887 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
9888 first_output_text_section_.
9889 (Arm_exidx_fixup::first_output_text_section): New method definition.
9890 (Arm_exidx_fixup::first_output_text_section_): New data member.
9891 (Arm_exidx_fixup::process_exidx_section): Record the first text
9892 output section seen.
9893 (Arm_output_section::fix_exidx_coverage): Set correct linked section
9894 and entsize in output section header.
9895
11b861d5
DK
98962010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9897
9898 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
9899 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
9900 (Arm_relocate_functions::thm_alu11): New Method.
9901 (Arm_relocate_functions::thm_pc8): New Method.
9902 (Arm_relocate_functions::thm_pc12): New Method.
9903 (Target_arm::Scan::local): Handle the relocations.
9904 (Target_arm::Scan::global): Likewise.
9905 (Target_arm::Relocate::relocate): Likewise.
9906 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9907
c9a2c125
DK
99082010-01-29 Doug Kwan <dougkwan@google.com>
9909
9910 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
9911 of relocation types as ld.
9912
1521477a
DK
99132010-01-29 Doug Kwan <dougkwan@google.com>
9914
9915 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
9916 to public.
9917 (Arm_relocate_functions::thumb_branch_common): Ditto.
9918 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
9919 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
9920 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
9921 Arm_relocate_functions::jump24): Remove.
9922 (Target_arm::Relocate::relocate): Adjust code to call
9923 Arm_relocation_functions::arm_branch_common and
9924 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 9925 wrappers. Merge switch-cases together to reduce source code size.
1521477a 9926
e7eca48c
DK
99272010-01-29 Doug Kwan <dougkwan@google.com>
9928
9929 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
9930 output_local_symbol_count_needs_update_.
9931 (Arm_relobj::output_local_symbol_count_needs_update,
9932 Arm_relobj::set_output_local_symbol_count_needs_update,
9933 Arm_relobj::update_output_local_symbol_count): New methods.
9934 (Arm_relobj::output_local_symbol_count_needs_update_): New data
9935 member.
9936 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
9937 of pointed function as in a R_ARM_PREL31 relocation.
9938 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
9939 for output local symbol count updating.
9940 (Target_arm::do_relax): Update output local symbol counts in objects
9941 if necessary.
9942 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
9943
02961d7e
ILT
99442010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9945
9946 * arm.cc: Added support for the ARM relocations:
9947 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
9948 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
9949 (Arm_relocate_functions::movw_rel_nc): Renamed (was
9950 movw_prel_nc).
9951 (Arm_relocate_functions::movw_rel): New method.
9952 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
9953 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
9954 thm_movw_prel_nc).
9955 (Arm_relocate_functions::thm_movw_rel): New method.
9956 (Arm_relocate_functions::thm_movt_rel): Renamed (was
9957 thm_movt_prel).
9958 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
9959 relocations.
9960 (Target_arm::Scan::global): Likewise.
9961 (Target_arm::Relocate::relocate): Likewise.
9962 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9963 Likewise.
9964
b10d2873
ILT
99652010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9966
9967 * arm.cc: Added support for ARM group relocations.
9968 (Target_arm::reloc_needs_sym_origin): New method.
9969 (Arm_relocate_functions::calc_grp_kn): New method.
9970 (Arm_relocate_functions::calc_grp_residual): New method.
9971 (Arm_relocate_functions::calc_grp_gn): New method.
9972 (Arm_relocate_functions::arm_grp_alu): New Method.
9973 (Arm_relocate_functions::arm_grp_ldr): New Method.
9974 (Arm_relocate_functions::arm_grp_ldrs): New Method.
9975 (Arm_relocate_functions::arm_grp_ldc): New Method.
9976 (Target_arm::Scan::local): Handle the ARM group relocations.
9977 (Target_arm::Scan::global): Likewise.
9978 (Target_arm::Relocate::relocate): Likewise.
9979 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9980 Likewise.
9981
2b328d4e
DK
99822010-01-26 Doug Kwan <dougkwan@google.com>
9983
9984 * arm.cc (set): Include.
9985 (class Arm_exidx_fixup): Change type of last_input_section_ to const
9986 pointer type.
2e702c99 9987 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
9988 (Arm_output_section::append_text_sections_to_list): New method.
9989 (Arm_output_section::fix_exidx_coverage): Ditto.
9990 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 9991 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
9992 Relobj::set_section_offset() instead of
9993 Sized_relobj::invalidate_section_offset().
2e702c99 9994 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
9995 parameter for section headers. Ignore relocation sections for
9996 unallocated sections and EXIDX sections.
9997 (Target_arm::fix_exidx_coverage): New method.
9998 (Target_arm::output_section_address_less_than): New type.
9999 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10000 linked text section instead of the EXIDX section.
10001 (Arm_output_section::create_stub_group): Add an assertion to check
10002 that this is not an EXIDX output section.
10003 (Arm_output_section::append_text_sections_to_list): New method.
10004 (Arm_output_section::fix_exidx_coverage): Ditto.
10005 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 10006 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
10007 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10008 first pass.
10009 (Target_arm::fix_exidx_coverage): New method.
10010 * object.h (Relobj::set_output_section): New method.
10011 (Sized_relobj::invalidate_section_offset): Remove method.
10012 (Sized_relobj::do_invalidate_section_offset): Remove method.
10013 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10014
c7f3c371
DK
100152010-01-25 Doug Kwan <dougkwan@google.com>
10016
10017 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10018 Fix warning due to signed and unsigned comparison on a 32-bit host.
10019
8923b24c
DK
100202010-01-22 Doug Kwan <dougkwan@google.com>
10021
10022 * arm.cc (Target_arm::do_relax): Record an output section for section
10023 offset adjustment it contains any stub table that has changed.
10024 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10025 offsets in an output section if necessary.
10026 * output.cc (Output_section::Output_section): Initialize
10027 section_offsets_need_adjustments_.
10028 (Output_section::add_input_section_for_script): Renamed to
10029 Output_section::add_simple_input_section.
10030 (Output_section::save_states): Add a comment.
10031 (Output_section::discard_states): New method defintion.
10032 (Output_section::adjust_section_offsets): Same.
10033 * output.h (Output_section::add_input_section_for_script): Renamed to
10034 Output_section::add_simple_input_section.
10035 (Output_section::discard_states): New method declaration.
10036 (Output_section::adjust_section_offsets): Same.
10037 (Output_section::section_offsets_need_adjustment,
10038 Output_section::set_section_offsets_need_adjustment): New method
10039 definitions.
10040 (Output_section::section_offsets_need_adjustment_): New data member.
10041 * script-sections.cc
10042 (Output_section_element_input::set_section_address): Adjust code for
10043 renaming of Output_section::add_input_section_for_script.
10044 (Orphan_output_section::set_section_address): Same.
10045
9b2fd367
DK
100462010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10047
10048 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10049 Fix_v4bx enum values .
10050 * gold/options.h (General_options): New option definitions.
10051 (General_options::fix_v4bx): New method.
10052 (General_options::Fix_v4bx): New enum.
10053 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10054 (General_options::parse_fix_v4bx_interworking): New method.
10055
80d0d023
DK
100562010-01-22 Doug Kwan <dougkwan@google.com>
10057
10058 * arm.cc (Arm_exidx_fixup): New class.
10059
af2cdeae
DK
100602010-01-21 Doug Kwan <dougkwan@google.com>
10061
10062 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10063 classes.
10064 (Arm_exidx_section_offset_map): New type.
10065
993d07c1
DK
100662010-01-21 Doug Kwan <dougkwan@google.com>
10067
10068 * arm.cc (Arm_exidx_input_section): New class.
10069 (Arm_relobj::exidx_input_section_by_link,
10070 Arm_relobj::exidx_input_section_by_shndx,
10071 Arm_relobj::make_exidx_input_section): New methods.
10072 (read_arm_attributes_section): Remove.
10073 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10074 information about them.
10075 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10076 to here.
10077
5ac169d4
DK
100782010-01-20 Doug Kwan <dougkwan@google.com>
10079
10080 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10081 Input_section_specifier to Section_id.
10082 (Target_arm::new_arm_input_section: Adjust code for change of key
10083 type.
10084 (Target_arm::find_arm_input_section): Ditto.
10085 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10086 (Section_id): Remove.
10087 (Garbage_collection::Section_id_hash): Remove.
10088 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10089 (Section_id): Remove.
10090 (Icf::Section_id_hash): Remove.
10091 * object.h (Section_id, Const_section_id, Section_id_hash,
10092 Const_section_id_hash): New type definitions.
10093 * output.cc (Output_section::add_relaxed_input_section): Change to
10094 use Const_section_id instead of Input_section_specifier as key type.
10095 (Output_section::add_merge_input_section): Ditto.
10096 (Output_section::build_relaxation_map): Change to use Section_id
10097 instead of Input_section_specifier as key type.
2e702c99 10098 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
10099 Ditto.
10100 (Output_section::convert_input_sections_to_relaxed_sections): Change
10101 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 10102 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
10103 (Output_section::find_relaxed_input_section): Ditto.
10104 * output.h (Input_section_specifier): Remove class.
10105 (Output_section::Output_section_data_by_input_section_map): Change
10106 key type to Const_section_id.
10107 (Output_section::Output_relaxed_input_section_by_input_section_map):
10108 Ditto.
10109 (Output_section::Relaxation_map): Change key type to Section_id.
10110
a2162063
ILT
101112010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10112
10113 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10114 (class Arm_v4bx_stub): New class.
10115 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10116 (Stub_factory::make_arm_v4bx_stub): New method.
10117 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10118 (Stub_table::empty): Handle v4bx stubs.
10119 (Stub_table::add_arm_v4bx_stub): New method.
10120 (Stub_table::find_arm_v4bx_stub): New method.
10121 (Arm_relocate_functions::v4bx): New method.
10122 (Target_arm::fix_v4bx): New method.
10123 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10124 (Stub_table::relocate_stubs): Likewise.
10125 (Stub_table::do_write): Likewise.
10126 (Stub_table::update_data_size_and_addralign): Likewise.
10127 (Stub_table::finalize_stubs): Likewise.
10128 (Target_arm::Scan::local): Likewise.
10129 (Target_arm::Scan::global): Likewise.
10130 (Target_arm::do_finalize_sections): Likewise.
10131 (Target_arm::Relocate::relocate): Likewise.
10132 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10133 Likewise.
10134 (Target_arm::scan_reloc_for_stub): Likewise.
10135 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10136
5696ab0b
ILT
101372010-01-19 Ian Lance Taylor <iant@google.com>
10138
10139 * output.cc (Output_section_headers::do_sized_write): Write large
10140 segment count to sh_info field.
10141 (Output_file_header::do_sized_write): For large segment count,
10142 write PN_XNUM to e_phnum field.
10143
800d0f56
ILT
101442010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10145
10146 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10147 (Arm_relocate_functions::thm_jump8): New function.
10148 (Arm_relocate_functions::thm_jump11): New function.
10149 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10150 R_ARM_THM_JUMP11.
10151 (Target_arm::Scan::global): Likewise.
10152 (Target_arm::Relocate::relocate): Likewise.
10153 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10154 Likewise.
10155
41263c05
DK
101562010-01-14 Doug Kwan <dougkwan@google.com>
10157
10158 * arm.cc (map, utility): Include headers.
10159 (Target_arm::apply_cortex_a8_workaround): New method.
10160 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10161 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10162 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10163 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10164 the --[no-]fix-cortex-a8 command line options.
10165 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10166 (Target_arm::relocate_stub): Use addend in instruction template.
10167 * options.h (DEFINE_bool): Set the user-set flag.
10168 (General_options): Add --[no-]-fix-cortex options.
10169 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10170 : Update fast look-up map after conversion.
41263c05 10171
459e9b03
ST
101722010-01-14 Sriraman Tallam <tmsriram@google.com>
10173
10174 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10175 in the first pass of do_layout.
10176
b521dfe4
DK
101772010-01-13 Doug Kwan <dougkwan@google.com>
10178
10179 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10180 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10181 apparent compiler problem of not folding static constant integral
10182 data members of elfcpp::Elf_sizes<32>.
10183
44272192
DK
101842010-01-13 Doug Kwan <dougkwan@google.com>
10185
10186 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10187 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10188 Arm_relobj::scan_section_for_cortex_a8_erratum,
10189 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10190 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10191 sections to scan for relocation stubs into a new method
10192 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10193 relocation and Cortex-A8 stub scanning.
10194 (Target_arm::do_relax): Force stubs to be after stubbed sections
10195 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10196 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10197 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10198
44b71ece
ILT
101992010-01-12 Ian Lance Taylor <iant@google.com>
10200
10201 * target-reloc.h (visibility_error): New inline function.
10202 (relocate_section): Call visibility_error.
10203 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10204 (MOSTLYCLEANFILES): Likewise.
10205 (protected_4_pic.o, protected_3.err): New targets.
10206 * testsuite/protected_4.cc: New file.
10207
a120bc7f
DK
102082010-01-12 Doug Kwan <dougkwan@google.com>
10209
10210 * arm.cc (Cortex_a8_reloc): New class.
10211 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10212 and cortex_a8_relocs_info_.
10213 (Target_arm::fix_cortex_a8): New method definition.
10214 (Target_arm::Cortex_a8_relocs_info): New type.
10215 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10216 New data member declarations.
10217 (Target_arm::scan_reloc_for_stub): Record information about
10218 relocations for THUMB branches that might be exempted from the
10219 Cortex-A8 workaround.
10220 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10221 at the beginning of a relaxation pass.
10222
20138696
DK
102232010-01-12 Doug Kwan <dougkwan@google.com>
10224
10225 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10226 (Arm_relobj::Mapping_symbol_position,
10227 Arm_reloj::Mapping_symbol_position_less,
10228 Arm_relobj::Mapping_symbols_info): New types.
10229 (Target_arm::is_mapping_symbol_name): New method definition.
10230 (Arm_relobj::do_count_local_symbols): Save information about mapping
10231 symbols.
10232
089d69dc
DK
102332010-01-11 Doug Kwan <dougkwan@google.com>
10234
10235 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10236 Arm_relocate_functions::thumb32_branch_upper,
10237 Arm_relocate_functions::thumb32_branch_lower,
10238 Arm_relocate_functions::thumb32_cond_branch_offset,
10239 Arm_relocate_functions::thumb32_cond_branch_upper,
10240 Arm_relocate_functions::thumb32_cond_branch_lower,
10241 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10242 branch offset encoding.
10243 (Arm_relocate_functions::thumb_branch_common): Use new branch
10244 offset encoding methods to avoid code duplication.
10245 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10246 (Stub_addend_reader::operator()): Use new branch encoding method
10247 to avoid code duplication.
10248
99e5bff2
DK
102492010-01-11 Doug Kwan <dougkwan@google.com>
10250
10251 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10252 (Target_arm::do_finalize_sections): Define special EXIDX section
10253 symbols only if referenced.
10254 * gc.h (Garbage_collection::add_reference): New method.
10255 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10256 code duplication.
10257
98e090bd
ILT
102582010-01-11 Ian Lance Taylor <iant@google.com>
10259
d0a91bd8
ILT
10260 * script.cc (Version_script_info::build_expression_list_lookup):
10261 Change complaing about duplicate wildcard match from error to
10262 warning.
10263
98e090bd
ILT
10264 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10265 of 2009-12-30.
10266 (Version_script_info::Version_script_info): Initialize globs_,
10267 default_version_, default_is_global_, and exact_. Don't
10268 initialize globals_ or locals_.
10269 (Version_script_info::build_lookup_tables): Build local symbols
10270 first.
10271 (Version_script_info::unquote): New function.
10272 (Version_script_info::add_exact_match): New function.
10273 (Version_script_info::build_expression_list_lookup): Remove lookup
10274 parameter. Add is_global parameter. Change all callers. Handle
10275 wildcard pattern specially. Unquote pattern. Call
10276 add_exact_match.
10277 (Version_script_info::get_name_to_match): New function.
10278 (Version_script_info::get_symbol_version): New function.
10279 (Version_script_info::get_symbol_version_helper): Remove.
10280 (Version_script_info::check_unmatched_names): Call unquote.
10281 * script.h (class Version_script_info): Change get_symbol_version
10282 to be non-inline and add is_global parameter; change all callers.
10283 Rewrite symbol_is_local. Update declarations. Define struct
10284 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10285 Remove globals_ and locals_ members. Add exact_, globs_,
10286 default_version_, is_global_.
10287 (Version_script_info::Glob): Remove pattern, add expression and
10288 is_global. Update constructor. Change all callers.
10289 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10290 default version.
10291 (Versions::symbol_section_contents): If a symbol is undefined, or
10292 defined in a dynamic object, set the version index to
10293 VER_NDX_LOCAL.
10294 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10295 symbol_is_local.
10296 (Symbol_table::add_from_pluginobj): Likewise.
10297 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10298
d56962d3
DK
102992010-01-11 Doug Kwan <dougkwan@google.com>
10300
10301 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10302 (incremental_dump_LDADD): Add linking option for libintl.
10303 * Makefile.in: Regenerate.
10304
94e6ee91
L
103052010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10306
10307 PR gold/11144
10308 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10309 instead of -Ds.
10310 * testsuite/Makefile.in: Regenerated.
10311
e96c574b
DK
103122010-01-10 Doug Kwan <dougkwan@google.com>
10313
10314 * options.h (DEFINE_var): Use parentheses around argument varname__
10315 in macro body to avoid any unintended subsequent substitutions.
10316
7198066b
ILT
103172010-01-10 Ian Lance Taylor <iant@google.com>
10318
ba4d53bf
ILT
10319 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10320 candidates before doing symbol resolution.
10321
7198066b
ILT
10322 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10323 ODR candidates if only one is weak.
10324
a2beed37
ILT
103252010-01-08 Ian Lance Taylor <iant@google.com>
10326
10327 * script.cc (Version_script_info::build_expression_list_lookup):
10328 Don't warn about ambiguous version, just record the ambiguity.
10329 (Version_script_info::get_symbol_version_helper): Give error if
10330 version is ambiguous.
10331
2fb7225c
DK
103322010-01-08 Doug Kwan <dougkwan@google.com>
10333
10334 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10335 prev_data_size_ and prev_addralign_. Remove initializer for
10336 deleted data member has_been_changed_.
10337 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10338 to determine if the table is empty.
10339 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10340 Remove.
10341 (Stub_table::add_reloc_stub): Define method in class definition
10342 instead of just declaring it there.
10343 (Stub_table::add_cortex_a8_stub): New method definition.
10344 (Stub_table::update_data_size_and_addralign): Ditto.
10345 (Stub_table::finalize_stubs): Ditto.
10346 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10347 (Stub_table::do_addralign_): Return address alignment in the
10348 (Stub_table::do_reset_address_and_file_offset): Define method in
10349 class definition instead of declaring it there. Set current data
10350 size to be the data size of the previous pass.
10351 (Stub_table::set_final_data_size): Use current data size as the
10352 final data size.
10353 (Stub_table::relocate_stub): Change parameter type of stub from
10354 Reloc_stub pointer to Stub pointer.
10355 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10356 (Stub_table::Cortex_a8_stub_list): New typedef.
10357 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10358 Stub_table::prev_addralign_): New data member.
10359 (Arm_relobj::Arm_relobj): Initialize data member
10360 section_has_cortex_a8_workaround_.
10361 (Arm_relobj::section_has_cortex_a8_workaround,
10362 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10363 definitions.
10364 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10365 declarations.
10366 (Target_arm::relocate_stub): Change parameter type of stub from
10367 Reloc_stub pointer to Stub pointer.
10368 (Insn_template::size, Insn_template::alignment): Handle
10369 THUMB16_SPECIAL_TYPE.
10370 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10371 Stub_table::update_data_size_and_addralign,
10372 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10373 definitions.
10374 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10375 (Stub_table::do_write): Ditto.
10376 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10377
880cd20d
ILT
103782010-01-08 Ian Lance Taylor <iant@google.com>
10379
10380 PR 11108
10381 * symtab.h (class Symbol): Remove fields is_target_special_ and
10382 has_plt_offset_. Add field is_defined_in_discarded_section_.
10383 (Symbol::is_defined_in_discarded_section): New function.
10384 (Symbol::set_is_defined_in_discarded_section): New function.
10385 (Symbol::has_plt_offset): Rewrite.
10386 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10387 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10388 Don't initialize is_target_special_ or has_plt_offset_.
10389 Initialize is_defined_in_discarded_section_.
10390 (Symbol_table::add_from_relobj): If appropriate, set
10391 is_defined_in_discarded_section.
10392 * resolve.cc (Symbol::override_base_with_special): Don't test
10393 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10394 * target-reloc.h (relocate_section): Do special handling for
10395 symbols defined in discarded sections for global symbols as well
10396 as local symbols.
10397
2703e3eb
ILT
103982010-01-08 Ian Lance Taylor <iant@google.com>
10399
10400 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10401 the SHT_SYMTAB case.
10402
339d40a3
ILT
104032010-01-08 Ian Lance Taylor <iant@google.com>
10404
10405 * object.cc (Sized_relobj::do_layout): Don't get confused if
10406 layout_eh_frame returns NULL.
10407
abecea76
ILT
104082010-01-08 Ian Lance Taylor <iant@google.com>
10409
10410 PR 11084
10411 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10412 dynamic symbol table, use the normal symbol table.
10413 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10414 symbol table.
10415
6b7dd3f3
ILT
104162010-01-08 Ian Lance Taylor <iant@google.com>
10417
10418 PR 11072
10419 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10420 sections.
10421
36c50e63
L
104222010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10423
10424 * version.cc (print_version): Change to "Copyright 2010".
10425
e291e7b9
ILT
104262010-01-08 Ian Lance Taylor <iant@google.com>
10427
10428 PR 10287
10429 PR 11063
10430 * i386.cc (class Target_i386): Change return type of plt_section
10431 to be non-const.
10432 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10433 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10434 tls_desc_rel_ field.
10435 (Output_data_plt_i386::rel_tls_desc): New function.
10436 (Target_i386::rel_tls_desc_section): New function.
10437 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10438 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10439 R_386_TLS_DESC reloc in rel_tls_desc_section.
10440 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10441 Define struct Tlsdesc_info.
10442 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10443 (Target_x86_64::do_reloc_symbol_index): New function.
10444 (Target_x86_64::add_tlsdesc_info): New function.
10445 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10446 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10447 tlsdesc_rel_ field.
10448 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10449 all callers.
10450 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10451 (Target_x86_64::rela_tlsdesc_section): New function.
10452 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10453 handling.
10454 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10455 (Target_x86_64::do_reloc_addend): New function.
10456 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10457 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10458 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10459 (Output_reloc::type): New function.
10460 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10461 (Output_reloc::is_target_specific): New function.
10462 (Output_reloc::target_arg): New function.
10463 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10464 absolute relocs and target specific relocs.
10465 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10466 add_target_specific.
10467 (class Output_data_reloc) [SHT_RELA]: Likewise.
10468 * output.cc (Output_reloc::Output_reloc): Add four new versions
10469 for absolute relocs and target specific relocs.
10470 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10471 (Output_reloc::get_symbol_index): Likewise.
10472 (Output_reloc::local_section_offset): Check that local_sym_index_
10473 is not TARGET_CODE or 0.
10474 (Output_reloc::symbol_value): Likewise.
10475 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10476 reloc.
10477 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10478 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10479 functions.
10480 * layout.cc (add_target_dynamic_tags): Use output section for
10481 DT_PLTRELSZ and DT_JMPREL.
10482
3a44184e
ILT
104832010-01-07 Ian Lance Taylor <iant@google.com>
10484
10485 PR 11061
10486 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10487 function.
10488 (class Output_data_reloc_generic): Define.
10489 (class Output_data_reloc_base): Change base class to
10490 Output_data_reloc_generic. Change add() method to call
10491 bump_relative_reloc_count for a relative reloc. Remove
10492 sort_relocs_ field.
10493 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10494 to sort_relocs().
10495 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10496 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10497 appropriate.
10498 * layout.h (class Layout): Update declaration.
10499
ea715a34
ILT
105002010-01-07 Ian Lance Taylor <iant@google.com>
10501
10502 * output.h (class Output_data): Add const version of
10503 output_section and do_output_section.
10504 (class Output_section_data): Add const version of
10505 do_output_section.
10506 (class Output_section): Likewise.
10507 * layout.cc (Layout::add_target_dynamic_tags): New function.
10508 * layout.h (class Layout): Update declarations.
10509 * arm.cc (Target_arm::do_finalize_sections): Use
10510 add_target_dynamic_tags.
10511 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10512 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10513 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10514 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10515
659948a4
ILT
105162010-01-07 Ian Lance Taylor <iant@google.com>
10517
10518 PR 11042
10519 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10520 object as needed.
10521
9d3b86f6
ILT
105222010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10523 Ian Lance Taylor <iant@google.com>
10524
10525 PR 11019
10526 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10527 Xindex::read_symtab_xindex.
10528
bb0d3eb0
DK
105292010-01-07 Doug Kwan <dougkwan@google.com>
10530
10531 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10532 (Insn_template::thumb16_bcond_insn): New method declaration.
10533 (Insn_template): Fix spelling.
10534 (Stub::thumb16_special): New method declaration.
10535 (Stub::do_write): Define virtual method which was previously pure
10536 virtual.
10537 (Stub::do_thumb16_special): New method declaration.
10538 (Stub::do_fixed_endian_write): New template member.
10539 (Reloc_stub::do_write): Remove.
10540 (Reloc_stub::do_fixed_endian_write): Remove.
10541 (Cortex_a8_stub): New class definition.
10542 (Stub_factory::make_cortex_a8_stub): New method definition.
10543 (Stub_factory::Stub_factory): Add missing static storage class
10544 qualifier for elf32_arm_stub_a8_veneer_blx.
10545
ffeef7df
ILT
105462010-01-07 Ian Lance Taylor <iant@google.com>
10547
dc3f80fe
ILT
10548 PR 10980
10549 * options.h (class General_options): Add --warn-unresolved-symbols
10550 and --error-unresolved-symbols.
10551 * errors.cc (Errors::undefined_symbol): Implement
10552 --warn-unresolved-symbols.
10553
ffeef7df
ILT
10554 * options.h (class General_options): Add -z text and -z textoff.
10555 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10556
f1ec9ded
ST
105572010-01-06 Sriraman Tallam <tmsriram@google.com>
10558
10559 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10560 (Garbage_collection::cident_sections): New function.
10561 (Garbage_collection::add_cident_section): New function.
10562 (Garbage_collection::cident_sections_): New member.
10563 (gc_process_relocs): Add references to sections whose names are C
10564 identifiers.
10565 * gold.h (cident_section_start_prefix): New constant.
10566 (cident_section_stop_prefix): New constant.
10567 (is_cident): New function.
10568 * layout.cc (Layout::define_section_symbols): Replace string constants
10569 with the newly defined constants.
10570 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10571 C identifiers.
10572 * testsuite/Makefile.am: Add gc_orphan_section_test.
10573 * testsuite/Makefile.in: Regenerate.
10574 * testsuite/gc_orphan_section_test.cc: New file.
10575 * testsuite/gc_orphan_section_test.sh: New file.
10576
6eda8c29
ILT
105772010-01-06 Ian Lance Taylor <iant@google.com>
10578
b9674e17
ILT
10579 PR 10980
10580 * options.h (class General_options): Add --warn-shared-textrel.
10581 * layout.cc (Layout::finish_dynamic_section): Implement
10582 --warn-shared-textrel.
10583
6eda8c29
ILT
10584 PR 10980
10585 * options.h (class General_options): Add --warn-multiple-gp.
10586
32dcd44e
ILT
105872010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10588
10589 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10590 $(THREADSLIB) and $(LIBDL).
10591 * Makefile.in: Rebuild.
10592
a192ba05
ILT
105932010-01-06 Ian Lance Taylor <iant@google.com>
10594
10595 PR 10980
10596 * options.cc (General_options::parse_section_start): New function.
10597 (General_options::section_start): New function.
10598 (General_options::General_options): Initialize all members.
10599 * options.h: Include <map>
10600 (class General_options): Add --section-start. Add section_starts_
10601 member.
10602 * layout.cc (Layout::attach_allocated_section_to_segment): If
10603 --section-start was used, set the address of the segment. Remove
10604 local sort_sections.
10605 (Layout::relaxation_loop_body): If the address of the load segment
10606 has been set by --section-start, don't use it.
10607 * output.h (Output_segment::update_flags_for_output_section): New
10608 function.
10609 * output.cc (Output_segment::add_output_section): Call
10610 update_flags_for_output_section.
10611
dde3f402
ILT
106122010-01-05 Ian Lance Taylor <iant@google.com>
10613
62dfdd4d
ILT
10614 PR 10980
10615 * options.h (class General_options): Add --undefined-version.
10616 * script.cc (struct Version_expression): Add was_matched_by_symbol
10617 field.
10618 (Version_script_info::matched_symbol): New function.
10619 (Version_script_info::get_symbol_version_helper): Call
10620 matched_symbol.
10621 (Version_script_info::check_unmatched_names): New function.
10622 * script.h (class Version_script_info): Update declarations.
10623 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10624
9c4ae156
ILT
10625 * options.h (class General_options): Use DEFINE_bool_alias for
10626 allow_multiple_definition.
10627 * resolve.cc (Symbol_table::should_override): Don't test
10628 allow_multiple_definition.
10629
dde3f402
ILT
10630 PR 10980
10631 * options.h (class General_options): Add --cref.
10632 * main.cc (main): Print cref table if --cref. Don't close mapfile
10633 until after printing cref table.
10634 * cref.cc: Include "symtab.h".
10635 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10636 (Cref_table_compare::operator()): New function.
10637 (Cref_inputs::gather_cref): New function.
10638 (filecol): New static const.
10639 (Cref_inputs::print_cref): New function.
10640 (Cref::print_cref): New function.
10641 * cref.h: Include <cstdio>.
10642 (class Cref): Update declarations.
10643 * mapfile.h (Mapfile::file): New function.
10644 * object.h (class Object): Define Symbols. Declare virtual
10645 do_get_global_symbols.
10646 (Object::get_global_symbols): New function.
10647 * object.cc (Input_objects::add_object): Pass object to cref_ if
10648 --cref.
10649 (Input_objects::archive_start): Likewise.
10650 (Input_objects::archive_stop): Likewise.
10651 (Input_objects::print_cref): New function.
10652 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10653 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10654 --cref.
10655 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10656 function.
10657 * plugin.h (class Sized_pluginobj): Update declarations.
10658
8781f709
ILT
106592010-01-05 Ian Lance Taylor <iant@google.com>
10660
10661 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10662 to is_default_version. Rename insdef to insdefault.
10663 (Symbol_table::add_from_relobj): Rename def to is_default_version
10664 and local to is_forced_local.
10665 (Symbol_table::add_from_pluginobj): Likewise.
10666 (Symbol_table::add_from_dynobj): Likewise.
10667 (Symbol_table::define_special_symbol): Rename insdef to
10668 insdefault.
10669
fe35d28d
ILT
106702010-01-04 Ian Lance Taylor <iant@google.com>
10671
30bc8c46
ILT
10672 PR 10980
10673 * options.h (class General_options): Add
10674 --allow-multiple-definition and -z muldefs.
10675 * resolve.cc (Symbol_table::should_override): Don't warn about a
10676 multiple symbol definition if --allow-multiple-definition or -z
10677 muldefs.
10678
7eaea549
ILT
10679 PR 10980
10680 * options.h (class General_options): Add --add-needed and
10681 --copy-dt-needed-entries. Tweak --as-needed help entry.
10682 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10683 error if --copy-dt-needed-entries aka --add-needed is used and
10684 would cause a change in behaviour.
10685
fe35d28d
ILT
10686 PR 10980
10687 * options.h (class General_options): Add -G as a short version of
10688 --shared. Add no-op options -assert, -g, and -i.
10689
55a2bb35
ST
106902010-01-04 Sriraman Tallam <tmsriram@google.com>
10691
10692 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10693 check for .text or .gnu.linkonce.t sections.
10694 * icf.cc (Icf::find_identical_sections): Ditto.
10695 Change the detection for mangled function name within the section
10696 name.
10697 * icf.h (is_section_foldable_candidate): New function.
10698
719328e1
ILT
106992009-12-30 Ian Lance Taylor <iant@google.com>
10700
10701 PR 10980
10702 * options.h (class General_options): Permit two dashes with
10703 --retain-symbols-file.
10704
d7bb5745
ILT
107052009-12-30 Ian Lance Taylor <iant@google.com>
10706
403a15dd
ILT
10707 PR 10979
10708 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10709 don't put the file header and segment headers in the text
10710 segment.
10711
eda294df
ILT
10712 PR 10979
10713 * common.cc (Sort_commons::operator()): Stabilize sort when both
10714 entries are NULL.
10715 (Symbol_table::do_allocate_commons_list): When allocating common
10716 symbols, skip a symbol which is no longer common.
10717 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10718 an object before checking its type.
10719 * testsuite/common_test_2.c: New file.
10720 * testsuite/common_test_3.c: New file.
10721 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10722 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10723 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10724 (common_test_2_pic.o, common_test_2.so): New targets.
10725 (common_test_3_pic.o, common_test_3.so): New targets.
10726 * testsuite/Makefile.in: Rebuild.
10727
d7bb5745
ILT
10728 PR 10979
10729 * script.cc (read_input_script): If we see a new SECTIONS clause,
10730 and we have added an input section, give an error.
10731 * layout.h (class Layout): Add have_added_input_section function.
10732 Add have_added_input_section_ field.
10733 * layout.cc (Layout::Layout): Initialize
10734 have_added_input_section_.
10735 (Layout::layout): Set have_added_input_section_.
10736 (Layout::layout_eh_frame): Likewise.
10737
fc59c572
ILT
107382009-12-30 Ian Lance Taylor <iant@google.com>
10739
10740 PR 10931
10741 * options.h (class General_options): Add --sort-common option.
10742 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10743 * common.cc (Sort_common): Add sort_order parameter to
10744 constructor. Add sort_order_ field.
10745 (Sort_commons::operator): Check sort_order_.
10746 (Symbol_table::allocate_commons): Determine the sort order.
10747 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10748 Change all callers.
10749 (Symbol_table::do_allocate_commons_list): Likewise.
10750
1c74fab0
ILT
107512009-12-30 Ian Lance Taylor <iant@google.com>
10752
10753 PR 10916
10754 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10755 symbols from this object, don't change the visibility of an
10756 undefined symbol.
10757 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10758
6affe781
ILT
107592009-12-30 Ian Lance Taylor <iant@google.com>
10760
10761 PR 10861
10762 * script.h (class Version_script_info): Define Language enum.
10763 Update declarations. Define Glob, Exact, and Lookup types. Add
10764 new fields globals_, locals_, and is_finalized_.
10765 * script.cc: Various formatting fixes.
10766 (class Parser_closure): Change language_stack_ from a vector of
10767 std::string to one of Version_script_info::Language. Adjust all
10768 uses accordingly.
10769 (class Lazy_demangler): Remove.
10770 (struct Version_expression): Change language from std::string to
10771 Version_script_info::Language.
10772 (Version_script_info::Version_script_info): New function.
10773 (Version_script_info::~Version_script_info): Don't call clear.
10774 (Version_script_info::finalize): New function.
10775 (Version_script_info::build_lookup_tables): New function.
10776 (Version_script_info::build_expression_list_lookup): New
10777 function.
10778 (Version_script_info::get_symbol_version_helper): Rewrite to use
10779 lookup tables.
10780 (Version_script_info::print_expression_list): Adjust to use
10781 Version_script_info::Language.
10782 (script_push_lex_into_version_mode): Check that the version script
10783 has not been finalized.
10784 (version_script_push_lang): Change language string to
10785 Version_script_info::Language.
10786 * options.cc (Command_line::version_script): New function.
10787 * options.h (class General_options): Add finalize_dynamic_list
10788 function. Change version_script from declaration to definition.
10789 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10790 * testsuite/version_script.map: Remove duplicate def of foo.
10791 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10792 version_script.map.
10793 * testsuite/Makefile.in: Rebuild.
10794
818bf354
ILT
107952009-12-30 Ian Lance Taylor <iant@google.com>
10796
10797 PR 10843
10798 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10799 if the input symbol index is 0, make the output symbol index 0.
10800
ebcc8304
ILT
108012009-12-30 Ian Lance Taylor <iant@google.com>
10802
10803 PR 10670
10804 * options.h (class General_options): Add -x/--discard-all.
10805 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10806 --discard-all. If the local symbol needs a dynamic entry, check
10807 that before handling --discard-locals.
10808
176fe33f
ILT
108092009-12-30 Ian Lance Taylor <iant@google.com>
10810
bb321bb1
ILT
10811 PR 10450
10812 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10813 flags to PF_R.
10814 (Output_segment::add_output_section): Don't change the flags if
10815 the type is PT_TLS.
10816
176fe33f
ILT
10817 PR 10450
10818 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10819 GNU hash table if they need a dynamic value. Otherwise, don't add
10820 them if they are defined in a dynamic object or are forced local.
10821
e8cd95c7
ILT
108222009-12-29 Ian Lance Taylor <iant@google.com>
10823
1b81fb71
ILT
10824 PR 10450
10825 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10826 .gnu.hash table for a 32-bit target.
10827
8d6d383d
ILT
10828 PR 10450
10829 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10830 regular and a dynamic object only needs a dynamic symbol table
10831 entry if it is externally visible.
10832
e785ec03
ILT
10833 PR 10450
10834 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10835 constructor. Add global_offset_table_ field.
10836 (Target_i386::got_section): Set global_offset_table_.
10837 (Target_i386::do_finalize_sections): Set global_offset_table_
10838 size.
10839 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10840 in constructor. Add global_offset_table_ field.
10841 (Target_x86_64::got_section): Set global_offset_table_.
10842 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10843 size.
10844
1a2dff53
ILT
10845 * layout.cc (Layout::Layout): Initialize increase_relro_.
10846 (Layout::get_output_section): Add is_relro, is_last_relro, and
10847 is_first_non_relro parameters. Change all callers.
10848 (Layout::choose_output_section): Likewise.
10849 (Layout::add_output_section_data): Likewise.
10850 (Layout::make_output_section): Likewise.
10851 (Layout::set_segment_offsets): Clear increase_relro when using a
10852 linker script.
10853 * layout.h (class Layout): Add increase_relro method. Add
10854 increase_relro_ field. Update declarations.
10855 * output.cc (Output_section::Output_section): Initialize
10856 is_last_relro_ and is_first_non_relro_.
10857 (Output_segment::add_output_section): Group relro sections is
10858 do_sort is true. Handle is_last_relro and is_first_non_relro.
10859 (Output_segment::maximum_alignment): Remove relro handling.
10860 (Output_segment::set_section_addresses): Add increase_relro
10861 parameter. Change all callers. Add initial alignment to align
10862 relro sections on separate page. Remove old relro handling.
10863 (Output_segment::set_section_list_addresses): Remove in_relro
10864 parameter. Change all callers.
10865 (Output_segment::set_offset): Add increase parameter. Change all
10866 callers. Remove old relro handling.
10867 * output.h (class Output_section): Add new methods: is_last_relro,
10868 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10869 Add is_last_relro_ and is_first_non_relro_ fields.
10870 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10871 Create separate .got.plt section. Call increase_relro.
10872 * x86_64.cc (Target_x86_64::got_section): Likewise.
10873 * testsuite/relro_script_test.t: Add .got.plt.
10874
f0ba79e2
ILT
10875 PR 10450
10876 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
10877 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
10878 (Layout::finalize): Call set_dynamic_symbol_size.
10879 (Layout::set_dynamic_symbol_size): New function.
10880 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
10881 set_dynamic_symbol_size.
10882
e8cd95c7
ILT
10883 PR 10450
10884 * output.h (class Output_section): Add is_entsize_zero_ field.
10885 * output.cc (Output_section::Output_section): Initialize
10886 is_entsize_zero_.
10887 (Output_section::set_entsize): If two different entsizes are
10888 requested, force it to zero.
10889 (Output_section::add_input_section): Set flags for .debug_str
10890 before updating section flags. Set entsize.
10891 (Output_section::update_flags_for_input_section): Set SHF_MERGE
10892 and SHF_STRING if all input sections have those flags.
10893
3e1b9a8a
RÁE
108942009-12-29 Rafael Espindola <espindola@google.com>
10895
10896 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
10897 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
10898 reporting.
3e1b9a8a 10899
3dcad376
ST
109002009-12-29 Sriraman Tallam <tmsriram@google.com>
10901
10902 * options.cc (General_options::parse_version): Allow -v to exit
10903 without an error if there is nothing to link.
10904
084e2665
ILT
109052009-12-29 Ian Lance Taylor <iant@google.com>
10906
10907 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
10908 using a version of gcc before 4.1.
10909 * configure: Rebuild.
10910
250acde3
CD
109112009-12-28 Chris Demetriou <cgd@google.com>
10912
10913 * attributes.cc (Output_attributes_section_data::do_write): Use
10914 std::vector::front rather than std::vector::data.
10915
99fff23b
ILT
109162009-12-28 Ian Lance Taylor <iant@google.com>
10917
10918 * symtab.h (class Symbol_table): Add enum Defined.
10919 * resolve.cc (Symbol_table::should_override): Add defined
10920 parameter. Change all callers. Test whether object is NULL
10921 before calling a method on it.
10922 (Symbol_table::report_resolve_problem): Add defined parameter.
10923 Change all callers.
10924 (Symbol_table::should_override_with_special): Likewise.
10925 * symtab.cc (Symbol_table::define_in_output_data): Add defined
10926 parameter. Change all callers.
10927 (Symbol_table::do_define_in_output_data): Likewise.
10928 (Symbol_table::define_in_output_segment): Likewise.
10929 (Symbol_table::do_define_in_output_segment): Likewise.
10930 (Symbol_table::define_as_constant): Likewise.
10931 (Symbol_table::do_define_as_constant): Likewise.
10932 * script.h (class Symbol_assignment): Add is_defsym parameter to
10933 constructor; change all callers.
10934 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
10935 parameter. Change all callers. Add is_defsym_ field.
10936 (class Parser_closure): Add parsing_defsym parameter to
10937 constructor; change all callers. Add parsing_defsym accessor
10938 function. Add parsing_defsym_ field.
10939
556bd683
ILT
109402009-12-28 Ian Lance Taylor <iant@google.com>
10941
10942 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 10943 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 10944
1782c879
ILT
109452009-12-23 Ian Lance Taylor <iant@google.com>
10946
10947 * i386.cc (Target_i386::do_calls_non_split): Recognize
10948 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
10949 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
10950 -fsplit-stack prologue when using %r11.
1782c879 10951
329ca2b1
ST
109522009-12-21 Sriraman Tallam <tmsriram@google.com>
10953
10954 * options.cc (General_options::parse_version): Make -v continue and do
10955 the link like GNU ld does.
10956
d675ff46
RÁE
109572009-12-17 Rafael Avila de Espindola <espindola@google.com>
10958
10959 * Makefile.am (CCFILES): Add timer.cc.
10960 (HFILES): Add timer.h.
10961 * configure.ac: Check for sysconf and times.
10962 * main.cc: include timer.h.
10963 (main): Use Timer instead of get_run_time.
10964 * timer.cc: New.
10965 * timer.h: New.
10966 * workqueue.cc: include timer.h.
10967 (Workqueue::find_and_run_task):
10968 Report user, sys and wall time.
10969 * Makefile.in: Regenerate.
10970 * config.in: Regenerate.
10971 * configure: Regenerate.
10972
d6344fb5
DK
109732009-12-16 Doug Kwan <dougkwan@google.com>
10974
10975 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
10976 sections.
10977 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
10978 relaxed input sections.
10979 * output.cc (Output_section::find_relaxed_input_section): Change
10980 return type to Output_relaxed_input_section pointer. Adjust code
10981 for new type of relaxed_input_section_map_.
10982 * output.h (Output_section::find_relaxed_input_section): Change
10983 return type to Output_relaxed_input_section pointer.
10984 (Output_section::Output_relaxed_input_section_by_input_section_map):
10985 New type.
10986 (Output_section::relaxed_input_section_map_): Change type to
10987 Output_section::Output_relaxed_input_section_by_input_section_map.
10988 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
10989 input section.
10990
0e0d5469
ILT
109912009-12-15 Ian Lance Taylor <iant@google.com>
10992
10993 * layout.cc (Layout::create_shstrtab): Only write out after input
10994 sections if we are compressing debug sections.
10995
0649a889
ILT
109962009-12-15 Ian Lance Taylor <iant@google.com>
10997
10998 * archive.cc (Archive::add_symbols): Only look up a symbol without
10999 a version if there is, in fact, a version.
11000
2ea97941
ILT
110012009-12-14 Ian Lance Taylor <iant@google.com>
11002
11003 Revert -Wshadow changes, all changes from:
11004 2009-12-11 Doug Kwan <dougkwan@google.com>
11005 2009-12-11 Nick Clifton <nickc@redhat.com>
11006 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11007
b0eec2cc
DK
110082009-12-11 Doug Kwan <dougkwan@google.com>
11009
11010 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11011 due to -Wshadow.
11012 * attributes.cc (Object_attribute::size): Ditto.
11013 (Attributes_section_data::size): Ditto.
11014 (Attributes_section_data::Attributes_section_data): Ditto.
11015 (Output_attributes_section_data::do_write): Ditto.
11016 * attributes.h (Object_attribute::set_type): Ditto.
11017 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11018
91d6fa6a
NC
110192009-12-11 Nick Clifton <nickc@redhat.com>
11020
11021 * archive.cc: Fix shadowed variable warnings.
11022 * arm.cc: Likewise.
11023 * compressed_output.cc: Likewise.
11024 * compressed_output.h: Likewise.
11025 * configure: Likewise.
11026 * dwarf_reader.cc: Likewise.
11027 * dynobj.cc: Likewise.
11028 * dynobj.h: Likewise.
11029 * ehframe.cc: Likewise.
11030 * ehframe.h: Likewise.
11031 * errors.cc: Likewise.
11032 * expression.cc: Likewise.
11033 * fileread.cc: Likewise.
11034 * fileread.h: Likewise.
11035 * freebsd.h: Likewise.
11036 * i386.cc: Likewise.
11037 * icf.cc: Likewise.
11038 * incremental.h: Likewise.
11039 * layout.cc: Likewise.
11040 * layout.h: Likewise.
11041 * mapfile.cc: Likewise.
11042 * merge.cc: Likewise.
11043 * merge.h: Likewise.
11044 * object.cc: Likewise.
11045 * object.h: Likewise.
11046 * options.h: Likewise.
11047 * output.cc: Likewise.
11048 * output.h: Likewise.
11049 * parameters.cc: Likewise.
11050 * plugin.cc: Likewise.
11051 * powerpc.cc: Likewise.
11052 * reduced_debug_output.cc: Likewise.
11053 * reduced_debug_output.h: Likewise.
11054 * reloc.cc: Likewise.
11055 * reloc.h: Likewise.
11056 * resolve.cc: Likewise.
11057 * script-sections.cc: Likewise.
11058 * script.cc: Likewise.
11059 * script.h: Likewise.
11060 * sparc.cc: Likewise.
11061 * symtab.cc: Likewise.
11062 * symtab.h: Likewise.
11063 * target-select.cc: Likewise.
11064 * target-select.h: Likewise.
11065 * token.h: Likewise.
11066 * workqueue.cc: Likewise.
11067 * workqueue.h: Likewise.
11068 * x86_64.cc: Likewise.
11069
a0351a69
DK
110702009-12-10 Doug Kwan <dougkwan@google.com>
11071
11072 * arm.cc (attributes.h): New include.
11073 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11074 (Arm_relobj::~Arm_relobj): Delete object pointed by
11075 attributes_section_data_.
11076 (Arm_relobj::attributes_section_data): New method definition.
11077 (Arm_relobj::attributes_section_data_): New data member declaration.
11078 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11079 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11080 attributes_section_data_.
11081 (Arm_dynobj::attributes_section_data): New method definition.
11082 (Arm_dynobj::attributes_section_data_): New data member declaration.
11083 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11084 initialization value of may_use_blx_ to false.
2e702c99 11085 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
11086 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11087 object attributes to compute results instead of hard-coding.
11088 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11089 Target_arm::get_secondary_compatible_arch,
11090 Target_arm::set_secondary_compatible_arch
11091 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11092 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11093 New method declarations.
11094 (Target_arm::get_aeabi_object_attribute): New method definition.
11095 (Target_arm::attributes_section_data_): New data member declaration.
11096 (read_arm_attributes_section): New template definition.
11097 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11098 (Arm_dynobj::do_read_symbols): Ditto.
11099 (Target_arm::do_finalize_sections): Merge attributes sections from
11100 input. Check for BLX use after attributes section merging.
11101 Fix __exidx_start and __exidx_end visibility. Create an
11102 .ARM.attributes section if necessary.
11103 (Target_arm::get_secondary_compatible_arch,
11104 Target_arm::set_secondary_compatible_arch,
11105 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11106 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 11107 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
11108 New method definitions.
11109
b59befec
ILT
111102009-12-09 Ian Lance Taylor <iant@google.com>
11111
11112 * plugin.cc (Plugin::load): Don't cast from void* to a function
11113 pointer.
11114
1276bc89
ILT
111152009-12-09 Ian Lance Taylor <iant@google.com>
11116
11117 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11118 information fields.
11119
2f2de248
L
111202009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11121
11122 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11123 Replace two_file_shared_1.so with two_file_shared_2.so.
11124 * testsuite/Makefile.in: Regenerated.
11125
4f787271
DK
111262009-12-08 Doug Kwan <dougkwan@google.com>
11127
11128 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11129 (HFILES): Add attributes.h and int_encoding.h.
11130 * Makefile.in: Regenerate.
11131 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11132 function definitions to int_encoding.cc
11133 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11134 prototypes to int_encoding.h
11135 * reduced_debug_output.cc (int_encoding.h): New include.
11136 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11137 function definitions to int_encoding.cc
11138 (insert_into_vector, read_from_pointer): Move template definitions to
11139 int_encoding.h
11140 * attributes.cc: New file.
11141 * attributes.h: New file.
11142 * int_encoding.cc: New file.
11143 * int_encoding.h: New file.
11144
20b52f1a
RÁE
111452009-12-07 Rafael Avila de Espindola <espindola@google.com>
11146
11147 PR gold/11055
11148 * incremental-dump.cc (dump_incremental_inputs): New.
11149 (main): Use dump_incremental_inputs.
11150
53d7974c
L
111512009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11152
11153 PR gold/10893
11154 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11155 checking elfcpp::STT_FUNC.
11156 (Target_i386::Relocate::relocate): Likewise.
11157 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11158
11159 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11160 symbols from shared libraries into normal FUNC symbols.
11161
11162 * symtab.h (Symbol): Add is_func and use it.
11163
05a352e6
DK
111642009-12-05 Doug Kwan <dougkwan@google.com>
11165
11166 * arm.cc (Target_arm::arm_info): Initialize new fields
11167 attributes_section and attributes_vendor.
11168 * i386.cc (Target_i386::i386_info): Same.
11169 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11170 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11171 fields attributes_section and attributes_vendor.
53d7974c 11172 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11173 * target.h (Target::attributes_section, Target::attributes_vendor,
11174 Target::is_attributes_section, Target::attribute_arg_type,
11175 Target::attributes_order): New method definitions.
11176 (Target::Target_info::attributes_section,
11177 Target::Target_info::attributes_vendor): New fields.
11178 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11179 virtual method definitions.
11180 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11181 attributes_section and attributes_vendor.
11182 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11183
f4e5969c
DK
111842009-12-05 Doug Kwan <dougkwan@google.com>
11185
11186 * arm.cc: Update comments about interworking and stub generation.
11187 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11188 considered as non-PIC.
11189 (Arm_relocate_functions::base_abs): Fix formatting.
11190 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11191 of function to use GOT entry address instead of offset.
11192 (Target_arm::Scan::global): Issue an error if a symbol would need a
11193 PLT does not get one because it is untyped. Remove code to create
11194 dynamic symbols for relative branches.
11195 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11196 takes unsigned integer instead of boolean.
11197
1abce4a6
L
111982009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11199
11200 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11201 (two_file_test_LDADD): Likewise.
11202 (common_test_1_LDADD): Likewise.
11203 (exception_test_LDADD) Likewise.
11204 (weak_test_LDADD): Likewise.
11205 (many_sections_test_LDADD): Likewise.
11206 (initpri1_LDADD): Likewise.
11207 (script_test_1_LDADD): Likewise.
11208 (script_test_2_LDADD): Likewise.
11209 (justsyms_LDADD): Likewise.
11210 (binary_test_LDADD): Likewise.
11211 (large_LDADD): Likewise.
11212 * testsuite/Makefile.in: Regenerated.
11213
adcf2816 112142009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11215
adcf2816
L
11216 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11217 (Symbol_table::override_with_special): Likewise.
11218 (Symbol_table::add_from_object): Likewise.
11219
28e67f5d
RÁE
112202009-12-04 Rafael Avila de Espindola <espindola@google.com>
11221
11222 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11223 Don't set the data_offset twice.
11224
ae10a101
RÁE
112252009-12-04 Rafael Avila de Espindola <espindola@google.com>
11226
11227 * testsuite/Makefile.in: Regenerate.
11228
f59f41f3
DK
112292009-12-03 Doug Kwan <dougkwan@google.com>
11230
11231 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11232 (Target_arm::do_finalize_sections): Add parameter for symbol table
11233 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11234 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11235 parameter for symbol table pointer.
11236 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11237 an additional parameter for a pointer to symbol table.
11238 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11239 parameter for a symbol table pointer.
11240 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11241 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11242 Ditto.
11243 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11244 parameter for a symbol table pointer.
11245
ca55d848
RÁE
112462009-12-03 Rafael Avila de Espindola <espindola@google.com>
11247
11248 * incremental.cc (Incremental_inputs_header)
11249 (Incremental_inputs_header_write, Incremental_inputs_entry)
11250 (Incremental_inputs_entry_write): Move ...
11251 * incremental.h (Incremental_inputs_header)
11252 (Incremental_inputs_header_write, Incremental_inputs_entry)
11253 (Incremental_inputs_entry_write): here.
11254
3aec4f9c
RÁE
112552009-12-02 Rafael Avila de Espindola <espindola@google.com>
11256
11257 * incremental.cc (make_sized_incremental_binary): Set the target.
11258 Error if it is incompatible.
11259 * output.h (Output_file): Add filename method.
11260
9c0ae74d
RÁE
112612009-12-02 Rafael Avila de Espindola <espindola@google.com>
11262
11263 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11264 from the get_* methods.
11265
a45500ae
RÁE
112662009-12-02 Rafael Avila de Espindola <espindola@google.com>
11267
11268 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11269 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11270 Write 0 for the data_offset of scripts.
11271
325e6408
RÁE
112722009-12-02 Rafael Avila de Espindola <espindola@google.com>
11273
11274 * testsuite/Makefile.am: Add the incremental_test.sh test.
11275 * testsuite/incremental_test.sh: New.
11276 * testsuite/incremental_test_1.c: New.
11277 * testsuite/incremental_test_2.c: New.
11278
954c3e2e
RÁE
112792009-12-01 Rafael Avila de Espindola <espindola@google.com>
11280
703d02da 11281 * incremental-dump.cc (main): Fix typos.
954c3e2e 11282
f8086623
RÁE
112832009-11-27 Rafael Avila de Espindola <espindola@google.com>
11284
11285 PR gold/11025
11286 * incremental-dump.cc (main): Use llu to print 64 bit values.
11287
3b0dd6ac
L
112882009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11289 H.J. Lu <hongjiu.lu@intel.com>
11290
11291 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11292 $(LIBDL).
11293 (incremental_dump_LDADD): Likewise.
11294 * Makefile.in: Regenerated.
11295
a6d1ef57 112962009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11297
a6d1ef57
DK
11298 Revert:
11299
11300 2009-11-25 Doug Kwan <dougkwan@google.com>
11301
11302 * arm.cc (Target_arm::Target_arm): Move method definition
11303 outside of class definition. Add code to handle
11304 --target1-rel, --target1-abs and --target2= options.
11305 (Target_arm::get_reloc_reloc_type): Change method to be
11306 non-static and const.
11307 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11308 New data member declaration.
11309 (Target_arm::Scan::local, Target_arm::Scan::global,
11310 Target_arm::Relocate::relocate,
11311 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11312 Adjust call to Target_arm::get_real_reloc_type.
11313 (Target_arm::get_real_reloc_type): Use command line options
11314 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11315 * options.h (--target1-rel, --target1-abs, --target2): New
11316 ARM-only options.
11317
50aeb7d4
DK
113182009-11-25 Doug Kwan <dougkwan@google.com>
11319
11320 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11321 class definition. Add code to handle --target1-rel, --target1-abs
11322 and --target2= options.
11323 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11324 and const.
11325 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11326 member declaration.
11327 (Target_arm::Scan::local, Target_arm::Scan::global,
11328 Target_arm::Relocate::relocate,
11329 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11330 call to Target_arm::get_real_reloc_type.
11331 (Target_arm::get_real_reloc_type): Use command line options to
11332 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11333 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11334 options.
11335
51938283
DK
113362009-11-25 Doug Kwan <dougkwan@google.com>
11337
11338 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11339 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11340 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11341 formatting.
11342 (Arm_relocate_functions::thm_call): Replace body with a call to
11343 Arm_relocate_functions::thumb_branch_common.
11344 (Arm_relocate_functions::thm_jump24,
11345 Arm_relocate_functions::thm_xpc22): New method definitions.
11346 (Arm_relocate_functions::thumb_branch_common): New method definition.
11347 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11348 operator.
11349 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11350 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11351
e2b8f3c4
RÁE
113522009-11-24 Rafael Avila de Espindola <espindola@google.com>
11353
11354 * Makefile.am: Build incremental-dump
11355 * Makefile.in: Regenerate.
11356 * incremental-dump.cc: New.
11357 * incremental.cc (Incremental_inputs_header_data,
11358 Incremental_inputs_entry_data): Move to incremental.h
11359 * incremental.h: (Incremental_inputs_header_data,
11360 Incremental_inputs_entry_data): Move from incremental.cc
11361
bcba9aec
RÁE
113622009-11-24 Rafael Avila de Espindola <espindola@google.com>
11363
11364 * incremental.cc (Incremental_inputs_header,
11365 Incremental_inputs_header_write, Incremental_inputs_entry,
11366 Incremental_inputs_entry_write): Add a typedef with the data type.
11367
7c3afe08
RÁE
113682009-11-24 Rafael Avila de Espindola <espindola@google.com>
11369
11370 * incremental.cc (Incremental_inputs_header,
11371 Incremental_inputs_header_write, Incremental_inputs_entry,
11372 Incremental_inputs_entry_write): Update comment about which
11373 type has the filed descriptions.
11374
d204b6e9
DK
113752009-11-15 Doug Kwan <dougkwan@google.com>
11376
11377 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11378 (Arm_relocate_functions::arm_branch_common): Change method defintion
11379 in class definition to a method declaration and update list of formal
11380 parameters.
11381 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11382 Arm_relocation_functions::jump24): Adjust call to
11383 Arm_relocate_functions::arm_branch_common. Update list of formal
11384 parameters.
11385 (Arm_relocate_functions::xpc25): New method definition.
11386 (Arm_relocate_functions::arm_branch_common): Move method defintion
11387 out from class definition. Use stubs for mode-switching and extending
11388 branch ranges.
11389 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11390 specially. Change code to enable use of stubs in ARM branches.
11391
43d12afe
DK
113922009-11-10 Doug Kwan <dougkwan@google.com>
11393
11394 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11395 in method declaration.
11396 (Target_arm::relocate_stub): New method declaration.
11397 (Target_arm::default_target): Change to return a pointer instead of
11398 a const reference.
11399 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11400 Target_arm::default_target.
11401 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11402 method definition.
11403 (Target_arm::relocate_section): Adjust view.
11404 (Target_arm::relocate_stub): New method definition.
11405
ac33a407
DK
114062009-11-10 Doug Kwan <dougkwan@google.com>
11407
11408 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11409 a format warning.
11410 * incremental.cc (open_incremental_binary): Initialized local
11411 variables to avoid warnings.
11412 * object.cc (make_elf_object): Ditto.
11413 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11414 a format warning.
e1df38aa 11415
88ee28e9
L
11416009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11417
11418 PR gold/10930
11419 * testsuite/plugin_test.c: Include "config.h".
11420
2daedcd6
DK
114212009-11-09 Doug Kwan <dougkwan@google.com>
11422
11423 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11424 (arm_symbol_value): Remove.
11425 (Arm_relocate_functions::arm_branch_common,
11426 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11427 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11428 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11429 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11430 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11431 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11432 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11433 Arm_relocate_functions::thm_mobw_abs_nc,
11434 Arm_relocate_functions::thm_mov_abs,
11435 Arm_relocate_functions::movw_prel_nc,
11436 Arm_relocate_functions::thm_movt_abs,
11437 Arm_relocate_functions::movt_prel,
11438 Arm_relocate_functions::thm_movw_prel_nc,
11439 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11440 (Target_arm::Relocate::relocate): Only decompose address into two
11441 parts if relocation type uses the thumb-bit and pass the actual
11442 bit instead of a flag indicating that the thumb-bit is used. Adjust
11443 calls to methods in Arm_relocate_functions for this change.
11444
1276bc89 114452009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
11446
11447 PR 10925
11448 * reloc.cc: Instantiate
11449 Sized_relobj::initialize_input_to_output_maps and
11450 Sized_relobj:free_input_to_output_maps.
11451
e53ad1b5
ILT
114522009-11-06 Ian Lance Taylor <iant@google.com>
11453
11454 PR 10876
11455 * defstd.cc (in_segment): Set only_if_ref true for "end".
11456
eb44217c
DK
114572009-11-06 Doug Kwan <dougkwan@google.com>
11458
11459 * arm.cc (class Reloc_stub): Correct a comment.
11460 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11461 (Target_arm::scan_section_for_stubs): New method declaration.
11462 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11463 Change methods from private to protected.
11464 (Target_arm::do_may_relax): New method definition.
11465 (Target_arm::do_relax, Target_arm::group_sections,
11466 Target_arm::scan_reloc_for_stub,
11467 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11468 (Target_arm::arm_input_section_map_): New data member declaration.
11469 (Target_arm::scan_reloc_for_stub,
11470 Target_arm::scan_reloc_section_for_stubs,
11471 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11472 Target_arm::do_relax): New method definitions.
11473
5d329b7d
ILT
114742009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11475
11476 * configure.ac: Check for (struct stat)::st_mtim
11477 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11478 * config.in: Regenerate.
11479 * configure: Regenerate.
11480
96a0d71b
ILT
114812009-11-05 Ian Lance Taylor <iant@google.com>
11482
11483 PR 10910
11484 * output.cc (Output_segment::add_output_section): Add missing
11485 return statement.
11486
594c8e5e
ILT
114872009-11-04 Ian Lance Taylor <iant@google.com>
11488
11489 PR 10880
11490 * object.h (class Object): Add is_needed and set_is_needed
11491 methods. Add is_needed_ field. Make bool fields into bitfields.
11492 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11493 defined in a dynamic object and referenced by a regular object,
11494 set is_needed for the dynamic object.
11495 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11496 if the file is marked with as_needed and it is not needed.
11497
22b127cc
ILT
114982009-11-04 Ian Lance Taylor <iant@google.com>
11499
11500 PR 10887
11501 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11502 tags if data is discarded by linker script.
11503 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11504 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11505 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11506 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11507
f5c870d2
ILT
115082009-11-04 Ian Lance Taylor <iant@google.com>
11509
11510 * layout.cc (Layout::get_output_section): Add is_interp and
11511 is_dynamic_linker_section parameters. Change all callers.
11512 (Layout::choose_output_section): Likewise.
11513 (Layout::make_output_section): Likewise.
11514 (Layout::add_output_section_data): Add is_dynamic_linker_section
11515 parameter. Change all callers.
11516 * layout.h (class Layout): Update declarations.
11517 * output.h (class Output_section): Add is_interp, set_is_interp,
11518 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11519 Add is_interp_, is_dynamic_linker_section_ fields. Change
11520 generate_code_fills_at_write_ to a bitfield.
11521 * output.cc (Output_section::Output_sections): Initialize new
11522 fields.
11523 (Output_segment::add_output_section): Add do_sort parameter.
11524 Change all callers.
11525
1ae4d23b
ILT
115262009-11-03 Ian Lance Taylor <iant@google.com>
11527
11528 PR 10860
11529 * options.h (class General_options): Add --warn-common.
11530 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11531 merging two common symbols.
11532 (Symbol_table::should_override): Handle --warn-common when merging
11533 a common symbol with a defined symbol. Use report_resolve_problem
11534 for multiple definitions.
11535 (Symbol_table::report_resolve_problem): New function.
11536 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11537
55da9579
DK
115382009-11-03 Doug Kwan <dougkwan@google.com>
11539
11540 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11541 stub_factory_.
11542 (Target_arm::stub_factory): New method definition.
11543 (Target_arm::new_arm_input_section,
11544 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11545 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 11546 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
11547 New type definitions.
11548 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11549 member declarations.
11550 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11551 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11552 New method definitions.
11553
37a9ac43
ILT
115542009-11-03 Ian Lance Taylor <iant@google.com>
11555
11556 * options.h (class General_options): Add --warn_constructors.
11557
b3d6a3d4
ILT
115582009-11-03 Ian Lance Taylor <iant@google.com>
11559
11560 PR 10893
11561 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11562 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11563
934b01dd
ILT
115642009-11-03 Ian Lance Taylor <iant@google.com>
11565
11566 PR 10895
11567 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11568 --msgid-bugs-address.
11569 (install-pdf): New target.
11570 (install-data_yes): Look up one directory to find mkinstalldirs.
11571
03c1939b
L
115722009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11573
11574 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11575 tree.
11576
ebd95253
DK
115772009-10-30 Doug Kwan <dougkwan@google.com>
11578
11579 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11580
e9bbb538
DK
115812009-10-30 Doug Kwan <dougkwan@google.com>
11582
11583 * arm.cc (Stub_addend_reader): New struct template definition
11584 and partial specializations.
11585 (Stub_addend_reader::operator()): New method definition for a
11586 partially specialized template.
11587
d5b40221
DK
115882009-10-30 Doug Kwan <dougkwan@google.com>
11589
11590 * arm.cc (Arm_relobj::processor_specific_flags): New method
11591 definition.
11592 (Arm_relobj::do_read_symbols): New method declaration.
11593 (Arm_relobj::processor_specific_flags_): New data member declaration.
11594 (Arm_dynobj): New class definition.
11595 (Target_arm::do_finalize_sections): Add input_objects parameter.
11596 (Target_arm::do_adjust_elf_header): New method declaration.
11597 (Target_arm::are_eabi_versions_compatible,
11598 (Target_arm::merge_processor_specific_flags): New method declaration.
11599 (Target_arm::do_make_elf_object): New overloaded method definitions
11600 and declaration.
11601 (Arm_relobj::do_read_symbols): New method definition.
11602 (Arm_dynobj::do_read_symbols): Ditto.
11603 (Target_arm::do_finalize_sections): Add input_objects parameters.
11604 Merge processor-specific flags from all input objects.
11605 (Target_arm::are_eabi_versions_compatible,
11606 Target_arm::merge_processor_specific_flags,
11607 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11608 New method definitions.
11609 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11610 Input_objects pointer type parameter.
11611 * layout.cc (Layout::finalize): Pass input objects to target's.
11612 finalize_sections function.
11613 * output.cc (Output_file_header::do_sized_write): Set ELF file
11614 header's processor-specific flags.
11615 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11616 Input_objects pointer type parameter.
11617 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11618 * target.h (Input_objects): New forward class declaration.
11619 (Target::processor_specific_flags,
11620 Target::are_processor_specific_flags_sect): New method definitions.
11621 (Target::finalize_sections): Add input_objects parameter.
11622 (Target::Target): Initialize processor_specific_flags_ and
11623 are_processor_specific_flags_set_.
11624 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11625 parameter.
11626 (Target::set_processor_specific_flags): New method definition.
11627 (Target::processor_specific_flags_,
11628 Target::are_processor_specific_flags_set_): New data member
11629 declarations.
11630 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11631 Input_objects pointer type parameter.
11632
ebabffbd
DK
116332009-10-30 Doug Kwan <dougkwan@google.com>
11634
11635 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11636
ad0f2072
ILT
116372009-10-28 Ian Lance Taylor <iant@google.com>
11638
11639 * object.h (class Relobj): Drop options parameter from
11640 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11641 do_scan_relocs, do_relocate. Change all callers.
11642 (class Sized_relobj): Drop options parameters from
11643 do_gc_process_relocs, do_scan_relocs, do_relocate,
11644 do_relocate_sections, relocate_sections, emit_relocs_scan,
11645 emit_relocs_scan_reltype. Change all callers.
11646 (struct Relocate_info): Remove options field and all references to
11647 it.
11648 * reloc.h (class Read_relocs): Remove options constructor
11649 parameter and options_ field. Change all callers.
11650 (class Gc_process_relocs, class Scan_relocs): Likewise.
11651 (class Relocate_task): Likewise.
11652 * target-reloc.h (scan_relocs): Remove options parameter. Change
11653 all callers.
11654 (scan_relocatable_relocs): Likewise.
11655 * target.h (class Sized_target): Remove options parameter from
11656 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11657 all callers.
11658 * gc.h (gc_process_relocs): Remove options parameter. Change all
11659 callers.
11660 * arm.cc: Update functions to remove options parameters.
11661 * i386.cc: Likewise.
11662 * powerpc.cc: Likewise.
11663 * sparc.cc: Likewise.
11664 * x86_64.cc: Likewise.
11665 * testsuite/testfile.cc: Likewise.
11666
8ffa3667
DK
116672009-10-28 Doug Kwan <dougkwan@google.com>
11668
11669 * arm.cc (Arm_relobj): New class definition.
e1df38aa 11670 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
11671 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11672 New method definitions.
11673
40f36857
CC
116742009-10-28 Cary Coutant <ccoutant@google.com>
11675
11676 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11677 (Plugin::cleanup_done_): New member.
11678 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11679 (Plugin_manager::cleanup_done_): Remove.
11680 (Plugin_manager::add_input_file): Edit error message.
11681 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11682 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11683
2c849493
ILT
116842009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11685
11686 * fileread.cc: (File_read::View::~View): Use the new
11687 data_ownership_ filed.
11688 (File_read::~File_read): Dispose the new whole_file_view_.
11689 (File_read::open): Mmap the whole file if needed.
11690 (File_read::open): Use whole_file_view_ instead of contents_.
11691 (File_read::find_view): Use whole_file_view_ if applicable.
11692 (File_read::do_read): Use whole_file_view_ instead of contents_.
11693 (File_read::make_view): Use whole_file_view_ instead of contents_,
11694 update File_read::View::View call.
11695 (File_read::find_or_make_view): Update File_read::View::View
11696 call.
11697 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11698 remove contents_
11699 (File_read::View::Data_ownership): New enum.
11700 (File_read::View::View): Replace bool mapped_ with Data_ownership
11701 argument.
11702 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11703 (File_read::View::data_ownership_): New field.
11704 (File_read::contents_): Remove (replaced by whole_file_view_).
11705 (File_read::whole_file_view_): New field.
11706 * options.h (class General_options): Add --keep-files-mapped.
11707
24998053
CC
117082009-10-27 Cary Coutant <ccoutant@google.com>
11709
11710 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11711 * testsuite/Makefile.am (plugin_test_5): New test case.
11712 * testsuite/Makefile.in: Regenerate.
11713
72adc4fa
DK
117142009-10-25 Doug Kwan <dougkwan@google.com>
11715
11716 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11717 from private to protected to allow access by child class.
11718 (Sized_relobj::do_relocate_sections): New method declaration.
11719 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 11720 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
11721 Sized_relobj::relocate_sections. Instantiate template explicitly
11722 for different target sizes and endianity.
11723
07f508a2
DK
117242009-10-24 Doug Kwan <dougkwan@google.com>
11725
11726 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11727 (Arm_input_section::as_arm_input_section): New method.
11728 (Arm_output_section): New class definition.
11729 (Arm_output_section::create_stub_group,
11730 Arm_output_section::group_sections): New method definitions.
11731
10ad9fe5
DK
117322009-10-22 Doug Kwan <dougkwan@google.com>
11733
11734 * arm.cc (Arm_input_section): New class definition.
11735 (Arm_input_section::init, Arm_input_section:do_write,
11736 Arm_input_section::set_final_data_size,
11737 Arm_input_section::do_reset_address_and_file_offset): New method
11738 definitions.
11739
56ee5e00
DK
117402009-10-21 Doug Kwan <dougkwan@google.com>
11741
11742 * arm.cc (Stub_table, Arm_input_section): New forward class
11743 declarations.
11744 (Stub_table): New class defintion.
11745 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11746 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11747 New method definition.
11748
b569affa
DK
117492009-10-21 Doug Kwan <dougkwan@google.com>
11750
11751 * arm.cc: Update copyright comments.
11752 (Target_arm): New forward class template declaration.
11753 (Arm_address): New type.
11754 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11755 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11756 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11757 constants.
11758 (Insn_template): Same.
11759 (DEF_STUBS): New macro.
11760 (Stub_type): New enum type.
11761 (Stub_template): New class definition.
11762 (Stub): Same.
11763 (Reloc_stub): Same.
11764 (Stub_factory): Same.
11765 (Target_arm::Target_arm): Initialize may_use_blx_ and
11766 should_force_pic_veneer_.
11767 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11768 Target_arm::should_force_pic_veneer,
11769 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11770 Target_arm::using_thumb_only, Target_arm:;default_target): New
11771 method defintions.
11772 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11773 New data member declarations.
11774 (Insn_template::size, Insn_template::alignment): New method defintions.
11775 (Stub_template::Stub_template): New method definition.
11776 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11777 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11778 (Stub_factory::Stub_factory): New method definition.
11779 * gold.h (string_hash): New template.
11780 * output.h (Input_section_specifier::hash_value): Use
11781 gold::string_hash.
11782 (Input_section_specifier::string_hash): Remove.
11783 * stringpool.cc (Stringpool_template::string_hash): Use
11784 gold::string_hash.
11785
6c172549
DK
117862009-10-20 Doug Kwan <dougkwan@google.com>
11787
11788 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11789 symbols of relaxed input sections.
11790 * output.h (Output_section::find_relaxed_input_section): Make
11791 method public.
11792
c5617f2f
DK
117932009-10-16 Doug Kwan <dougkwan@google.com>
11794
11795 * dynobj.cc (Versions::Versions): Initialize version_script_.
11796 Only insert base version symbol definition for a shared object
11797 if version script defines any version versions.
11798 (Versions::define_base_version): New method definition.
11799 (Versions::add_def): Check that base version is not needed.
11800 (Versions::add_need): Define base version lazily.
11801 * dynobj.h (Versions::define_base_version): New method declaration.
11802 (Versions::needs_base_version_): New data member declaration.
11803 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11804 (check_DATA): Add no_version_test.stdout.
11805 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11806 New make rules.
11807 * testsuite/Makefile.in: Regenerate.
11808 * testsuite/no_version_test.c: New file.
11809 * testsuite/no_version_test.sh: Ditto.
11810
3c12dcdb
DK
118112009-10-16 Doug Kwan <dougkwan@google.com>
11812
11813 * expression.cc (class Segment_start_expression): New class definition.
11814 (Segment_start_expression::value): New method definition.
11815 (script_exp_function_segment_start): Return a new
11816 Segment_start_expression.
11817 * gold/script-c.h (script_saw_segment_start_expression): New function
11818 prototype.
11819 * script-sections.cc (Script_sections::Script_sections): Initialize
11820 SAW_SEGMENT_START_EXPRESSION_ to false.
11821 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11822 and -Tbbs options to specify section addresses if given in
11823 command line and no SEGMENT_START expression is seen in a script.
11824 * script-sections.h (Script_sections::saw_segment_start_expression,
11825 Script_sections::set_saw_segment_start_expression): New method
11826 definition.
11827 (Script_sections::saw_segment_start_expression_): New data member
11828 declaration.
11829 * script.cc (script_saw_segment_start_expression): New function.
11830 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11831 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11832 script_test_7.sh and script_test_8.sh.
11833 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11834 script_test_8.stdout.
11835 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11836 (script_test_6, script_test_6.stdout, script_test_7,
11837 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11838 * Makefile.in: Regenerate.
11839 * testsuite/script_test_6.sh: New file.
11840 * testsuite/script_test_6.t: Same.
11841 * testsuite/script_test_7.sh: Same.
11842 * testsuite/script_test_7.t: Same.
11843 * testsuite/script_test_8.sh: Same.
11844
64b1ae37
DK
118452009-10-16 Doug Kwan <dougkwan@google.com>
11846
11847 * output.cc (Output_segment::set_section_list_address): Cast
11848 expressions to unsigned long long type to avoid format warnings.
11849
661be1e2
ILT
118502009-10-15 Ian Lance Taylor <iant@google.com>
11851
12edd763 11852 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 11853 dot assignment to script_sections_.
12edd763
ILT
11854 * script-sections.cc (Script_sections::add_dot_assignment):
11855 Initialize if necessary.
11856
68b6574b
ILT
11857 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11858 program headers with no load segment if there is a linker script.
11859
661be1e2
ILT
11860 * layout.cc (Layout::set_segment_offsets): Align the file offset
11861 to the segment aligment for -N or -n with no load segment.
11862 * output.cc (Output_segment::add_output_section): Don't crash if
11863 the first section is a TLS section.
11864 (Output_segment::set_section_list_addresses): Print an error
11865 message if the address moves backward in a linker script.
11866 * script-sections.cc
11867 (Output_section_element_input::set_section_addresses): Don't
11868 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11869 (Orphan_output_section::set_section_addresses): Likewise.
11870
f15f61a7
DK
118712009-10-15 Doug Kwan <dougkwan@google.com>
11872
11873 * layout.cc (Layout::finish_dynamic_section): Generate tags
11874 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
11875 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
11876 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
11877
82bb573a
ILT
118782009-10-14 Ian Lance Taylor <iant@google.com>
11879
11880 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
11881 fields.
11882 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
11883 data_shdr fields of relinfo.
11884 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
11885 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
11886 R_386_TLS_LDO_32, adjust based on section flags.
11887 (Target_i386::Relocate::fix_up_ldo): Remove.
11888
374ad285
ILT
118892009-10-13 Ian Lance Taylor <iant@google.com>
11890
11891 Add support for -pie.
11892 * options.h (class General_options): Add -pie and
11893 --pic-executable.
11894 (General_options::output_is_position_independent): Test -pie.
11895 (General_options::output_is_executable): Return true if not shared
11896 and not relocatable.
11897 (General_options::output_is_pie): Remove.
11898 * options.cc (General_options::finalize): Reject incompatible uses
11899 of -pie.
11900 * gold.cc (queue_middle_tasks): A -pie link is not static.
11901 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
11902 * symtab.cc (Symbol::final_value_is_known): Return false if
11903 output_is_position_independent.
11904 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
11905 output_is_position_independent.
11906 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
11907 output_is_position_independent.
11908 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
11909 output_is_position_independent.
11910 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
11911 two_file_pie_test.
11912 (basic_pie_test.o, basic_pie_test): New targets.
11913 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
11914 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
11915 (two_file_pie_test): New target.
11916 * testsuite/Makefile.in: Rebuild.
11917 * README: Remove note saying that -pie is not supported.
11918
c6585162
ILT
119192009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
11920
11921 * options.h (class General_options): Add -init and -fini.
11922 * layout.cc (Layout::finish_dynamic_section): Emit
11923 given init and fini functions.
11924
032ce4e9
ST
119252009-10-13 Sriraman Tallam <tmsriram@google.com>
11926
11927 * gc.h (gc_process_relocs): Check if icf is enabled using new
11928 function.
11929 * gold.cc (queue_initial_tasks): Likewise.
11930 (queue_middle_tasks): Likewise.
11931 * object.cc (do_layout): Likewise.
11932 * symtab.cc (is_section_folded): Likewise.
11933 * main.cc (main): Likewise.
11934 * reloc.cc (Read_relocs::run): Likewise.
11935 (Sized_relobj::do_scan_relocs): Likewise.
11936 * icf.cc (is_function_ctor_or_dtor): New function.
11937 (Icf::find_identical_sections): Check if function is ctor or dtor when
11938 safe icf is chosen.
11939 * options.h (General_options::icf): Change option to be an enum.
11940 (Icf_status): New enum.
11941 (icf_enabled): New method.
11942 (icf_safe_folding): New method.
11943 (set_icf_status): New method.
11944 (icf_status_): New variable.
11945 * (options.cc) (General_options::finalize): Set icf_status_.
11946 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
11947 icf_test and icf_keep_unique_test to use the --icf enum flag.
11948 * testsuite/icf_safe_test.sh: New file.
e1df38aa 11949 * testsuite/icf_safe_test.cc: New file.
032ce4e9 11950
f345227a
ST
119512009-10-12 Sriraman Tallam <tmsriram@google.com>
11952
11953 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
11954 includes to gc.h and icf.h.
11955 * arm.cc: Include gc.h.
11956 * gold.cc: Likewise.
11957 * i386.cc: Likewise.
11958 * powerpc.cc: Likewise.
11959 * sparc.cc: Likewise.
11960 * x86_64.cc: Likewise.
11961 * gc.h: Include icf.h.
11962
1c7814ed
ILT
119632009-10-11 Ian Lance Taylor <iant@google.com>
11964
11965 * plugin.cc: Include "gold.h" before other header files.
11966
ae3b5189
CD
119672009-10-10 Chris Demetriou <cgd@google.com>
11968
11969 * options.h (Input_file_argument::Input_file_type): New enum.
11970 (Input_file_argument::is_lib_): Replace with...
11971 (Input_file_argument::type_): New member.
11972 (Input_file_argument::Input_file_argument): Take Input_file_type
11973 'type' rather than boolean 'is_lib' as second argument.
11974 (Input_file_argument::is_lib): Use type_.
11975 (Input_file_argument::is_searched_file): New function.
11976 (Input_file_argument::may_need_search): Handle is_searched_file.
11977 * options.cc (General_options::parse_library): Support -l:filename.
11978 (General_options::parse_just_symbols): Update for Input_file_argument
11979 changes.
11980 (Command_line::process): Likewise.
11981 * archive.cc (Archive::get_file_and_offset): Likewise.
11982 * plugin.cc (Plugin_manager::release_input_file): Likewise.
11983 * script.cc (read_script_file, script_add_file): Likewise.
11984 * fileread.cc (Input_file::Input_file): Likewise.
11985 (Input_file::will_search_for): Handle is_searched_file.
11986 (Input_file::open): Likewise.
11987 * readsyms.cc (Read_symbols::get_name): Likewise.
11988 * testsuite/Makefile.am (searched_file_test): New test.
11989 * testsuite/Makefile.in: Regenerate.
11990 * testsuite/searched_file_test.cc: New file.
11991 * testsuite/searched_file_test_lib.cc: New file.
11992
f3048a1d
ILT
119932009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11994 Ian Lance Taylor <iant@google.com>
11995
11996 * descriptor.cc: Include <cstdio> and "binary-io.h".
11997 (Descriptors::open): Open the files in binary mode always.
11998 * script.cc (Lex::get_token): Treat \r as whitespace.
11999
d4780e57
ILT
120002009-10-09 Ian Lance Taylor <iant@google.com>
12001
12002 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12003
d9a893b8
ILT
120042009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12005 Ian Lance Taylor <iant@google.com>
12006
12007 * configure.ac: Check for readv function also.
12008 * fileread.cc (readv): Define if not HAVE_READV.
12009 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12010 does not exist.
12011 * config.in: Regenerate.
12012 * configure: Regenerate.
12013
c0a62865
DK
120142009-10-09 Doug Kwan <dougkwan@google.com>
12015
12016 * layout.cc (Layout::make_output_section): Call target hook to make
12017 ordinary output section.
12018 (Layout::finalize): Adjust parameter list of call the
12019 Target::may_relax().
12020 * layout.h (class Layout::section_list): New method.
12021 * merge.h (Output_merge_base::entsize): Change visibility to public.
12022 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12023 New methods.
12024 (Output_merge_string::do_is_string): New method.
12025 * object.cc (Sized_relobj::do_setup): renamed from
12026 Sized_relobj::set_up.
12027 * object.h (Sized_relobj::adjust_shndx,
12028 Sized_relobj::initializ_input_to_output_maps,
12029 Sized_relobj::free_input_to_output_maps): Change visibilities to
12030 protected.
12031 (Sized_relobj::setup): Virtualize.
12032 (Sized_relobj::do_setup): New method declaration.
12033 (Sized_relobj::invalidate_section_offset,
12034 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12035 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12036 * options.cc (parse_int): New function.
12037 * options.h (parse_int): New declaration.
12038 (DEFINE_int): New macro.
12039 (stub_group_size): New option.
12040 * output.cc (Output_section::Output_section): Initialize memebers
12041 merge_section_map_, merge_section_by_properties_map_,
12042 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12043 (Output_section::add_input_section): Handled deferred code-fill
12044 generation and remove an old comment.
12045 (Output_section::add_relaxed_input_section): New method definition.
12046 (Output_section::add_merge_input_section): Use merge section by
12047 properties map to speed to search. Update merge section maps
12048 as appropriate.
12049 (Output_section::build_relaxation_map): New method definition.
12050 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12051 Same.
12052 (Output_section::relax_input_section): Renamed to
12053 Output_section::convert_input_sections_to_relaxed_sections and change
12054 interface to take a vector of pointers to relaxed sections.
12055 (Output_section::find_merge_section,
12056 Output_section::find_relaxed_input_section): New method definitions.
12057 (Output_section::is_input_address_mapped,
12058 Output_section::output_offset, Output_section::output_address):
12059 Use output section data maps to speed up searching.
12060 (Output_section::find_starting_output_address): Add comments.
12061 (Output_section::do_write,
12062 Output_section::write_to_postprocessing_buffer): Do code-fill
12063 generation as appropriate.
12064 (Output_section::get_input_sections): Invalidate relaxed input section
12065 map.
12066 (Output_section::restore_states): Adjust type of checkpoint .
12067 Invalidate relaxed input section map.
12068 * output.h (Output_merge_base): New class declaration.
12069 (Input_section_specifier): New class defintion.
12070 (class Output_relaxed_input_section) Change base class to
12071 Output_section_data_build.
12072 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12073 base class initializer.
12074 (Output_section::add_relaxed_input_section): New method declaration.
12075 (Output_section::Input_section): Change visibility to protected.
2e702c99 12076 (Output_section::Input_section::relobj,
c0a62865
DK
12077 Output_section::Input_section::shndx): Handle relaxed input sections.
12078 Output_section::input_sections) Change visibility to protected. Also
12079 define overload to return a non-const pointer.
12080 (Output_section::Merge_section_properties): New class defintion.
12081 (Output_section::Merge_section_by_properties_map,
12082 Output_section::Output_section_data_by_input_section_map,
12083 Output_section::Relaxation_map): New types.
12084 (Output_section::relax_input_section): Rename method to
12085 Output_section::convert_input_sections_to_relaxed_sections and change
12086 interface to take a vector of relaxed section pointers.
12087 (Output_section::find_merge_section,
12088 Output_section::find_relaxed_input_section,
12089 Output_section::build_relaxation_map,
12090 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12091 New method declarations.
12092 (Output_section::merge_section_map_
12093 Output_section::merge_section_by_properties_map_,
12094 Output_section::relaxed_input_section_map_,
12095 Output_section::is_relaxed_input_section_map_valid_,
12096 Output_section::generate_code_fills_at_write_): New data members.
12097 * script-sections.cc
12098 (Output_section_element_input::set_section_addresses): Call
12099 current_data_size and addralign methods of relaxed input sections.
12100 (Orphan_output_section::set_section_addresses): Call current_data_size
12101 and addralign methods of relaxed input sections.
12102 * symtab.cc (Symbol_table::compute_final_value): Extract template
12103 from the body of Symbol_table::sized_finalize_symbol.
12104 (Symbol_table::sized_finalized_symbol): Call
12105 Symbol_table::compute_final_value.
12106 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12107 (Symbol_table::compute_final_value): New templated method declaration.
12108 * target.cc (Target::do_make_output_section): New method defintion.
12109 * target.h (Target::make_output_section): New method declaration.
12110 (Target::relax): Add more parameters for input objects, symbol table
12111 and layout. Adjust call to do_relax.
12112 (Target::do_make_output_section): New method declaration.
12113 (Target::do_relax): Add parameters for input objects, symbol table
12114 and layout.
12115
d446d6c4
ILT
121162009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12117
12118 * pread.c: Include stdio.h.
12119
bc06c745
ILT
121202009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12121
12122 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12123 defined.
12124
75aea3d0
ILT
121252009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12126
12127 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12128 Change read_shndx type to unsigned int.
12129 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12130 int.
12131 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12132 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12133 Change read_shndx type to unsigned int.
12134 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12135 int.
12136 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12137 * layout.cc (Layout::create_symtab_sections): Cast the result of
12138 local_symcount * symsize to off_t in the gold_assert.
12139
be8fcb75
ILT
121402009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12141
12142 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12143 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12144 R_ARM_BASE_ABS.
12145 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12146 (Arm_relocate_functions::thm_abs5): New function.
12147 (Arm_relocate_functions::abs12): New function.
12148 (Arm_relocate_functions::abs16): New function.
12149 (Arm_relocate_functions::base_abs): New function.
12150 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12151 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12152 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12153 R_ARM_BASE_ABS.
12154 (Scan::global): Likewise.
12155 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12156 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12157 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12158 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12159 R_ARM_BASE_ABS.
12160
c2a122b6
ILT
121612009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12162
12163 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12164 (Arm_relocate_functions::movt_prel): New function.
12165 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12166 (Arm_relocate_functions::thm_movt_prel): New function.
12167 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12168 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12169 (Scan::global, Relocate::relocate): Likewise.
12170 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12171
c4aa1e2d
ILT
121722009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12173
12174 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12175 Incremental_checker.
12176 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12177 unsigned int.
12178 (class Incremental_inputs_header): New class.
12179 (Incremental_inputs_header_writer): Edit comment.
12180 (Incremental_inputs_entry): New class.
12181 (Incremental_inputs_entry_writer): Edit comment.
12182 (Sized_incremental_binary::do_find_incremental_inputs_section):
12183 Add *strtab_shndx parameter, fill it.
12184 (Sized_incremental_binary::do_check_inputs): New method.
12185 (Incremental_checker::can_incrementally_link_output_file): Use
12186 Sized_incremental_binary::check_inputs.
12187 (Incremental_inputs::report_command_line): Save command line in
12188 command_line_.
12189 * incremental.h:
12190 (Incremental_binary::find_incremental_inputs_section): New
12191 method.
12192 (Incremental_binary::do_find_incremental_inputs_section): Add
12193 strtab_shndx parameter.
12194 (Incremental_binary::do_check_inputs): New pure virtual method.
12195 (Sized_incremental_binary::do_check_inputs): Declare.
12196 (Incremental_checker::Incremental_checker): Add incremental_inputs
12197 parameter, use it to initialize incremental_inputs_.
12198 (Incremental_checker::incremental_inputs_): New field.
12199 (Incremental_checker::command_line): New method.
12200 (Incremental_checker::inputs): New method.
12201 (Incremental_checker::command_line_): New field.
12202
c549a694
ILT
122032009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12204
12205 * incremental.cc: Include <cstdarg> and "target-select.h".
12206 (vexplain_no_incremental): New function.
12207 (explain_no_incremental): New function.
12208 (Incremental_binary::error): New method.
12209 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12210 method.
12211 (make_sized_incremental_binary): New function.
12212 (open_incremental_binary): New function.
12213 (can_incrementally_link_file): Add checks if output is ELF and has
12214 inputs section.
12215 * incremental.h: Include "elfcpp_file.h" and "output.h".
12216 (Incremental_binary): New class.
12217 (Sized_incremental_binary): New class.
12218 (open_incremental_binary): Declare.
12219 * object.cc (is_elf_object): Use
12220 elfcpp::Elf_recognizer::is_elf_file.
12221 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12222 * output.h (Output_file::filesize): New method.
12223
fd3c5f0b
ILT
122242009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12225
12226 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12227 New function.
12228 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12229 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12230 function.
12231 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12232 function.
12233 (Arm_relocate_functions::movw_abs_nc): New function.
12234 (Arm_relocate_functions::movt_abs): New function.
12235 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12236 (Arm_relocate_functions::thm_movt_abs): New function.
12237 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12238 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12239 (Scan::global): Likewise.
12240 (Relocate::relocate): Likewise.
12241 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12242
7f5309a5
ILT
122432009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12244
12245 * arm.cc (Arm_relocate_functions::got_prel) New function.
12246 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12247 (Relocate::relocate): Likewise.
12248 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12249
364c7fa5
ILT
122502009-10-06 Ian Lance Taylor <iant@google.com>
12251
12252 * options.h (class General_options): Define
12253 split_stack_adjust_size parameter.
12254 * object.h (class Object): Add uses_split_stack_ and
12255 has_no_split_stack_ fields. Add uses_split_stack and
12256 has_no_split_stack accessor functions. Declare
12257 handle_split_stack_section.
12258 (class Reloc_symbol_changes): Define.
12259 (class Sized_relobj): Define Function_offsets. Declare
12260 split_stack_adjust, split_stack_adjust_reltype, and
12261 find_functions.
12262 * object.cc (Object::handle_split_stack_section): New function.
12263 (Sized_relobj::do_layout): Call handle_split_stack_section.
12264 * dynobj.cc (Sized_dynobj::do_layout): Call
12265 handle_split_stack_section.
12266 * reloc.cc (Sized_relobj::relocate_sections): Call
12267 split_stack_adjust for executable sections in split_stack
12268 objects. Pass reloc_map to relocate_section.
12269 (Sized_relobj::split_stack_adjust): New function.
12270 (Sized_relobj::split_stack_adjust_reltype): New function.
12271 (Sized_relobj::find_functions): New function.
12272 * target-reloc.h: Include "object.h".
12273 (relocate_section): Add reloc_symbol_changes parameter. Change
12274 all callers.
12275 * target.h (class Target): Add calls_non_split method. Declare
12276 do_calls_non_split virtual method. Declare match_view and
12277 set_view_to_nop.
12278 * target.cc: Include "elfcpp.h".
12279 (Target::do_calls_non_split): New function.
12280 (Target::match_view): New function.
12281 (Target::set_view_to_nop): New function.
12282 * gold.cc (queue_middle_tasks): Give an error if mixing
12283 split-stack and non-split-stack objects with -r.
12284 * i386.cc (Target_i386::relocate_section): Add
12285 reloc_symbol_changes parameter.
12286 (Target_i386::do_calls_non_split): New function.
12287 * x86_64.cc (Target_x86_64::relocate_section): Add
12288 reloc_symbol_changes parameter.
12289 (Target_x86_64::do_calls_non_split): New function.
12290 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12291 parameter.
12292 * powerpc.cc (Target_powerpc::relocate_section): Add
12293 reloc_symbol_changes parameter.
12294 * sparc.cc (Target_sparc::relocate_section): Add
12295 reloc_symbol_changes parameter.
12296 * configure.ac: Call AM_CONDITIONAL for the default target.
12297 * configure: Rebuild.
12298 * testsuite/Makefile.am (TEST_AS): New variable.
12299 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12300 (check_DATA): Add split_i386 and split_x86_64 files.
12301 (SPLIT_DEFSYMS): Define.
12302 (split_i386_[1234n].o): New targets.
12303 (split_i386_[124]): New targets.
12304 (split_i386_[1234r].stdout): New targets.
12305 (split_x86_64_[1234n].o): New targets.
12306 (split_x86_64_[124]): New targets.
12307 (split_x86_64_[1234r].stdout): New targets.
12308 (MOSTLYCLEANFILES): Add new executables.
12309 * testsuite/split_i386.sh: New file.
12310 * testsuite/split_x86_64.sh: New file.
12311 * testsuite/split_i386_1.s: New file.
12312 * testsuite/split_i386_2.s: New file.
12313 * testsuite/split_i386_3.s: New file.
12314 * testsuite/split_i386_4.s: New file.
12315 * testsuite/split_i386_n.s: New file.
12316 * testsuite/split_x86_64_1.s: New file.
12317 * testsuite/split_x86_64_2.s: New file.
12318 * testsuite/split_x86_64_3.s: New file.
12319 * testsuite/split_x86_64_4.s: New file.
12320 * testsuite/split_x86_64_n.s: New file.
12321 * testsuite/testfile.cc (Target_test): Update relocation_section
12322 function.
12323 * testsuite/Makefile.in: Rebuild.
12324
e8a9fcda
ILT
123252009-10-06 Ian Lance Taylor <iant@google.com>
12326
12327 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12328 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12329 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12330 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12331 the address on ldo_addrs_.
12332 (Target_i386::Relocate::fix_up_ldo): New function.
12333
e99daf92
ILT
123342009-10-06 Rafael Espindola <espindola@google.com>
12335
12336 * plugin.cc (add_input_library): New.
12337 (Plugin::load): Add add_input_library to tv.
12338 (Plugin_manager::add_input_file): Add the is_lib argument.
12339 (add_input_file): Update call to Plugin_manager::add_input_file.
12340 (add_input_library): New.
12341 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12342
966d4097
DK
123432009-09-30 Doug Kwan <dougkwan@google.com>
12344
12345 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12346 symbol and call Symbol::may_need_copy_reloc to determine if
12347 a copy reloc is needed.
12348 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12349 nocopyreloc is given in command line.
12350 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12351 given in command line.
12352 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12353 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12354 of the removed Target_i386::may_need_copy_reloc.
12355 * options.h (copyreloc): New option with default value false.
12356 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12357 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12358 instead of the removed Target_powerpc::may_need_copy_reloc.
12359 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12360 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12361 instead of the removed Target_sparc::may_need_copy_reloc.
12362 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12363 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12364 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12365 instead of the removed Target_x86_64::may_need_copy_reloc.
12366
029ba973
ILT
123672009-09-30 Ian Lance Taylor <iant@google.com>
12368
12369 * object.h (class Object): Remove target_ field, and target,
12370 sized_target, and set_target methods.
12371 (Object::sized_target): Remove.
12372 (class Sized_relobj): Update declarations. Remove sized_target.
12373 * object.cc (Sized_relobj::setup): Remove target parameter.
12374 Change all callers.
12375 (Input_objects::add_object): Don't do anything with the target.
12376 (make_elf_sized_object): Add punconfigured parameter. Change all
12377 callers. Set or test parameter target.
12378 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12379 Change all callers.
12380 * parameters.cc (Parameters::set_target): Change parameter type to
12381 be non-const.
12382 (Parameters::default_target): Remove.
12383 (set_parameters_target): Change parameter type to be non-const.
12384 (parameters_force_valid_target): New function.
12385 (parameters_clear_target): New function.
12386 * parameters.h (class Parameters): Update declarations. Remove
12387 default_target method. Add sized_target and clear_target
12388 methods. Change target_ to be non-const.
12389 (set_parameters_target): Update declaration.
12390 (parameters_force_valid_target): Declare.
12391 (parameters_clear_target): Declare.
12392 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12393 as NULL if we aren't searching.
12394 (Add_symbols::run): Don't check for compatible target.
12395 * fileread.cc (Input_file::open_binary): Call
12396 parameters_force_valid_target.
12397 * gold.cc (queue_middle_tasks): Likewise.
12398 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12399 set_target on object.
12400 * dynobj.h (class Sized_dynobj): Update declarations.
12401 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12402 make_elf_object returns NULL.
12403 (Archive::include_member): Don't check whether object target is
12404 compatible.
12405 * output.cc (Output_section::add_input_section): Get target from
12406 parameters.
12407 (Output_section::relax_input_section): Likewise.
12408 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12409 parameters.
12410 (Sized_relobj::do_scan_relocs): Likewise.
12411 (Sized_relobj::relocate_sections): Likewise.
12412 * resolve.cc (Symbol_table::resolve): Likewise.
12413 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12414 parameter. Change all callers.
12415 (Symbol_table::add_from_object): Get target from parameters.
12416 (Symbol_table::add_from_relobj): Don't check object target.
12417 (Symbol_table::add_from_dynobj): Likewise.
12418 (Symbol_table::define_special_symbol): Get target from
12419 parameters.
12420 * symtab.h (class Symbol_table): Update declaration.
12421 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12422 parameter. Change all callers. Clear parameter target.
12423 (Binary_test): Test target here.
12424 * testsuite/object_unittest.cc (gold_testsuite): Remove
12425 target_test_pointer parameter. Change all callers.
12426 (Object_test): Test target here.
12427
a6a22b83
ILT
124282009-09-26 Ian Lance Taylor <iant@google.com>
12429
12430 * testsuite/initpri1.c: Don't try to use constructor priorities if
12431 compiling with gcc before 4.3.
12432
6a8f49fe
ILT
124332009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12434
12435 * testsuite/retain_symbols_file_test.sh (check_present): Change
12436 output file name to retain_symbols_file_test.stdout.
12437 (check_absent): Likewise.
12438
8c604651
CS
124392009-09-18 Craig Silverstein <csilvers@google.com>
12440
12441 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12442 * options.cc: Include <cerrno> and <fstream>.
12443 (General_options::finalize): Parse -retain-symbols-file tag.
12444 * options.h: New flag.
12445 (General_options): New method should_retain_symbol, new
12446 variable symbols_to_retain.
12447 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12448 should_retain_symbol map.
12449 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12450 * testsuite/Makefile.in: Regenerate.
12451 * testsuite/retain_symbols_file_test.sh: New file.
12452
ca58b19f
NC
124532009-09-18 Nick Clifton <nickc@redhat.com>
12454
12455 * po/es.po: Updated Spanish translation.
12456
20e6d0d6
DK
124572009-09-17 Doug Kwan <dougkwan@google.com>
12458
12459 * debug.h (DEBUG_RELAXATION): New constant.
12460 (DEBUG_ALL): Add DEBUG_RELAXATION.
12461 (debug_string_to_enum): Add relaxation debug option.
12462 * layout.cc
12463 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12464 Layout::Relaxation_debug_check::read_sections,
12465 Layout::Relaxation_debug_check::read_sections): New method definitions.
12466 (Layout::Layout): Initialize data members
12467 record_output_section_data_from_scrips_,
12468 script_output_section_data_list_ and relaxation_debug_check_.
12469 (Layout::save_segments, Layout::restore_segments,
12470 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12471 Layout::relaxation_loop_body): New method definitions.
12472 (Layout::finalize): Support relaxation. Move section layout code to
12473 Layout::relaxation_loop_body.
12474 (Layout::set_asection_address_from_script): Move code for orphan
12475 section placement out.
12476 (Layout::place_orphan_sections_in_script): New method definition.
12477 * layout.h (Output_segment_headers, Output_file_header):
12478 New forward class declarations.
12479 (Layout::~Layout): Define.
12480 (Layout::new_output_section_data_from_script): New method definition.
12481 (Layout::place_orphan_sections_in_script): New method declaration.
12482 (Layout::Segment_states): New type declaration.
12483 (Layout::save_segments, Layout::restore_segments,
12484 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12485 Layout::relaxation_loop_body): New method declarations.
12486 (Layout::Output_section_data_list): New type declaration.
12487 (Layout::Relaxation_debug_check): New class definition.
12488 (Layout::record_output_section_data_from_script_,
12489 Layout::script_output_section_data_list_, Layout::segment_states_,
12490 Layout::relaxation_debug_check_): New data members.
12491 * output.cc: (Output_section_headers::do_size): New method definition.
12492 (Output_section_headers::Output_section_headers): Move size
12493 computation to Output_section_headers::do_size.
12494 (Output_segment_headers::do_size): New method definition.
e1df38aa 12495 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
12496 Output_file_header::do_size and call it.
12497 (Output_file_header::do_size): New method definition.
12498 (Output_data_group::Output_data_group): Adjust call to
12499 Output_section_data.
12500 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12501 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 12502 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
12503 RELAXED_INPUT_SECTION_CODE.
12504 (Output_section::Output_section): Initialize data member checkpoint_.
12505 (Output_section::~Output_section): Delete checkpoint object pointed
12506 by checkpoint_.
12507 (Output_section::add_input_section): Always add an Input_section if
12508 relaxing.
12509 (Output_section::add_merge_input_section): Add assert.
12510 (Output_section::relax_input_section): New method definition.
12511 (Output_section::set_final_data_size): Set load address to zero for
12512 an unallocated section.
12513 (Output_section::do_address_and_file_offset_have_reset_values):
12514 New method definition.
12515 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12516 Handle relaxed input section.
12517 (Output_section::sort_attached_input_sections): Checkpoint input
12518 section list lazily.
12519 (Output_section::get_input_sections): Change type of input_sections to
12520 list of Simple_input_section pointers. Checkpoint input section list
12521 lazily. Also handle relaxed input sections.
12522 (Output_section::add_input_section_for_script): Take a reference to
12523 a Simple_input_section object instead of Relobj pointer and section
12524 index as parameter. Handle relaxed input sections.
12525 (Output_section::save_states, Output_section::restore_states): New
12526 method definitions.
12527 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12528 (Output_data::is_data_size_fixed): New method definition.
12529 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12530 if it is fixed.
12531 (Output_data::address_and_file_offset_have_reset_values): New method
12532 definition.
12533 (Output_data::do_address_and_file_offset_have_reset_values): New method
12534 definition.
12535 (Output_data::set_data_size): Check that data size is not fixed.
12536 (Output_data::fix_data_size): New method definition.
12537 (Output_data::is_data_size_fixed_): New data member.
12538 (Output_section_headers::set_final_data_size): New method definition.
12539 (Output_section_headers::do_size): New method declaration.
12540 (Output_segment_headers::set_final_data_size): New method definition.
12541 (Output_segment_headers::do_size): New method declaration.
12542 (Output_file_header::set_final_data_size)::New method definition.
12543 (Output_file_header::do_size)::New method declaration.
12544 (Output_section_data::Output_section_data): Add new parameter
12545 is_data_size_fixed and use it to fix data size.
12546 (Output_data_const::Output_data_const): Adjust call to base class
12547 constructor and fix data size.
12548 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12549 base class constructor and fix data size.
12550 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12551 base class constructor and fix data size.
12552 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12553 class constructor and fix data size.
12554 (Output_data_group::set_final_data_size): New method definition.
12555 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12556 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12557 class constructor and fix data size.
12558 (Output_relaxed_input_section): New class definition.
12559 (Output_section::Simple_input_section): New class definition.
12560 (Output_section::get_input_sections): Adjust parameter list.
12561 (Output_section::add_input_section_for_script): Same.
12562 (Output_section::save_states, Output_section::restore_states,
12563 Output_section::do_address_and_file_offset_have_reset_values,
12564 (Output_section::Input_section::Input_section): Handle
12565 RELAXED_INPUT_SECTION_CODE. Add new overload for
12566 Output_relaxed_input_section.
12567 (Output_section::Input_section::is_input_section,
12568 Output_section::Input_section::set_output_section): Handle relaxed
12569 input section.
12570 (Output_section::Input_section::is_relaxed_input_section,
12571 Output_section::Input_section::output_section_data,
12572 Output_section::Input_section::relaxed_input_section): New method
12573 definitions.
12574 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12575 value.
12576 (Output_section::Input_section::u1_): Update comments.
12577 (Output_section::Input_section::u2_): Add new union member poris.
12578 (Output_section::Checkpoint_output_section): New classs definition.
12579 (Output_section::relax_input_section): New method declaration.
12580 (Output_section::checkpoint_): New data member.
12581 (Output_segment): Update comments.
12582 (Output_segment::Output_segment): Un-privatize copy constructor.
12583 (Output_segment::operator=): Un-privatize.
12584 * script-sections.cc (Output_section_element::Input_section_list):
12585 Change element type to Output_section::Simple_input_section.
12586 (Output_section_element_dot_assignment::set_section_addresses):
12587 Register output section data for relaxation clean up.
12588 (Output_data_exression::Output_data_expression): Adjust call to base
12589 constructor to fix data size.
12590 (Output_section_element_data::set_section_addresses): Register
12591 Output_data_expression object for relaxation clean up.
12592 (struct Input_section_info): Replace Relobj pointer and section index
12593 pair with Output_section::Simple_input_section and Convert struct to a
12594 class.
12595 (Input_section_sorter::operator()): Adjust access to
e1df38aa 12596 Input_section_info data member to use accessors.
20e6d0d6
DK
12597 (Output_section_element_input::set_section_addresses): Use layout
12598 parameter. Adjust code to use Output_section::Simple_input_section
12599 and Input_secction_info classes. Register filler for relaxation
12600 clean up.
12601 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12602 and section index pair with Output_section::Simple_input_section
12603 class. Adjust code accordingly.
12604 (Phdrs_element::release_segment): New method definition.
12605 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12606 segment list.
12607 (Script_sections::release_segments): New method definition.
12608 * gold/script-sections.h (Script_sections::release_segments): New
12609 method declaration.
12610 * gold/target.h (Target::may_relax, Target::relax,
12611 Target::do_may_relax, Target::do_relax): New method definitions.
12612
5e445df6
ILT
126132009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12614
12615 * arm.cc (has_signed_unsigned_overflow): New function.
12616 (Arm_relocate_functions::abs8): New function.
12617 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12618 (Target_arm::Scan::global): Likewise.
12619 (Target_arm::relocate::relocate): Likewise.
12620 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12621 Likewise.
12622
8c604651 126232009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
12624
12625 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12626 * testsuite/Makefile.in: Regenerate.
12627
1e9cc1c2
NC
126282009-09-11 Nick Clifton <nickc@redhat.com>
12629
12630 * po/gold.pot: Updated by the Translation project.
12631
6a89f575
CC
126322009-09-08 Cary Coutant <ccoutant@google.com>
12633
12634 * output.cc (Output_file::open): Add execute permission to empty file.
12635 * testsuite/Makefile.am (permission_test): New test.
12636 * testsuite/Makefile.in: Regenerate.
12637
fdcac5af
ILT
126382009-09-02 Ian Lance Taylor <iant@google.com>
12639
12640 * output.cc (Output_file::resize): Call map_no_anonymous rather
12641 than map.
12642
44453f85
ILT
126432009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12644
12645 * gold.cc: Include "incremental.h".
12646 (queue_initial_tasks): Call Incremental_checker methods.
12647 * incremental.cc: Include "output.h".
12648 (Incremental_checker::can_incrementally_link_output_file): New
12649 method.
12650 * incremental.h (Incremental_checker): New class.
12651
12652 * output.cc (Output_file::open_for_modification): New method.
12653 (Output_file::map_anonymous): Changed return type to bool. Record
12654 map in base_ field.
12655 (Output_file::map_no_anonymous): New method, broken out of map.
12656 (Output_file::map): Use map_no_anonymous and map_anonymous.
12657 * output.h (class Output_file): Update declarations.
12658
293c1386
CC
126592009-08-24 Cary Coutant <ccoutant@google.com>
12660
12661 * options.h (Command_line::Pre_options): New class.
12662 (Command_line::pre_options): New member.
12663 * options.cc (gold::options::ready_to_register): New variable.
12664 (One_option::register_option): Do nothing if not registering options.
12665 Assert if same short option registered twice.
12666 (General_options::General_options): Turn off option registration when
12667 done constructing.
12668 (Command_line::Pre_options::Pre_options): New constructor.
12669
f773f3d2
CC
126702009-08-24 Cary Coutant <ccoutant@google.com>
12671
06a73cfe
CC
12672 * options.h (General_options::no_keep_memory): Remove incorrect
12673 short option.
f773f3d2 12674
a15af8e2
RW
126752009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12676
12677 * Makefile.am (am__skiplex, am__skipyacc): New.
12678 * Makefile.in: Regenerate.
12679
c462b41b
RW
126802009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12681
14ec8efd
RW
12682 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12683 (INCLUDES): ... this.
12684 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12685 (AM_CPPFLAGS): Renamed from ...
12686 (INCLUDE): ... this.
12687 * Makefile.in, testsuite/Makefile.in: Regenerate.
12688
81ecdfbb
RW
12689 * Makefile.in: Regenerate.
12690 * aclocal.m4: Likewise.
12691 * config.in: Likewise.
12692 * configure: Likewise.
12693 * testsuite/Makefile.in: Likewise.
12694
c462b41b
RW
12695 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12696 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12697 * Makefile.in: Regenerate.
12698 * testsuite/Makefile.in: Regenerate.
12699
2da73f13
CC
127002009-08-19 Cary Coutant <ccoutant@google.com>
12701
12702 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12703 symbols in shared libraries overridden by hidden or internal symbols
12704 in the main program.
12705
2db70501
CD
127062009-08-19 Chris Demetriou <cgd@google.com>
12707
12708 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12709 checking source file names in error messages.
12710
f733487b
DK
127112009-08-18 Doug Kwan <dougkwan@google.com>
12712
12713 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12714 an elcpp::Ehdr as parameter. Adjust call to set_target.
12715 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12716 an elfcpp::Ehdr as parameter.
12717 * object.cc (Object::set_target): Remove the version that looks up
12718 a target and sets it.
12719 (Sized_relobj::setup): Take a Target object instead of
12720 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12721 (make_elf_sized_object): Find target and ask target to
12722 make an ELF object.
12723 * object.h: (Object::set_target): Remove the version that looks up
12724 a target and sets it.
12725 (Sized_relobj::setup): Take a Target object instead of
12726 an elfcpp:Ehdr as parameter.
12727 * target.cc: Include dynobj.h.
12728 (Target::do_make_elf_object_implementation): New.
2e702c99 12729 (Target::do_make_elf_object): New.
f733487b
DK
12730 * target.h (Target::make_elf_object): New template declaration.
12731 (Target::do_make_elf_object): New method declarations.
12732 (Target::do_make_elf_object_implementation): New template declaration.
12733
cc70f101
ILT
127342009-08-14 Ian Lance Taylor <iant@google.com>
12735
12736 * gold.h (FUNCTION_NAME): Define.
12737 (gold_unreachable): Use FUNCTION_NAME.
12738
ef5e0cb1
ST
127392009-08-12 Sriraman Tallam <tmsriram@google.com>
12740
12741 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12742 symbol in the --keep-unique list is not found.
12743
48c187ce
ST
127442009-08-12 Sriraman Tallam <tmsriram@google.com>
12745
12746 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12747 been maked as --keep-unique.
12748 (Icf::unfold_section): New function.
12749 * icf.h (Icf::unfold_section): New function.
12750 * options.h (General_options::keep_unique): New option.
12751 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12752 * testsuite/Makefile.in: Regenerate.
12753 * testsuite/icf_keep_unique_test.sh: New file.
12754 * testsuite/icf_keep_unique_test.cc: New file.
12755
645afe0c
CC
127562009-08-12 Cary Coutant <ccoutant@google.com>
12757
12758 PR 10471
12759 * resolve.cc (Symbol_table::resolve): Check for references from
12760 dynamic objects to hidden and internal symbols.
12761 * testsuite/Makefile.am (hidden_test.sh): New test.
12762 * testsuite/Makefile.in: Regenerate.
12763 * testsuite/hidden_test.sh: New script.
12764 * testsuite/hidden_test_1.c: New test source.
12765 * testsuite/hidden_test_main.c: New test source.
12766
11af873f
DK
127672009-08-11 Doug Kwan <dougkwan@google.com>
12768
12769 * arm.cc: Update comments.
12770 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12771 segment to locate the .ARM.exidx section if present.
12772
b9f7d72d
DK
127732009-08-09 Doug Kwan <dougkwan@google.com>
12774
12775 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12776 patch.
12777
ddd3c53c
ST
127782009-08-07 Sriraman Tallam <tmsriram@google.com>
12779 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12780 compiler warnings.
12781
27721062
ST
127822009-08-06 Sriraman Tallam <tmsriram@google.com>
12783
12784 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12785 valid tls_segment only for non-debug-section relocations.
12786 * testsuite/Makefile.am: Add gc_tls_test.
12787 * testsuite/Makefile.in: Regenerate.
12788 * testsuite/gc_tls_test.cc: New file.
12789 * testsuite/gc_tls_test.sh: New file.
12790
ef15dade 127912009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 12792
ef15dade
ST
12793 * icf.cc: New file.
12794 * icf.h: New file.
12795 * Makefile.am (CCFILES): Add icf.cc.
12796 (HFILES): Add icf.h
12797 * Makefile.in: Regenerate.
12798 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12799 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12800 section, symbol and addend information for the relocs.
12801 * gold.cc (queue_middle_tasks): Call identical code folding.
12802 * gold.h: Add defines for multimap.
12803 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12804 to the call of finalize_local_symbols.
12805 * main.cc (main): Create object of class Icf.
12806 * object.cc (Sized_relobj::do_layout): Allow this function to be
12807 called twice during icf.
12808 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12809 to sections marked as identical by icf.
12810 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12811 when available.
12812 (Sized_relobj::do_section_entsize): New function.
12813 * object.h (Object::section_entsize): New function.
12814 (Object::do_section_entsize): New pure virtual function.
12815 (Relobj::finalize_local_symbols): Add new parameter.
12816 (Relobj::do_section_entsize): New function.
12817 * options.h (General_options::icf): New option.
12818 (General_options::icf_iterations): New option.
12819 (General_options::print_icf_sections): New option.
12820 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12821 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12822 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12823 icf.
12824 * symtab.cc (Symbol_table::is_section_folded): New function.
12825 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12826 to sections marked as identical by icf.
12827 * symtab.h (Symbol_table::set_icf): New function.
12828 (Symbol_table::icf): New function.
12829 (Symbol_table::is_section_folded): New function.
12830 (Symbol_table::icf_): New data member.
12831 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12832 * testsuite/Makefile.am: Add commands to build icf_test.
12833 * testsuite/Makefile.in: Regenerate.
12834 * testsuite/icf_test.sh: New file.
12835 * testsuite/icf_test.cc: New file.
12836
c3b65ac4
CD
128372009-07-24 Chris Demetriou <cgd@google.com>
12838
12839 * layout.cc (is_compressible_debug_section): Fix incorrect
12840 comment about compressed section names.
12841
1caf2c51
ILT
128422009-07-20 Ian Lance Taylor <ian@airs.com>
12843
12844 PR 10419
12845 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12846
1ef4d87f
ILT
128472009-07-16 Ian Lance Taylor <iant@google.com>
12848
12849 PR 10400
12850 * layout.h: #include <map>.
12851 (class Kept_section): Change from struct to class. Add accessors
12852 and setters. Add section size to Comdat_group mapping. Change
12853 Comdat_group to std::map. Add is_comdat_ field. Add
12854 linkonce_size field in union.
12855 (class Layout): Update declaration of find_or_add_kept_section.
12856 Don't declare find_kept_object.
12857 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12858 parameter. Add object, shndx, is_comdat, and is_group_name
12859 parameters. Change all callers. Adjust for new Kept_section.
12860 (Layout::find_kept_object): Remove.
12861 * object.cc (Sized_relobj::include_section_group): Update use of
12862 Kept_section. Rename secnum to shndx. Only record
12863 Kept_comdat_section if sections are the same size.
12864 (Sized_relobj::include_linkonce_section): Update use of
12865 Kept_section. Only record Kept_comdat_section if sections are the
12866 same size. Set size of linkonce section.
12867 (Sized_relobj::map_to_kept_section): Update call to
12868 get_kept_comdat_section.
12869 * object.h (class Sized_relobj): Rename fields in
12870 Kept_comdat_section to drop trailing underscores; change object
12871 field to Relobj*. Change Kept_comdat_section_table to store
12872 struct rather than pointer.
12873 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
12874 Add kept_object and kept_shndx parameters. Change all callers.
12875 (Sized_relobj::get_kept_comdat_section): Change return type to
12876 bool. Add kept_object and kept_shndx parameters. Change all
12877 callers.
12878 * plugin.cc (Pluginobj::include_comdat_group): Update call to
12879 Layout::find_or_add_kept_section.
12880
37c3b7b0
ILT
128812009-07-09 Ian Lance Taylor <iant@google.com>
12882
12883 * merge.cc (Object_merge_map::initialize_input_to_output_map):
12884 Reserve space in the hash table.
12885
98fa85cb
ILT
128862009-07-06 Mikolaj Zalewski <mikolajz@google.com>
12887
12888 * fileread.cc (File_read::get_mtime): New method.
12889 * fileread.h (Timespec): New structure.
12890 (File_read::get_mtime): New method.
12891 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
12892 Renamed from timestamp_nsec.
12893 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
12894 Elf_Xword.
e1df38aa 12895 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 12896 timestamp_nsec.
e1df38aa 12897 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
12898 (Incremental_inputs::report_obejct): Save mtime; style fix.
12899 (Incremental_inputs::report_script): Save mtime; style fix.
12900 (Incremental_inputs::finalize_inputs): Style fix.
12901 (Incremental_inputs::finalize): Style fix.
12902 (Incremental_inputs::create_input_section_data): Store inputs
12903 mtime.
12904 * incremental.h (Incremental_inputs::report_script): Add mtime
12905 argument.
12906 (Incremental_inputs::Input_info::Input_info): Intialize only one
12907 union member.
12908 (Incremental_inputs::Input_info::archive): Move to nameless
12909 union.
12910 (Incremental_inputs::Input_info::obejct): Move to nameless union.
12911 (Incremental_inputs::Input_info::script): Move to nameless union.
12912 (Incremental_inputs::mtime): New field.
12913 * script.cc (read_input_script): Pass file mtime to
12914 Incremental_input.
12915 * script.h (Script_info::inputs): Style fix.
12916
c9d70757
ILT
129172009-07-01 Ian Lance Taylor <ian@airs.com>
12918
12919 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
12920 instead of 32.
12921
9c547ec3
ILT
129222009-06-24 Ian Lance Taylor <iant@google.com>
12923
12924 PR 10156
12925 * layout.cc (Layout::choose_output_section): If we find an
12926 existing section, update the flags.
12927 (Layout::create_notes): New function, broken out of
12928 Layout::finalize.
12929 (Layout::finalize): Don't create note sections.
12930 (Layout::create_note): Don't crash if linker script discards
12931 section.
12932 (Layout::create_gold_note): Likewise.
12933 (Layout::create_build_id): Likewise. Don't set
12934 after_input_sections on the section.
12935 (Layout::create_executable_stack_info): Remove target parameter.
12936 Change caller.
12937 * layout.h (class Layout): Declare create_notes. Update
12938 declaration of create_executable_stack_info.
12939 * gold.cc (queue_middle_tasks): Call create_notes.
12940 * output.cc (Output_section::update_flags_for_input_section): Move
12941 here from output.h. If SHF_ALLOC flag is newly set, mark address
12942 invalid.
12943 * output.h (Output_data::mark_address_invalid): New function.
12944 (class Output_section): Only declare, not define,
12945 update_flags_for_input_section. Remove set_flags.
12946
55458500
ILT
129472009-06-24 Ian Lance Taylor <iant@google.com>
12948
12949 * script-sections.cc (Output_section_definition::
12950 set_section_addresses): Rename shadowing local load_address to
12951 laddr.
12952
1307d6cd
ILT
129532009-06-24 Ian Lance Taylor <iant@google.com>
12954
12955 PR 10244
12956 * reloc.cc (relocate_sections): Skip empty relocation sections.
12957
ec3f783e
ILT
129582009-06-23 Ian Lance Taylor <iant@google.com>
12959
12960 PR 10156
12961 * layout.cc (Layout::create_note): Use choose_output_section
12962 rather than make_output_section.
12963
459c9f1c
ILT
129642009-06-23 Ian Lance Taylor <iant@google.com>
12965
12966 PR 10237
12967 * options.cc (General_options::parse_V): Set printed_version_.
12968 (General_options::General_options): Initialize printed_version_.
12969 * options.h (class General_options): Add printed_version_ field.
12970 * gold.cc (queue_initial_tasks): If there are no input files,
12971 don't give a fatal error if we printed the version information.
12972 (queue_middle_tasks): If using -r with a shared object, give a
12973 fatal error rather than an ordinary error.
12974
1518dc8f
ILT
129752009-06-23 Ian Lance Taylor <iant@google.com>
12976
12977 PR 10219
12978 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
12979 (Layout::make_output_section): Set have_stabstr_section_ if we see
12980 a .stab*str section.
12981 (Layout::finalize): Call link_stabs_sections.
12982 (Layout::link_stabs_sections): New file.
12983 * layout.h (class Layout): Add have_stabstr_section_ field.
12984 Declare link_stabs_sections.
12985
3d857b98
DK
129862009-06-23 Doug Kwan <dougkwan@google.com>
12987
12988 * Makefile.am (libgold_a_LIBADD): New.
12989 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 12990 * Makefile.in: Regenerate.
3d857b98
DK
12991 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
12992 * configure: Regenerate.
12993 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
12994 * fileread.cc: Include sys/state.h
12995 * gold.h: Declare memmem and strndup if found missing.
12996 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
12997
0639a6f6
ILT
129982009-06-23 Ian Lance Taylor <iant@google.com>
12999
13000 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13001 * configure: Rebuild.
13002
8d63875c
ILT
130032009-06-23 Ian Lance Taylor <iant@google.com>
13004
13005 PR 10147
13006 * object.cc (Object::section_contents): Don't try to get a view if
13007 the section has length zero.
13008 (Object::handle_gnu_warning_section): If the section is empty, use
13009 the name of the section as the warning.
13010
f7c8a183
ILT
130112009-06-23 Ian Lance Taylor <iant@google.com>
13012
13013 PR 10133
13014 * stringpool.h (class Stringpool_template): Add optimize_ field.
13015 (Stringpool_template::set_optimize): New function.
13016 * stringpool.cc (Stringpool_template::Stringpool_template):
13017 Initialize optimize_ field.
13018 (Stringpool_template::set_string_offsets): Test local optimize
13019 fild rather than parameter.
13020 * layout.cc (Layout::Layout): Call set_optimize on the section
13021 name stringpool.
13022
e6a307ba
ILT
130232009-06-22 Ian Lance Taylor <iant@google.com>
13024
13025 PR 10030
13026 * yyscript.y: Parse TARGET.
13027 * script.cc (script_set_target): New function.
13028 * script-c.h (script_set_target): Declare.
13029 * options.cc (General_options::string_to_object_format): Rename
13030 from string_to_object_format in anonymous namespace. Change
13031 callers.
13032 * options.h (class General_options): Declare
13033 string_to_object_format.
13034
3ee173de
ILT
130352009-06-22 Ian Lance Taylor <iant@google.com>
13036
13037 * script-sections.cc (Script_sections::create_segments): Don't put
13038 program headers in a PT_LOAD segment if -n or -N.
13039
130402009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
13041
13042 PR 10141
13043 * options.h (class General_options): Add -z lazy and -z now. Sort
13044 -z options into alphabetical order.
13045 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13046
cd6739a1 130472009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
13048
13049 * layout.cc (Layout::make_output_section): Call
13050 Target::new_output_section.
13051 (Layout::attach_allocated_section_to_segment): Put large section
13052 sections in a separate load segment with the large segment flag
13053 set.
13054 (Layout::segment_precedes): Sort large data segments after other
13055 load segments.
13056 (align_file_offset): New static function.
13057 (Layout::set_segment_offsets): Use align_file_offset.
13058 * output.h (class Output_section): Add is_small_section_ and
13059 is_large_section_ fields.
13060 (Output_section::is_small_section): New function.
13061 (Output_section::set_is_small_section): New function.
13062 (Output_section::is_large_section): New function.
13063 (Output_section::set_is_large_section): New function.
13064 (Output_section::is_large_data_section): New function.
13065 (class Output_segment): Add is_large_data_segment_ field.
13066 (Output_segment::is_large_data_segment): New function.
13067 (Output_segment::set_is_large_data_segment): New function.
13068 * output.cc (Output_section::Output_section): Initialize new
13069 fields.
13070 (Output_segment::Output_segment): Likewise.
13071 (Output_segment::add_output_section): Add assertion that large
13072 data sections always go in large data segments. Force small data
13073 sections to the end of the list of data sections. Force small BSS
13074 sections to the start of the list of BSS sections. For large BSS
13075 sections to the end of the list of BSS sections.
13076 * symtab.h (class Symbol): Declare is_common_shndx.
13077 (Symbol::is_defined): Check Symbol::is_common_shndx.
13078 (Symbol::is_common): Likewise.
13079 (class Symbol_table): Define enum Commons_section_type. Update
13080 declarations. Add small_commons_ and large_commons_ fields.
13081 * symtab.cc (Symbol::is_common_shndx): New function.
13082 (Symbol_table::Symbol_table): Initialize new fields.
13083 (Symbol_table::add_from_object): Put small and large common
13084 symbols in the right list.
13085 (Symbol_table::sized_finalized_symbol): Check
13086 Symbol::is_common_shndx.
13087 (Symbol_table::sized_write_globals): Likewise.
13088 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13089 common symbol lists. Don't call do_allocate_commons_list if the
13090 list is empty.
13091 (Symbol_table::do_allocate_commons_list): Remove is_tls
13092 parameter. Add comons_section_type parameter. Change all
13093 callers. Handle small and large common symbols.
13094 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13095 Symbol::is_common_shndx.
13096 * resolve.cc (symbol_to_bits): Likewise.
13097 * target.h (Target::small_common_shndx): New function.
13098 (Target::small_common_section_flags): New function.
13099 (Target::large_common_shndx): New function.
13100 (Target::large_common_section_flags): New function.
13101 (Target::new_output_section): New function.
13102 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13103 small_common_section_flags, and large_common_section_flags
13104 fields.
13105 (Target::do_new_output_section): New virtual function.
13106 * arm.cc (Target_arm::arm_info): Initialize new fields.
13107 * i386.cc (Target_i386::i386_info): Likewise.
13108 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13109 Likewise.
13110 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13111 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13112 (Target_x86_64::do_new_output_section): New function.
13113 * configure.ac: Define conditional MCMODEL_MEDIUM.
13114 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13115 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13116 (large_LDFLAGS): Define.
13117 * testsuite/large.c: New file.
13118 * testsuite/testfile.cc (Target_test::test_target_info):
13119 Initialize new fields.
13120 * configure, testsuite/Makefile.in: Rebuild.
13121
bb04269c
DK
131222009-06-05 Doug Kwan <dougkwan@google.com>
13123
13124 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13125 * Makefile.in: Regenerate.
bb04269c
DK
13126 * i386.cc (class Target_i386): Define new virtual method to
13127 override do_is_local_label_name in parent.
13128 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13129 local symbols if --discard-locals or -X is given.
13130 * options.h (class General_options): Declare new options
13131 '--discard-locals' and '-X' for discarding locals.
13132 * target.h (class Target): Define new methods is_local_label_name.
13133 Declare new virtual method do_is_local_label_name.
13134 * target.cc: New file.
13135 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13136 (check_SCRIPTS): Add discard_locals_test.sh.
13137 (check_DATA): Add discard_local_tests.syms.
13138 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13139 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13140 * testsuite/Makefile.in: Regenerate.
13141 * testsuite/discard_locals_test.c: New file.
13142 * testsuite/discard_locals_test.sh: Same.
13143
805bb01c
DK
131442009-06-05 Doug Kwan <dougkwan@google.com>
13145
13146 * object.cc (Sized_relobj::Sized_relobj): Initialize
13147 discarded_eh_frame_shndx_ to -1U.
13148 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13149 section.
13150 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13151 a discarded .eh_frame section.
13152 (Sized_relobj::do_finalize_local_symbols): Ditto.
13153 * object.h (class Sized_relobj): Declare new member
13154 discarded_eh_frame_shndx_.
13155 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13156 (local_labels_test.o, local_labels_test): New rules.
13157 * testsuite/Makefile.in: Regenerate.
13158
1dcd334d
DK
131592009-06-04 Doug Kwan <dougkwan@google.com>
13160
13161 * layout.cc (Layout::section_name_mapping): Add mapping for
13162 special ARM sections.
13163
96d49306
DK
131642009-06-03 Doug Kwan <dougkwan@google.com>
13165
13166 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13167 (utils::has_overflow): Same.
13168
dff16297
ILT
131692009-06-03 Ian Lance Taylor <iant@google.com>
13170
13171 * layout.cc (Layout::section_name_mapping): New array, replacing
13172 Layout::linkonce_mapping.
13173 (Layout::section_name_mapping_count): New variable, replacing
13174 Layout::linkonce_mapping_count.
13175 (Layout::linkonce_output_name): Remove.
13176 (Layout::output_section_name): Rewrite.
13177 * layout.h (class Layout): Rename Linkonce_mapping to
13178 Section_name_mapping, linkonce_mapping to section_name_mapping,
13179 linkonce_mapping_count to section_name_mapping_count. Don't
13180 declare linkonce_output_name.
13181
c121c671
DK
131822009-06-03 Doug Kwan <dougkwan@google.com>
13183
13184 * gold/arm.cc (namespace utils): New.
13185 (Target_arm::reloc_is_non_pic): Define new method.
13186 (class Arm_relocate_functions): New.
13187 (Target_arm::Relocate::relocate): Handle relocation types used by
13188 Android.
13189
07800fab
ILT
131902009-06-03 Ian Lance Taylor <iant@google.com>
13191
13192 * arm.cc (Target_arm::scan::global): Use || instead of |.
13193
c121c671
DK
131942009-06-02 Doug Kwan <dougkwan@google.com>
13195
13196 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13197 issued_non_pic_error_.
13198 (class Target_arm::Scan): Declare new method check_non_pic.
13199 Define new method symbol_needs_plt_entry.
13200 Declare new data member issued_non_pic_error_.
13201 (class Target_arm::Relocate): Declare new method
13202 should_apply_static_reloc.
13203 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13204 (Target_arm::Scan::check_non_pic): Define new method.
13205 (Target_arm::Scan::local): Handle a small subset of reloc types used
13206 by Android.
13207 (Target_arm::Scan::local): Same.
13208 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13209
b19b0c6d
ILT
132102009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13211
13212 * incremental.cc (Incremental_inputs::report_command_line): Filter
13213 out --incremental-* options.
13214
94cdfcff
DK
132152009-05-29 Doug Kwan <dougkwan@google.com>
13216
13217 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13218 template class.
13219 (class Target_arm): Update comment.
13220 (Target_arm::Target_arm): Initialize new data members GOT_,
13221 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13222 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13223 and Target_arm::rel_dyn_section.
13224 Declare new_enum Target_arm::Got_type.
13225 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13226 and DYNBSS_.
13227 Update commments for member do_dynsym_value.
13228 (Target_arm::got_size, Target_arm::plt_section,
13229 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13230 new methods inside class defintion.
13231 (Target_arm::got_section): Define new method.
13232 (Target_arm::rel_dyn_section): Same.
13233 (Output_data_plt_arm): New template class.
13234 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13235 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13236 (Output_data_plt_arm::add_entry): Same.
13237 (Output_data_plt_arm::first_plt_entry): Define new
13238 static data member for PLT instruction template.
13239 (Output_data_plt_arm::plt_entry): Same.
13240 (Output_data_plt_arm::do_write): Define new method.
13241 (Target_arm::make_plt_entry): Same.
13242 (Target_arm::do_finalize_sections): Same.
13243 (Target_arm::do_dynsym_value): Same.
13244
4a657b0d
DK
132452009-05-28 Doug Kwan <dougkwan@google.com>
13246
13247 * Makefile.am (TARGETSOURCES): Add arm.cc.
13248 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13249 * Makefile.in: Regenerate.
13250 * arm.cc: New file.
13251 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13252
e7ae8c36
DK
132532009-05-26 Doug Kwan <dougkwan@google.com>
13254
13255 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13256 (General_options::check_excluded_libs): Strip off directories in
13257 archive name before matching like GNU ld does.
13258 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13259 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13260 (exclude_libs_test_LDFLAGS): Add linker option
13261 -Wl,--exclude-libs,libexclude_libs_test_3
13262 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13263 an explicit archive without using -l.
13264 (alt/libexclude_libs_test_3.a): New make rule.
13265 * testsuite/Makefile.in: Regenerate.
13266 * testsuite/exclude_libs_test.c : Declare lib3_default().
13267 (main): Call it.
13268 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13269 * exclude_libs_test_3.c: New file.
13270
f12e7348
NC
132712009-05-26 Nick Clifton <nickc@redhat.com>
13272
13273 * po/id.po: New Indonesian translation.
13274 * po/gold.pot: Updated template file.
13275
4daadc0d
ST
132762009-05-22 Sriraman Tallam <tmsriram@google.com>
13277
e1df38aa 13278 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13279 gc_comdat_test files. Add -Wl,--gc-sections to build
13280 gc_comdat_test.
13281 * testsuite/Makefile.in: Regenerate.
13282 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13283
531813ad
ST
132842009-05-21 Sriraman Tallam <tmsriram@google.com>
13285
13286 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13287 kept comdat section was garbage collected.
13288 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13289 * testsuite/Makefile.in: Regenerate.
13290 * testsuite/gc_comdat_test.sh: New file.
13291 * testsuite/gc_comdat_test_1.cc: New file.
13292 * testsuite/gc_comdat_test_2.cc: New file.
13293
65514900
CC
132942009-05-19 Doug Kwan <dougkwan@google.com>
13295
13296 * archive.cc (Archive::Archive): Move constructor from archive.h
13297 to here. Initialize no_export_.
13298 (Archive::get_elf_object_for_member): Set no_export flag of object.
13299 * archive.h (Archive::Archive): Move constructor body to
13300 archive.cc.
13301 (Archive::no_export): New method.
13302 (Archive::no_export_): New field.
13303 * object.h (Object::Object): Initialize no_export_ to false.
13304 (Object::no_export, Object::set_no_export): New methods.
13305 (Object::no_export_): New field.
13306 * options.cc (General_options::parse_exclude_libs): New method.
13307 (General_options::check_excluded_libs) Same.
13308 * options.h (exclude_libs): New option.
13309 (General_options::check_excluded_libs): New method declaration.
13310 (General_options::excluded_libs_): New field.
13311 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13312 default or protected visibility if an object has no-export flag set.
13313 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13314 (check_SCRIPTS): Add exclude_libs_test.sh.
13315 (check_DATA): Add exclude_libs_test.syms.
13316 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13317 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13318 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13319 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13320 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13321 libexclude_libs_test_2.a): New rules.
13322 * testsuite/Makefile.in: Regenerate.
13323 * testsuite/exclude_libs_test.c: New file.
13324 * testsuite/exclude_libs_test.sh: Ditto.
13325 * testsuite/exclude_libs_test_1.c: Ditto.
13326 * testsuite/exclude_libs_test_2.c: Ditto.
13327
1b77ea50
ILT
133282009-05-15 Ian Lance Taylor <iant@google.com>
13329
13330 * configure.ac: Check for declarations for cases where libiberty.h
13331 checks HAVE_DECL_xxx.
13332 * configure, config.in: Rebuild.
13333
072fe7ce
ILT
133342009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13335
13336 * gold.h (Incremental_argument_list): Remove (invalid) forward
13337 declaration.
13338 * incremental.cc (Incremental_inputs::report_achive): New method.
13339 (Incremental_inputs::report_object): New method.
13340 (Incremental_inputs::report_script): New method.
13341 (Incremental_inputs::finalize_inputs): New method.
13342 (Incremental_inputs::finalize): Call finalize_inputs().
13343 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13344 Create inputs entries.
13345 * incremental.h (Incremental_input_type): New enum.
13346 (Incremental_inputs::Incremental_input): Initialize new fields.
13347 (Incremental_inputs::report_inputs): New method.
13348 (Incremental_inputs::report_achive): New method.
13349 (Incremental_inputs::report_object): New method.
13350 (Incremental_inputs::report_script): New method.
13351 (Incremental_inputs::finalize_inputs): New method.
13352 (Incremental_inputs::Input_info): New struct.
13353 (Incremental_inputs::Input_info_map): New typedef.
13354 (Incremental_inputs::lock_): New field.
13355 (Incremental_inputs::Inputs_): New field.
13356 (Incremental_inputs::Inputs_map): New field.
13357 * main.cc (main): Call Incremental_input::report_inputs.
13358 * options.h (Input_argument_list): Typedef moved from
13359 Input_arguments.
13360 (Input_file_group::Files): Remove, use ::Input_argument_list.
13361 (Input_file_group::Input_argument_list): Remove, use
13362 ::Input_argument_list.
13363 * plugin.cc (Plugin_manager::add_input_file): Add error in
13364 incremental build.
13365 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13366 functions.
13367 * script.cc (read_input_script): Call
13368 Incremental_input::report_script.
13369 * script.h (Script_info): New class.
13370
b0481b0b
ILT
133712009-04-27 Ian Lance Taylor <iant@google.com>
13372
13373 * x86_64.cc (do_adjust_output_section): Set entsize to
13374 plt_entry_size.
13375
b22a5a41 133762009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13377
13378 * output.cc (Output_file::close): After short writes, continue
13379 writing from the correct offset in the buffer being written.
13380
40fde488
CD
133812009-04-23 Chris Demetriou <cgd@google.com>
13382
13383 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13384 * configure: Regenerate.
13385 * config.in: Regenerate.
13386 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13387 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13388
3ce2c28e
ILT
133892009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13390
13391 * incremental.cc (Incremental_inputs_header_data): Renamed from
13392 Incremental_input_header_data.
13393 (Incremental_inputs_header_data::data_size): New field.
13394 (Incremental_inputs_header_data::put_input_file_count): Renamed
13395 from input_file_count.
13396 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13397 from command_line_offset.
13398 (Incremental_inputs_header_data::put_reserved): Renamed from
13399 put_reserved.
13400 (Incremental_inputs_entry_data): Renamed from
13401 Incremental_input_entry_data.
13402 (Incremental_inputs_entry_data::data_size): New field.
13403 (Incremental_inputs::report_command_line): New method.
13404 (Incremental_inputs::finalize): New method.
13405 (Incremental_inputs::create_incremental_inputs_data): New method.
13406 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13407 * incremental.h: New file.
13408 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13409 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13410 incremental builds.
703d02da 13411 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13412 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13413 (Layout::create_incremental_info_sections): New method.
13414 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13415 * main.cc (main): Notify Incremental_input of the command line.
13416
e55bde5e
ILT
134172009-04-01 Ian Lance Taylor <iant@google.com>
13418 Mikolaj Zalewski <mikolajz@google.com>
13419
13420 * gold.h (reserve_unordered_map): Define, three versions, one for
13421 each version of Unordered_map.
13422 * layout.cc (Layout::Layout): Remove options parameter. Add
13423 number_of_input_files parameter. Don't initialize options_.
13424 Initialize number_of_input_files_ and resized_signatures_. Move
13425 sections_are_attached_.
13426 (Layout::layout_group): Reserve space for group_signatures_.
13427 (Layout::find_or_add_kept_section): Change name parameter to be a
13428 reference. Resize signatures_ map when it gets large enough.
13429 (Layout::layout_eh_frame): Use parameters->options() instead of
13430 this->options_.
13431 (Layout::make_output_section): Likewise.
13432 (Layout::attach_allocated_section_to_segment): Likewise.
13433 (Layout::finalize, Layout::create_executable_stack): Likewise.
13434 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13435 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13436 * layout.h (class Layout): Update declarations. Remove options_
13437 field. Add number_of_input_files_ and resized_signatures_
13438 fields. Move sections_are_attached_ field.
13439 * main.cc (main): Pass number of input files to Layout
13440 constructor. Don't pass options.
13441
154b857c
ILT
134422009-03-30 Ian Lance Taylor <iant@google.com>
13443
13444 * ffsll.c (ffsll): Correct implementation.
13445
2f35ab9b
ILT
134462009-03-27 Ian Lance Taylor <iant@google.com>
13447
fd03461a
ILT
13448 * ffsll.c: New file.
13449 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13450 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13451 * ftruncate.c (ftruncate): Declare before definition.
13452 * mremap.c (mremap): Likewise.
13453 * pread.c (pread): Likewise.
13454 * configure, Makefile.in, config.in: Rebuild.
13455
2f35ab9b
ILT
13456 * mremap.c: New file.
13457 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13458 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13459 (mremap): Declare if HAVE_MREMAP is not defined.
13460 * configure, Makefile.in, config.in: Rebuild.
13461
33aea2fd
CC
134622009-03-27 Cary Coutant <ccoutant@google.com>
13463
13464 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13465 position independent.
13466 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13467 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13468
6d479619
CC
134692009-03-24 Cary Coutant <ccoutant@google.com>
13470
13471 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13472 an executable.
13473 (needs_dynamic_reloc): Likewise.
13474
afc06bb8
ILT
134752009-03-24 Ian Lance Taylor <iant@google.com>
13476
13477 * yyscript.y (file_cmd): Recognize EXTERN.
13478 (extern_name_list, extern_name_list_body): New nonterminals.
13479 * script.cc (script_add_extern): Define.
13480 * script-c.h (script_add_extern): Declare.
13481
f6060a4d
ILT
134822009-03-24 Rafael Avila de Espindola <espindola@google.com>
13483
13484 * object.cc (is_elf_object): Define.
13485 * object.h (is_elf_object): Declare.
13486 * archive.cc (Archive::get_elf_object_for_member): Call
13487 is_elf_object.
33aea2fd 13488 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 13489
26736d8e
ILT
134902009-03-24 Elliott Hughes <enh@google.com>
13491
13492 * output.cc (Output_file::map_anonymous): Define.
13493 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13494 try an anonymous one. Report the size if the mmap fails.
13495 * output.h (class Output_file): Declare map_anonymous.
13496
22fd9730
ILT
134972009-03-24 Ian Lance Taylor <iant@google.com>
13498
13499 * target-select.cc (instantiate_target): Don't acquire the lock if
13500 the instantiated_target_ field has already been set.
13501
cb010894
ILT
135022009-03-23 Ian Lance Taylor <iant@google.com>
13503
7f055c20
ILT
13504 * gold-threads.h (class Initialize_lock): Define.
13505 * gold-threads.cc (class Initialize_lock_once): Define.
13506 (initialize_lock_control): New static variable.
13507 (initialize_lock_pointer): New static variable.
13508 (initialize_lock_once): New static function.
13509 (Initialize_lock::Initialize_lock): Define.
13510 (Initialize_lock::initialize): Define.
13511 * target-select.h: Include "gold-threads.h".
13512 (class Target_selector): Add lock_ and initialize_lock_ fields.
13513 Don't define instantiate_target, just declare it.
13514 * target-select.cc (Target_selector::Target_selector): Initialize
13515 new fields.
13516 (Target_selector::instantiate_target): Define.
13517 * descriptors.h: Include "gold-threads.h".
13518 (class Descriptors): Add initialize_lock_ field.
13519 * descriptors.cc (Descriptors::Descriptors): Initialize new
13520 field.
13521 (Descriptors::open): Use initialize_lock_ field
13522 * errors.h (class Errors): Add initialize_lock_ field.
13523 * errors.cc (Errors::Errors): Initialize new field.
13524 (Errors::initialize_lock): Use initialize_lock_ field.
13525 * powerpc.cc (class Target_selector_powerpc): Remove
13526 instantiated_target_ field. In do_recognize call
13527 instantiate_target rather than do_instantiate_target. In
13528 do_instantiate_target just allocate a new target.
13529 * sparc.cc (class Target_selector_sparc): Likewise.
13530
36959681
ILT
13531 * freebsd.h: New file.
13532 * i386.cc: Include "freebsd.h".
13533 (Target_i386): Derive from Target_freebsd rather than
13534 Sized_target.
13535 (Target_selector_i386): Derive from Target_selector_freebsd rather
13536 than Target_selector.
13537 * x86_64.cc: Include "freebsd.h".
13538 (Target_x86_64): Derive from Target_freebsd rather than
13539 Sized_target.
13540 (Target_selector_x86_64): Derive from Target_selector_freebsd
13541 rather than Target_selector.
13542 * target.h (class Target): Add adjust_elf_header and
13543 do_adjust_elf_header.
13544 * output.cc (Output_file_header:: do_sized_write): Call target
13545 adjust_elf_header routine.
13546 * configure.tgt: Set targ_osabi.
13547 * configure.ac: Define GOLD_DEFAULT_OSABI.
13548 * parameters.cc (Parameters::default_target): Pass
13549 GOLD_DEFAULT_OSABI to select_target.
13550 * target-select.h (class Target_selector): Make instantiate_target
13551 protected rather than private.
13552 * Makefile.am (HFILES): Add freebsd.h.
13553 * configure, Makefile.in, config.in: Rebuild.
13554
cb010894
ILT
13555 * merge.cc (do_add_input_section): Correct pend value. Change
13556 message about last entry not being null terminated from error to
13557 warning.
13558
0e879927
ILT
135592009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13560
13561 * incremental.cc: New file.
13562 * Makefile.am (CCFILES): Add incremental.cc.
13563 * Makefile.in: Rebuild.
13564
41105937
PP
135652009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13566
13567 * layout.cc (Layout::output_section_name): Preserve names
13568 of '.note.' sections.
e1df38aa 13569
60439920
ILT
135702009-03-19 Ian Lance Taylor <iant@google.com>
13571
13572 * descriptors.cc (Descriptors::open): Check that the options are
13573 valid before using them.
13574
0d371ad3
ILT
135752009-03-18 Ian Lance Taylor <iant@google.com>
13576
13577 * script-sections.h: Include <list>.
13578 (class Script_sections): Change Sections_elements from std::vector
13579 to std::list. Typedef public Elements_iterator. Add
13580 orphan_section_placement_, data_segment_align_start_, and
13581 saw_data_segment_align_ fields. Remove data_segment_align_index_
13582 field.
13583 * script-sections.cc (class Orphan_section_placement): New class.
13584 (class Sections_element): Add virtual functions is_relro and
13585 orphan_section_init. Remove virtual function place_orphan_here.
13586 (class Output_section_definition): Add is_relro and
13587 orphan_section_init. Remove place_orphan_here.
13588 (class Orphan_output_section): Likewise.
13589 (Script_sections::Script_sections): Update for field changes.
13590 (Script_sections::data_segment_align): Set saw_data_segment_align_
13591 and data_segment_align_start_, not data_segment_align_index.
13592 (Script_sections::data_segment_relro_end): Check
13593 saw_data_segment_align_. Use data_segment_align_start_ rather
13594 than data_segment_align_index_.
13595 (Script_sections::place_orphan): Rewrite to use
13596 Orphan_section_placement.
13597
9201d894
ILT
135982009-03-17 Ian Lance Taylor <iant@google.com>
13599
9c5b8369
ILT
13600 * archive.cc (Archive::add_symbols): Check for a version attached
13601 to the symbol name in the archive map.
13602 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13603 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13604 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13605 (ver_test_11.a): New target.
13606 * testsuite/Makefile.in: Rebuild.
13607
9201d894
ILT
13608 * configure.ac: Check for chsize and posix_fallocate. Replace
13609 ftruncate.
13610 * ftruncate.c: New file, from gnulib.
13611 * output.cc (posix_fallocate): Define dummy version if not
13612 HAVE_POSIX_FALLOCATE.
13613 (Output_file::map): Call posix_fallocate rather than lseek and
13614 write.
13615 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13616 * configure, Makefile.in, config.in: Rebuild.
13617
ef4ab7a8 136182009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 13619
ef4ab7a8
PP
13620 * layout.h (Layout::create_note): Add section_name parameter.
13621 * layout.cc (Layout::create_note): Likewise.
13622 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 13623
8c500701
ILT
136242009-03-17 Ian Lance Taylor <iant@google.com>
13625
e85b18e1
ILT
13626 * descriptors.cc: Include "options.h".
13627 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13628 (Descriptors::open): Always use O_CLOEXEC when opening a new
13629 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13630 then set FD_CLOEXEC.
13631
9efe6174
ILT
13632 * sparc.cc (class Target_sparc): Add has_got_section.
13633 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13634 make sure we have a GOT section.
13635
13636 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13637 (Target_sparc::Scan::local): Likewise.
13638 (Target_sparc::Scan::global): Likewise.
13639 (Target_sparc::Relocate::relocate): Likewise.
13640 (Target_sparc::Relocate::relocate_tls): Likewise.
13641
8c500701
ILT
13642 * symtab.cc (Symbol_table::define_default_version): New function,
13643 broken out of add_from_object.
13644 (Symbol_table::add_from_object): Call define_default_version.
13645 (Symbol_table::define_special_symbol): Add resolve_oldsym
13646 parameter. Change all callers. If the version for a symbol comes
13647 from a version script, resolve it with the symbol with the same
13648 name with no version. Also add the symbol without a version if
13649 appropriate.
13650 (do_define_in_output_data): If resolving with oldsym, don't delete
13651 sym.
13652 (do_define_in_output_segment): Likewise.
13653 (do_define_as_constant): Likewise.
13654 * symtab.h (class Symbol_table): Update declarations.
13655
f1ed28fb
ILT
136562009-03-13 Ian Lance Taylor <iant@google.com>
13657
15f8229b
ILT
13658 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13659 (Read_symbols::requeue): New function.
13660 (Read_symbols::do_read_symbols): If make_elf_object fails because
13661 the target type is not configured, and the file was searched for,
13662 issue a warning and retry with the next directory.
13663 (Add_symbols::run): If the file has an incompatible format, and
13664 it was searched for, requeue the Read_symbols task. On error,
13665 release the object.
13666 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13667 dirindex parameter to constructor. Change all callers. Declare
13668 incompatible_warning and requeue.
13669 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13670 input_argument_ and input_group_ fields. Add them to
13671 constructor. Change all callers.
13672 (class Read_script): Add dirindex_ field. Add it to constructor.
13673 Change all callers.
13674 * archive.cc (Archive::setup): Remove input_objects parameter.
13675 Change all callers.
13676 (Archive::get_file_and_offset): Likewise.
13677 (Archive::read_all_symbols): Likewise.
13678 (Archive::read_symbols): Likewise.
13679 (Archive::get_elf_object_for_member): Remove input_objects
13680 parameter. Add punconfigured parameter. Change all callers.
13681 (Archive::add_symbols): Change return type to bool. Check return
13682 value of include_member.
13683 (Archive::include_all_members): Likewise.
13684 (Archive::include_member): Change return type to bool. Return
13685 false if first included object has incompatible target. Set
13686 included_member_ field.
13687 (Add_archive_symbols::run): If add_symbols returns false, requeue
13688 Read_symbols task.
13689 * archive.h (class Archive): Add included_member_ field.
13690 Initialize it in constructor. Add input_file and searched_for
13691 methods. Update declarations.
13692 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13693 input_argument_ fields. Add them to constructor. Change all
13694 callers.
13695 * script.cc: Include "target-select.h".
13696 (class Parser_closure): Add skip_on_incompatible_target_ and
13697 found_incompatible_target_ fields. Add
13698 skip_on_incompatible_target parameter to constructor. Change all
13699 callers. Add methods skip_on_incompatible_target,
13700 clear_skip_on_incompatible_target, found_incompatible_target, and
13701 set_found_incompatible_target.
13702 (read_input_script): Add dirindex parameter. Change all callers.
13703 If parser finds an incompatible target, requeue Read_symbols
13704 task.
13705 (script_set_symbol): Clear skip_on_incompatible_target in
13706 closure.
13707 (script_add_assertion, script_parse_option): Likewise.
13708 (script_start_sections, script_add_phdr): Likewise.
13709 (script_check_output_format): New function.
13710 * script.h (read_input_script): Update declaration.
13711 * script-c.h (script_check_output_format): Declare.
13712 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13713 (ignore_cmd): Remove OUTPUT_FORMAT.
13714 * fileread.cc (Input_file::Input_file): Add explicit this.
13715 (Input_file::will_search_for): New function.
13716 (Input_file::open): Add pindex parameter. Change all callers.
13717 * fileread.h (class Input_file): Add input_file_argument method.
13718 Declare will_search_for. Update declarations.
13719 * object.cc (make_elf_object): Add punconfigured parameter.
13720 Change all callers.
13721 * object.h (class Object): Make input_file public. Add
13722 searched_for method.
13723 (make_elf_object): Update declaration.
13724 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13725 restart search.
13726 * dirsearch.h (class Dirsearch): Update declaration.
13727 * options.h (class General_options): Add --warn-search-mismatch.
13728 * parameters.cc (Parameters::is_compatible_target): New function.
13729 * parameters.h (class Parameters): Declare is_compatible_target.
13730 * workqueue.cc (Workqueue::add_blocker): New function.
13731 * workqueue.h (class Workqueue): Declare add_blocker.
13732
f1ed28fb
ILT
13733 * fileread.cc (Input_file::open): Remove options parameter.
13734 Change all callers.
13735 (Input_file::open_binary): Likewise.
13736 * script.cc (read_input_script): Likewise.
13737 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13738 options parameter from constructor. Change all callers.
13739 (class Read_script): Likewise.
13740 * fileread.h (class Input_file): Update declarations.
13741 * script.h (read_input_script): Update declaration.
13742
34dd024a
NC
137432009-03-10 Nick Clifton <nickc@redhat.com>
13744
13745 * po/es.po: New Spanish translation.
13746
6d71b17c
CC
137472009-03-06 Cary Coutant <ccoutant@google.com>
13748
13749 * options.cc (parse_short_option): Keep dash_z from registering itself.
13750
031cdbed
ILT
137512009-03-03 Ian Lance Taylor <iant@google.com>
13752
13753 PR 9918
13754 * target-reloc.h (relocate_section): Pass output_section to
13755 relocate.
13756 * i386.cc (Target_i386::should_apply_static_reloc): Add
13757 output_section parameter. Change all callers.
13758 (Target_i386::Relocate::relocate): Add output_section parameter.
13759 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13760 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13761 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13762 * testsuite/two_file_shared.sh: New script.
13763 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13764 (check_DATA): Add two_file_shared.dbg.
13765 (two_file_shared.dbg): New target.
13766 * testsuite/Makefile.in: Rebuild.
13767
15d5fa16
ILT
137682009-03-01 Ian Lance Taylor <iant@google.com>
13769
13770 * configure.ac: Check for byteswap.h.
13771 * configure: Rebuild.
13772 * config.in: Rebuild.
13773
8a4c0b0d
ILT
137742009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13775
13776 * layout.cc (Layout::find_or_add_kept_section): New function.
13777 (Layout::add_comdat): Removed.
13778 * layout.h (struct Kept_section): Move out of class Layout.
13779 Remove trailing underscores from field names. Add group_sections
13780 field. Rename group_ field to is_group. Change all uses.
13781 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13782 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13783 comdat_groups_ field.
13784 (Sized_relobj::include_section_group): Use
13785 find_or_add_kept_section and Kept_section::group_sections.
13786 (Sized_relobj::include_linkonce_section): Likewise.
13787 * object.cc (class Sized_relobj): Don't define Comdat_group or
13788 Comdat_group_table. Remove find_comdat_group and
13789 add_comdat_group. Remove comdat_groups_ field.
13790 * plugin.cc (include_comdat_group): Use
13791 Layout::find_or_add_kept_section.
13792
b4ecf66b
ILT
137932009-02-28 Ian Lance Taylor <iant@google.com>
13794
14359ca0
ILT
13795 * README: --gc-sections and map files are now supported. Document
13796 some build requirements.
13797
b4ecf66b
ILT
13798 PR 6992
13799 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13800 relocatable link set the value of the section symbol to zero.
13801 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13802 relocatable link don't include the section address in the local
13803 symbol value.
13804
0602e05a
ILT
138052009-02-27 Ian Lance Taylor <iant@google.com>
13806
fd9d194f
ILT
13807 PR 6811
13808 * options.h (class Search_directory): Add is_system_directory.
13809 (class General_options): Declare is_in_system_directory.
13810 * options.cc (get_relative_sysroot): Make static.
13811 (get_default_sysroot): Make static.
13812 (General_optoins::is_in_system_directory): New function.
13813 * fileread.cc (Input_file::is_in_system_directory): New function.
13814 * fileread.h (class Input_file): Declare is_in_system_directory.
13815 * object.h (class Object): Add is_in_system_directory.
13816 (class Input_objects): Remove system_library_directory_ field.
13817 * object.cc (Input_objects::add_object): Don't set
13818 system_library_directory_.
13819 (input_objects::found_in_system_library_directory): Remove.
13820 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13821 parameter. Change all callers.
13822 (Symbol_table::sized_write_globals): Likewise.
13823 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13824 Call Object::is_in_system_directory.
13825 * symtab.h (class Symbol_table): Update declarations.
13826
61edd21f
ILT
13827 PR 5990
13828 * descriptors.h (Open_descriptor): Add is_on_stack field.
13829 * descriptors.cc (Descriptors::open): If the descriptor is on the
13830 top of the stack, remove it. Initialize is_on_stack field.
13831 (Descriptors::release): Only add pod to stack if it is not on the
13832 stack already.
13833 (Descriptors::close_some_descriptor): Clear stack_next and
13834 is_on_stack fields.
13835
e29e076a
ILT
13836 PR 7091
13837 * output.cc (Output_section::find_starting_output_address): Rename
13838 from starting_output_address; add PADDR parameter; change return
13839 type.
13840 * output.h (class Output_section): Declare
13841 find_starting_output_address instead of starting_output_address.
13842 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13843 section symbol for which we can't find a merge section.
13844
0602e05a
ILT
13845 PR 9836
13846 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13847 hidden or internal, force the symbol to be local.
13848 * resolve.cc (Symbol::override_visibility): Define.
13849 (Symbol::override_base): Use override_visibility.
13850 (Symbol_table::resolve): Likewise.
13851 (Symbol::override_base_with_special): Likewise.
13852 (Symbol_table::override_with_special): If the visibility is hidden
13853 or internal, force the symbol to be local.
13854 * symtab.h (class Symbol): Add set_visibility and
13855 override_visibility.
13856 * testsuite/ver_test_1.sh: New file.
13857 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13858 (check_DATA): Add ver_test_1.syms.
13859 (ver_test_1.syms): New target.
13860 * testsuite/Makefile.in: Rebuild.
13861
401a9a73
CC
138622009-02-25 Cary Coutant <ccoutant@google.com>
13863
13864 * layout.cc (Layout::choose_output_section): Don't rename sections
13865 when using a linker script that has a SECTIONS clause.
13866 * Makefile.in: Regenerate.
13867
13868 * testsuite/Makefile.am (script_test_5.sh): New test case.
13869 * testsuite/Makefile.in: Regenerate.
13870 * testsuite/script_test_5.cc: New file.
13871 * testsuite/script_test_5.sh: New file.
13872 * testsuite/script_test_5.t: New file.
13873
f488e4b0
CC
138742009-02-13 Rafael Avila de Espindola <espindola@google.com>
13875
13876 * archive.cc (Archive::include_member): Update calls to add_symbols.
13877 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
13878 the Layout argument.
13879 * dynobj.h (do_add_symbols): Add the Layout argument.
13880 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
13881 Layout argument.
13882 * object.h (Object::add_symbols): Add the Layout argument.
13883 (Object::do_add_symbols): Add the Layout argument.
13884 (Sized_relobj::do_add_symbols): Add the Layout argument.
13885 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
13886 Unify the two versions.
13887 (Add_plugin_symbols): Remove.
13888 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
13889 (Sized_pluginobj::do_add_symbols): Unify the two versions.
13890 (Add_plugin_symbols): Remove.
13891 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
13892 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
13893 (Add_symbols::run): Make it work with Pulginobj.
13894
89dd1680
ILT
138952009-02-06 Ian Lance Taylor <iant@google.com>
13896
13897 * object.cc (Sized_relobj::do_layout): Make info message start
13898 with lower case letter.
13899
266d0a74
ILT
139002009-02-06 Mikolaj Zalewski <mikolajz@google.com>
13901
602b464e
ILT
13902 * binary.cc: Fix file comment.
13903
266d0a74
ILT
13904 * options.h (enum Incremental_disposition): Define.
13905 (class General_options): Add new options: --incremental,
13906 --incremental_changed, --incremental_unchanged,
13907 --incremental_unknown. Add incremental_disposition_ and
13908 implicit_incremental_ fields.
13909 (General_options::incremental_disposition): New function.
13910 (class Position_dependent_options): Add incremental_disposition
13911 option.
13912 (Position_dependent_options::copy_from_options): Set incremental
13913 dispositions.
13914 * options.cc (General_options::parse_incremental_changed): New
13915 function.
2e702c99
RM
13916 (General_options::parse_incremental_unchanged): New function.
13917 (General_options::parse_incremental_unknown): New function.
13918 (General_options::General_options): Initialize new fields
266d0a74 13919 incremental_disposition_ and implicit_incremental_.
2e702c99 13920 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
13921 without --incremental.
13922
f073bbf7
CD
139232009-02-06 Chris Demetriou <cgd@google.com>
13924
13925 * gold.h (gold_undefined_symbol): Change to take only a Symbol
13926 pointer and to report location as the file name associated with
13927 the symbol.
13928 (gold_undefined_symbol_at_location): New function to replace the
13929 old gold_undefined_symbol functionality.
13930 * target-reloc.h (relocate_section): Update to use
13931 gold_undefined_symbol_at_location.
13932 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13933 Call gold_undefined_symbol function rather than gold_error.
13934 * errors.h (Errors::undefined_symbol): Take location as a
13935 string, rather than calculating it from a relocation.
13936 * errors.cc (Errors::fatal): Print "fatal error:" before the
13937 formatted message.
13938 (Errors::error, Errors::error_at_location): Print "error: "
13939 before the formatted message.
13940 (Errors::undefined_symbol): Take location as a string, rather
13941 than calculating it from a relocation.
13942 (gold_undefined_symbol_at_location): New function akin to
13943 old gold_undefined_symbol, calculates location from relocation.
13944 (gold_undefined_symbol): Change to take only a Symbol pointer
13945 and to report location as the file name associated with the symbol.
13946 * testsuite/debug_msg.sh: Update for changed error messages.
13947 * testsuite/undef_symbol.sh: Likewise.
13948
8e94a90c
ILT
139492009-02-04 Duncan Sands <baldrick@free.fr>
13950
13951 PR 9812
13952 * reduced_debug_output.h
13953 (Output_reduced_debug_abbrev_section::failed): Use format for
13954 gold_warning.
13955 (Output_reduced_debug_info_section::faild): Likewise.
13956
88a0e15b
ILT
139572009-01-31 Mikolaj Zalewski <mikolajz@google.com>
13958
13959 * script.cc (Lazy_demangler): New class.
2e702c99 13960 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
13961 symbol only once.
13962
5efc7cd2
CC
139632009-01-29 Cary Coutant <ccoutant@google.com>
13964
13965 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
13966 to __tls_get_addr.
13967 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13968
e0ebcf42
ILT
139692009-01-28 Ian Lance Taylor <iant@google.com>
13970
5efc7cd2 13971 * version.cc (version_string): Bump to 1.9.
75fe7426 13972
e0ebcf42
ILT
13973 * gold.h: Include <cstring> and <stdint.h>.
13974 * version.cc: Include <cstdio>.
13975 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
13976 warning.
13977 * reduced_debug_output.cc (insert_into_vector): Rename from
13978 Insert_into_vector; change all callers. Use Swap_unaligned to
13979 avoid aliasing issue; remove union since it is unnecessary.
13980
8e2813be 139812009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
13982
13983 * Makefile.am (CCFILES): Add gc.cc.
13984 (HFILES): Add gc.h.
13985 * Makefile.in: Regenerate.
13986 * gold.cc (Gc_runner): New class.
13987 (queue_initial_tasks): Call garbage collection related tasks
13988 when corresponding options are invoked.
13989 (queue_middle_gc_tasks): New function.
13990 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
13991 processed early before laying out sections during garbage collection.
13992 * gold.h (queue_middle_gc_tasks): New function.
13993 (is_prefix_of): Move from "layout.cc".
13994 * i386.cc (Target_i386::gc_process_relocs): New function.
13995 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
13996 * main.cc (main): Create object of class "Garbage_collection".
13997 * object.cc (Relobj::copy_symbols_data): New function.
13998 (Relobj::is_section_name_included): New function.
e1df38aa
NC
13999 (Sized_relobj::do_layout): Allow this function to be called twice
14000 during garbage collection and defer layout of section during the
6d03d481
ST
14001 first call.
14002 * object.h (Relobj::get_symbols_data): New function.
14003 (Relobj::is_section_name_included): New function.
14004 (Relobj::copy_symbols_data): New function.
14005 (Relobj::set_symbols_data): New function.
14006 (Relobj::get_relocs_data): New function.
14007 (Relobj::set_relocs_data): New function.
14008 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14009 (Relobj::gc_process_relocs): New function.
14010 (Relobj::do_gc_process_relocs): New pure virtual function.
14011 (Relobj::sd_): New data member.
14012 (Sized_relobj::is_output_section_offset_invalid): New function.
14013 (Sized_relobj::do_gc_process_relocs): New function.
14014 * options.h (General_options::gc_sections): Modify to not be a no-op.
14015 (General_options::print_gc_sections): New option.
14016 * plugin.cc (Plugin_finish::run): Remove function call to
14017 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14018 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14019 * reloc.cc (Read_relocs::run): Add task to process relocs and
14020 determine unreferenced sections when doing garbage collection.
14021 (Gc_process_relocs): New class.
14022 (Sized_relobj::do_gc_process_relocs): New function.
14023 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14024 sections that are garbage collected.
14025 * reloc.h (Gc_process_relocs): New class.
14026 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14027 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14028 symbols whose corresponding sections are garbage collected.
14029 (Symbol_table::Symbol_table): Add new parameter for the garbage
14030 collection object.
14031 (Symbol_table::gc_mark_undef_symbols): New function.
14032 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14033 (Symbol_table::gc_mark_dyn_syms): New function.
14034 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14035 as garbage.
14036 (Symbol_table::add_from_object): Likewise.
14037 (Symbol_table::add_from_relobj): When building shared objects, do not
14038 treat externally visible symbols as garbage.
14039 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14040 table information for static and relocatable links.
14041 * symtab.h (Symbol_table::set_gc): New function.
14042 (Symbol_table::gc): New function.
14043 (Symbol_table::gc_mark_undef_symbols): New function.
14044 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14045 (Symbol_table::gc_mark_dyn_syms): New function.
14046 (Symbol_table::gc_): New data member.
e1df38aa 14047 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
14048 function.
14049 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14050 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14051
3b293544
CF
140522009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14053
14054 * options.h (General_options::gc_sections): Define as a no-op for now.
14055 (General_options::no_keep_memory): Ditto.
14056 (General_options::Bshareable): Define.
14057 * options.cc (General_options::finalize): Honor -Bshareable.
14058
83d22aa8
AS
140592009-01-20 Andreas Schwab <schwab@suse.de>
14060
14061 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14062 read the value in the contents, since we don't use it. Use the
14063 template endianness when writing.
14064 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14065
cd536b21
AS
140662009-01-19 Andreas Schwab <schwab@suse.de>
14067
14068 * configure.tgt (powerpc64-*): Fix targ_obj.
14069
99e9a495
ILT
140702009-01-15 Ian Lance Taylor <iant@google.com>
14071
14072 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14073 local symbols when stripping all symbols.
14074
bbbfea06
CC
140752009-01-14 Cary Coutant <ccoutant@google.com>
14076
99e9a495 14077 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 14078
0f7c0701
CC
140792009-01-14 Cary Coutant <ccoutant@google.com>
14080
14081 * archive.cc (Archive::get_elf_object_for_member): Remove call
14082 to File_read::claim_for_plugin.
14083 * descriptors.cc (Descriptors::open): Remove reference to
14084 is_claimed.
14085 (Descriptors::claim_for_plugin): Remove.
14086 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14087 (Descriptors::is_claimed): Remove.
14088 (claim_descriptor_for_plugin): Remove.
14089 * fileread.cc (File_read::claim_for_plugin): Remove.
14090 * fileread.h (File_read::claim_for_plugin): Remove.
14091 (File_read::descriptor): Reopen descriptor if necessary.
14092 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14093 (Plugin_manager::all_symbols_read): Add task parameter. Change
14094 all callers.
14095 (Plugin_manager::get_input_file): New function.
14096 (Plugin_manager::release_input_file): New function.
14097 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14098 corresponding data member.
14099 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14100 and pass to base constructor. Change all callers.
14101 (get_input_file, release_input_file): New functions.
14102 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14103 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14104 (Plugin_manager::all_symbols_read): Add task parameter.
14105 (Plugin_manager::get_input_file): New function.
14106 (Plugin_manager::release_input_file): New function.
14107 (Plugin_manager::task_): New data member.
14108 (Pluginobj::Pluginobj): Add filesize parameter.
14109 (Pluginobj::filename): New function.
14110 (Pluginobj::descriptor): New function.
14111 (Pluginobj::filesize): New function.
14112 (Pluginobj::filesize_): New data member.
14113 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14114 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14115 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14116
14117 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14118 with archive libraries.
14119 * testsuite/Makefile.in: Regenerate.
14120 * testsuite/plugin_test.c (struct sym_info): New type.
14121 (get_input_file, release_input_file): New static variables.
14122 (onload): Capture new transfer vector entries.
14123 (claim_file_hook): Stop reading at end of file according to filesize.
14124 Factor out parsing of readelf output into separate function.
14125 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14126 APIs and get the source file name from the symbol table. Convert
14127 source file name to corresponding object file name. Print info
14128 message when adding new input files.
14129 (parse_readelf_line): New function.
14130 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14131 * testsuite/plugin_test_2.sh: Likewise.
14132 * testsuite/plugin_test_3.sh: Likewise.
14133 * testsuite/plugin_test_4.sh: New test case.
14134
62a6d109
ILT
141352009-01-07 Ian Lance Taylor <iant@google.com>
14136
14137 * version.cc (version_string): Bump to 1.8.
14138
483620e8
CC
141392008-12-23 Cary Coutant <ccoutant@google.com>
14140
14141 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14142 * plugin.cc (Plugin_manager::finish): Rename as
14143 layout_deferred_objects. Move cleanup to separate function.
14144 (Plugin_manager::cleanup): New function.
14145 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14146 separately.
14147 * plugin.h (Plugin_manager::finish): Rename as
14148 layout_deferred_objects.
14149 (Plugin_manager::cleanup): New function.
14150 (Plugin_manager::cleanup_done): New field.
14151
d66a9eb3
CC
141522008-12-23 Cary Coutant <ccoutant@google.com>
14153
14154 * plugin.cc (is_visible_from_outside): New function.
14155 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14156 so we don't return "IR only" status for exported symbols or -r links.
14157
14158 * testsuite/Makefile.am (plugin_test_3): New test case.
14159 * testsuite/Makefile.in: Regenerate.
14160 * testsuite/plugin_test_3.sh: New file.
14161
5995b570
CC
141622008-12-22 Cary Coutant <ccoutant@google.com>
14163
14164 * object.cc (Sized_relobj::layout_section): New function.
14165 (Sized_relobj::do_layout): Defer layout of input sections until after
14166 plugin has provided replacement files.
14167 (Sized_relobj::do_layout_deferred_sections): New function.
14168 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14169 (Relobj::layout_deferred_sections): New function.
14170 (Relobj::do_layout_deferred_sections): New function.
14171 (Sized_relobj::do_layout_deferred_sections): New function.
14172 (Sized_relobj::layout_section): New function.
14173 (Sized_relobj::Deferred_layout): New structure.
14174 (Sized_relobj::deferred_layout_): New field.
14175 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14176 Change all callers. Layout deferred sections.
14177 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14178 references.
14179 (Plugin_hook::run): Move code from do_plugin_hook inline.
14180 (Plugin_hook::do_plugin_hook): Remove.
14181 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14182 (Plugin_manager::finish): Renamed, was cleanup.
14183 (Plugin_manager::should_defer_layout): New function.
14184 (Plugin_manager::add_deferred_layout_object): New function.
14185 (Plugin_manager::Deferred_layout_list): New type.
14186 (Plugin_manager::deferred_layout_objects_): New field.
14187 (Plugin_hook::do_plugin_hook): Remove.
14188
ee769c88
ILT
141892008-12-17 Ian Lance Taylor <iant@google.com>
14190
14191 * options.h (class General_options): Add --no case for
14192 --export-dynamic.
14193
abc8dcba
CC
141942008-12-16 Cary Coutant <ccoutant@google.com>
14195
14196 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14197 vector.
14198 (Plugin_manager::claim_file): Create plugin object even if
14199 plugin did not call the add_symbols callback.
14200 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14201 asking for more symbols than were added.
14202 * testsuite/Makefile.am (plugin_test_1): Add test case with
14203 no global symbols.
14204 (empty.syms): New target.
14205 * testsuite/Makefile.in: Regenerate.
14206 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14207 message. Don't call add_symbols if no globals.
14208 (all_symbols_read_hook): Don't provide replacement for empty
14209 claimed file.
14210
b0074644
ILT
142112008-12-12 Ian Lance Taylor <iant@google.com>
14212
68943102
ILT
14213 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14214 r_type == 0 for a local symbol with r_sym == 0.
14215 (scan_relocatable_relocs): Pass r_sym to
14216 local_non_section_strategy.
14217 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14218 r_sym parameter.
14219
b0074644
ILT
14220 * configure.ac: Update test for TLS descriptors: they are
14221 supported as of glibc 2.9.
14222 * configure: Rebuild.
14223
c2508178
ILT
142242008-12-11 Ian Lance Taylor <iant@google.com>
14225
14226 PR 7091
14227 * target-reloc.h (Default_scan_relocatable_relocs): For each
14228 function, map r_type == 0 to RELOC_DISCARD.
14229
2756a258
CC
142302008-12-10 Cary Coutant <ccoutant@google.com>
14231
14232 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14233 object to override a kept COMDAT group from a plugin object.
14234
bb6f53d3
ILT
142352008-12-09 Ian Lance Taylor <iant@google.com>
14236
fbc558e1
ILT
14237 PR 7088
14238 * yyscript.y (file_cmd): Handle INPUT.
14239
bb6f53d3
ILT
14240 * testsuite/initpri1.c: Change all declarations to be full
14241 prototypes by adding void, to avoid compiler warnings.
14242
4674ecfc
CC
142432008-12-05 Rafael Avila de Espindola <espindola@google.com>
14244
14245 * options.cc (General_options::parse_plugin_opt): New.
14246 (General_options::add_plugin): The argument now is just the filename.
14247 (General_options::add_plugin_option): New.
14248 * options.h (plugin_opt): New.
14249 (add_plugin): Change argument name.
14250 (add_plugin_option): New.
14251 * plugin.cc (Plugin::load): Don't parse the plugin option.
14252 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14253 (Plugin::add_option): New.
14254 (Plugin::args_): Change type.
14255 (Plugin::filename_): New.
14256 (Plugin_manager::add_plugin_option): New.
14257 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14258 * testsuite/Makefile.in: Regenerate.
14259
fd06b4aa
CC
142602008-12-05 Cary Coutant <ccoutant@google.com>
14261
14262 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14263 Handle --strip-lto-sections option.
14264 * options.h (strip_lto_sections): New option.
14265
6c52134c
CC
142662008-12-01 Cary Coutant <ccoutant@google.com>
14267
14268 * plugin.cc (ld_plugin_message): Change format parameter to const.
14269 Fix mismatch between new[] and delete.
14270
a45248e0
CC
142712008-11-14 Cary Coutant <ccoutant@google.com>
14272
14273 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14274 instead of -1U.
14275
c82fbeee
CS
142762008-11-05 Craig Silverstein <csilvers@google.com>
14277
14278 * options.cc (General_options::parse_dynamic_list): New function.
14279 * options.h (General_options): New flags dynamic_list,
14280 dynamic_list_data, dynamic_list_cpp_new, and
14281 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14282 (General_options::in_dynamic_list): New function.
14283 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14284 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14285 (Lex::can_continue_name): Likewise.
14286 (yylex): Likewise.
14287 (read_script_file): New parameter script_options.
14288 (read_dynamic_list): New function.
14289 (Script_options::define_dynamic_list): New function.
14290 (dynamic_list_keyword_parsecodes): New variable.
14291 (dynamic_list_keywords): New variable.
14292 * script.h (Script_options::define_dynamic_list): New function
14293 prototype.
14294 (read_dynamic_list): New function prototype.
14295 * symtab.cc (strprefix): New macro.
14296 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14297 dynamic_list_data, dynamic_list_cpp_new, and
14298 dynamic_list_cpp_typeinfo.
14299 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14300 (dynamic_list_expr): New rule.
14301 (dynamic_list_nodes): Likewise.
14302 (dynamic_list_node): Likewise.
14303 * testsuite/Makefile.am (dynamic_list): New test.
14304 * testsuite/Makefile.in: Regenerated.
14305 * testsuite/dynamic_list.t: New file.
14306 * testsuite/dynamic_list.sh: New file.
14307
e0bb29a5
CS
143082008-11-05 Craig Silverstein <csilvers@google.com>
14309
14310 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14311 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14312 (t11_last): Likewise.
14313 * testsuite/ver_test_6.c (main): Likewise.
14314
4e1e25e0
CC
143152008-10-07 Cary Coutant <ccoutant@google.com>
14316
14317 * options.c (General_options::finalize): Add check for -static and
14318 -shared.
14319 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14320 is not empty.
14321
92f03fcb
CC
143222008-10-02 Cary Coutant <ccoutant@google.com>
14323
14324 * plugin.cc (make_sized_plugin_object): Fix conditional
14325 compilation to work when not all targets are enabled.
14326
fbd8a257
CC
143272008-09-29 Cary Coutant <ccoutant@google.com>
14328
14329 * archive.cc (Archive::get_file_and_offset): Use filename instead
14330 of name to get library path.
14331 (Archive::include_member): Unlock external member of a thin archive.
14332
14333 * testsuite/Makefile.am (TEST_AR): New variable.
14334 (thin_archive_test_1): New test.
14335 (thin_archive_test_2): New test.
81636b3f
CC
14336 * testsuite/Makefile.in: Regenerate.
14337 * testsuite/thin_archive_main.cc: New file.
14338 * testsuite/thin_archive_test_1.cc: New file.
14339 * testsuite/thin_archive_test_2.cc: New file.
14340 * testsuite/thin_archive_test_3.cc: New file.
14341 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14342
eff45813
CC
143432008-09-29 Cary Coutant <ccoutant@google.com>
14344
14345 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14346 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14347 instead of -1U.
14348 (Sized_relobj::do_finalize_local_symbols): Likewise.
14349 (Sized_relobj::map_to_kept_section): Likewise.
14350 * object.h (Sized_relobj::invalid_address): New constant.
14351 (Sized_relobj::do_output_section_offset): Check for invalid_address
14352 and return -1ULL.
14353 * output.cc (Output_reloc::local_section_offset): Use constant
14354 invalid_address instead of -1U.
14355 (Output_reloc::get_address): Likewise.
14356 (Output_section::output_address): Change -1U to -1ULL.
14357 * output.h (Output_reloc::invalid_address): New constant.
14358 * reloc.cc (Sized_relobj::write_sections): Use constant
14359 invalid_address instead of -1U.
14360 (Sized_relobj::relocate_sections): Likewise.
14361 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14362 values for merge sections.
14363 * target-reloc.h (relocate_for_relocatable): Use constant
14364 invalid_address instead of -1U.
14365
89fc3421
CC
143662008-09-19 Cary Coutant <ccoutant@google.com>
14367
14368 Add plugin functionality for link-time optimization (LTO).
14369 * configure.ac (plugins): Add --enable-plugins option.
14370 * configure: Regenerate.
14371 * config.in: Regenerate.
14372 * Makefile.am (LIBDL): New variable.
14373 (CCFILES): Add plugin.cc.
14374 (HFILES): Add plugin.h.
14375 (ldadd_var): Add LIBDL.
14376 * Makefile.in: Regenerate.
14377
14378 * archive.cc: Include "plugin.h".
14379 (Archive::setup): Don't preread archive symbols when using a plugin.
14380 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14381 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14382 files.
14383 (Archive::include_member): Add symbols from plugin objects.
14384 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14385 * descriptors.cc (Descriptors::open): Check for file descriptors
14386 abandoned by plugins.
14387 (Descriptors::claim_for_plugin): New function.
14388 * descriptors.h (Descriptors::claim_for_plugin): New function.
14389 (Open_descriptor::is_claimed): New field.
14390 (claim_descriptor_for_plugin): New function.
14391 * fileread.cc (File_read::claim_for_plugin): New function.
14392 * fileread.h (File_read::claim_for_plugin): New function.
14393 (File_read::descriptor): New function.
14394 * gold.cc: Include "plugin.h".
14395 (queue_initial_tasks): Add task to call plugin hooks for generating
14396 new object files.
14397 * main.cc: Include "plugin.h".
14398 (main): Load plugin libraries.
14399 * object.h (Pluginobj): Declare.
14400 (Object::pluginobj): New function.
14401 (Object::do_pluginobj): New function.
14402 (Object::set_target): New function.
14403 * options.cc: Include "plugin.h".
14404 (General_options::parse_plugin): New function.
14405 (General_options::General_options): Initialize plugins_ field.
14406 (General_options::add_plugin): New function.
14407 * options.h (Plugin_manager): Declare.
14408 (General_options): Add --plugin option.
14409 (General_options::has_plugins): New function.
14410 (General_options::plugins): New function.
14411 (General_options::add_plugin): New function.
14412 (General_options::plugins_): New field.
14413 * plugin.cc: New file.
14414 * plugin.h: New file.
14415 * readsyms.cc: Include "plugin.h".
14416 (Read_symbols::do_read_symbols): Check for archive before checking
14417 for ELF file. Call plugin hooks to claim files.
14418 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14419 from a real object file; force override when processing replacement
14420 files.
14421 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14422 (Symbol::init_base_object): Likewise.
14423 (Symbol::init_base_output_data): Likewise.
14424 (Symbol::init_base_output_segment): Likewise.
14425 (Symbol::init_base_constant): Likewise.
14426 (Symbol::init_base_undefined): Likewise.
14427 (Symbol::output_section): Assert that object is not a plugin.
14428 (Symbol_table::add_from_pluginobj): New function.
14429 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14430 undefined.
14431 (Symbol_table::sized_write_globals): Likewise.
14432 (Symbol_table::add_from_pluginobj): Instantiate template.
14433 * symtab.h (Sized_pluginobj): Declare.
14434 (Symbol::in_real_elf): New function.
14435 (Symbol::set_in_real_elf): New function.
14436 (Symbol::in_real_elf_): New field.
14437 (Symbol_table::add_from_pluginobj): New function.
14438
14439 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14440 (LIBDL): New variable.
14441 (LDADD): Add LIBDL.
14442 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14443 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14444 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14445 (MOSTLYCLEANFILES): Likewise.
14446 * testsuite/Makefile.in: Regenerate.
14447 * testsuite/plugin_test.c: New file.
14448 * testsuite/plugin_test_1.sh: New file.
14449 * testsuite/plugin_test_2.sh: New file.
14450
de31bda5
ILT
144512008-09-16 Ian Lance Taylor <iant@google.com>
14452
9c2d0ef9
ILT
14453 * target-reloc.h (relocate_section): Check whether a symbol is
14454 defined by the ABI before reporting an undefined symbol error.
14455 * target.h (Target::is_defined_by_abi): Make parameter const.
14456 (Target::do_is_defined_by_abi): Likewise.
14457 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14458 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14459 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14460 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14461 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14462 * testsuite/Makefile.in: Rebuild.
14463
de31bda5
ILT
14464 * fileread.cc (make_view): Add casts to avoid warning.
14465
9fa33bee
AO
144662008-09-16 Alexandre Oliva <aoliva@redhat.com>
14467
14468 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14469 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14470
183fd0e3
AO
144712008-09-16 Alexandre Oliva <aoliva@redhat.com>
14472
14473 * options.h (General_options::output_is_executable): New.
14474 (General_options::output_is_pie): New.
14475 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14476 for shared libraries.
14477 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14478
7be8330a
CD
144792008-09-11 Chris Demetriou <cgd@google.com>
14480
14481 * options.h (origin): New -z option.
14482 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14483 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14484 in DT_FLAGS_1.
14485
a9caad02
CC
144862008-09-05 Cary Coutant <ccoutant@google.com>
14487
14488 * fileread.cc (File_read::make_view): Add check for attempt to map
14489 beyond end of file.
14490
ae6dce4d
CC
144912008-09-05 Cary Coutant <ccoutant@google.com>
14492
14493 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14494 explicit instantiations.
14495
d7ab2a47
KVH
144962008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14497
14498 PR gold/6858
14499 * options.cc (General_options::finalize): Allow undefined symbols
14500 in shlibs if linking -shared.
14501
14502 PR gold/6859
14503 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14504 symbols as not needing a dynsym entry.
14505
1e52a9c1
CS
145062008-08-20 Craig Silverstein <csilvers@google.com>
14507
14508 * fileread.cc (File_read::open): Do not lock the file unless it
14509 was successfully opened.
14510
d85c80a3
CC
145112008-08-14 Cary Coutant <ccoutant@google.com>
14512
14513 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14514 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14515 * testsuite/tls_test.cc (struct int128): 128-bit struct
14516 for testing TLS relocs with non-zero addend.
14517 (v12): New TLS variable.
14518 (t12): New test.
14519 (t_last): Add check for v12.
14520 * testsuite/tls_test.h (t12): New function.
14521 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14522
2d924fd9
ILT
145232008-08-13 Ian Lance Taylor <iant@google.com>
14524
14525 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14526 set tls_segment_ or relro_segment_.
14527 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14528 when appropriate.
14529 * output.h (Output_section::clear_is_relro): New function.
14530 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14531 sections specially even when output_data_ is empty.
14532 (Output_segment::maximum_alignment): When first section is relro,
14533 only force alignment for PT_LOAD segments.
14534 * script.cc (script_data_segment_align): New function.
14535 (script_data_segment_relro_end): New function.
14536 * script-c.h (script_data_segment_align): Declare.
14537 (script_data_segment_relro_end): Declare.
14538 * script-sections.h (class Script_sections): Declare
14539 data_segment_align and data_segment_relro_end. Add fields
14540 segment_align_index_ and saw_relro_end_.
14541 * script-sections.cc (class Sections_element): Add set_is_relro
14542 virtual function. Add new bool* parameter to place_orphan_here.
14543 Add get_output_section virtual function.
14544 (class Output_section_definition): Add set_is_relro. Add new
14545 bool* parameter to place_orphan_here. Add get_output_section.
14546 Add is_relro_ field.
14547 (Output_section_definition::Output_section_definition): Initialize
14548 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14549 and is_relro_ fields.
14550 (Output_section_definition::place_orphan_here): Add is_relro
14551 parameter.
14552 (Output_section_definition::set_section_addresses): Set relro for
14553 output section.
14554 (Output_section_definition::alternate_constraint): Likewise.
14555 (class Orphan_output_section): Add new bool* parameter to
14556 place_orphan_here. Add get_output_section.
14557 (Orphan_output_section::place_orphan_here): Add is_relro
14558 parameter.
14559 (Script_sections::Script_sections): Initialize
14560 data_segment_align_index_ and saw_relro_end_.
14561 (Script_sections::data_segment_align): New function.
14562 (Script_sections::data_segment_relro_end): New function.
14563 (Script_sections::place_orphan): Set or clear is_relro.
14564 (Script_sections::set_section_addresses): Force alignment of first
14565 TLS section.
14566 * yyscript.y (exp): Call script_data_segment_align and
14567 script_data_segment_relro_end.
14568 * testsuite/relro_script_test.t: New file.
14569 * testsuite/relro_test.cc (using_script): Declare.
14570 (t1, t2): Test using_script.
14571 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14572 (relro_script_test_SOURCES): Define.
14573 (relro_script_test_DEPENDENCIES): Define.
14574 (relro_script_test_LDFLAGS): Define.
14575 (relro_script_test_LDADD): Define.
14576 (relro_script_test.so): New target.
14577 * testsuite/Makefile.in: Rebuild.
14578
f827c9a9
CC
145792008-08-06 Cary Coutant <ccoutant@google.com>
14580
14581 * archive.cc (Archive::total_archives, Archive::total_members)
14582 (Archive::total_members_loaded): New variables.
14583 (Archive::setup): Add parameter. Add option to preread
14584 archive symbols.
14585 (Archive::read_armap): Add counter.
14586 (Archive::get_file_and_offset): New function.
14587 (Archive::get_elf_object_for_member): New function.
14588 (Archive::read_all_symbols): New function.
14589 (Archive::read_symbols): New function.
14590 (Archive::add_symbols): Add counters.
14591 (Archive::include_all_members): Use armap to find members if it's
14592 already built.
14593 (Archive::include_member): Skip reading symbols if already read.
14594 Factored code into Archive::get_file_and_offset and
14595 Archive::get_elf_object_for_member. Changed call to
14596 Mapfile::report_include_archive_member.
14597 (Archive::print_stats): New function.
14598 * archive.h: Declare Object and Read_symbols_data classes.
14599 (Archive::Archive): Add initializers for new members.
14600 (Archive::setup): Add parameter.
14601 (Archive::print_stats): New function.
14602 (Archive::total_archives, Archive::total_members)
14603 (Archive::total_members_loaded): New variables.
14604 (Archive::get_file_and_offset): New function.
14605 (Archive::get_elf_object_for_member): New function.
14606 (Archive::read_all_symbols): New function.
14607 (Archive::read_symbols): New function.
14608 (Archive::Archive_member): New class.
14609 (Archive::members_): New member.
14610 (Archive::num_members_): New member.
14611 * main.cc: Include archive.h.
14612 (main): Call Archive::print_stats.
14613 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14614 archive parameter; member_name is now the fully-decorated name.
14615 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14616 * options.h: (General_options): Add --preread-archive-symbols option.
14617 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14618 Archive::setup.
14619
de4c45bd
ILT
146202008-08-04 Ian Lance Taylor <iant@google.com>
14621
14622 * symtab.h (Symbol::use_plt_offset): New function.
14623 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14624 * powerpc.cc (Relocate::relocate): Likewise.
14625 * sparc.cc (Relocate::relocate): Likewise.
14626 * x86_64.cc (Relocate::relocate): Likewise.
14627 * testsuite/weak_plt.sh: New test.
14628 * testsuite/weak_plt_main.cc: New test.
14629 * testsuite/weak_plt_shared.cc: New test.
14630 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14631 (check_PROGRAMS): Add weak_plt.
14632 (check_DATA): Add weak_plt_shared.so.
14633 (weak_plt_main_pic.o, weak_plt): New targets.
14634 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14635 * testsuite/Makefile.in: Rebuild.
14636
14637 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14638 gcctestdir/ld.
14639 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14640 * testsuite/Makefile.in: Rebuild.
14641
323ee3f4
AM
146422008-08-04 Alan Modra <amodra@bigpond.net.au>
14643
14644 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14645 * Makefile.in: Regenerate.
14646 * po/POTFILES.in: Regenerate.
14647
7c07ecec
ILT
146482008-07-29 Ian Lance Taylor <iant@google.com>
14649
14650 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14651 symbols before other symbols.
14652 * testsuite/script_test_2.cc (test_addr): Declare.
14653 (test_addr_alias): Declare.
14654 (main): Check that test_addr and test_addr_alias have the right
cd536b21 14655 values.
7c07ecec
ILT
14656 * testsuite/script_test_2.t: Define test_addr_alias and
14657 test_addr.
14658
5778530e
ILT
146592008-07-24 Ian Lance Taylor <iant@google.com>
14660
2a00e4fb
ILT
14661 PR 5990
14662 * descriptors.cc: New file.
14663 * descriptors.h: New file.
14664 * gold-threads.h (class Hold_optional_lock): New class.
14665 * fileread.cc: Include "descriptors.h".
14666 (File_read::~File_read): Release descriptor rather than closing
14667 it.
14668 (File_read::open) [file]: Call open_descriptor rather than open.
14669 Set is_descriptor_opened_.
14670 (File_read::open) [memory]: Assert that descriptor is not open.
14671 (File_read::reopen_descriptor): New function.
14672 (File_read::release): Release descriptor.
14673 (File_read::do_read): Make non-const. Reopen descriptor.
14674 (File_read::read): Make non-const.
14675 (File_read::make_view): Reopen descriptor.
14676 (File_read::do_readv): Likewise.
14677 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14678 Update declarations.
14679 * layout.cc: Include "descriptors.h".
14680 (Layout::create_build_id): Use open_descriptor rather than open.
14681 * output.cc: Include "descriptors.h".
14682 (Output_file::open): Use open_descriptor rather than open.
14683 * archive.cc (Archive::const_iterator): Change Archive to be
14684 non-const.
14685 (Archive::begin, Archive::end): Make non-const.
14686 (Archive::count_members): Likewise.
14687 * archive.h (class Archive): Update declarations.
14688 * object.h (Object::read): Make non-const.
14689 * Makefile.am (CCFILES): Add descriptors.cc.
14690 (HFILES): Add descriptors.h.
14691 * Makefile.in: Rebuild.
14692
801647d1
ILT
14693 PR 6716
14694 * gold.h: Always include <clocale>. Add Solaris workarounds
14695 following code in binutils/sysdep.h.
14696
5edd166e
ILT
14697 PR 6048
14698 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14699 this->eh_frame_hdr_ is NULL before using it.
14700
c89ad728
ILT
14701 * dynobj.cc (Versions::Versions): Update comment.
14702
aa86f06b
ILT
14703 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14704 the base version name.
14705
5778530e
ILT
14706 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14707 array size plus one.
14708 (Stringpool_template::set_string_offsets): Subtract one from key
14709 before using it as an array index.
14710 (Stringpool_template::get_offset_with_length): Likewise.
14711 (Stringpool_template::write_to_buffer): Likewise.
14712 * stringpool.h (Stringpool_template::get_offset_from_key):
14713 Likewise.
14714
057ead22
ILT
147152008-07-23 Ian Lance Taylor <iant@google.com>
14716
7f649c59
ILT
14717 PR 6658
14718 * object.h (Merged_symbol_value::value): Do our best to handle a
14719 negative addend.
14720
057ead22
ILT
14721 PR 6647
14722 * script.cc (Version_script_info::get_versions): Don't add empty
14723 version tag to return value.
14724 (Version_script_info::get_symbol_version_helper): Change return
14725 type to bool. Add pversion parameter. Change all callers.
14726 (script_register_vers_node): Don't require a non-NULL tag.
14727 * script.h (class Version_script_info): Update declarations.
14728 (Version_script_info::get_symbol_version): Change return type to
14729 bool. Add version parameter. Change all callers.
14730 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14731 handling. Handle an empty version from a version script.
14732 (Symbol_table::define_special_symbol): Likewise.
14733 * testsuite/ver_test_10.script: New file.
14734 * testsuite/ver_test_10.sh: New file.
14735 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14736 (check_DATA): Add ver_test_10.syms.
14737 (ver_test_10.syms, ver_test_10.so): New target.
14738 * testsuite/Makefile.in: Rebuild.
14739
58e54ac2
CD
147402008-07-23 Simon Baldwin <simonb@google.com>
14741
14742 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14743 to zero for undefined symbols from dynamic libraries.
14744
95d14cd3
ILT
147452008-07-23 Ian Lance Taylor <iant@google.com>
14746
14747 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14748 Change all callers.
14749 * symtab.h (class Symbol_table): Update declaration.
14750 * testsuite/ver_test_9.cc: New file.
14751 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14752 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14753 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14754 (ver_test_9.so, ver_test_9.o): New targets.
14755 * testsuite/Makefile.in: Rebuild.
14756
92de84a6
ILT
147572008-07-22 Ian Lance Taylor <iant@google.com>
14758
34810851
ILT
14759 * options.h (class General_options): Define --check-sections.
14760 * layout.cc (Layout::set_segment_offsets): Handle
14761 --check-sections.
14762
af6156ef
ILT
14763 * options.h (class General_options): Define -n/--nmagic and
14764 -N/--omagic.
14765 * options.cc (General_options::finalize): For -n/--nmagic or
14766 -N/--omagic, set -static.
14767 * layout.cc (Layout::attach_allocated_section_to_segment): If
14768 -N/--omagic, don't put read-only and read-write sections in
14769 different segments.
14770 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14771 finding a read-only segment.
14772 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14773 don't set the minimum segment alignment to the common page size,
14774 and don't set the file offset to the address modulo the page size.
14775 * script-sections.cc (Script_sections::create_segments): If
14776 -n/--omagic, don't put read-only and read-write sections in
14777 different segments.
14778
92de84a6
ILT
14779 * cref.cc: New file.
14780 * cref.h: New file.
14781 * options.h (class General_options): Add --print-symbol-counts.
14782 * main.cc (main): Issue defined symbol report if requested.
14783 * archive.cc (Archive::interpret_header): Make into a const member
14784 function.
14785 (Archive::add_symbols): Call Input_objects::archive_start and
14786 archive_stop.
14787 (Archive::const_iterator): Define new class.
14788 (Archive::begin, Archive::end): New functions.
14789 (Archive::include_all_members): Rewrite to use iterator.
14790 (Archive::count_members): New function.
14791 * archive.h (class Archive): Update declarations.
14792 (Archive::filename): New function.
14793 * object.cc: Include "cref.h".
14794 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14795 (Sized_relobj::do_get_global_symbol_counts): New function.
14796 (Input_objects::add_object): Add object to cross-referencer.
14797 (Input_objects::archive_start): New function.
14798 (Input_objects::archive_stop): New function.
14799 (Input_objects::print_symbol_counts): New function.
14800 * object.h: Declare Cref and Archive.
14801 (Object::get_global_symbol_counts): New function.
14802 (Object::do_get_global_symbol_counts): New pure virtual function.
14803 (class Sized_relobj): Add defined_count_ field. Update
14804 declarations.
14805 (class Input_objects): Add cref_ field. Update constructor.
14806 Update declarations.
14807 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14808 defined_count_.
14809 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14810 symbol counts.
14811 (Sized_dynobj::do_get_global_symbol_counts): New function.
14812 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14813 defined_count_. Update declarations. Define Symbols typedef.
14814 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14815 parameter. Change all callers.
14816 (Symbol_table::add_from_dynobj): Add sympointers and defined
14817 parameters. Change all callers.
14818 * symtab.h (class Symbol_table): Update declarations.
14819 * Makefile.am (CCFILES): Add cref.cc.
14820 (HFILES): Add cref.h.
14821 * Makefile.in: Rebuild.
14822
3f7c5e1d
CD
148232008-07-22 Simon Baldwin <simonb@google.com>
14824
14825 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14826 to zero when writing undefined symbols.
14827
e0b64032
ILT
148282008-07-22 Ian Lance Taylor <iant@google.com>
14829
14830 * output.cc (Output_section::add_input_section): Don't try to
14831 merge empty merge sections.
14832
096b02cf
CS
148332008-07-21 Craig Silverstein <csilvers@google.com>
14834
14835 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14836 Include symbol version in error message.
cd536b21 14837
1d1f116d
CD
148382008-07-20 Chris Demetriou <cgd@google.com>
14839
cd536b21 14840 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
14841 (RANDOM_SEED_CFLAGS): New substituted variable.
14842 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14843 * configure: Rebuild.
14844 * Makefile.in: Likewise.
14845 * testsuite/Makefile.in: Likewise.
14846
a18f591e
ILT
148472008-07-18 Ian Lance Taylor <iant@google.com>
14848
14849 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14850 where we see NAME/NULL and NAME/VERSION as separate symbols.
14851 * testsuite/ver_test_main.cc (main): Call t4.
14852 (t4, t4_2a): Define.
14853 * testsuite/ver_test_2.cc (t4_2): Define.
14854 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14855 * testsuite/ver_test_4.cc (t4_2a): Define.
14856 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14857 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14858
c6e3f6ed
ILT
148592008-07-17 Ian Lance Taylor <iant@google.com>
14860
14861 * dynobj.cc (Versions::add_def): If we give an error about a
14862 missing version, go ahead and create the version anyhow.
14863
ef9beddf
ILT
148642008-07-10 Ian Lance Taylor <iant@google.com>
14865
14866 Handle output sections with more than 0x7fffffff bytes.
14867 * object.h (class Relobj): Change map_to_output_ to
14868 output_sections_, and just keep a section pointer. Change all
14869 uses. Move comdat group support to Sized_relobj.
14870 (Relobj::is_section_specially_mapped): Remove.
14871 (Relobj::output_section): Remove poff parameter. Change all
14872 callers.
14873 (Relobj::output_section_offset): New function.
14874 (Relobj::set_section_offset): Rewrite.
14875 (Relobj::map_to_output): Remove.
14876 (Relobj::output_sections): New function.
14877 (Relobj::do_output_section_offset): New pure virtual function.
14878 (Relobj::do_set_section_offset): Likewise.
14879 (class Sized_relobj): Add section_offsets_ field. Add comdat
14880 group support from Relobj. Update declarations.
14881 (Sized_relobj::get_output_section_offset): New function.
14882 (Sized_relobj::do_output_section_offset): New function.
14883 (Sized_relobj::do_set_section_offset): New function.
14884 * object.cc (Relobj::output_section_address): Remove.
14885 (Sized_relobj::Sized_relobj): Initialize new fields.
14886 (Sized_relobj::include_section_group): Cast find_kept_object to
14887 Sized_relobj.
14888 (Sized_relobj::include_linkonce_section): Likewise.
14889 (Sized_relobj::do_layout): Use separate arrays for output section
14890 and output offset.
14891 (Sized_relobj::do_count_local_symbols): Change map_to_output to
14892 output_sections.
14893 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
14894 output_sections and section_offsets.
14895 (Sized_relobj::write_local_symbols): Likewise.
14896 (map_to_kept_section): Compute output address directly.
14897 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
14898 output_sections and section_offsets.
14899 (Sized_relobj::write_sections): Likewise.
14900 (Sized_relobj::relocate_sections): Likewise.
14901 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
14902 * output.h (class Output_reloc): Update declarations. Change
14903 u2_.relobj to Sized_relobj*.
14904 (class Output_data_reloc): Change add functions to use
14905 Sized_relobj*.
14906 * output.cc (Output_reloc::Output_reloc): Change relobj to
14907 Sized_relobj*.
14908 (Output_reloc::local_section_offset): Change return type to
14909 Elf_Addr. Use get_output_section_offset.
14910 (Output_reloc::get_address): Likewise.
14911 (Output_section::is_input_address_mapped): Don't call
14912 is_section_specially_mapped.
14913 (Output_section::output_offset): Likewise.
14914 (Output_section::output_address): Likewise.
14915 (Output_section::starting_output_address): Likewise.
14916 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
14917 parameter to Sized_relobj*.
14918 (Copy_relocs::need_copy_reloc): Likewise.
14919 (Copy_relocs::save): Likewise.
14920 * copy-relocs.h (class Copy_relocs): Update declarations.
14921 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
14922 Sized_relobj*. Change relobj_ field to Sized_relobj*.
14923 * target-reloc.h (relocate_for_relocatable): Change
14924 offset_in_output_section type to Elf_Addr. Change code that uses
14925 it as well.
14926 * layout.cc (Layout::layout): Always set *off.
14927 * mapfile.cc (Mapfile::print_input_section): Use
14928 output_section_offset.
14929 * i386.cc (Target_i386::copy_reloc): Change object parameter to
14930 Sized_relobj*.
14931 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
14932 * sparc.cc (Target_sparc::copy_reloc): Likewise.
14933 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
14934
5cb66f97
ILT
149352008-07-03 Ian Lance Taylor <iant@google.com>
14936
14937 * layout.cc (Layout::include_section): Do not discard unrecognized
14938 SHT_STRTAB sections.
14939
afe47622
CS
149402008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
14941
14942 * script.cc (Lex::can_continue_name): Make '?' allowable in
14943 version-script names.
14944 * testsuite/version_script.map: Change glob pattern to use '?'
14945
5adf9721
ILT
149462008-06-30 Manish Singh <yosh@gimp.org>
14947
14948 PR 6585
14949 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
14950 Correct typo.
14951
e6fde208
ILT
149522008-06-30 Ian Lance Taylor <iant@google.com>
14953
14954 PR 6660
14955 PR 6682
14956 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
14957 versions]: Don't try to read the value in the contents, since we
14958 don't use it. Use the template endianness when writing.
14959
3f2e6a2d
CC
149602008-06-25 Cary Coutant <ccoutant@google.com>
14961
14962 * fileread.cc (File_read::make_view): Assert on zero-length view.
14963 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
14964 symbol table when there are no symbols to read.
14965
c43d3a48
CS
149662008-06-23 Craig Silverstein <csilvers@google.com>
14967
14968 * version.cc (version_string): Bump to 1.7
14969
5f494ea0
CS
149702008-06-18 Craig Silverstein <csilvers@google.com>
14971
14972 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
14973 constant 0xFFFF to type Valtype.
14974 (Powerpc_relocate_functions::rel16_ha): Likewise.
14975
c42e122e
ILT
149762008-06-17 Ian Lance Taylor <iant@google.com>
14977
f34787f8
ILT
14978 * output.h (Output_section::Input_section): Initialize p2align_ to
14979 zero for Output_section_data constructors.
14980 (Output_section::Input_section::addralign): If not an input
14981 section, return the alignment of the Output_section_data.
14982 * testsuite/copy_test.cc: New file.
14983 * testsuite/copy_test_1.cc: New file.
14984 * testsuite/copy_test_2.cc: New file.
14985 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
14986 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
14987 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
14988 (copy_test_1_pic.o, copy_test_1.so): New targets.
14989 (copy_test_2_pic.o, copy_test_2.so): New targets.
14990 * testsuite/Makefile.in: Rebuild.
14991
c42e122e
ILT
14992 * script-sections.cc (Script_sections::place_orphan): Initialize
14993 local variable exact.
14994
ce3ac18a
DE
149952008-06-13 David Edelsohn <edelsohn@gnu.org>
14996
14997 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
14998
42cacb20
DE
149992008-06-12 David Edelsohn <edelsohn@gnu.org>
15000 David S. Miller <davem@davemloft.net>
15001
15002 * powerpc.cc: New file.
15003 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15004 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15005 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15006 * Makefile.in: Rebuild.
15007
7b308235
ILT
150082008-06-09 Ian Lance Taylor <iant@google.com>
15009
15010 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15011 <exception>.
15012 (throwing, orig_terminate): New static variables.
15013 (terminate_handler): New static function.
15014 (t2): Set terminate handler.
15015
f0b886e3
ILT
150162008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15017
15018 PR 6584
cd536b21 15019 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
15020 alignment.
15021
3e90f135
CC
150222008-05-30 Cary Coutant <ccoutant@google.com>
15023
15024 * archive.cc (Archive::include_all_members) Correct to step
15025 over symbol table and extended name table in thin archives.
15026
e09ad04a
ILT
150272008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15028
15029 PR 6407
15030 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15031 calculation.
15032
62b01cb5
ILT
150332008-05-28 Caleb Howe <cshowe@google.com>
15034
15035 * reduced_debug_output.cc: New file.
15036 * reduced_debug_output.h: New file.
92de84a6 15037 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
15038 * options.cc (General_options::finalize): Add strip_debug_non_line
15039 to the strip heirarchy.
15040 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15041 fields.
15042 * layout.cc: Include "reduced_debug_output.h".
15043 (Layout::Layout): Initialize new fields.
15044 (line_only_debug_sections): New static array.
15045 (is_lines_only_debug_sections): New static inline function.
15046 (Layout::include_section): Handle --strip-debug-non-line.
15047 (Layout::make_output_section): If --strip-debug-non-line, build
15048 new output sections for .debug_abbrev and .debug_info.
15049 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15050 gold. Warn about possible overflow.
15051 (read_signed_LEB_128): Likewise.
15052 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15053 (read_signed_LEB_128): Declare.
15054 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15055 (HFILES): Add reduced_debug_output.h.
15056 * Makefile.in: Rebuild.
15057
7d9e3d98
ILT
150582008-05-21 Ian Lance Taylor <iant@google.com>
15059
15060 * mapfile.cc: New file.
15061 * mapfile.h: New file.
15062 * options.h (class General_options): Add -M/--print-map and -Map.
15063 * options.cc (General_options::finalize): Make -M equivalent to
15064 -Map -.
15065 * main.cc: Include <cstdio> and "mapfile.h".
15066 (main): Open mapfile if requested.
15067 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15068 constructor. Change caller.
15069 (queue_initial_tasks): Add mapfile parameter. Change caller.
15070 (queue_middle_tasks): Likewise.
15071 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15072 declarations.
15073 * archive.cc: Include "mapfile.h".
15074 (Archive::add_symbols): Add mapfile parameter. Change all
15075 callers. Pass mapfile, symbol, and reason to include_member.
15076 (Archive::include_all_members): Add mapfile parameter. Change all
15077 callers.
15078 (Archive::include_member): Add mapfile, sym, and why parameters.
15079 Change all callers. Report inclusion to map file.
15080 * archive.h: Include "fileread.h".
15081 (class Archive): Update declarations.
15082 (Archive::file): New const method.
15083 (class Add_archive_symbols): Add mapfile_ field. Update
15084 constructor. Change all callers.
15085 * readsyms.h (class Read_symbols): Likewise.
15086 (class Finish_group): Likewise.
15087 (class Read_script): Likewise.
15088 * common.cc: Include "mapfile.h".
15089 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15090 all callers.
15091 (Symbol_table::do_allocate_commons): Likewise.
15092 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15093 symbol allocation to mapfile.
15094 * common.h (class Allocate_commons_task): Add mapfile_ field.
15095 Update constructor. Change all callers.
15096 * symtab.h (class Symbol_table): Update declarations.
15097 * layout.cc: Include "mapfile.h".
15098 (Layout_task_runner::run): Print information to mapfile.
15099 (Layout::create_gold_note): Change Output_data_fixed_space to
15100 Output_data_zero_fill.
15101 (Layout::create_build_id): Likewise.
15102 (Layout::print_to_mapfile): New function.
15103 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15104 constructor. Change caller.
15105 (class Layout): Declare print_to_mapfile.
15106 * output.cc (Output_section::Input_section::print_to_mapfile): New
15107 function.
15108 (Output_section::add_input_section): If producing a map, always
15109 add to input_sections_ list.
15110 (Output_section::do_print_to_mapfile): New function.
15111 (Output_segment::print_sections_to_mapfile): New function.
15112 (Output_segment::print_section_list_to_mapfile): New function.
15113 * output.h: Include "mapfile.h".
15114 (Output_data::print_to_mapfile): New function.
15115 (Output_data::do_print_to_mapfile): New virtual function.
15116 (Output_segment_headers::do_print_to_mapfile): New function.
15117 (Output_file_header::do_print_to_mapfile): New function.
15118 (Output_data_const::do_print_to_mapfile): New function.
15119 (class Output_data_const_buffer): Add map_name_ field. Update
15120 constructor. Change all callers. Add do_print_to_mapfile
15121 function.
15122 (class Output_data_fixed_space): Likewise.
15123 (class Output_data_space): Likewise.
15124 (class Output_data_zero_fill): New class.
15125 (Output_data_strtab::do_print_to_mapfile): New function.
15126 (Output_data_reloc_base::do_print_to_mapfile): New function.
15127 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15128 (Output_data_group::do_print_to_mapfile): New function.
15129 (Output_data_got::do_print_to_mapfile): New function.
15130 (Output_data_dynamic::do_print_to_mapfile): New function.
15131 (Output_symtab_xindex::do_print_to_mapfile): New function.
15132 (class Output_section): Declare do_print_to_mapflie. Declare
15133 print_to_mapfile in Input_section.
15134 (class Output_segment): Declare new functions.
15135 * object.h (Sized_relobj::symbol_count): New function.
15136 * script-sections.cc
15137 (Output_section_element_dot_assignment::set_section_addresses):
15138 Change Output_data_fixed_space to Output_data_zero_fill.
15139 (Output_data_expression::do_print_to_mapfile): New function.
15140 * script.cc (read_input_script): Add mapfile parameter. Change
15141 all callers.
15142 * script.h (read_input_script): Update declaration.
15143 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15144 (Eh_frame::do_print_to_mapfile): New function.
15145 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15146 (Output_merge_string::do_print_to_mapfile): New function.
15147 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15148 function.
15149 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15150 function.
15151 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15152 function.
15153 * Makefile.am (CCFILES): Add mapfile.cc.
15154 (HFILES): Add mapfile.h.
15155 * Makefile.in: Rebuild.
15156
9f1d377b
ILT
151572008-05-19 Ian Lance Taylor <iant@google.com>
15158
15159 * options.h (class General_options): Add -z relro.
15160 * layout.cc (Layout::Layout): Initialize relro_segment_.
15161 (Layout::add_output_section_data): Return the output section.
15162 (Layout::make_output_section): Rcognize relro sections and mark
15163 them appropriately.
15164 (Layout::attach_allocated_section_to_segment): Put relro sections
15165 in a PT_GNU_RELRO segment.
15166 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15167 section as relro.
15168 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15169 PT_TLS segments.
15170 (Layout::linkonce_mapping): Map d.rel.ro.local to
15171 .data.rel.ro.local.
15172 (Layout::output_section_name): Us .data.rel.ro.local for any
15173 section which begins with that.
15174 * layout.h (class Layout): Update add_output_section_data
15175 declaration. Add relro_segment_ field.
15176 * output.cc (Output_section::Output_section): Initialize is_relro_
15177 and is_relro_local_ fields.
15178 (Output_segment::add_output_section): Group relro sections.
15179 (Output_segment::is_first_section_relro): New function.
15180 (Output_segment::maximum_alignment): If there is a relro section,
15181 align the segment to the common page size.
15182 (Output_segment::set_section_addresses): Track whether we are
15183 looking at relro sections. If the last section is a relro
15184 section, align to the common page size.
15185 (Output_segment::set_section_list_addresses): Add in_relro
15186 parameter. Change all callers. Align to the page size when
15187 moving from relro to non-relro section.
15188 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15189 segment.
15190 * output.h (class Output_section): Add is_relro_ and
15191 is_relro_local_ fields.
15192 (Output_section::is_relro): New function.
15193 (Output_section::set_is_relro): New function.
15194 (Output_section::is_relro_local): New function.
15195 (Output_section::set_is_relro_local): New function.
15196 (class Output_segment): Update declarations.
15197 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15198 * sparc.cc (Target_sparc::got_section): Likewise.
15199 * x86_64.cc (Target_x86_64::got_section): Likewise.
15200 * testsuite/relro_test_main.cc: New file.
15201 * testsuite/relro_test.cc: New file.
15202 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15203 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15204 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15205 (relro_test.so, relro_test_pic.o): New targets.
15206 * testsuite/Makefile.in: Rebuild.
15207
a984ee1d
ILT
152082008-05-16 Ian Lance Taylor <iant@google.com>
15209
01676dcd
ILT
15210 * output.cc (Output_segment::add_output_section): Remove front
15211 parameter.
15212 * output.h (class Output_segment): Remove
15213 add_initial_output_section and overloaded add_output_section.
15214 Update declaration of remaining add_output_section.
15215 * layout.cc (Layout::create_interp): Call add_output_section
15216 rather than add_initial_output_section.
15217 (Layout::finish_dynamic_section): Likewise.
15218
497897f9
ILT
15219 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15220 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15221 know the dynamic type.
15222 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15223 field. Initialize it in constructor.
15224 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15225 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15226 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15227 reloc.
15228
a984ee1d
ILT
15229 * output.cc (Output_reloc::get_address): Change return type to
15230 Elf_Addr.
15231 * output.h (class Output_reloc): Update get_address declaration.
15232 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15233 for section addresses.
15234
55ba0940
ILT
152352008-05-09 Ian Lance Taylor <iant@google.com>
15236
15237 PR 6493
15238 * gold.cc (gold_nomem): Use return value of write.
15239
75517b77
ILT
152402008-05-08 Ian Lance Taylor <iant@google.com>
15241
15242 * symtab.c (Symbol::init_base_output_data): Add version
15243 parameter. Change all callers.
15244 (Symbol::init_base_output_segment): Likewise.
15245 (Symbol::init_base_constant): Likewise.
15246 (Symbol::init_base_undefined): Likewise.
15247 (Sized_symbol::init_output_data): Likewise.
15248 (Sized_symbol::init_output_segment): Likewise.
15249 (Sized_symbol::init_constant): Likewise.
15250 (Sized_symbol::init_undefined): Likewise.
15251 (Symbol_table::do_define_in_output_data): If the new symbol has a
15252 version, mark it as the default.
15253 (Symbol_table::do_define_in_output_segment): Likewise.
15254 (Symbol_table::do_define_as_constant): Likewise.
15255 * symtab.h (class Symbol): Update declarations.
15256 (class Sized_symbol): Likewise.
15257 * resolve.cc (Symbol::override_version): New function.
c42e122e 15258 (Symbol::override_base): Call override_version.
75517b77
ILT
15259 (Symbol::override_base_with_special): Likewise.
15260 * testsuite/ver_script_8.script: New file.
15261 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15262 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15263 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15264 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15265
f1f70eae
ILT
152662008-05-06 Ian Lance Taylor <iant@google.com>
15267
f3e9c5c5
ILT
15268 PR 6049
15269 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15270 functions.
15271 (class General_options): Remove existing --undefined, and add
15272 --no-undefined instead. Add new --undefined as synonym for -u.
15273 * archive.cc (Archive::add_symbols): Check whether symbol was
15274 named with -u.
15275 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15276 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15277 all uses. Add IS_UNDEFINED. Update declarations to split
15278 different versions of init_base. Declare init_base_undefined.
15279 (Symbol::is_defined): Handle IS_UNDEFINED.
15280 (Symbol::is_undefined): Likewise.
15281 (Symbol::is_weak_undefined): Call is_undefined.
15282 (Symbol::is_absolute): Handle IS_CONSTANT.
15283 (class Sized_symbol): Update declarations to split different
15284 versions of init. Declare init_undefined.
15285 (class Symbol_table): Declare new functions.
15286 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15287 Change all callers.
15288 (Symbol::init_base_output_data): Likewise.
15289 (Symbol::init_base_output_segment): Likewise.
15290 (Symbol::init_base_constant): Likewise.
15291 (Symbol::init_base_undefined): New function.
15292 (Sized_symbol::init_object): Rename from init. Change all
15293 callers.
15294 (Sized_symbol::init_output_data): Likewise.
15295 (Sized_symbol::init_output_segment): Likewise.
15296 (Sized_symbol::init_constant): Likewise.
15297 (Sized_symbol::init_undefined): New function.
15298 (Symbol_table::add_undefined_symbols_from_command_line): New
15299 function.
15300 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15301 function.
15302 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15303 (Symbol::output_section): Likewise.
15304 (Symbol::set_output_section): Likewise.
15305 (Symbol_table::sized_finalize_symbol): Likewise.
15306 (Symbol_table::sized_write_globals): Likewise.
15307 * resolve.cc (Symbol_table::should_override): Likewise.
15308 (Symbol::override_base_with_special): Likewise.
15309
8bdcdf2c
ILT
15310 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15311 symbol, change it to have default visibility.
15312 * testsuite/protected_1.cc: New file.
15313 * testsuite/protected_2.cc: New file.
15314 * testsuite/protected_3.cc: New file.
15315 * testsuite/protected_main_1.cc: New file.
15316 * testsuite/protected_main_2.cc: New file.
15317 * testsuite/protected_main_3.cc: New file.
15318 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15319 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15320 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15321 (protected_1.so): New target.
15322 (protected_1_pic.o, protected_2_pic.o): New targets.
15323 (protected_3_pic.o): New target.
15324 (check_PROGRAMS): Add protected_2.
15325 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15326 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15327 * testsuite/Makefile.in: Rebuild.
15328
2b706932
ILT
15329 * options.h (DEFINE_var): Add set_user_set_##varname__.
15330 (DEFINE_bool_alias): New macro.
15331 (class General_options): Define -Bstatic using DEFINE_bool_alias
15332 rather than DEFINE_special. Add --undefined as an alias for -z
15333 defs.
15334 * options.cc (General_options::parse_Bstatic): Remove.
15335
d82a5bcc
ILT
15336 * options.h (class General_options): Add --fatal-warnings.
15337 * main.cc (main): Implement --fatal-warnings.
15338 * errors.h (Errors::warning_count): New function.
15339
f1f70eae
ILT
15340 * options.h (class General_options): Add -Bsymbolic-functions.
15341 * symtab.h (Symbol::is_preemptible): Check for
15342 -Bsymbolic-functions.
15343
8825ac63
ILT
153442008-05-05 Ian Lance Taylor <iant@google.com>
15345
d98bc257
ILT
15346 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15347 as noVARNAME rather than no-VARNAME.
15348 (class General_options): Add option -z combreloc.
15349 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15350 get_address.
15351 (Output_reloc::sort_before) [SHT_REL]: New function.
15352 (Output_reloc::sort_before) [SHT_RELA]: New function.
15353 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15354 Sort_relocs_comparison.
15355 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15356 parameter. Change all callers.
15357 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15358 sort_relocs parameter. Change all callers.
15359 * output.cc (Output_reloc::get_address): New function, broken out
15360 of write_rel.
15361 (Output_reloc::write_rel): Call it.
15362 (Output_reloc::compare): New function.
15363 (Output_data_reloc_base::do_write): Optionally sort relocs.
15364
60b2b4e7
ILT
15365 * configure.ac: If targ_extra_obj is set, link it in.
15366 * configure.tgt: Initialize all variables.
15367 (x86_64*): Set targ_extra_obj and targ_extra_size.
15368 * configure: Rebuild.
15369
8825ac63
ILT
15370 * object.cc (Sized_relobj::include_section_group): Adjust section
15371 indexes read from group data. Build vector to pass to
15372 layout_group.
15373 * layout.cc (Layout::layout_group): Add flags and shndxes
15374 parameters. Remove contents parameter. Change caller. Update
15375 explicit instantiations.
15376 * layout.h (class Layout): Update layout_group declaration.
15377 * output.cc (Output_data_group::Output_data_group): Add flags and
15378 input_shndxes parameters. Remove contents parameter. Change
15379 caller.
15380 (Output_data_group::do_write): Change input_sections_ to
15381 input_shndxes_.
15382 * output.h (class Output_data_group): Update constructor
15383 declaration. Rename input_sections_ to input_shndxes_.
15384 * testsuite/many_sections_test.cc: Add template.
15385
e94cf127
CC
153862008-04-30 Cary Coutant <ccoutant@google.com>
15387
4418b2d5
CC
15388 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15389
e94cf127
CC
15390 * layout.cc (Layout::include_section): Refactored check for debug
15391 info section.
15392 (Layout::add_comdat): Add new parameters. Change type
15393 of signature parameter. Add object and shndx to signatures table.
15394 (Layout::find_kept_object): New function.
15395 * layout.h: Include <cstring>.
15396 (Layout::is_debug_info_section): New function.
15397 (Layout::add_comdat): Add new parameters.
15398 (Layout::find_kept_object): New function.
15399 (Layout::Kept_section): New struct.
15400 (Layout::Signatures): Change type of map range.
15401 * object.cc (Relobj::output_section_address): New function.
15402 (Sized_relobj::include_section_group): Add new parameters. Change
15403 calls to Layout::add_comdat. Change to build table of kept comdat
15404 groups and table mapping discarded sections to kept sections.
15405 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15406 (Sized_relobj::do_layout): Change calls to include_section_group and
15407 include_linkonce_section.
15408 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15409 value to zero when section is discarded.
15410 (Sized_relobj::map_to_kept_section): New function.
15411 * object.h (Relobj::output_section_address): New function.
15412 (Relobj::Comdat_group): New type.
15413 (Relobj::find_comdat_group): New function.
15414 (Relobj::Comdat_group_table): New type.
15415 (Relobj::Kept_comdat_section): New type.
15416 (Relobj::Kept_comdat_section_table): New type.
15417 (Relobj::add_comdat_group): New function.
15418 (Relobj::set_kept_comdat_section): New function.
15419 (Relobj::get_kept_comdat_section): New function.
15420 (Relobj::comdat_groups_): New field.
15421 (Relobj::kept_comdat_sections_): New field.
15422 (Symbol_value::input_value): Update comment.
15423 (Sized_relobj::map_to_kept_section) New function.
15424 (Sized_relobj::include_linkonce_section): Add new parameter.
15425 * target-reloc.h (Comdat_behavior): New type.
15426 (get_comdat_behavior): New function.
15427 (relocate_section): Add code to map a discarded section to the
15428 corresponding kept section when applying a relocation.
15429
e4e5049b
CS
154302008-04-30 Craig Silverstein <csilvers@google.com>
15431
15432 * dwarf_reader.cc (next_generation_count): New static var.
15433 (Addr2line_cache_entry): New struct.
15434 (addr2line_cache): New static var.
15435 (Dwarf_line_info::one_addr2line): Added caching.
15436 (Dwarf_line_info::clear_addr2line_cache): New function.
15437 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15438 cache-size parameter.
15439 (Dwarf_line_info::one_addr2line_cache): New function.
15440 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15441 new cache-size argument to one_addr2line(), and clear cache.
15442
d09e9154
CC
154432008-04-28 Cary Coutant <ccoutant@google.com>
15444
15445 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15446 R_386_PC8 relocations.
15447
7ef73768
ILT
154482008-04-23 Ian Lance Taylor <iant@google.com>
15449
55438702
ILT
15450 * object.cc (Sized_relobj::include_section_group): Check for
15451 invalid section group.
15452
c165fb93
ILT
15453 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15454 header size.
15455
7ef73768
ILT
15456 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15457 than read for file header.
15458 * archive.cc (Archive::include_member): Likewise.
15459
6194aaab
L
154602008-04-23 Paolo Bonzini <bonzini@gnu.org>
15461
15462 * aclocal.m4: Regenerate.
15463 * configure: Regenerate.
15464
d491d34e
ILT
154652008-04-19 Ian Lance Taylor <iant@google.com>
15466
5ea2bac6
ILT
15467 * version.cc (version_string): Bump to 1.6.
15468
7bc3e21a
ILT
15469 * testsuite/Makefile.am (many_sections_r_test): New target.
15470 (many_sections_r_test_SOURCES): Remove.
15471 (many_sections_r_test_DEPENDENCIES): Remove.
15472 (many_sections_r_test_LDFLAGS): Remove.
15473 (many_sections_r_test_LDADD): Remove.
15474
7fcd3aa9
ILT
15475 * object.cc (Sized_relobj::do_add_symbols): Always pass
15476 local_symbol_count_ to add_from_relobj.
15477
4c94d6ae
ILT
15478 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15479 every thousand variables.
15480 * testsuite/Makefile.in: Rebuild.
15481
d491d34e
ILT
15482 * object.cc (Xindex::initialize_symtab_xindex): New function.
15483 (Xindex::read_symtab_xindex): New function.
15484 (Xindex::sym_xindex_to_shndx): New function.
15485 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15486 available.
15487 (Sized_relobj::do_initialize_xindex): New function.
15488 (Sized_relobj::do_read_symbols): Adjust section links.
15489 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15490 parameter. Change all callers.
15491 (Sized_relobj::include_section_group): Adjust section links and
15492 symbol section indexes.
15493 (Sized_relobj::do_layout): Adjust section links.
15494 (Sized_relobj::do_count_local_symbols): Adjust section links and
15495 symbol section indexes.
15496 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15497 ordinary and special symbols.
15498 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15499 dynsym_xindex parameters. Change all callers. Adjust section
15500 links. Use SHN_XINDEX when needed.
15501 (Sized_relobj::get_symbol_location_info): Adjust section links.
15502 Don't get fooled by special symbols.
15503 * object.h (class Xindex): Define.
15504 (class Object): Add xindex_ parameter. Declare virtual functoin
15505 do_initialize_xindex.
15506 (Object::adjust_sym_shndx): New function.
15507 (Object::set_xindex): New protected function.
15508 (class Symbol_value): Add is_ordinary_shndx_ field.
15509 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15510 (Symbol_value::value): Assert ordinary section.
15511 (Symbol_value::initialize_input_to_output_map): Likewise.
15512 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15513 Change all callers.
15514 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15515 all callers.
15516 (class Sized_relobj): Update declarations.
15517 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15518 parameter. Change all callers.
15519 (Sized_relobj::adjust_shndx): New function.
15520 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15521 field.
15522 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15523 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15524 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15525 (Sized_dynobj::read_dynsym_section): Adjust section links.
15526 (Sized_dynobj::read_dynamic): Likewise.
15527 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15528 section links.
15529 (Sized_dynobj::do_initialize_xindex): New function.
15530 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15531 do_initialize_xindex.
15532 (Sized_dynobj::adjust_shndx): New function.
15533 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15534 dynsym_xindex_ fields.
15535 (Layout::finalize): Add a call to set_section_indexes before
15536 creating the symtab sections.
15537 (Layout::set_section_indexes): Don't do anything if the section
15538 already has a section index.
15539 (Layout::create_symtab_sections): Add shnum parameter. Change
15540 caller. Create .symtab_shndx section if needed.
15541 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15542 caller.
15543 (Layout::allocated_output_section_count): New function.
15544 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15545 needed.
15546 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15547 fields. Update declarations.
15548 (Layout::symtab_xindex): New function.
15549 (Layout::dynsym_xindex): New function.
15550 (class Write_symbols_task): Add layout_ field.
15551 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15552 Change caller.
15553 * output.cc (Output_section_headers::Output_section_headers): Add
15554 shstrtab_section parameter. Change all callers.
15555 (Output_section_headers::do_sized_write): Store overflow values
15556 for section count and section string table section index in
15557 section header zero.
15558 (Output_file_header::do_sized_write): Check for overflow of
15559 section count and section string table section index.
15560 (Output_symtab_xindex::do_write): New function.
15561 (Output_symtab_xindex::endian_do_write): New function.
15562 * output.h (class Output_section_headers): Add shstrtab_section_.
15563 Update declarations.
15564 (class Output_symtab_xindex): Define.
15565 (Output_section::has_out_shndx): New function.
15566 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15567 field.
15568 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15569 Change all callers.
15570 (Sized_symbol::init): Likewise.
15571 (Symbol::output_section): Check for ordinary symbol.
15572 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15573 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15574 callers.
15575 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15576 Change all callers. Simplify handling of symbols from sections
15577 not included in the link.
15578 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15579 distinction.
15580 (Weak_alias_sorter::operator()): Assert that symbols are
15581 ordinary.
15582 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15583 distinction.
15584 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15585 parameters. Change all callers.
15586 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15587 symbol distinction. Use SHN_XINDEX when needed.
15588 (Symbol_table::write_section_symbol): Add symtab_xindex
15589 parameter. Change all callers.
15590 (Symbol_table::sized_write_section_symbol): Likewise. Use
15591 SHN_XINDEX when needed.
15592 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15593 declarations.
15594 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15595 (Symbol::is_defined): Check is_ordinary.
15596 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15597 (Symbol::is_absolute, Symbol::is_common): Likewise.
15598 (class Sized_symbol): Update declarations.
15599 (class Symbol_table): Update declarations.
15600 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15601 parameters. Change all callers.
15602 (Sized_symbol::override): Likewise.
15603 (Symbol_table::override): Likewise.
15604 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15605 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15606 is_ordinary, and orig_st_shndx parameters. Change all callers.
15607 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15608 to be in an ordinary section.
15609 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15610 object and is_ordinary parameters. Change all callers.
15611 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15612 Change all callers. Don't add undefined or non-ordinary symbols
15613 to reloc_map_.
15614 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15615 Change all callers.
15616 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15617 declarations.
15618 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15619 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15620 (Sized_relobj::relocate_sections): Likewise.
15621 * target-reloc.h (scan_relocs): Adjust section symbol index.
15622 (scan_relocatable_relocs): Likewise.
15623 * i386.cc (Scan::local): Check for ordinary symbols.
15624 * sparc.cc (Scan::local): Likewise.
15625 * x86_64.cc (Scan::local): Likewise.
15626 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15627 to symbol_section_and_value.
15628 * testsuite/many_sections_test.cc: New file.
15629 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15630 (check_PROGRAMS): Add many_sections_test.
15631 (many_sections_test_SOURCES): Define.
15632 (many_sections_test_DEPENDENCIES): Define.
15633 (many_sections_test_LDFLAGS): Define.
15634 (BUILT_SOURCES): Add many_sections_define.h.
15635 (many_sections_define.h): New target.
15636 (BUILT_SOURCES): Add many_sections_check.h.
15637 (many_sections_check.h): New target.
15638 (check_PROGRAMS): Add many_sections_r_test.
15639 (many_sections_r_test_SOURCES): Define.
15640 (many_sections_r_test_DEPENDENCIES): Define.
15641 (many_sections_r_test_LDFLAGS): Define.
15642 (many_sections_r_test_LDADD): Define.
15643 (many_sections_r_test.o): New target.
15644 * testsuite/Makefile.in: Rebuild.
15645
c5818ff1
CC
156462008-04-17 Cary Coutant <ccoutant@google.com>
15647
15648 * errors.cc (Errors::info): New function.
15649 (gold_info): New function.
15650 * errors.h (Errors::info): New function.
15651 * gold.h (gold_info): New function.
15652 * object.cc (Input_objects::add_object): Print trace output.
15653 * options.cc (options::parse_set): New function.
15654 (General_options::parse_wrap): Deleted.
15655 (General_options::General_options): Deleted initializer.
15656 * options.h (options::String_set): New typedef.
15657 (options::parse_set): New function.
15658 (DEFINE_set): New macro.
15659 (General_options::wrap): Changed to use DEFINE_set. Changed
15660 callers of any_wrap_symbols and is_wrap_symbol.
15661 (General_options::trace, General_options::trace_symbol):
15662 New options.
15663 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15664 (General_options::wrap_symbols_): Deleted.
15665 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15666
b5be4a7c
DM
156672008-04-17 David S. Miller <davem@davemloft.net>
15668
15669 * options.cc (General_options::parse_V): New function.
15670 * options.h: Add entries for -V and -Qy.
15671
155a0dd7
ILT
156722008-04-17 Ian Lance Taylor <iant@google.com>
15673
15674 * common.cc (Symbol_table::allocate_commons): Remove options
15675 parameter. Change caller.
15676 (Symbol_table::do_allocate_commons): Remove options parameter.
15677 Change caller. Just call do_allocate_commons_list twice.
15678 (Symbol_table::do_allocate_commons_list): New function, broken out
15679 of do_allocate_commons.
15680 * common.h (class Allocate_commons_task): Remove options_ field.
15681 Update constructor.
15682 * symtab.cc (Symbol_table::Symbol_table): Initialize
15683 tls_commons_.
15684 (Symbol_table::add_from_object): Put TLS common symbols on
15685 tls_commons_ list.
15686 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15687 which are IN_OUTPUT_DATA.
15688 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15689 allocate_commons and do_allocate_commons declarations. Declare
15690 do_allocate_commons_list.
15691 * gold.cc (queue_middle_tasks): Update creation of
15692 Allocate_commons_task to not pass options.
15693 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15694 (TLS_TEST_C_FLAGS): New variable.
15695 (tls_test_c_pic.o): New target.
15696 (tls_test_shared.so): Link in tls_test_c_pic.o.
15697 (tls_test_c_pic_ie.o): New target.
15698 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15699 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15700 (tls_test_c.o): New target.
15701 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15702 (tls_pic_test_LDADD): Likewise.
15703 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15704 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15705 (tls_test_c_gnu2.o): New target.
15706 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15707 tls_test_c_gnu2.o.
15708 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15709 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15710 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15711 * testsuite/tls_test.cc: Include "config.h".
15712 (t_last): Call t11_last.
15713 * testsuite/tls_test.h (t11, t11_last): Declare.
15714 * testsuite/tls_test_c.c: New file.
15715 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15716 * configure.ac: Check for OpenMP support.
15717 * configure, config.in, Makefile.in: Rebuild.
15718 * testsuite/Makefile.in: Rebuild.
15719
edfbb029
CC
157202008-04-16 Cary Coutant <ccoutant@google.com>
15721
15722 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15723 (Target_i386::tls_base_symbol_defined_): New field.
15724 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15725 (Target_i386::Scan::global): Likewise.
15726 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15727 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15728 (Target_x86_64::tls_base_symbol_defined_): New field.
15729 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15730 (Target_x86_64::Scan::global): Likewise.
15731
f3c69fca
CC
157322008-04-16 Cary Coutant <ccoutant@google.com>
15733
15734 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15735 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15736 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15737 building shared libraries.
15738 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15739 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15740 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15741 * testsuite/Makefile.in: Rebuild.
15742 * testsuite/weak_undef.h: New file.
15743 * testsuite/weak_undef_file1.cc: Add extra test cases.
15744 * testsuite/weak_undef_file2.cc: Likewise.
15745 * testsuite/weak_undef_test.cc: Likewise.
15746
7c414435
DM
157472008-04-16 David S. Miller <davem@davemloft.net>
15748
32b769e1
DM
15749 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15750 Add issued_non_pic_error_ field. Declare check_non_pic.
15751 (Target_sparc::Scan::check_non_pic): New function.
15752 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15753 (Target_sparc::Scan::global): Likewise.
15754
11936fb1
DM
15755 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15756 * configure: Rebuild.
15757
7c414435
DM
15758 * options.h (DEFINE_enable): New macro.
15759 (new_dtags): New enable option.
15760 (initfirst, interpose, loadfltr, nodefaultlib,
15761 nodelete, nodlopen, nodump): New -z options.
15762 * layout.cc (Layout:finish_dynamic_section): If new
15763 dtags enabled, emit DT_RUNPATH. Also, emit a
15764 DT_FLAGS_1 containing any specified -z flags.
15765
85c7bf8b
ILT
157662008-04-16 Ian Lance Taylor <iant@google.com>
15767
12c0daef
ILT
15768 * copy-relocs.cc: New file.
15769 * copy-relocs.h: New file.
15770 * reloc.cc: Remove Copy_relocs code.
15771 * reloc.h: Likewise.
15772 * reloc-types.h (struct Reloc_types) [both versions]: Add
15773 get_reloc_addend_noerror.
15774 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15775 variants of add_global which take an addend which must be zero.
15776 * i386.cc: Include "copy-relocs.h".
15777 (class Target_i386): Change type of copy_relocs_ to variable,
15778 update initializer.
15779 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15780 Change all callers.
15781 (Target_i386::do_finalize_sections): Change handling of
15782 copy_relocs_.
15783 * sparc.cc: Include "copy-relocs.h".
15784 (class Target_sparc): Change type of copy_relocs_ to variable,
15785 update initializer.
15786 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15787 Change all callers.
15788 (Target_sparc::do_finalize_sections): Change handling of
15789 copy_relocs_.
15790 * x86_64.cc: Include "copy-relocs.h".
15791 (class Target_x86_64): Change type of copy_relocs_ to variable,
15792 update initializer.
15793 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15794 class. Change all callers.
15795 (Target_x86_64::do_finalize_sections): Change handling of
15796 copy_relocs_.
15797 * Makefile.am (CCFILES): Add copy-relocs.cc.
15798 (HFILES): Add copy-relocs.h.
15799
4f4995b6
ILT
15800 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15801
85c7bf8b
ILT
15802 * testsuite/script_test_4.sh: Permit leading zeroes.
15803
4f2a9edd
ILT
158042008-04-15 Ian Lance Taylor <iant@google.com>
15805
e6188289
ILT
15806 * script-sections.cc (Script_sections::create_segments): Use
15807 header_size_adjustment even when there is enough room for the
15808 headers.
15809 * testsuite/script_test_4.sh: New file.
15810 * testsuite/script_test_4.t: New file.
15811 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15812 (check_DATA): Add script_test_4.stdout.
15813 (MOSTLYCLEANFILES): Likewise.
15814 (script_test_4): New target.
15815 (script_test_4.stdout): New target.
15816 * testsuite/Makefile.in: Rebuild.
15817
4f2a9edd
ILT
15818 * sparc.cc: Add definitions for Output_data_plt_sparc class
15819 constants.
15820
f5314dd5
DM
158212008-04-14 David S. Miller <davem@davemloft.net>
15822
15823 * sparc.cc: New file.
15824 * Makefile.am (TARGETSOURCES): Add sparc.cc
15825 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15826 * configure.tgt: Document targ_extra_size and
15827 targ_extra_big_endian. Add entries for sparc-* and
15828 sparc64-*.
15829 * configure.ac: Handle targ_extra_size and
15830 targ_extra_big_endian.
15831 * Makefile.in: Rebuild.
15832 * configure: Likewise.
15833 * po/POTFILES.in: Likewise.
15834 * po/gold.pot: Likewise.
15835
154e0e9a
ILT
158362008-04-14 Ian Lance Taylor <iant@google.com>
15837
15838 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15839 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15840 in the name/type/flags to section mapping. Don't call
15841 allocate_output_section.
15842 (Layout::choose_output_section): Change parameter from adjust_name
15843 to is_input_section. Don't permit input sections after sections
15844 are attached to segments. Don't call allocate_output_section.
15845 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15846 not write_enable_output_section.
15847 (Layout::make_output_section): Don't push to
15848 unattached_section_list_ nor call attach_to_segment. Call
15849 attach_section_to_segment if sections are attached.
15850 (Layout::attach_sections_to_segments): New function.
15851 (Layout::attach_section_to_segment): New function.
15852 (Layout::attach_allocated_section_to_segment): Rename from
15853 attach_to_segment. Remove flags parameter.
15854 (Layout::allocate_output_section): Remove function.
15855 (Layout::write_enable_output_section): Remove function.
15856 * layout.h (class Layout): Update for above changes. Add new
15857 field sections_are_attached_.
15858 * output.h (Output_section::update_flags_for_input_section): New
15859 function.
15860 * output.cc (Output_section::add_input_section): Call
15861 update_flags_for_input_section.
15862 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15863
009a67a2
CC
158642008-04-11 Cary Coutant <ccoutant@google.com>
15865
15866 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15867 thought unnecessary.
15868 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15869
759b1a24
ILT
158702008-04-11 Ian Lance Taylor <iant@google.com>
15871
15872 * output.h (class Output_section_data): Remove inline definition
15873 of set_addralign.
15874 * output.cc (Output_section_data::set_addralign): New function.
15875
c2b45e22
CC
158762008-04-11 Cary Coutant <ccoutant@google.com>
15877
15878 Add support for TLS descriptors for i386 and x86_64.
15879 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
15880 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
15881 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
15882 GOT_TYPE_TLS_DESC.
15883 (Target_i386::got_mod_index_entry): Remove unnecessary code.
15884 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
15885 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
15886 relocations.
15887 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
15888 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
15889 Fix problem with initial-exec relocations.
15890 (Target_i386::Relocate::relocate_tls): Likewise.
15891 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
15892 relaxation.
15893 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
15894 support for section-plus-offset dynamic table entries.
15895 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
15896 (Output_data_dynamic::Dynamic_entry): Add support for
15897 section-plus-offset dynamic table entries.
15898 (Output_data_dynamic::Classification): Likewise.
15899 (Output_data_dynamic::classification_): Renamed offset_.
15900 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
15901 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
15902 (Target_x86_64::make_plt_section): New function.
15903 (Target_x86_64::reserve_tlsdesc_entries): New function.
15904 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
15905 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
15906 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
15907 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
15908 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
15909 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
15910 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
15911 add extra PLT entry for TLS descriptors.
15912 (Output_data_plt_x86_64::got_): New field.
15913 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
15914 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
15915 fields.
15916 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
15917 descriptors.
15918 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
15919 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
15920 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
15921 R_386_TLS_DESC_CALL relocations.
15922 (Target_x86_64::Scan::global): Likewise.
15923 (Target_x86_64::do_finalize_sections): Add dynamic table entries
15924 for TLS descriptors.
15925 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
15926 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
15927 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
15928 GD-to-IE relaxation.
15929 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
15930 and TLS_DESCRIPTORS.
15931 * Makefile.in: Rebuild.
15932 * configure: Rebuild.
15933 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
15934 (tls_test_shared2.so): New target.
15935 (tls_shared_gd_to_ie_test_SOURCES): New variable.
15936 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
15937 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
15938 (tls_shared_gd_to_ie_test_LDADD): New variable.
15939 (tls_shared_gnu2_gd_to_ie_test): New target.
15940 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
15941 New targets.
15942 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
15943 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
15944 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
15945 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
15946 (tls_shared_gnu2_test): New target.
15947 (tls_test_gnu2_shared.so): New target.
15948 (tls_shared_gnu2_test_SOURCES): New variable.
15949 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
15950 (tls_shared_gnu2_test_LDFLAGS): New variable.
15951 (tls_shared_gnu2_test_LDADD): New variable.
15952 * testsuite/Makefile.in: Rebuild.
15953 * testsuite/Makefile.
15954
83bfb6b7
ILT
159552008-04-11 Ian Lance Taylor <iant@google.com>
15956
15957 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
15958 justsyms.t.
15959 * testsuite/Makefile.in: Rebuild.
15960
15961 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
15962 long.
15963 * testsuite/script_test_2.cc (main): Adjust test.
15964
706e1f5e
ILT
159652008-04-11 David S. Miller <davem@davemloft.net>
15966 Ian Lance Taylor <iant@google.com>
15967
15968 * options.h (General_options): Add entries for '-Y' and
15969 '-relax'.
15970 * options.cc (General_options:finalize): If -Y was used, add those
15971 entries to the library path instead of the default "/lib" and
15972 "/usr/lib".
15973
7c98e6bb
DM
159742008-04-11 David S. Miller <davem@davemloft.net>
15975
15976 * testsuite/justsyms.t: Start at 0x100.
15977 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
15978 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
15979 long.
15980 * testsuite/script_test_2.cc: Adjust string and section length
15981 checks.
7c98e6bb 15982
99a37bfd
ILT
159832008-04-09 Ian Lance Taylor <iant@google.com>
15984
2cefc357
ILT
15985 PR gold/5996
15986 * script-sections.cc (Sections_element::allocate_to_segment): Add
15987 orphan parameter.
15988 (Output_section_definition::allocate_to_segment): Likewise.
15989 (Orphan_output_section::allocate_to_segment): Likewise.
15990 (Script_sections::attach_sections_using_phdrs_clause): Don't
15991 propagate non-PT_LOAD segments to orphan sections.
15992 * testsuite/Makefile.am (script_test_3.stdout): Generate using
15993 readelf rather than objdump.
15994 * testsuite/script_test_3.sh: Adjust accordingly. Test that
15995 .interp section and PT_INTERP segment are the same size.
15996 * testsuite/Makefile.in: Rebuild.
15997
99a37bfd
ILT
15998 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
15999 aliases for symbols defined in the same object.
16000 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16001 (weak_alias_test_SOURCES): New variable.
16002 (weak_alias_test_DEPENDENCIES): New variable.
16003 (weak_alias_test_LDFLAGS): New variable.
16004 (weak_alias_test_LDADD): New variable.
16005 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16006 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16007 (weak_alias_test_3.o): New target.
16008 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16009 * testsuite/weak_alias_test_main.cc: New file.
16010 * testsuite/weak_alias_test_1.cc: New file.
16011 * testsuite/weak_alias_test_2.cc: New file.
16012 * testsuite/weak_alias_test_3.cc: New file.
16013
780e49c5
ILT
160142008-04-08 Ian Lance Taylor <iant@google.com>
16015
cdb0b8f5
ILT
16016 * options.h (class General_options): Add --noinhibit-exec option.
16017 * main.cc (main): Check --noinhibit-exec.
16018
0864d551
ILT
16019 * options.h (class General_options): Define --wrap as a special
16020 option. Add wrap_symbols_ field.
16021 (General_options::any_wrap_symbols): New function.
16022 (General_options::is_wrap_symbol): New function.
16023 * options.cc (General_options::parse_wrap): New function.
16024 (General_options::General_options): Initialize wrap_symbols_.
16025 * symtab.cc (Symbol_table::wrap_symbol): New function.
16026 (Symbol_table::add_from_object): Handle --wrap.
16027 * symtab.h (class Symbol_table): Declare wrap_symbol.
16028 * target.h (Target::wrap_char): New function.
16029 (Target::Target_info): Add wrap_char field.
16030 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16031 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16032 * testsuite/testfile.cc (Target_test::test_target_info):
16033 Likewise.
16034
789aa6de
ILT
16035 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16036 there is one.
16037
2c38906f
ILT
16038 * layout.h (class Layout): Add added_eh_frame_data_ field.
16039 * layout.cc (Layout::Layout): Initialize new field.
16040 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16041 output section until we find a section we merged successfully.
16042 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16043 that the size be non-zero.
16044
780e49c5
ILT
16045 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16046 qualifier.
16047
7fcd0256
ILT
160482008-04-08 Craig Silverstein <csilvers@google.com>
16049
16050 * configure.ac: Export new conditional variable HAVE_ZLIB.
16051 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16052 on HAVE_ZLIB.
16053 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16054 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16055
6835af53
ILT
160562008-04-07 Ian Lance Taylor <iant@google.com>
16057
e24f324c
ILT
16058 * version.cc (version_string): Set to "1.5".
16059
a036edd8
ILT
16060 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16061 Add issued_non_pic_error_ field. Declare check_non_pic.
16062 (Target_x86_64::Scan::check_non_pic): New function.
16063 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16064 (Target_x86_64::Scan::global): Likewise.
16065
624f8810
ILT
16066 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16067 addend parameter. Change caller. Handle merge sections.
16068 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16069 Address to Addend. Don't add in the result of
16070 local_section_offset, pass down the addend and use the returned
16071 value.
16072 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16073 Update declarations of local_section_offset and symbol_value.
16074 * testsuite/two_file_test_1.cc (t18): New function.
16075 * testsuite/two_file_test_2.cc (f18): New function.
16076 * testsuite/two_file_test_main.cc (main): Call t18.
16077 * testsuite/two_file_test.h (t18, f18): Declare.
16078
6835af53
ILT
16079 * configure.ac: Don't test for objdump, c++filt, or readelf.
16080 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16081 conditionals.
16082 (TEST_READELF): New variable.
16083 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16084 (check_PROGRAMS): Add two_file_strip_test.
16085 (two_file_strip_test): New target.
16086 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16087 (two_file_same_shared_strip_test_SOURCES): New variable.
16088 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16089 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16090 (two_file_same_shared_strip_test_LDADD): New variable.
16091 (two_file_shared_strip.so): New target.
16092 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16093 (ver_test_5.syms, ver_test_7.syms): Likewise.
16094 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16095 (strip_test_3.stdout): Use TEST_OBJDUMP.
16096 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16097
86925eef
CC
160982008-04-04 Cary Coutant <ccoutant@google.com>
16099
16100 * symtab.h (Symbol::is_weak_undefined): New function.
16101 (Symbol::is_strong_undefined): New function.
16102 (Symbol::is_absolute): New function.
16103 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16104 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16105 absolute symbols.
16106 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16107 (weak_undef_test): New target.
16108 * testsuite/Makefile.in: Rebuild.
16109 * testsuite/weak_undef_file1.cc: New file.
16110 * testsuite/weak_undef_file2.cc: New file.
16111 * testsuite/weak_undef_test.cc: New file.
16112
126f3ece
ILT
161132008-04-03 Craig Silverstein <csilvers@google.com>
16114
16115 * compressed_output.h (class Output_compressed_section): Use
16116 unsigned buffer.
16117 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16118 add zlib header.
16119 (zlib_compressed_suffix): Removed.
16120 (Output_compressed_section::set_final_data_size): Use unsigned
16121 buffers.
16122 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16123 Fix linker invocation.
16124 (flagstest_o_specialfile_and_compress_debug_sections):
16125 Likewise.
16126 * testsuite/Makefile.in: Regenerated.
16127
deae2a14
DM
161282008-04-02 David S. Miller <davem@davemloft.net>
16129
16130 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16131 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16132
70752818
ILT
161332008-04-02 Craig Silverstein <csilvers@google.com>
16134
16135 * TODO: New file.
16136
39d0cb0e
ILT
161372008-04-02 Ian Lance Taylor <iant@google.com>
16138
16139 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16140 parameters. Update for new key type to views_. Change all
16141 callers.
16142 (File_read::read): Adjust for byteshift in returned view.
16143 (File_read::add_view): New function, broken out of
16144 find_and_make_view.
16145 (File_read::make_view): New function, broken out of
16146 find_and_make_view.
16147 (File_read::find_or_make_view): Add offset and aligned
16148 parameters. Rewrite accordingly. Change all callers.
16149 (File_read::get_view): Add offset and aligned parameters. Adjust
16150 for byteshift in return value.
16151 (File_read::get_lasting_view): Likewise.
16152 * fileread.h (class File_read): Update declarations.
16153 (class File_read::View): Add byteshift_ field. Add byteshift to
16154 constructor. Add byteshift method.
16155 * archive.h (Archive::clear_uncached_views): New function.
16156 (Archive::get_view): Add aligned parameter. Change all callers.
16157 * object.h (Object::get_view): Add aligned parameter. Change all
16158 callers.
16159 (Object::get_lasting_view): Likewise.
16160
16161 * fileread.cc (File_read::release): Don't call clear_views if
16162 there are multiple objects.
16163 * fileread.h (File_read::clear_uncached_views): New function.
16164 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16165 on the archive.
16166
a1207466
CC
161672008-03-31 Cary Coutant <ccoutant@google.com>
16168
16169 Add thin archive support.
16170 * archive.cc (Archive::armagt): New const.
16171 (Archive::setup): Remove task parameter and calls to unlock.
16172 (Archive::unlock_nested_archives): New function.
16173 (Archive::read_header): Add nested_off parameter. Change
16174 all callers.
16175 (Archive::interpret_header): Likewise.
16176 (Archive::include_all_members): Change to handle thin
16177 archives.
16178 (Archive::include_member): Likewise.
16179 * archive.h (Archive::Archive): Add new parameters and
16180 initializers.
16181 (Archive::armagt): New const.
16182 (Archive::setup): Remove task parameter.
16183 (Archive::unlock_nested_archives): New function.
16184 (Archive::read_header): Add nested_off parameter.
16185 (Archive::interpret_header): Likewise.
16186 (Archive::Nested_archive_table): New typedef.
16187 (Archive::is_thin_archive_): New field.
16188 (Archive::nested_archives_): New field.
16189 (Archive::options_): New field.
16190 (Archive::dirpath_): New field.
16191 (Archive::task_): New field.
16192 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16193 for thin archives. Pass additional parameters to
16194 Archive::Archive. Unlock the archive file after calling
16195 Archive::setup.
cd536b21 16196
479f6503
ILT
161972008-03-29 Ian Lance Taylor <iant@google.com>
16198
686c8caf
ILT
16199 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16200 version symbol to be local.
16201 * testsuite/ver_test_4.sh: New file.
16202 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16203 (check_DATA): Add ver_test_4.syms.
16204 (ver_test_4.syms): New target.
16205 * testsuite/Makefile.in: Rebuild.
16206
ab794b6b
ILT
16207 * output.cc
16208 (Output_section::Input_section_sort_entry::has_priority): New
16209 function.
16210 (Output_section::Input_section_sort_entry::match_file_name): New
16211 function.
16212 (Output_section::Input_section_sort_entry::match_section_name):
16213 Remove.
16214 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16215 Remove.
16216 (Output_section::Input_section_sort_entry::match_section_file):
16217 Remove.
16218 (Output_section::Input_section_sort_compare::operator()): Rewrite
16219 using new Input_section_sort_entry functions. Sort crtbegin and
16220 crtend first. Sort sections with no priority before sections with
16221 a priority.
16222 * testsuite/initpri1.c (d3): Check j != 4.
16223 (cd5): New constructor/destructor function.
16224 (main): Check j != 2.
16225
479f6503
ILT
16226 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16227 new symbol when resolving, don't call set_is_default.
16228 * testsuite/ver_test_7.cc: New file.
16229 * testsuite/ver_test_7.sh: New file.
16230 * testsuite/Makefile.am (ver_test_7.so): New target.
16231 (ver_test_7.o): New target.
16232 (check_SCRIPTS): Add ver_test_7.sh.
16233 (check_DATA): Add ver_test_7.syms.
16234 (ver_test_7.syms): New target.
16235
2fd32231
ILT
162362008-03-28 Ian Lance Taylor <iant@google.com>
16237
16238 * layout.cc (Layout::layout): If we see an input section with a
16239 name that needs sorting, set the must_sort flag for the output
16240 section.
16241 (Layout::make_output_section): If the name of the output section
16242 indicates that it might require sorting, set the may_sort flag.
16243 * output.h (Output_section::may_sort_attached_input_sections): New
16244 function.
16245 (Output_section::set_may_sort_attached_input_sections): New
16246 function.
16247 (Output_section::must_sort_attached_input_sections): New
16248 function.
16249 (Output_section::set_must_sort_attached_input_sections): New
16250 function.
16251 (class Output_section): Declare Input_section_sort_entry. Define
16252 Input_section_sort_compare. Declare
16253 sort_attached_input_sections. Add new fields:
16254 may_sort_attached_input_sections_,
16255 must_sort_attached_input_sections_,
16256 attached_input_sections_are_sorted_.
16257 * output.cc (Output_section::Output_section): Initialize new
16258 fields.
16259 (Output_section::add_input_section): Add an entry to
16260 input_sections_ if may_sort or must_sort are true.
16261 (Output_section::set_final_data_size): Call
16262 sort_attached_input_sections if necessary.
16263 (Output_section::Input_section_sort_entry): Define new class.
16264 (Output_section::Input_section_sort_compare::operator()): New
16265 function.
16266 (Output_section::sort_attached_input_sections): New function.
16267 * configure.ac: Check whether the compiler supports constructor
16268 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16269 * testsuite/initpri1.c: New file.
16270 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16271 CONSTRUCTOR_PRIORITY.
16272 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16273 (initpri1_LDFLAGS): New variable.
16274 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16275
18e6b24e
ILT
162762008-03-27 Ian Lance Taylor <iant@google.com>
16277
49bdd526
ILT
16278 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16279 * testsuite/common_test_1.c: New file.
16280 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16281 (common_test_1_SOURCES): New variable.
16282 (common_test_1_DEPENDENCIES): New variable.
16283 (common_test_1_LDFLAGS): New variable.
16284
18e6b24e
ILT
16285 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16286 and commons_ correctly when NAME/VERSION does not override
16287 NAME/NULL.
16288 * testsuite/ver_test_6.c: New file.
16289 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16290 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16291 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16292
04bf7072
ILT
162932008-03-26 Ian Lance Taylor <iant@google.com>
16294
5871526f
ILT
16295 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16296 of an undefined symbol from a version script.
16297 * testsuite/Makefile.am (ver_test_5.so): New target.
16298 (ver_test_5.o): New target.
16299 (check_SCRIPTS): Add ver_test_5.sh.
16300 (check_DATA): Add ver_test_5.syms.
16301 (ver_test_5.syms): New target.
16302 * testsuite/ver_test_5.cc: New file.
16303 * testsuite/ver_test_5.script: New file.
16304 * testsuite/ver_test_5.sh: New file.
16305 * Makefile.in, testsuite/Makefile.in: Rebuild.
16306
04bf7072
ILT
16307 PR gold/5986
16308 Fix problems building gold with gcc 4.3.0.
16309 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16310 (gold_error_at_location, gold_warning_at_location): Use it.
16311 * configure.ac: Check whether we can compile and use a template
16312 function with a printf attribute.
16313 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16314 when jumping over bytes.
16315 * object.cc: Instantiate Object::read_section_data.
16316 * debug.h: Include <cstring>
16317 * dwarf_reader.cc: Include <algorithm>
16318 * main.cc: Include <cstring>.
16319 * options.cc: Include <cstring>.
16320 * output.cc: Include <cstring>.
16321 * script.cc: Include <cstring>.
16322 * script.h: Include <string>.
16323 * symtab.cc: Include <cstring> and <algorithm>.
16324 * target-select.cc: Include <cstring>.
16325 * version.cc: Include <string>.
16326 * testsuite/testmain.cc: Include <cstdlib>.
16327 * configure, config.in: Rebuild.
16328
874c5b28
ILT
163292008-03-25 Ian Lance Taylor <iant@google.com>
16330
819d6c3a
ILT
16331 * options.cc: Include "../bfd/bfdver.h".
16332 (options::help): Print bug reporting address.
16333
f4b2c6f5
ILT
16334 * version.cc (print_version): Adjust output for current value of
16335 BFD_VERSION_STRING.
16336
16337 * NEWS: New file.
16338
e96caa79
ILT
16339 * options.cc (options::help): Print list of supported targets.
16340 * target-select.h: Include <vector>.
16341 (class Target_selector): Make machine_, size_, and is_big_endian_
16342 fields const. Add bfd_name_ and instantiated_target_ fields.
16343 (Target_selector::Target_selector): Add bfd_name parameter.
16344 (Target_selector::recognize): Make non-virtual, call
16345 do_recognize.
16346 (Target_selector::recognize_by_name): Make non-virtual, call
16347 do_recognize_by_name.
16348 (Target_selector::supported_names): New function.
16349 (Target_selector::bfd_name): New function.
16350 (Target_selector::do_instantiate_target): New pure virtual
16351 function.
16352 (Target_selector::do_recognize): New virtual function.
16353 (Target_selector::do_recognize_by_name): New virtual function.
16354 (Target_selector::instantiate_target): New private function.
16355 (supported_target_names): Declare.
16356 * target-select.cc (Target_selector::Target_selector): Update for
16357 new parameter and fields.
16358 (select_target_by_name): Check that the name matches before
16359 calling recognize_by_name.
16360 (supported_target_names): New function.
16361 * i386.cc (class Target_selector_i386): Update Target_selector
16362 constructor call. Remove recognize and recognize_by_name. Add
16363 do_instantiate_target.
16364 * x86_64.cc (class Target_selector_x86_64): Likewise.
16365 * testsuite/testfile.cc (class Target_selector_test): Update for
16366 changes to Target_selector.
16367
874c5b28
ILT
16368 * README: Rewrite, with some notes on unsupported features.
16369
0a65a3a7
CC
163702008-03-24 Cary Coutant <ccoutant@google.com>
16371
16372 * i386.cc (Target_i386::Got_type): New enum declaration.
16373 (Target_i386::Scan::local): Updated callers of Output_data_got
16374 member functions.
16375 (Target_i386::Scan::global): Likewise.
16376 (Target_i386::Relocate::relocate): Likewise.
16377 (Target_i386::Relocate::relocate_tls): Likewise.
16378 * object.h (Got_offset_list): New class.
16379 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16380 (Sized_relobj::local_got_offset): Likewise.
16381 (Sized_relobj::set_local_got_offset): Likewise.
16382 (Sized_relobj::local_has_tls_got_offset): Removed.
16383 (Sized_relobj::local_tls_got_offset): Removed.
16384 (Sized_relobj::set_local_tls_got_offset): Removed.
16385 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16386 * output.cc (Output_data_got::add_global): Added got_type parameter.
16387 (Output_data_got::add_global_with_rel): Likewise.
16388 (Output_data_got::add_global_with_rela): Likewise.
16389 (Output_data_got::add_global_pair_with_rel): New function.
16390 (Output_data_got::add_global_pair_with_rela): New function.
16391 (Output_data_got::add_local): Added got_type parameter.
16392 (Output_data_got::add_local_with_rel): Likewise.
16393 (Output_data_got::add_local_with_rela): Likewise.
16394 (Output_data_got::add_local_pair_with_rel): New function.
16395 (Output_data_got::add_local_pair_with_rela): New function.
16396 (Output_data_got::add_global_tls): Removed.
16397 (Output_data_got::add_global_tls_with_rel): Removed.
16398 (Output_data_got::add_global_tls_with_rela): Removed.
16399 (Output_data_got::add_local_tls): Removed.
16400 (Output_data_got::add_local_tls_with_rel): Removed.
16401 (Output_data_got::add_local_tls_with_rela): Removed.
16402 * output.h (Output_data_got::add_global): Added got_type parameter.
16403 (Output_data_got::add_global_with_rel): Likewise.
16404 (Output_data_got::add_global_with_rela): Likewise.
16405 (Output_data_got::add_global_pair_with_rel): New function.
16406 (Output_data_got::add_global_pair_with_rela): New function.
16407 (Output_data_got::add_local): Added got_type parameter.
16408 (Output_data_got::add_local_with_rel): Likewise.
16409 (Output_data_got::add_local_with_rela): Likewise.
16410 (Output_data_got::add_local_pair_with_rel): New function.
16411 (Output_data_got::add_local_pair_with_rela): New function.
16412 (Output_data_got::add_global_tls): Removed.
16413 (Output_data_got::add_global_tls_with_rel): Removed.
16414 (Output_data_got::add_global_tls_with_rela): Removed.
16415 (Output_data_got::add_local_tls): Removed.
16416 (Output_data_got::add_local_tls_with_rel): Removed.
16417 (Output_data_got::add_local_tls_with_rela): Removed.
16418 * resolve.cc (Symbol::override_base_with_special): Removed
16419 reference to has_got_offset_ field.
16420 * symtab.cc (Symbol::init_fields): Replaced initialization
16421 of got_offset_ with got_offsets_. Removed initialization
16422 of has_got_offset_
53fcba31 16423 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16424 (Symbol::got_offset): Likewise.
16425 (Symbol::set_got_offset): Likewise.
16426 (Symbol::has_tls_got_offset): Removed.
16427 (Symbol::tls_got_offset): Removed.
16428 (Symbol::set_tls_got_offset): Removed.
16429 (Symbol::got_offset_): Removed.
16430 (Symbol::tls_mod_got_offset_): Removed.
16431 (Symbol::tls_pair_got_offset_): Removed.
16432 (Symbol::got_offsets_): New field.
16433 (Symbol::has_got_offset): Removed.
16434 (Symbol::has_tls_mod_got_offset): Removed.
16435 (Symbol::has_tls_pair_got_offset): Removed.
16436 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16437 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16438 member functions.
16439 (Target_x86_64::Scan::global): Likewise.
16440 (Target_x86_64::Relocate::relocate): Likewise.
16441 (Target_x86_64::Relocate::relocate_tls): Likewise.
16442
bd52eafb
BE
164432008-03-25 Ben Elliston <bje@au.ibm.com>
16444
16445 * yyscript.y: Fix spelling error in comment.
16446
8b105e34
ILT
164472008-03-24 Ian Lance Taylor <iant@google.com>
16448
8ed814a9
ILT
16449 * options.h (class General_options): Define build_id option.
16450 * layout.h (class Layout): Declare write_build_id, create_note,
16451 create_build_id. Add build_id_note_ member.
16452 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16453 "libiberty.h", "md5.h", "sha1.h".
16454 (Layout::Layout): Initialize eh_frame_data_,
16455 eh_frame_hdr_section_, and build_id_note_.
16456 (Layout::finalize): Call create_build_id.
16457 (Layout::create_note): New function, broken out of
16458 Layout::create_gold_note.
16459 (Layout::create_gold_note): Call create_note.
16460 (Layout::create_build_id): New function.
16461 (Layout::write_build_id): New function.
16462 (Close_task_runner::run): Call write_build_id.
16463
8b105e34
ILT
16464 * x86_64.cc: Correct license to GPLv3.
16465
086a1841
ILT
164662008-03-23 Ian Lance Taylor <iant@google.com>
16467
16468 * options.cc: Include "demangle.h".
16469 (parse_optional_string): New function.
16470 (parse_long_option): Handle takes_optional_argument.
16471 (parse_short_option): Update dash_z initializer. Handle
16472 takes_optional_argument.
16473 (General_options::General_options): Initialize do_demangle_.
16474 (General_options::finalize): Set do_demangle_. Handle demangling
16475 style.
16476 * options.h (parse_optional_string): Declare.
16477 (struct One_option): Add optional_arg field. Update constructor.
16478 Update call constructor calls. Add takes_optional_argument
16479 function.
16480 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16481 (DEFINE_optional_string): Define.
16482 (General_options::demangle): Change from DEFINE_bool to
16483 DEFINE_optional_string.
16484 (General_options::no_demangle): New function.
16485 (General_options::do_demangle): New function.
16486 (General_options::set_do_demangle): New function.
16487 (General_options::execstack_status_): Move definition to end of
16488 class definition.
16489 (General_options::static_): Likewise.
16490 (General_options::do_demangle_): New field.
16491 * object.cc (big_endian>::get_symbol_location_info): Call
16492 Options::do_demangle, not Options::demangle.
16493 * symtab.cc (demangle): Likewise.
16494
cbb93e63
ILT
164952008-03-22 Ian Lance Taylor <iant@google.com>
16496
16497 * gold.h: Include <cstddef> and <sys/types.h>
16498 * options.h: Include <cstring>.
16499
ec531623
ILT
165002008-03-21 Ian Lance Taylor <iant@google.com>
16501
16502 * Added source code to GNU binutils.
752937aa 16503\f
b90efa5b 16504Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
16505
16506Copying and distribution of this file, with or without modification,
16507are permitted in any medium without royalty provided the copyright
16508notice and this notice are preserved.
16509
16510Local Variables:
16511mode: change-log
16512left-margin: 8
16513fill-column: 74
16514version-control: never
16515End:
This page took 1.023975 seconds and 4 git commands to generate.