Make plugin_get_ir_dummy_bfd static
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
5485698a
CC
12015-01-25 Cary Coutant <ccoutant@google.com>
2
3 * output.cc (Output_segment::set_section_addresses): Fix calculation
4 of size of relro segment.
5
b01a4b04
AM
62015-01-22 Alan Modra <amodra@gmail.com>
7
8 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
9 condition for need of ifunc plt entry.
10 (Target_powerpc::Scan::global <got relocs>): Likewise.
11
3d0064a9
CC
122015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
13
14 * mips.cc (reloc_high): Add r_sym.
15 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
16 reloc_high constructor.
17 (Mips_relocate_functions::relgot16_local): Likewise.
18 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
19 r_type to decide whether LO16 matches HI16.
20 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
21 rello16 and relgot16_local.
22
a5cd8f05
CC
232015-01-09 Cary Coutant <ccoutant@google.com>
24
25 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
26 unless alignment is larger than page size.
27
4fc1b9d4
L
282015-01-06 H.J. Lu <hongjiu.lu@intel.com>
29 Cary Coutant <ccoutant@google.com>
30
31 PR gold/17729
32 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
33 (DEFAULT_TARGET_X32): Set for x32.
34 * x86_64.cc (cmp_insn_32): New.
35 (lea_r10_insn_32): Likewise.
36 (lea_r11_insn_32): Likewise.
37 (cmp_insn_64): Likewise.
38 (lea_r10_insn_64): Likewise.
39 (lea_r11_insn_64): Likewise.
40 (Target_x86_64<size>::do_calls_non_split): Handle x32.
41 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
42 (check_DATA): Add split_x32 files.
43 (split_x32_[1234n].o): New targets.
44 (split_x32_[124]): New targets.
45 (split_x32_[1234r].stdout): New targets.
46 * testsuite/split_x32.sh: New file.
47 * testsuite/split_x32_1.s: Likewise.
48 * testsuite/split_x32_2.s: Likewise.
49 * testsuite/split_x32_3.s: Likewise.
50 * testsuite/split_x32_4.s: Likewise.
51 * testsuite/split_x32_n.s: Likewise.
52 * configure: Regenerated.
53 * testsuite/Makefile.in: Likewise.
54
e749cab8
L
552015-01-06 H.J. Lu <hongjiu.lu@intel.com>
56
57 PR gold/17809
58 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
59 x32.
60
af759df0
AM
612015-01-02 Alan Modra <amodra@gmail.com>
62
63 * version.cc (print_version): Just print current year.
64 * dwp.cc (print_version): Likewise.
65
b90efa5b
AM
662015-01-01 Alan Modra <amodra@gmail.com>
67
68 Update year range in copyright notice of all files.
69
f12d1e8a
AM
702014-12-25 Alan Modra <amodra@gmail.com>
71
72 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
73 new enums.
74 (Target_arm::merge_object_attributes, ): Likewise.
75
5c294fee
TG
762014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
77
78 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
79 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
80 AEABI_VFP_args_vfp to check that.
81 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
82 value and replace hardcoded values by enum values.
83
e30880c2
CC
842014-12-22 Cary Coutant <ccoutant@google.com>
85
86 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
87
bd040da1
L
882014-12-20 H.J. Lu <hongjiu.lu@intel.com>
89
90 PR gold/14608
91 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
92 to "return i * i * 3;".
93
e02a4046
CC
942014-12-16 Cary Coutant <ccoutant@google.com>
95
96 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
97 (Mapfile::print_output_data): Use current_data_size() to avoid
98 assert for sections requiring postprocessing; if address is not valid,
99 print 0.
100 (Mapfile::print_output_section): Use current_data_size(); print note
101 that addresses and sizes are before compression.
102
add6016b
L
1032014-12-14 H.J. Lu <hongjiu.lu@intel.com>
104
105 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
106 Cast current_group_size to unsigned long when reporting error.
107
0bf32ea9
JY
1082014-12-10 Jing Yu <jingyu@google.com>
109
110 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
111 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
112 Update error message.
113 (Target_aarch64::do_relax): Use absolute value of option
114 stub_group_size. Replace local variable with class member
115 stub_group_size_.
116
cbcb23fa
AM
1172014-12-04 Alan Modra <amodra@gmail.com>
118
119 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
120 addend of PLTREL24 reloc when not generating a plt stub. Make
121 max_branch_offset an "Address".
fbad6518 122 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
123 (Target_powerpc::Relocate::relocate): Likewise.
124
1611bc4a
AM
1252014-12-04 Alan Modra <amodra@gmail.com>
126
127 PR 17670
128 * symtab.cc (Symbol::set_undefined): Remove assertion.
129 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
130 on symbols defined in discarded sections, instead return false.
131 Rearrange params, update all callers.
132 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
133 branches to syms in discarded sections.
134 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
135 undefined and flag as discarded.
136 (Target_powerpc::Relocate::relocate): Localize variable.
137
4759c34e
L
1382014-12-03 H.J. Lu <hongjiu.lu@intel.com>
139
140 PR gold/17675
141 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
142 * testsuite/Makefile.in: Regenerated.
143
1f98a074
AM
1442014-12-03 Alan Modra <amodra@gmail.com>
145
146 PR 17566
147 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
148 when adding dynamic relocations against section symbols.
149
fb257835
DI
1502014-12-01 Dimitry Ivanov <dimitry@google.com>
151
152 * layout.cc (Layout::finish_dynamic_section): When '-z global'
153 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
154 * options.h (General_options): New -z option (global).
155
d8e60314
CC
1562014-12-01 Cary Coutant <ccoutant@google.com>
157
158 PR gold/17578
159 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
160 is given.
161 (Layout::create_executable_stack_info): Warn when -z noexecstack is
162 given but some inputs require executable stack.
163
982bbd97
CC
1642014-11-26 Cary Coutant <ccoutant@google.com>
165
166 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
167 .debug_str_offsets; strip .debug_gnu_pubnames and
168 .debug_gnu_pubtypes.
169 (lines_only_debug_sections): Strip all four new sections.
170
bb779192
HS
1712014-11-26 Jing Yu <jingyu@google.com>
172
173 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
174 register to be x0 when to relax TLSDESC_LD64_LO12.
175
a3e60ddb
AM
1762014-11-26 Alan Modra <amodra@gmail.com>
177
178 * powerpc.cc (struct Stub_table_owner): New.
179 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
180 unsigned int vector. Update all references.
181 (powerpc_relobj::set_stub_table): Take an unsigned int param
182 rather than a Stub_table. Update callers.
183 (Powerpc_relobj::clear_stub_table): New function.
184 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
185 stub_group_size_ vars.
186 (Target_powerpc::new_stub_table): Delete.
187 (max_branch_delta): New function, extracted from..
188 (Target_powerpc::Relocate::relocate): ..here..
189 (Target_powerpc::Branch_info::make_stub): ..and here. Return
190 status on whether stub created successfully.
191 (Stub_control::Stub_control): Add "no_size_errors" param. Move
192 default sizing to..
193 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
194 reduce on relax failure.
195 (Target_powerpc::group_sections): Add "no_size_errors" param.
196 Use stub_group_size_. Set up group info in a temp vector,
197 before building Stub_table vector. Account for input sections
198 possibly already converted to relaxed sections.
199 (Stub_table::init): Delete. Merge into..
200 (Stub_table::Stub_table): ..here.
201 (Stub_table::can_reach_stub): New function.
202 (Stub_table::add_plt_call_entry): Add "from" parameter and
203 return true iff stub could be reached.
204 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
205 param too.
206 (Stub_table::clear_stubs): Add "all" param.
207
a20605cf
AM
2082014-11-26 Alan Modra <amodra@gmail.com>
209
210 * powerpc.cc (Stub_control::set_output_and_owner): New function.
211 (Target_powerpc::group_sections): Use it.
212
43b64deb
CC
2132014-11-25 Cary Coutant <ccoutant@google.com>
214
215 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
216 (Binary_to_elf::write_symbol): Add st_size parameter.
217 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
218
c924eb67
CC
2192014-11-25 Cary Coutant <ccoutant@google.com>
220
221 PR gold/17639
222 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
223 (Sized_relobj_file::do_layout): Handle deferred sections properly
224 during GC pass 1. Don't add reloc sections to deferred list twice.
225 * object.h (Sized_relobj_file::is_deferred_layout): New function.
226 (Sized_relobj_file::is_deferred_layout_): New data member.
227
9d585188
L
2282014-11-21 H.J. Lu <hongjiu.lu@intel.com>
229
230 PR gold/17619
231 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
232 Check PC-relative offset overflow in PLT entry.
233
3ffaac20
AM
2342014-11-21 Alan Modra <amodra@gmail.com>
235
236 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
237 for undefined weaks.
238
0cfb0717
AM
2392014-11-20 Alan Modra <amodra@gmail.com>
240
241 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
242 from --stub-group-size parameter divided by 1024.
243 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
244 template parameter. Update all uses.
245 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
246 has_stub_value. Set for long branches. Don't report overflow for
247 branch to undefined weak symbols. Print info message on
248 overflowing branch to stub.
249
f9dffbf0
AM
2502014-11-20 Alan Modra <amodra@gmail.com>
251
252 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
253
e88ba8d5
L
2542014-11-13 H.J. Lu <hongjiu.lu@intel.com>
255
256 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
257 entry for R_X86_64_GOTPLT64.
258 (Target_x86_64<size>::Relocate::relocate): Update comments for
259 R_X86_64_GOTPLT64.
260
d37ffe25
ED
2612014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
262
263 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
264 * plugin.h: add lock definition
265
9726c3c1
HS
2662014-10-29 Han Shen <shenhan@google.com>
267 Jing Yu <jingyu@google.com>
268
269 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
270 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
271 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
272 Symbol::TLS_REF.
273 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
274 method.
275 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
276 (Target_aarch64::tls_ld_to_le): New method.
277 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
278 for 64bit targets.
279 (Output_data_plt_aarch64::irelative_rel_): New data member.
280 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
281 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
282 (Output_data_plt_aarch64::add_relocation): New method.
283 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
284 offset. Add got_irelative size to got size.
285 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
286 type string with the new typename.
287 (AArch64_relocate_functions::update_adr): Replace parameter x with
288 immed.
289 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
290 (AArch64_relocate_functions::reloc_common): New method.
291 (AArch64_relocate_funcsions::rela_general): Extract common part out
292 into reloc_common method.
293 (AArch64_relocate_functions::rela_general): Likewise.
294 (AArch64_relocate_functions::pcrela_general): Likewise.
295 (AArch64_relocate_functions::adr): New method.
296 (AArch64_relocate_functions::adrp): Calculate immed before calling
297 update_adr.
298 (AArch64_relocate_functions::adrp): Likewise.
299 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
300 comparing x to 0. Calculate immed from ~x when x < 0.
301 (Target_aarch64::optimize_tls_reloc): Add new cases for
302 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
303 TLSLD_MOVW_DTPREL_G0_NC.
304 (Target_aarch64::possible_function_pointer_reloc): Implement this
305 method.
306 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
307 comment.
308 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
309 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
310 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
311 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
312 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
313 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
314 (Target_aarch64::make_plt_entry): Call add_entry with two more
315 parameters.
316 (Target_aarch64::make_local_ifunc_plt_entry): New method.
317 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
318 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
319 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
320 (Target_aarch64::Relocate::relocate_tls): Add cases for
321 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
322 TLSLD_MOVW_DTPREL_G0_NC.
323 * testsuite/icf_safe_so_test.cc: Correct test comment.
324 * testsuite/icf_safe_test.sh: Add AArch64 arch.
325
80272b8c
AM
3262014-10-22 Alan Modra <amodra@gmail.com>
327
328 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
329 thread_starter.
330
998a69f4
AS
3312014-10-18 Andreas Schwab <schwab@linux-m68k.org>
332
333 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
334
aed56ec5
CC
3352014-10-17 Cary Coutant <ccoutant@google.com>
336
337 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
338 Add "typename" keyword.
339
bb779192 3402014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
341 Jing Yu <jingyu@google.com>
342
343 Patch for gold aarch64 backend to support relaxation.
344 * aarch64-reloc.def: Change format.
345 * aarch64.cc (class Reloc_stub): New class.
346 (class Stub_table): New class.
347 (class AArch64_relobj): New class.
348 (class AArch64_input_section): New class.
349 (class AArch64_output_section): New class.
350 (Target_aarch64::new_stub_table): New method.
351 (Target_aarch64::new_aarch64_input_section): New method.
352 (Target_aarch64::find_aarch64_input_section): New method.
353 (Target_aarch64::scan_section_for_stubs): New method.
354 (Target_aarch64::scan_reloc_section_for_stubs): New method.
355 (Target_aarch64::relocate_stub): New method.
356 (Target_aarch64::current_target): New method.
357 (Target_aarch64::do_make_elf_object): New method.
358 (Target_aarch64::do_may_relax): New method.
359 (Target_aarch64::do_relax): New method.
360 (Target_aarch64::group_sections): New method.
361 (Target_aarch64::scan_reloc_for_stub): New method.
362 (Target_aarch64::do_make_output_section): New method.
363 (Target_aarch64::stub_tables_): New data member.
364 (Target_aarch64::aarch64_input_section_map_): New data member.
365 (AArch64_relocate_functions::maybe_apply_stub): New method.
366
db4c9594
CC
3672014-09-30 Cary Coutant <ccoutant@google.com>
368
369 PR gold/17432
370 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
371
cd6da036
KC
3722014-09-30 Kito Cheng <kito@0xlab.org>
373
374 PR gold/13597
375 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
376 hash table before sysv-style hash table.
377
5f772412
ST
3782014-09-29 Sriraman Tallam <tmsriram@google.com>
379
380 * options.h (--pic-executable): Add negative to alias to -no-pie.
381
5efeedf6
CC
3822014-09-26 Cary Coutant <ccoutant@google.com>
383
384 PR gold/16773
385 * object.cc (Sized_relobj_file): Compute value of section symbols
386 for TLS sections the same as TLS symbols.
387
1707f183
CC
3882014-09-25 Cary Coutant <ccoutant@google.com>
389
390 PR gold/17432
391 * resolve.cc (Symbol_table::resolve): Override common placeholder
392 symbols, but adjust sizes.
393 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
394 symbols to common lists.
395
00cac886
AM
3962014-09-24 Alan Modra <amodra@gmail.com>
397
398 * po/POTFILES.in: Regenerate.
399
635aa30e
CC
4002014-09-23 Taiju Tsuiki <tzik@google.com>
401 Cary Coutant <ccoutant@google.com>
402
71b9b91b 403 PR gold/14860
635aa30e
CC
404 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
405 on input_sections_blocker.
406 * layout.cc (Write_sections_task::locks): Unblock
407 input_sections_blocker_.
408 * layout.h (Write_sections_task::Write_sections_task): Add
409 input_sections_blocker.
410 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
411 to DEPENDENCIES.
412 * testsuite/Makefile.in: Regenerate.
413
c0c71592
RÁE
4142014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
415
416 * testsuite/Makefile.am (plugin_test_10): New test.
417 * testsuite/Makefile.in: Regenerate
418 * testsuite/plugin_common_test_2.c (c1): Align to 8.
419 * testsuite/plugin_test_10.sh: New file.
420
6168c2a1
RÁE
4212014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
422
423 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
424 * resolve.cc (Symbol_table::resolve): Don't override common symbols
425 during the replacement phase.
426
3a531937
JY
4272014-09-17 Han Shen <shenhan@google.com>
428 Jing Yu <jingyu@google.com>
429
430 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
431 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
432 * aarch64.cc (Target_aarch64): Add data members
433 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
434 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
435 constructor.
436 (Target_aarch64::do_reloc_symbol_index): New method.
437 (Target_aarch64::do_reloc_addend): New method.
438 (Target_aarch64::add_tlsdesc_info): New method.
439 (Target_aarch64::do_dynsym_value): New method.
440 (Target_aarch64::do_make_data_plt): Add new parameters: got,
441 got_irelative. Pass them to Output_data_plt_aarch64_standard.
442 (Target_aarch64::make_data_plt): Add new parameters: got,
443 got_irelative. Pass them to do_make_data_plt.
444 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
445 (Target_aarch64::Relocate:tls_gd_to_le): New method.
446 (Target_aarch64::Relocate:tls_ie_to_le): New method.
447 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
448 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
449 (Target_aarch64::got_tlsdesc_section): New method.
450 (Target_aarch64::make_local_ifunc_plt_entry): New method.
451 (Target_aarch64::define_tls_base_symbol): New method.
452 (Target_aarch64::reserve_tlsdesc_entries): New method.
453 (Target_aarch64::got_mod_index_entry): New method.
454 (Target_aarch64::rela_tlsdesc_section): New method.
455 (Target_aarch64::rela_irelative_section): New method.
456 (Target_aarch64::Tlsdesc_info): New struct.
457 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
458 relocations and tlsdesc relocations.
459 (Target_aarch64::optimize_tls_reloc): Implement method.
460 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
461 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
462 in constructor.
463 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
464 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
465 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
466 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
467 (Output_data_plt_aarch64::rela_tlsdesc): New method.
468 (Output_data_plt_aarch64::rela_irelative): New method.
469 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
470 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
471 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
472 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
473 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
474 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
475 (Output_data_plt_aarch64_standard): New member variables:
476 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
477 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
478 New parameter: got, got_irelative.
479 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
480 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
481 (Output_data_plt_aarch64::do_write): Replace got_address with
482 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
483 (AArch64_relocate_functions::update_movnz): New method.
484 (AArch64_relocate_functions): Correct format.
485 (AArch64_relocate_functions::movnz): New method.
486 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
487 before the switch. Add new cases to switch.
00cac886 488 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
489 tlsgd tlsdesc cases.
490 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
491 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
492 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
493 Call reloc_name_in_error_message to print unsupported reloc.
494 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
495 make_data_plt.
496 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
497 relocs. Fill in some more dynamic tags.
498 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
499 Skip call tls_get_addr when tlsgd is relaxed.
500 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
501 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
502 tlsdesc->ie relaxation.
503
62661c93
SS
5042014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
505
506 * mips.cc (Target_mips_nacl): New class.
507 (Target_selector_mips_nacl): New class.
508 (target_selector_mips32): Rename from target_selector_mips32be and use
509 Target_selector_mips_nacl instead of Target_selector_mips.
510 (target_selector_mips32el): Rename from target_selector_mips32 and use
511 Target_selector_mips_nacl instead of Target_selector_mips.
512 (target_selector_mips64): Rename from target_selector_mips64be and use
513 Target_selector_mips_nacl instead of Target_selector_mips.
514 (target_selector_mips64el): Rename from target_selector_mips64 and use
515 Target_selector_mips_nacl instead of Target_selector_mips.
516 (Target_mips::mips_info): Add const attribute.
517
54674d38
CC
5182014-09-02 Cary Coutant <ccoutant@google.com>
519
520 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
521 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
522 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
523 (Sized_incr_dynobj::do_section_name): Likewise.
524 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
525 (Sized_incr_dynobj::do_section_name): Likewise.
526 * object.h (Object::section_name): Likewise.
527 (Object::do_section_name): Likewise.
528 (Sized_relobj_file::do_section_name): Likewise.
529 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
530 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
531
9860cbcf
CC
5322014-09-02 Cary Coutant <ccoutant@google.com>
533
534 PR gold/17005
535 * ehframe.cc (Fde::write): Add output_offset parameter.
536 (Cie::write): Likewise.
537 (Eh_frame::set_final_data_size): Account for offset within output
538 section.
539 (Eh_frame::do_sized_write): Likewise.
540 * ehframe.h (Fde::write): Add output_offset parameter.
541 (Cie::write): Likewise.
542 * output.cc (Output_section::Input_section_sort_entry): Remove
543 section_has_name_; add output_section_name parameter. Use
544 output section name for non-input sections.
545 (Output_section::Input_section_sort_entry::section_has_name): Remove.
546 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
547 (Output_section::Input_section_sort_compare): Remove logic for
548 sections without names.
549 (Output_section::Input_section_sort_init_fini_compare): Likewise.
550 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
551 Likewise.
552 (Output_section::Input_section_sort_section_name_compare): Likewise.
553
8e33481e
HS
5542014-08-29 Han Shen <shenhan@google.com>
555 Jing Yu <jingyu@google.com>
556
557 * aarch64-reloc-property.cc
558 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
559 reference reloc property in the table.
560 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
561 3 other entries.
562 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
563 2 new overloaded methods.
564 (Output_data_got_aarch64::do_write): Add code to write out
565 static relocs.
566 (class Output_data_got_aarch64::Static_reloc): New class to wrap
567 static relocs.
568 (Output_data_got_aarch64::static_relocs): New vector to
569 hold static relocs.
570 (Target_aarch64::TCB_SIZE): New const static memeber.
571 (Target_aarch64::tcb_size): New method.
572 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
573 (Target_aarch64::Relocate::relocate_tls): New method.
574 (Target_aarch64::Scan::local): Add code handling new reloc types.
575 (Target_aarch64::Scan::global): Add code handling new reloc types.
576
81233653
ST
5772014-08-13 Sriraman Tallam <tmsriram@google.com>
578
579 * options.h (-no-pie): Add option.
580
9363c7c3
JY
5812014-08-08 Jing Yu <jingyu@google.com>
582 Han Shen <shenhan@google.com>
583
584 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
585 (DEFFILES): add aarch64-reloc.def.
586 (TARGETSOURCES): Add aarch64-reloc-property.cc.
587 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
588 * Makefile.in: Regenerate.
589 * aarch64-reloc-property.cc: New file.
590 * aarch64-reloc-property.h: New file.
591 * aarch64-reloc.def: New file.
592 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
593 with tab to make the format consistent.
594 (Output_data_got_aarch64::symbol_table_): New method.
595 (Target_aarch64::do_plt_address_for_global): New method.
596 (Target_aarch64::do_plt_address_for_local): New method.
597 (Target_aarch64::do_select_as_default_target): New method.
598 (Target_aarch64::do_make_data_plt): New method.
599 (Target_aarch64::make_data_plt): New method.
600 (Output_data_plt_aarch64::has_irelative_section): New method.
601 (Output_data_plt_aarch64::address_for_global): New method.
602 (Output_data_plt_aarch64::address_for_local): New method.
603 (Output_data_plt_aarch64::irelative_rel_): New parameter.
604 (Output_data_plt_aarch64::add_entry): Implement contents.
605 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
606 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
607 the got_pov entry to plt0.
608 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
609 Implement contents.
610 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
611 (AArch64_howto): New struct.
612 (aarch64_howto[]): New static const array.
613 (AArch64_relocate_functions): New class.
614 (Target_aarch64::Scan::get_reference_flags): Remove method.
615 (Target_aarch64::Scan::local): Implement to support a few relocations.
616 (Target_aarch64::Scan::global): Implement to support a few relocations.
617 (Target_aarch64::make_plt_section): Implement contents.
618 (Target_aarch64::make_plt_entry): Implement contents.
619 (Target_aarch64::do_finalize_sections): Implement contents.
620 (Target_aarch64::Relocate::relocate): Implement a few relocations.
621 (Target_aarch64::relocate_section): Implement contents.
622
ad9fe6c1
AM
6232014-08-06 Alan Modra <amodra@gmail.com>
624
625 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
626
7cd4e5b7
AM
6272014-08-06 Alan Modra <amodra@gmail.com>
628
629 PR 13227
630 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
631
5ad9b0a7
ST
6322014-07-21 Sriraman Tallam <tmsriram@google.com>
633
634 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 635 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 636
e051745c
CC
6372014-07-08 Cary Coutant <ccoutant@google.com>
638
639 * expression.cc (struct Expression::Expression_eval_info): Add
640 new fields type_pointer, vis_pointer, and nonvis_pointer.
641 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
642 nonvis_pointer parameters. Adjust all calls.
643 (Symbol_expression::value): Update type, visibility, and nonvis bits
644 in caller.
645 * script.cc (Symbol_assignment::sized_finalize): Update type,
646 visibility, and remaining st_other bits for new symbol.
647 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
648 vis_pointer, and nonvis_pointer parameters.
649 * symtab.h (Symbol::set_type): New method.
650
651 * testsuite/Makefile.am (defsym_test): New test.
652 * testsuite/Makefile.in: Regenerate.
653 * testsuite/defsym_test.c: New file.
654 * testsuite/defsym_test.sh: New file.
655
f35c4853
CC
6562014-07-08 Cary Coutant <ccoutant@google.com>
657
658 PR gold/15639
659 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
660 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
661 (Sized_dynobj::base_read_symbols): ...new method.
662 * object.h (Sized_relobj_file::base_read_symbols): New method.
663 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
664 (Sized_relobj_file::base_read_symbols): ...new method.
665 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
666 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
667 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
668
2900af2d
AM
6692014-07-04 Alan Modra <amodra@gmail.com>
670
671 * po/POTFILES.in: Regenerate.
672
053a4d68
JY
6732014-07-02 Jing Yu <jingyu@google.com>
674
675 * aarch64.cc: New file
676 * Makefile.am (TARGETSOURCES): Add aarch64.cc
677 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
678 * Makefile.in: Regenerate.
679 * configure.tgt: Add entries for aarch64*.
680 * configure.ac: Likewise.
681 * configure: Likewise.
682
7b549045
AM
6832014-06-27 Alan Modra <amodra@gmail.com>
684
685 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
686
cb818dbf
CC
6872014-06-24 Cary Coutant <ccoutant@google.com>
688
689 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
690 sections.
691 (Dwo_file::sized_read_unit_index): Likewise.
692
9810d34d
SS
6932014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
694
695 * mips.cc: New file.
696 * Makefile.am (TARGETSOURCES): Add mips.cc
697 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
698 * configure.tgt: Add entries for mips*.
699 * configure.ac: Likewise.
700 * Makefile.in: Regenerate.
701 * configure: Likewise.
702
9baa787b
CC
7032014-06-09 Cary Coutant <ccoutant@google.com>
704
705 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
706 unit_length is within section bounds.
707
8f89af0a
CC
7082014-06-09 Cary Coutant <ccoutant@google.com>
709
710 PR gold/16980
711 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
712 map.
713
a47622ac
AM
7142014-06-07 Alan Modra <amodra@gmail.com>
715
716 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
717
4320c691
CC
7182014-06-06 Cary Coutant <ccoutant@google.com>
719
720 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
721 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
722 (Dwarf_pubnames_table::read_header): Likewise.
723 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
724 .debug_gnu_pubtypes.
725
270c9937
JB
7262014-06-05 Joel Brobecker <brobecker@adacore.com>
727
728 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
729 * Makefile.in, configure: Regenerate.
730
397998fc
AM
7312014-06-03 Alan Modra <amodra@gmail.com>
732
733 * powerpc.cc (addis_12_2): Define.
734 (Stub_table::do_write): Support fusion on ELFv2 stubs.
735
61f5c66f
AM
7362014-06-03 Alan Modra <amodra@gmail.com>
737
738 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
739 st_other output.
740
f6971787
AM
7412014-06-02 Alan Modra <amodra@gmail.com>
742
743 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
744 Only ignore relocs on ELFv1.
745 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
746
f6fb8322
CC
7472014-05-30 Cary Coutant <ccoutant@google.com>
748
749 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
750 * testsuite/Makefile.in: Regenerate.
751 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
752
c23dd342
L
7532014-05-27 H.J. Lu <hongjiu.lu@intel.com>
754
755 PR gold/16945
756 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
757 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
758
5fe7ffdc
AM
7592014-05-15 Alan Modra <amodra@gmail.com>
760
761 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
762 Compare FDE contents with DW_CFA_nop rather than 0.
763
a82bef93
ST
7642014-05-13 Sriraman Tallam <tmsriram@google.com>
765
766 * symtab.h (may_need_copy_reloc): Remove check for position independent
767 code.
768 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
769 position independence before pc absolute may_need_copy_reloc call.
770 Add check for executable output befor pc relative may_need_copy_reloc
771 call.
772 * i386.cc: Ditto.
773 * arm.cc: Ditto.
774 * sparc.cc: Ditto.
775 * tilegx.cc: Ditto.
776 * powerpc.cc: Add check for no position independence before
777 may_need_copy_reloc calls.
778 * testsuite/pie_copyrelocs_test.cc: New file.
779 * testsuite/pie_copyrelocs_shared_test.cc: New file.
780 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 781 * Makefile.in: Regenerate.
a82bef93 782
53c66605
ML
7832014-05-08 Martin Liška <mliska@suse.cz>
784
785 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
786
57b2284c
CC
7872014-05-06 Cary Coutant <ccoutant@google.com>
788
789 PR gold/16900
790 * i386.cc (Output_data_got_plt_i386): New class.
791 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
792 parameter. Change all callers.
793 (Output_data_plt_i386::layout_): Remove.
794 (Output_data_plt_i386::got_plt_): Change type.
795 (Target_i386::got_plt_): Change type. Change all references.
796 (Target_i386::got_section): Create instance of new class.
797 (Output_data_got_plt_i386::do_write): New function.
798 * x86_64.cc (Output_data_got_plt_x86_64): New class.
799 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
800 parameter. Change all callers.
801 (Output_data_plt_x86_64::layout_): Remove.
802 (Output_data_plt_x86_64::got_plt_): Change type.
803 (Target_x86_64::got_plt_): Change type. Change all references.
804 (Target_x86_64::got_section): Create instance of new class.
805 (Output_data_got_plt_x86_64::do_write): New function.
806 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
807 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
808 class.
809
6b97515d 8102014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 811
6b97515d
CC
812 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
813 if we have pubnames/pubtypes.
814
d1bddd3c
CC
8152014-05-02 Cary Coutant <ccoutant@google.com>
816
5fe7ffdc
AM
817 * defstd.cc (in_segment): Define __ehdr_start here...
818 * layout.cc (Layout::finalize): ...Instead of here. Set the
819 output segment when known.
820 * resolve.cc (Symbol::override_base_with_special): Remember
821 the original binding.
822 * symtab.cc (Symbol::set_output_segment): New function.
823 (Symbol::set_undefined): New function.
824 * symtab.h (Symbol::is_weak_undefined): Check original undef
825 binding.
826 (Symbol::is_strong_undefined): New function.
827 (Symbol::set_output_segment): New function.
828 (Symbol::set_undefined): New function.
829 * target-reloc.h (is_strong_undefined): Remove.
830 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
831 Check for hidden undefs.
832 (relocate_section): Call Symbol::is_strong_undefined.
833
834 * testsuite/Makefile.am (ehdr_start_test_1)
835 (ehdr_start_test_2, ehdr_start_test_3)
836 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
837 * testsuite/Makefile.in: Regenerate.
838 * testsuite/ehdr_start_def.cc: New source file.
839 * testsuite/ehdr_start_test.cc: New source file.
840 * testsuite/ehdr_start_test.t: New linker script.
841 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 842
7849f6d8
CC
8432014-04-23 Cary Coutant <ccoutant@google.com>
844
bf2cc635 845 PR gold/16870
7849f6d8
CC
846 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
847
99fd8cff
CC
8482014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
849
850 * layout.cc (Layout::include_section): Allow a target to decide
851 whether to include a section.
852 * target.h (Target::should_include_section): New function.
853 (Target::do_should_include_section): New function.
854
91f43acd
CC
8552014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
856
857 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
858 inline into ...
859 (Copy_relocs::emit): ... here.
860 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
861 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
862 (Copy_reloc_entry::entries_): Change from private to protected.
863
c4eb27e1
ST
8642014-04-02 Sriraman Tallam <tmsriram@google.com>
865
866 * icf.cc (get_section_contents): Replace copies of reloc
867 vectors with const references.
868
ae447ddd
CC
8692014-04-02 Cary Coutant <ccoutant@google.com>
870
871 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
872 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
873 * configure: Regenerate.
874 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
875 -fno-use-linker-plugin.
876 (LINK1, CXXLINK1): Add it to the link command.
877 * testsuite/Makefile.in: Regenerate.
878
fa47fa92
AM
8792014-03-12 Alan Modra <amodra@gmail.com>
880
881 * Makefile.in: Regenerate.
882
9b12c500
CC
8832014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
884
885 * symtab.h (Symbol::set_nonvis): New function.
886
beacaa96
CC
8872014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
888
889 * symtab.cc (Sized_symbol<32>::init_output_data):
890 Instantiate the template.
891 (Sized_symbol<64>::init_output_data): Likewise.
892
800d9823
CC
8932014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
894
895 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
896 adjust dynamic symbol value.
897 * target.h (Target::adjust_dyn_symbol): New function.
898 (Target::do_adjust_dyn_symbol): New function.
899
918fc1f8 9002014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 901
918fc1f8
CC
902 * output.cc (Output_data_dynamic::Dynamic_entry::write):
903 Get the value of DYNAMIC_CUSTOM dynamic entry.
904 * output.h (Output_data_dynamic::add_custom): New function.
905 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
906 dynamic entry.
907 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
908 * target.h (Target::dynamic_tag_custom_value): New function.
909 (Target::do_dynamic_tag_custom_value): New function.
910
98ff9231
CC
9112014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
912
913 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
914 dynsym indexes.
915 * target.h (Target::has_custom_set_dynsym_indexes): New function.
916 (Target::do_has_custom_set_dynsym_indexes): New function.
917 (Target::set_dynsym_indexes): New function.
918 (Target::do_set_dynsym_indexes): New function.
919
b80eed39
AM
9202014-03-07 Alan Modra <amodra@gmail.com>
921
922 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
923 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
924 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
925 (Powerpc_relocate_functions::has_overflow_bitfield,
926 overflowed): Use the above.
927 (Target_powerpc::Relocate::relocate): Correct overflow checking
928 for a number of relocations. Modify overflow test for 16-bit
929 fields in instructions to signed/unsigned according to whether
930 the field takes a signed or unsigned value.
931
4b95cf5c
AM
9322014-03-05 Alan Modra <amodra@gmail.com>
933
934 Update copyright years.
935
45965137
AM
9362014-03-05 Alan Modra <amodra@gmail.com>
937
938 * powerpc.cc (Target_powerpc::Scan::local, global): Support
939 R_PPC64_ADDR64_LOCAL.
940 (Target_powerpc::Relocate::relocate): Likewise.
941
2c80b753
AM
9422014-03-03 Alan Modra <amodra@gmail.com>
943
944 * dwp.cc (print_version): Update copyright year to current.
945
c1c69e83
AM
9462014-02-10 Alan Modra <amodra@gmail.com>
947
948 * po/gold.pot: Regenerate.
949
dd0c4e70
CC
9502014-02-06 Cary Coutant <ccoutant@google.com>
951
952 Fix problem where -u is ignored when a weak undef is seen.
953
954 * archive.cc (Library_base::should_include_member): Reorder
955 code to check for -u option if a weak undef has already been seen.
956 * testsuite/Makefile.am (weak_undef_test_2): New test case.
957 * testsuite/Makefile.in: Regenerate.
958 * testsuite/weak_undef_file3.cc: New file.
959 * testsuite/weak_undef_file4.cc: New file.
960 * testsuite/weak_undef_test_2.cc: New file.
961
1a221d3d
CC
9622014-02-05 Cary Coutant <ccoutant@google.com>
963
964 Fix issues with gold undefined symbol diagnostics.
965
966 PR binutils/15435
967 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
968 check to here.
969 * target-reloc.h (is_strong_undefined): New function.
970 (relocate_section): Move undef vtable symbol check from here.
971 Check for is_strong_undefined.
972
e889f0a4 9732014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 974
e889f0a4
CC
975 Fix problems with the --dynamic-list option.
976
977 PR gold/13577
978 * options.cc (General_options::parse_dynamic_list):
979 Set have_dynamic_list_.
980 (General_options::General_options): Initialize have_dynamic_list_.
981 (General_options::finalize): Turn off -Bsymbolic and
982 -Bsymbolic-functions if --dynamic-list provided.
983 * options.h (General_options::have_dynamic_list): New function.
984 (General_options::have_dynamic_list_): New data member.
985 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
986 correctly.
5fe7ffdc 987
e889f0a4
CC
988 PR gold/16530
989 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
990 in --dynamic-list, mark it.
5fe7ffdc 991
e889f0a4
CC
992 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
993 (dynamic_list_2): New test case.
994 * testsuite/Makefile.in: Regenerate.
995 * testsuite/dynamic_list_2.cc: New file.
996 * testsuite/dynamic_list_2.t: New file.
997 * testsuite/dynamic_list_lib1.cc: New file.
998 * testsuite/dynamic_list_lib2.cc: New file.
999 * testsuite/gc_dynamic_list_test.c: New file.
1000 * testsuite/gc_dynamic_list_test.sh: New file.
1001 * testsuite/gc_dynamic_list_test.t: New file.
1002
ec673e64
CC
10032014-01-28 Cary Coutant <ccoutant@google.com>
1004
1005 Add .gdb_index version 7 support.
1006
1007 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1008 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1009 debug sections.
1010 (Dwarf_ranges_table::read_ranges_table): Likewise.
1011 (Dwarf_pubnames_table::read_section): Check for GNU-style
1012 sections, and for compressed debug sections.
1013 (Dwarf_pubnames_table::read_header): Compute end address of table.
1014 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1015 for end of list by offset, not by offset == 0.
1016 (Dwarf_info_reader::do_read_string_table): Check for compressed
1017 debug sections.
1018 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1019 Initialize new data members.
1020 (Dwarf_pubnames_table::next_name): return flag_byte.
1021 (Dwarf_pubnames_table::end_of_table_): New data member.
1022 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1023 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1024 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1025 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1026 read skeleton type unit DIEs.
1027 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1028 (Gdb_index::do_write): Write flag_byte.
1029 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1030 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1031 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1032 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1033
221fd5d5
L
10342014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1035
1036 * version.cc (print_version): Update copyright year to 2014.
1037
6c09fb0b
ILT
10382013-12-19 Dimitry Andric <dimitry@andric.com>
1039
1040 * stringpool.cc (Stringpool_template::reserve): Add
1041 HAVE_UNORDERED_MAP case.
1042 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1043
8356f2d0
CC
10442013-12-18 Cary Coutant <ccoutant@google.com>
1045
1046 * configure.ac: Check for <unordered_set> and <unordered_map>.
1047 * config.in: Regenerate.
1048 * configure: Regenerate.
1049 * system.h: Use <unordered_set> and <unordered_map> if available.
1050
f2c7d7ee
RM
10512013-12-10 Roland McGrath <mcgrathr@google.com>
1052
1053 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1054 with $(INSTALL_PROGRAM_ENV).
1055 * Makefile.in: Regenerate.
1056
6632e8cc
CC
10572013-11-22 Cary Coutant <ccoutant@google.com>
1058
1059 * configure.ac: Add check for which library is needed for
1060 dlopen.
1061 * configure: Regenerate.
1062
0c075858
CC
10632013-11-22 Cary Coutant <ccoutant@google.com>
1064
1065 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1066 assembler.
1067 * testsuite/Makefile.in: Regenerate.
1068
f49fe902
L
10692013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1070
1071 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1072 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1073 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1074 (Target_x86_64<size>::Scan::local): Likewise.
1075 (Target_x86_64<size>::Scan::global): Likewise.
1076 (Target_x86_64<size>::Relocate::relocate): Likewise.
1077 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1078 Likewise.
1079 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1080 R_X86_64_PC32_BND.
1081
1082 * testsuite/Makefile.am (check_PROGRAMS): Add
1083 exception_x86_64_bnd_test.
1084 (exception_x86_64_bnd_test_SOURCES): New macro.
1085 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1086 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1087 (exception_x86_64_bnd_test_LDADD): Likewise.
1088 (exception_x86_64_bnd_1.o): New rule.
1089 (exception_x86_64_bnd_2.o): Likewise.
1090 * testsuite/Makefile.in: Regenerated.
1091
9055360d
AM
10922013-11-15 Alan Modra <amodra@gmail.com>
1093
1094 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1095 accessor.
1096 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1097 Only call ppc64_local_entry_offset for 64-bit. Restrict
1098 symval_for_branch lookup to ELFv1.
1099 (Stub_table::add_plt_call_entry): Use unsigned int off.
1100 (Output_data_glink::Address, invalid_address): New.
1101 (Output_data_glink::add_eh_frame): Move out of line. Add
1102 support for ELFv2.
1103 (Output_data_glink::add_global_entry, find_global_entry,
1104 global_entry_address): New functions.
1105 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1106 ge_size): New variables.
1107 (Output_data_glink::set_final_data_size): Add global entry
1108 stub sizing.
1109 (Output_data_glink::do_write): Write global entry stubs.
1110 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1111 parameter. Return true for ELFv2. Adjust callers.
1112 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1113 ELFv1. Similarly for ifunc and dynamic relocation processing
1114 specific to ELFv1. Recognize that symbols are defined on
1115 their plt entries for ELFv2.
1116 (Target_powerpc::symval_for_branch): Assert if called for
1117 ELFv2 or ppc32.
1118 (Target_powerpc::Relocate::relocate): Use global entry plt
1119 stub for symbol value if such exists on ELFv2.
1120 (Target_powerpc::Relocate::relocate): Don't call
1121 symval_for_branch when ELFv2. Do adjust for local entry
1122 offset when ELFv2.
1123 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1124 plt stub for ELFv2.
1125 (Target_powerpc::do_plt_address_for_global): Similarly.
1126
cafdd569
CC
11272013-11-14 Cary Coutant <ccoutant@google.com>
1128
1129 Revert patch -- this did not fix the problem, and there is
1130 no race there.
1131
1132 2013-11-14 Cary Coutant <ccoutant@google.com>
1133
1134 PR gold/14860
1135 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1136 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1137 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1138 updating fde_offsets_.
1139 (Eh_frame_hdr::lock_): New data member.
1140
94e49e16
CC
11412013-11-14 Cary Coutant <ccoutant@google.com>
1142
1143 * dwp.cc (Dwo_file_entry): New type.
1144 (File_list): Use Dwo_file_entry.
1145 (Dwo_file::verify): New function.
1146 (Dwo_file::verify_dwo_list): New function.
1147 (Dwo_file::sized_verify_dwo_list): New function.
1148 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1149 list.
1150 (Dwp_options): New enum type.
1151 (dwp_options): Add --verify-only.
1152 (usage): Likewise.
1153 (main): Likewise.
1154 * dwp.h (gold_info): Add declaration.
1155
7cdd7d57
CC
11562013-11-14 Cary Coutant <ccoutant@google.com>
1157
1158 PR gold/14860
1159 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1160 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1161 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1162 updating fde_offsets_.
1163 (Eh_frame_hdr::lock_): New data member.
1164
1d946cb3
CC
11652013-11-06 Cary Coutant <ccoutant@google.com>
1166
1167 PR gold/15758
1168 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1169 before reloc sections.
1170
4f65b40e
AM
11712013-11-04 Alan Modra <amodra@gmail.com>
1172
1173 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1174 (Symbol::needs_dynamic_reloc): Test new flag.
1175 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1176 (Target_powerpc::Scan::get_reference_flags): Add target param.
1177 Return FUNC_DESC_ABI for 64-bit ELFv1.
1178 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1179 call.
1180 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1181 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1182
908794a9
CC
11832013-10-31 Cary Coutant <ccoutant@google.com>
1184
1185 Restore support for dwp v2 DWARF package file format.
1186
1187 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1188 tu_length parameter. Adjust all callers.
1189 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1190 * dwp.cc: Include dwarf.h.
1191 (Section_bounds): New struct type.
1192 (Unit_set): New struct type.
1193 (Dwo_file::Dwo_file): Initialize new data member.
1194 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1195 Combine and rename to...
1196 (Dwo_file::read_unit_index): ...this.
1197 (Dwo_file::sized_read_compunit_index)
1198 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1199 (Dwo_file::sized_read_unit_index): ...this.
1200 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1201 parameters; add section_id parameter.
1202 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1203 (Dwo_file::add_unit_set): ...this.
1204 (Dwo_file::shndx_map_): Remove.
1205 (Dwo_file::sect_offsets_): New data member.
1206 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1207 (Dwp_output_file::add_section): Rename to...
1208 (Dwp_output_file::add_contribution): ...this.
1209 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1210 (Dwp_output_file::add_tu_set): Likewise.
1211 (Dwp_output_file::Contribution): New type.
1212 (Dwp_output_file::Section::contributions): New data member.
1213 (Dwp_output_file::Cu_or_tu_set): Remove.
1214 (Dwp_output_file::Section::Section): New ctor.
1215 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1216 (Dwp_output_file::Dwp_index::Section_table): New type.
1217 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1218 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1219 parameter.
1220 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1221 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1222 (Dwp_output_file::Dwp_index::section_table): New member function.
1223 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1224 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1225 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1226 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1227 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1228 (Dwp_output_file::Dwp_index::section_table_): New data member.
1229 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1230 (Dwp_output_file::add_output_section): New member function.
1231 (Dwp_output_file::write_new_section): New member function.
1232 (Dwp_output_file::write_contributions): New member function.
1233 (Dwp_output_file::section_id_map_): New data member.
1234 (class Dwo_id_info_reader): Remove.
1235 (class Unit_reader): New class.
1236 (get_dwarf_section_name): New function.
1237 (Dwo_file::read_executable): Adjust initializations of class data.
1238 (Dwo_file::read): Add support for v2 package file format.
1239 (Dwo_file::read_unit_index): Likewise.
1240 (Dwo_file::sized_read_unit_index): Likewise.
1241 (Dwo_file::copy_section): Likewise.
1242 (Dwo_file::add_unit_set): Likewise.
1243 (Dwp_output_file::add_output_section): Likewise.
1244 (Dwp_output_file::add_contribution): Likewise.
1245 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1246 for empty slot.
1247 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1248 file format.
1249 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1250 slot.
1251 (Dwp_output_file::initialize): Remove unused function.
1252 (Dwp_output_file::finalize): Add support for v2 package file format.
1253 (Dwp_output_file::write_index): Likewise.
1254 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1255 function prototype.
1256
2500c017
CC
12572013-10-31 Cary Coutant <ccoutant@google.com>
1258
1259 * configure.ac: Fix check for -fmerge-constants.
1260 * configure.ac: Regenerate.
1261
dd0845d7
RM
12622013-10-30 Roland McGrath <mcgrathr@google.com>
1263
1264 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1265 Correct 9-byte nop sequence to match what the assembler generates.
1266
b4f7960d
AM
12672013-10-30 Alan Modra <amodra@gmail.com>
1268
1269 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1270 ppc64_local_entry_offset, ppc64_local_entry_offset,
1271 do_read_symbols): New functions.
1272 (Powerpc_relobj::e_flags_, st_other_): New vars.
1273 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1274 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1275 (Powerpc_relobj::e_flags_): New var.
1276 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1277 and adjust for ELFv2.
1278 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1279 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1280 (Powerpc_dynobj::do_find_special_sections): Likewise.
1281 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1282 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1283 to ELFv2 local entry.
1284 (Target_powerpc::do_relax): No thread safe barriers needed for
1285 ELFv2.
1286 (Output_data_plt_powerpc::initial_plt_entry_size_,
1287 plt_entry_size): Delete. Replace all uses with
1288 first_plt_entry_offset() and plt_entry_size().
1289 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1290 reserved_size parm. Update callers.
1291 (Output_data_plt_powerpc::entry_count): Update.
1292 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1293 and use Target_powerpc::first_plt_entry_offset().
1294 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1295 rename to plt_entry_size.
1296 (Output_data_plt_powerpc::add_ifunc_entry,
1297 add_local_ifunc_entry): Adjust reloc for ELFv2.
1298 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1299 (glink_eh_frame_fde_64v2): New.
1300 (Stub_table::plt_call_size): Support ELFv2 sizing.
1301 (Output_data_glink::add_eh_frame): Use the new FDE.
1302 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1303 (Stub_table::do_write): Write ELFv2 stubs and glink.
1304 (Target_powerpc::Relocate::relocate): Replaces nop after call
1305 with ld 2,24(1) and adjust local offset destination for ELFv2.
1306
f9c6b907
AM
13072013-10-30 Alan Modra <amodra@gmail.com>
1308
1309 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1310 (Target_powerpc::Scan::global, local): Likewise.
1311 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1312 on all ppc64 @h and @ha relocs.
1313
e84fe78f
AM
13142013-10-14 Alan Modra <amodra@gmail.com>
1315
1316 * output.h (Output_data_got::add_constant): Tidy.
1317 (Output_data_got::add_constant_pair): New function.
1318 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1319 methods used so as to first call reserve_ent().
1320
679e4abf
RM
13212013-10-11 Roland McGrath <mcgrathr@google.com>
1322
44dcb735
RM
1323 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1324 add_got_entry and add_got_entry_pair.
1325
13323c49
RM
1326 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1327 (HAVE_PUBNAMES): Likewise.
1328 * configure: Regenerate.
1329
1496b446
RM
1330 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1331 * testsuite/Makefile.in: Regenerate.
1332
cc84c10b
RM
1333 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1334 Remove const from declaration.
1335 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1336 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1337 * output.h (Output_file_header): Remove const from member target_
1338 and corresponding constructor argument.
1339 * output.cc (Output_file_header::Output_file_header): Update prototype.
1340 (Output_file_header::do_sized_write): Use this->target_ in place
1341 of parameters()->target().
1342
52f66a2c
RM
1343 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1344
2b64b551
RM
1345 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1346 * configure: Regenerate.
1347 * Makefile.in: Regenerate.
1348 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1349 * testsuite/merge_string_literals_2.c: Likewise.
1350 * testsuite/Makefile.am
1351 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1352 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1353 literal -fmerge-constants.
1354 * testsuite/Makefile.in: Regenerate.
1355
43819297
RM
1356 * i386.cc (Target_i386): Remove unused member dynbss_.
1357 * arm.cc (Target_arm): Likewise.
1358 * powerpc.cc (Target_powerpc): Likewise.
1359 * sparc.cc (Target_sparc): Likewise.
1360 * tilegx.cc (Target_tilegx): Likewise.
1361 * x86_64.cc (Target_x86_64): Likewise.
1362 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1363 type_signature_, type_offset_.
1364 * plugin.h (Plugin_hook): Remove unused member layout_.
1365 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1366 mapfile_.
1367 (Read_member): Remove unused members input_objects_, symtab_,
1368 mapfile_, layout_.
1369 (Check_library): Remove unused member symtab_.
1370 * archive.h (Lib_group): Remove unused member lib_.
1371 * archive.cc (Lib_group::Lib_group): Update initializer.
1372 * incremental.h (Incremental_binary): Remove unused member target_.
1373 (Incremental_script_entry): Removed unused member script_.
1374 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1375 * icf.h (Icf): Remove unused member num_tracked_relocs.
1376
39d9ead7
RM
1377 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1378 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1379 its only use.
1380 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1381
679e4abf
RM
1382 * archive.h: Use struct rather than class for forward declaration
1383 of Read_symbols_data.
1384
54de2ea6
CC
13852013-10-07 Cary Coutant <ccoutant@google.com>
1386
1387 PR gold/16010
1388 * testsuite/Makefile.am (icf_test): Fix dependencies.
1389 (icf_safe_test): Likewise.
1390 (icf_safe_so_test): Likewise.
1391 (large_symbol_alignment): Add empty _LDADD rule.
1392 * testsuite/Makefile.in: Regenerate.
1393
b14016f0
L
13942013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1395
1396 PR gold/15927
1397 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1398 relocation for R_X86_64_32 on x32.
1399
eb426534
RM
14002013-08-27 Roland McGrath <mcgrathr@google.com>
1401
1402 * output.cc (Output_segment::set_section_addresses): Take new
1403 Target* argument. If target->isolate_execinstr() and the segment
1404 is executable and starts at a target->abi_pagesize() boundary,
1405 pad its end out to a target->abi_pagesize() boundary with code fill.
1406 * output.h (Output_segment::set_section_addresses): Update decl.
1407 * layout.h (Layout::check_output_data_for_reset_values): Take new
1408 argument RELAX_OUTPUTS.
1409 (Layout): New member relax_output_list_.
1410 (Layout::add_relax_output): New method.
1411 * layout.cc (Layout::Layout): Update constructor.
1412 (Layout::reset_relax_output): New method.
1413 (Layout::clean_up_after_relaxation): Call it.
1414 (Layout::prepare_for_relaxation): Update caller.
1415 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1416 Call reset_relax_output before re-processing segments for
1417 isolate_execinstr case.
1418 (Layout::write_data): Handle relax_output_list_.
1419 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1420 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1421
9aff4b7a
NC
14222013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1423
1424 PR binutils/15834
1425 * object.h: Fix typos.
1426
93f8221c
RM
14272013-08-16 Roland McGrath <mcgrathr@google.com>
1428
1429 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1430 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1431
e44c3715
CC
14322013-08-07 Cary Coutant <ccoutant@google.com>
1433
1434 Revert support for v2 DWP files:
1435
1436 2013-03-01 Cary Coutant <ccoutant@google.com>
1437
1438 Add dwp support for v2 DWARF package file format.
1439 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1440 tu_length parameter. Adjust all callers.
1441 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1442 * dwp.cc: Include dwarf.h.
1443 (Section_bounds): New struct type.
1444 (Unit_set): New struct type.
1445 (Dwo_file::Dwo_file): Initialize new data member.
1446 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1447 Combine and rename to...
1448 (Dwo_file::read_unit_index): ...this.
1449 (Dwo_file::sized_read_compunit_index)
1450 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1451 (Dwo_file::sized_read_unit_index): ...this.
1452 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1453 parameters; add section_id parameter.
1454 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1455 (Dwo_file::add_unit_set): ...this.
1456 (Dwo_file::shndx_map_): Remove.
1457 (Dwo_file::sect_offsets_): New data member.
1458 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1459 (Dwp_output_file::add_section): Rename to...
1460 (Dwp_output_file::add_contribution): ...this.
1461 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1462 (Dwp_output_file::add_tu_set): Likewise.
1463 (Dwp_output_file::Contribution): New type.
1464 (Dwp_output_file::Section::contributions): New data member.
1465 (Dwp_output_file::Cu_or_tu_set): Remove.
1466 (Dwp_output_file::Section::Section): New ctor.
1467 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1468 (Dwp_output_file::Dwp_index::Section_table): New type.
1469 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1470 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1471 parameter.
1472 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1473 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1474 (Dwp_output_file::Dwp_index::section_table): New member function.
1475 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1476 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1477 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1478 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1479 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1480 (Dwp_output_file::Dwp_index::section_table_): New data member.
1481 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1482 (Dwp_output_file::add_output_section): New member function.
1483 (Dwp_output_file::write_new_section): New member function.
1484 (Dwp_output_file::write_contributions): New member function.
1485 (Dwp_output_file::section_id_map_): New data member.
1486 (class Dwo_id_info_reader): Remove.
1487 (class Unit_reader): New class.
1488 (get_dwarf_section_name): New function.
1489 (Dwo_file::read_executable): Adjust initializations of class data.
1490 (Dwo_file::read): Add support for v2 package file format.
1491 (Dwo_file::read_unit_index): Likewise.
1492 (Dwo_file::sized_read_unit_index): Likewise.
1493 (Dwo_file::copy_section): Likewise.
1494 (Dwo_file::add_unit_set): Likewise.
1495 (Dwp_output_file::add_output_section): Likewise.
1496 (Dwp_output_file::add_contribution): Likewise.
1497 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1498 for empty slot.
1499 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1500 file format.
1501 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1502 slot.
1503 (Dwp_output_file::initialize): Remove unused function.
1504 (Dwp_output_file::finalize): Add support for v2 package file format.
1505 (Dwp_output_file::write_index): Likewise.
1506 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1507 function prototype.
1508
c6905c28
CC
15092013-07-31 Cary Coutant <ccoutant@google.com>
1510
1511 * object.cc (Sized_relobj::do_output_section_address): New function.
1512 (Sized_relobj): Instantiate explicitly.
1513 * object.h (Object::output_section_address): New function.
1514 (Object::do_output_section_address): New function.
1515 (Sized_relobj::do_output_section_address): New function.
1516 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1517
15182013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 1519 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
1520
1521 * parameters.cc (Parameters::entry): Return target-specific entry
1522 symbol name.
1523 * target.h (Target::entry_symbol_name): New function.
1524 (Target_info::entry_symbol_name): New data member.
1525
1526 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1527 * i386.cc (Target_i386::i386_info): Likewise.
1528 (Target_i386_nacl::i386_nacl_info): Likewise.
1529 * sparc.cc (Target_sparc::sparc_info): Likewise.
1530 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1531 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1532 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1533 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1534
234d4ab8
SA
15352013-07-22 Sterling Augustine <saugustine@google.com>
1536
1537 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1538 Convert parameter shndx to local variable. Add parameters symtab
1539 and symtab_size. Scan over section names. Find relocation
1540 section corresponding to current section. Create and initialize
1541 reloc_mapper_ and reloc_type_.
1542 (Dwarf_pubnames_table::read_header): Add assertion. Change
1543 unit_length to off_t. Initialize member unit_length_. Fill in field
1544 cu_offset_.
1545 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1546 Initialize new fields unit_length_ and cu_offset_.
1547 (Dwarf_pubnames_table::read_section): Update prototype.
1548 (Dwarf_pubnames_table::cu_offset): New member function.
1549 (Dwarf_pubnames_table::subsection_size): Likewise.
1550 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1551 New fields.
1552 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1553 member functions public.
1554 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1555 Update comment. Rework logic. Move repeated parts to...
1556 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1557 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1558 pubtypes_table_, and stmt_list_offset.
1559 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1560 Gdb_index::find_pubtype_offset,
1561 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1562 (Gdb_index::pubnames_read): Update prototype and rework logic.
1563 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1564 Forward declare.
1565 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1566 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1567 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1568 Gdb_index::map_pubtable_to_dies):
1569 Declare functions.
1570 (Gdb_index::pubnames_read): Update declaration.
1571 (Gdb_index::Pubname_offset_map): New type.
1572 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1573 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1574 Gdb_index::stmt_list_offset): Declare.
1575 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1576 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1577 Gdb_index::pubtypes_offset_): Remove.
1578
a3ed37d8
RM
15792013-07-19 Roland McGrath <mcgrathr@google.com>
1580
1581 * options.h (General_options): Add -Trodata-segment option.
1582 * parameters.cc (Parameters::check_rodata_segment): New function.
1583 (Parameters::set_target_once): Call it.
1584 * parameters.h (Parameters): Declare it (private member function).
1585 * layout.cc (load_seg_unusable_for_headers): New function, broken
1586 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1587 then validate rodata segment rather than text segment.
1588 (relaxation_loop_body): Call that.
1589 (is_text_segment): New function. Don't admit a non-executable
1590 segment if TARGET->isolate_execinstr().
1591 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1592
eb5b4ded
CC
15932013-07-15 Shawn Landden <shawnlandden@gmail.com>
1594
1595 PR gold/15070
1596 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1597 * nacl.h (Sniff_file::View::View): Request aligned view.
1598
4d5effb9
CC
15992013-07-11 Cary Coutant <ccoutant@google.com>
1600
1601 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1602 correct BRLT entry size.
1603
ba8ca3e7
AM
16042013-07-03 Alan Modra <amodra@gmail.com>
1605
1606 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1607 comment.
1608
267257d2
CC
16092013-07-01 Cary Coutant <ccoutant@google.com>
1610
1611 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1612 reloc_type_.
1613 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1614 (Dwarf_ranges_table::lookup_reloc): New function.
1615 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1616 reloc_type_.
1617 (Dwarf_ranges_table::lookup_reloc): New function.
1618 (Dwarf_ranges_table::reloc_type_): New data member.
1619
06f30c9d
CC
16202013-06-27 Jing Yu <jingyu@google.com>
1621
1622 PR gold/15662
1623 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1624 function.
1625 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1626 (Target_powerpc::do_relax): Call the above.
1627
a2d7bf59
AM
16282013-06-27 Cary Coutant <ccoutant@google.com>
1629
1630 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1631 on garbage collected .opd section.
1632
16332013-06-27 Alan Modra <amodra@gmail.com>
1634
1635 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1636 is non-zero.
1637 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1638 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1639
32364e50
CC
16402013-06-14 Cary Coutant <ccoutant@google.com>
1641
1642 * resolve.cc (Symbol::override_base): Don't override st_type
1643 from plugin placeholder symbols.
1644 (Symbol_table::resolve): Likewise.
1645 (Symbol_table::should_override): Don't complain about TLS mismatch
1646 if the TO symbol is a plugin placeholder.
1647 * testsuite/Makefile.am (plugin_test_tls): New test.
1648 * testsuite/Makefile.in: Regenerate.
1649 * testsuite/plugin_test_tls.sh: New test script.
1650 * testsuite/two_file_test_2_tls.cc: New test source.
1651 * testsuite/two_file_test_tls.cc: New test source.
1652
7fb47cc9
CC
16532013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1654
1655 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1656 the maximum segment alignment is larger than the page size.
1657 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1658 correctly aligns the symbols with large alignemnt.
1659 * testsuite/Makefile.in: Regenerate.
1660 * testsuite/large_symbol_alignment.cc: New file.
1661
6934001a
CC
16622013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1663 Sriraman Tallam <tmsriram@google.com>
1664
1665 * options.h (sort_section): New option.
1666 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1667 Rename from Input_section_sort_section_name_special_ordering_compare.
1668 (Input_section_sort_section_name_compare): New struct.
1669 * output.cc (Output_section::Input_section_sort_section_name_compare::
1670 operator()): New function.
1671 (Output_section::sort_attached_input_sections): Use new sort function
1672 for .text if --sort-section=name is specified.
1673 * layout.cc (Layout::make_output_section):
1674 Add sorting by name when --sort-section=name is specified.
1675 * testsuite/Makefile.am (text_section_grouping): Test option
1676 --sort-section=name.
1677 * testsuite/Makefile.in: Regenerate.
1678 * testsuite/section_sorting_name.cc: New file.
1679 * testsuite/section_sorting_name.sh: New file.
1680
93acabad
CC
16812013-05-21 Cary Coutant <ccoutant@google.com>
1682
1683 * symtab.h (Symbol::is_cxx_vtable): New function.
1684 * target-reloc.h (relocate_section): Check for vtable symbol.
1685 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1686 * testsuite/Makefile.in: Regenerate.
1687 * testsuite/missing_key_func.cc: New test source.
1688 * testsuite/missing_key_func.sh: New test script.
1689
60e8b3fc
CC
16902013-05-21 Cary Coutant <ccoutant@google.com>
1691
2b64b551
RM
1692 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1693 type of enclosing symbol.
1694 (Relocate_info::location): Check symbol type when describing symbol.
1695 * object.h (Symbol_location_info): Remove unused line_number;
1696 add enclosing_symbol_type.
1697 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 1698
9df9de2c
CC
16992013-05-13 Cary Coutant <ccoutant@google.com>
1700
2b64b551
RM
1701 * configure.ac: Export DEFAULT_TARGET.
1702 * configure: Regenerate.
1703 * Makefile.in: Regenerate.
1704 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1705 * testsuite/Makefile.in: Regenerate.
1706 * testsuite/debug_msg.sh: Delete duplicate tests.
1707 Don't check undef_int error message match for powerpc where the
1708 source file and line number aren't available.
9df9de2c 1709
bbc5ae17
RM
17102013-05-10 Roland McGrath <mcgrathr@google.com>
1711
1712 * options.h (General_options): Add --rosegment-gap option.
1713 * options.cc (finalize): --rosegment-gap implies --rosegment.
1714 * layout.cc (set_segment_offsets): Let user option override
1715 target->rosegment_gap().
1716
0c6e6c39
RM
17172013-05-10 Roland McGrath <mcgrathr@google.com>
1718
1719 * options.h (General_options): Remove leading space from help
1720 messages for -nostdlib and --rosegment.
1721
cde7cb01
MR
17222013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1723
1724 PR ld/15365
1725 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1726
f31ae5b8
AM
17272013-05-03 Alan Modra <amodra@gmail.com>
1728
1729 * merge.cc (Output_merge_string::do_add_input_section): Correct
1730 scan for number of strings. Rename vars to avoid shadowing.
1731 Include missing terminator in input_size_.
1732
d3a7cd45
L
17332013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1734
1735 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1736 Restore empty string handling.
1737
6ad3daba
CC
17382013-05-01 Cary Coutant <ccoutant@google.com>
1739
1740 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1741 uninitialized warning.
1742
e31908b6
CC
17432013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1744
1745 * output.cc (Output_section::add_merge_input_section): Allow
1746 to merge sections if the alignment is more than character size.
1747 * merge.h (Output_merge_string::Output_merge_string): Remove
1748 assert.
1749 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1750 only not-null strings. Check the alignment of strings.
1751 * stringpool.h
1752 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1753 alignment as the argument.
1754 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1755 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1756 Align non-zero length strings according to the addralign_.
1757 (Stringpool_template<Stringpool_char>::set_string_offsets):
1758 Updating offsets according to the given alignment.
1759 * testsuite/Makefile.am (text_section_grouping): Test if string
1760 literals are getting merged.
1761 * testsuite/Makefile.in: Regenerate.
1762 * testsuite/merge_string_literals_1.c: New file.
1763 * testsuite/merge_string_literals_2.c: Ditto.
1764 * testsuite/merge_string_literals.sh: Ditto.
1765
0e804863
ILT
17662013-04-26 Ian Lance Taylor <iant@google.com>
1767
1768 * target-reloc.h (relocate_section): If the reloc offset is out of
1769 range, pass VIEW as NULL to relocate.relocate.
1770 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1771 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1772 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1773 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1774 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1775 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1776
e7c5ea40
CC
17772013-04-26 Geoff Pike <gpike@chromium.org>
1778
1779 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1780 * layout.cc (Hash_task): New class.
1781 (Layout::queue_build_id_tasks): New function.
1782 (Layout::write_build_id): Handle single-thread portion of build ID
1783 computation. (In some cases, all of it is single-threaded.) Replace
1784 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1785 functionality in fewer lines of code.
1786 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1787 * options.h (General_options): make "--build-id" default to tree
1788 rather than sha1. Add two new options related to --build-id=tree:
1789 --build-id-chunk-size-for-treehash and
1790 --build-id-min-file-size-for-treehash.
1791 * Makefile.am: add testing of --build-id=tree and related new options
1792 (these tests will be invoked by "make check").
1793 * Makefile.in: Regenerate.
1794
49926cd0
AM
17952013-04-25 Alan Modra <amodra@gmail.com>
1796
1797 * configure.tgt: Add powerpcle and powerpc64le.
1798
a4034750
AM
17992013-04-22 Alan Modra <amodra@gmail.com>
1800
1801 PR gold/15355
1802 * layout.cc (Layout::segment_precedes): Allow more than one
1803 segment with the same type and flags.
1804
e79c84aa
CC
18052013-04-15 Cary Coutant <ccoutant@google.com>
1806
1807 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1808 allocate space in file for BSS sections.
1809
2199fbe7
CC
18102013-04-15 Cary Coutant <ccoutant@google.com>
1811
1812 * script-sections.cc (Orphan_output_section): Reset address
1813 to zero after each orphaned section for relocatable links.
1814
502e8a84
CC
18152013-04-15 Cary Coutant <ccoutant@google.com>
1816
a4034750
AM
1817 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1818 section starting address for relocatable link.
1819 * testsuite/Makefile.am (script_test_11): New test.
1820 * testsuite/Makefile.in: Regenerate.
1821 * testsuite/script_test_11.c: New source file.
1822 * testsuite/script_test_11.t: New linker script.
502e8a84 1823
0cfdc767
AM
18242013-04-13 Alan Modra <amodra@gmail.com>
1825
1826 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1827 owner when sections are not adjacent and exceed group size.
1828 (Target_powerpc::group_sections): Handle corner case.
1829 (Target_powerpc::Branch_info::make_stub): Handle case where
1830 stub table doesn't exist due to branches in non-exec sections.
1831 (Target_powerpc::Relocate::relocate): Likewise.
1832
6830ee24
AM
18332013-04-11 Alan Modra <amodra@gmail.com>
1834
1835 PR gold/15354
1836 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1837 .branch_lt to match bfd ld. Adjust comments throughout file.
1838
54a3d865
ILT
18392013-04-04 Ian Lance Taylor <iant@google.com>
1840
1841 GCC PR c++/56840
1842 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1843 sections before checking whether they are included in the link.
1844
9993ba11
ST
18452013-03-29 Sriraman Tallam <tmsriram@google.com>
1846
1847 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1848 object before calling the plugin claim_file handler. Pass the elf
1849 object of the archive to the plugin. Delete the elf object if the
1850 plugin claims the file.
1851
ebacd51e
AM
18522013-03-21 Alan Modra <amodra@gmail.com>
1853
1854 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1855 segment when omagic.
1856
117be58f
AM
18572013-03-21 Alan Modra <amodra@gmail.com>
1858
1859 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1860 comparison warning.
1861 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1862 uninitialized" warning.
1863
32e2b61d
AM
18642013-03-20 Alan Modra <amodra@gmail.com>
1865
1866 * symtab.h (Symbol::clear_version): New function.
1867 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1868 is_needed by weak references. Clear version for symbols defined
1869 in as-needed objects that are not needed.
1870
b3ccdeb5
AM
18712013-03-15 Alan Modra <amodra@gmail.com>
1872
1873 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1874 static and public. Add report_err param. Return false for data refs.
1875 (Target_powerpc::rela_dyn_section): New overloaded function.
1876 (Target_powerpc::plt_, iplt_): Elucidate.
1877 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1878 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1879 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1880 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1881 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1882 push_branch and make_plt_entry for ifunc syms when
1883 reloc_needs_plt_for_ifunc.
1884 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1885 for ifunc unless reloc_needs_plt_for_ifunc.
1886
ad3d8a2f
AM
18872013-03-15 Alan Modra <amodra@gmail.com>
1888
1889 * gc.h (gc_process_relocs): Don't look through function descriptors.
1890 * icf.cc (get_section_contents): Do so here instead.
1891
4d9aa155
AM
18922013-03-13 Alan Modra <amodra@gmail.com>
1893
1894 * powerpc.cc (is_branch_reloc): Forward declare.
1895 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
1896 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
1897 false for 64-bit, true for 32-bit non-branch relocs.
1898 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
1899 * testsuite/Makefile.am (icf_test): Use linker map file instead of
1900 nm output.
1901 (icf_safe_test): Generate linker map file as well as nm output.
1902 (icf_safe_so_test): Likewise.
1903 * testsuite/Makefile.in: Regenerate.
1904 * testsuite/icf_test.sh: Parse linker map file to determine
1905 section folding.
1906 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
1907 * testsuite/icf_safe_so_test.sh: Likewise.
1908 (X86_32_or_ARM_specific_safe_fold): Merge into..
1909 (arch_specific_safe_fold): ..this.
1910 (X86_64_specific_safe_fold): Delete unused function.
1911
57420c20
AM
19122013-03-12 Alan Modra <amodra@gmail.com>
1913
1914 * gc.h (gc_process_relocs): Look through function descriptors
1915 to determine shndx, symvalue and addend used by ICF. Tidy
1916 variable duplication.
1917
dc3714f3
AM
19182013-03-11 Alan Modra <amodra@gmail.com>
1919
1920 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
1921 * layout.cc (Layout_task_runner::run): ..to here.
1922 * symtab.h (struct Symbol_location): Extract from..
1923 (class Symbol_table): ..here.
1924 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
1925 * target.h (class Target): Add function_location and
1926 do_function_location functions.
1927 (class Sized_target): Add do_function_location.
1928 * object.h (class Sized_relobj_file): Move find_shdr..
1929 (class Object): ..to here.
1930 * object.cc: Likewise. Update to suit. Instantiate.
1931 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
1932 * powerpc.cc (class Powerpc_dynobj): New.
1933 (Target_powerpc::do_function_location): New function.
1934 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
1935 (Powerpc_dynobj::do_read_symbols): New function.
1936 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
1937
956b03bb
ILT
19382013-03-08 Ian Lance Taylor <iant@google.com>
1939
1940 * options.cc (General_options::string_to_object_format): Accept
1941 "default".
1942
4bead2d5
AM
19432013-03-08 Alan Modra <amodra@gmail.com>
1944
1945 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
1946 pointer to Post_fde.
1947 (struct Post_fde): Move definition to here..
1948 * ehframe.cc (struct Post_fde): ..from here.
1949 (Cie::write): Don't alloc Post_fde.
1950 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
1951
02e60bf7
AM
19522013-03-07 Alan Modra <amodra@gmail.com>
1953
1954 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
1955 relocation referencing .LC0.
1956 * testsuite/discard_locals_test.sh: Remove FIXMEs.
1957
8343f03a
AM
19582013-03-07 Alan Modra <amodra@gmail.com>
1959
1960 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
1961 always_inline. Add assembly for powerpc to avoid GOT.
1962
3366d57c
AM
19632013-03-07 Alan Modra <amodra@gmail.com>
1964
1965 * testsuite/script_test_10.sh: Don't test .bss section
1966 header number.
1967
6c77229c
AM
19682013-03-06 Alan Modra <amodra@gmail.com>
1969
1970 * powerpc.cc (class Powerpc_relobj): Move some member functions.
1971 (Target_powerpc::symval_for_branch): Add symtab param. Update
1972 all callers. Handle folded sections.
1973 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
1974 to Powerpc_relobj.
1975 (Global_symbol_visitor_opd::operator()): Likewise.
1976
a39e4af6
AM
19772013-03-04 Alan Modra <amodra@gmail.com>
1978
1979 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
1980 * testsuite/Makefile.in: Regenerate.
1981
d5834edb
CC
19822013-03-01 Cary Coutant <ccoutant@google.com>
1983
1984 Add dwp support for v2 DWARF package file format.
1985 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1986 tu_length parameter. Adjust all callers.
1987 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1988 * dwp.cc: Include dwarf.h.
1989 (Section_bounds): New struct type.
1990 (Unit_set): New struct type.
1991 (Dwo_file::Dwo_file): Initialize new data member.
1992 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1993 Combine and rename to...
1994 (Dwo_file::read_unit_index): ...this.
1995 (Dwo_file::sized_read_compunit_index)
1996 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1997 (Dwo_file::sized_read_unit_index): ...this.
1998 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1999 parameters; add section_id parameter.
2000 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2001 (Dwo_file::add_unit_set): ...this.
2002 (Dwo_file::shndx_map_): Remove.
2003 (Dwo_file::sect_offsets_): New data member.
2004 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2005 (Dwp_output_file::add_section): Rename to...
2006 (Dwp_output_file::add_contribution): ...this.
2007 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2008 (Dwp_output_file::add_tu_set): Likewise.
2009 (Dwp_output_file::Contribution): New type.
2010 (Dwp_output_file::Section::contributions): New data member.
2011 (Dwp_output_file::Cu_or_tu_set): Remove.
2012 (Dwp_output_file::Section::Section): New ctor.
2013 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2014 (Dwp_output_file::Dwp_index::Section_table): New type.
2015 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2016 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2017 parameter.
2018 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2019 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2020 (Dwp_output_file::Dwp_index::section_table): New member function.
2021 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2022 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2023 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2024 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2025 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2026 (Dwp_output_file::Dwp_index::section_table_): New data member.
2027 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2028 (Dwp_output_file::add_output_section): New member function.
2029 (Dwp_output_file::write_new_section): New member function.
2030 (Dwp_output_file::write_contributions): New member function.
2031 (Dwp_output_file::section_id_map_): New data member.
2032 (class Dwo_id_info_reader): Remove.
2033 (class Unit_reader): New class.
2034 (get_dwarf_section_name): New function.
2035 (Dwo_file::read_executable): Adjust initializations of class data.
2036 (Dwo_file::read): Add support for v2 package file format.
2037 (Dwo_file::read_unit_index): Likewise.
2038 (Dwo_file::sized_read_unit_index): Likewise.
2039 (Dwo_file::copy_section): Likewise.
2040 (Dwo_file::add_unit_set): Likewise.
2041 (Dwp_output_file::add_output_section): Likewise.
2042 (Dwp_output_file::add_contribution): Likewise.
2043 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2044 for empty slot.
2045 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2046 file format.
2047 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2048 slot.
2049 (Dwp_output_file::initialize): Remove unused function.
2050 (Dwp_output_file::finalize): Add support for v2 package file format.
2051 (Dwp_output_file::write_index): Likewise.
2052 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2053 function prototype.
2054
a68a081d
CC
20552013-03-01 Cary Coutant <ccoutant@google.com>
2056
2057 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2058 function into class definition in header file.
2059 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2060 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2061 New function.
2062 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2063
9d5781f8
AM
20642013-02-28 Alan Modra <amodra@gmail.com>
2065
2066 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2067 * target.cc (Target::do_plt_fde_location): New function.
2068 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2069 accessor function, and constructor param.
2070 (struct Post_fde, Post_fdes): Declare.
2071 (Cie::write): Add post_fdes param.
2072 * ehframe.cc (Fde::write): Use plt_fde_location.
2073 (struct Post_fde): Define.
2074 (Cie::write): Stash FDEs added post merge mapping.
2075 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2076 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2077 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2078 other FDEs.
2079 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2080 (Target_powerpc::has_glink): New function.
2081 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2082 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2083 glink_eh_frame_fde_32, default_fde): New data.
2084 (Stub_table::eh_frame_added_): New var.
2085 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2086 Make const.
2087 (Stub_table::add_eh_frame): New function.
2088 (Output_data_glink::add_eh_frame): New function.
2089 (Target_powerpc::make_glink_section): Call add_eh_frame.
2090
214383dd
ILT
20912013-02-15 Ian Lance Taylor <iant@google.com>
2092
2093 * options.h (DEFINE_uint64_alias): Define.
2094 (class General_options): Add -Ttext-segment as an alias for
2095 -Ttext.
2096
91c2b899
AM
20972013-02-15 Alan Modra <amodra@gmail.com>
2098
2099 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2100 (Stub_table::do_write): ..here, two places.
2101 (Stub_table::plt_call_size): Use it here too.
2102
20e2a8aa
ILT
21032013-02-11 Ian Lance Taylor <iant@google.com>
2104
2105 * descriptors.cc (Descriptors::close_all): New function.
2106 * descriptors.h (class Descriptors): Declare close_all.
2107 (close_all_descriptors): New inline function.
2108 * plugin.cc: Include "descriptors.h".
2109 (Plugin_manager::cleanup): Call close_all_descriptors.
2110
8952bc69
AM
21112013-02-06 Alan Modra <amodra@gmail.com>
2112
2113 * README: Update coding style link.
2114
29bd8b6b
CC
21152013-01-28 Cary Coutant <ccoutant@google.com>
2116
a4034750
AM
2117 * dwp.cc (File_list): New typedef.
2118 (Dwo_name_info_reader): New class.
2119 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2120 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2121 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2122 (Dwo_file::read_executable): New function.
2123 (Dwo_file::read): Move common setup code to ...
2124 (Dwo_file::make_object): ... here.
2125 (dwp_options): Add --exec/-e.
2126 (usage): Likewise.
2127 (main): Likewise.
29bd8b6b 2128
c6ac678d
ST
21292013-01-24 Sriraman Tallam <tmsriram@google.com>
2130
2131 * layout.cc (Layout::layout): Check for option text_reorder.
2132 (Layout::make_output_section): Ditto.
2133 * options.h (text_reorder): New option.
2134 * output.cc (Input_section_sort_compare): Remove special ordering
2135 of section names.
2136 (Output_section::
2137 Input_section_sort_section_name_special_ordering_compare::
2138 operator()): New function.
2139 (Output_section::sort_attached_input_sections): Use new sort function
2140 for .text.
2141 * output.h (Input_section_sort_section_name_special_ordering_compare):
2142 New struct.
2143 * testsuite/Makefile.am (text_section_grouping): Test option
2144 --no-text-reorder
2145 * testsuite/Makefile.in: Regenerate.
2146 * testsuite/text_section_grouping.sh: Check order of functions without
2147 default text reordering.
2148
50701cc1
MF
21492013-01-18 Mike Frysinger <vapier@gentoo.org>
2150
2151 * options.h (General_options): Change default to true for new_dtags.
2152
b1b00fcc
MF
21532013-01-18 Mike Frysinger <vapier@gentoo.org>
2154
2155 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2156 when enable_new_dtags is false. Only add DT_RUNPATH when
2157 enable_new_dtags is true.
2158
ec5b8187
AM
21592013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2160
2161 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2162 used in declaration and definition consistent.
2163 (Target_powerpc::symval_for_branch): Ditto.
2164
a880d4c4
ST
21652013-01-16 Sriraman Tallam <tmsriram@google.com>
2166
2167 * testsuite/plugin_final_layout.cc: Fix comment.
2168
7c381248
ST
21692013-01-16 Sriraman Tallam <tmsriram@google.com>
2170
2171 * layout.cc (Layout::layout): Do not do default sorting for
2172 text sections when section ordering is specified.
2173 (make_output_section): Ditto.
2174 * testsuite/plugin_final_layout.cc: Name the function sections
2175 to catch reordering issues.
2176
e2458743
AM
21772013-01-15 Alan Modra <amodra@gmail.com>
2178
2179 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2180 plt-thread-safe.
2181
431ed302
AM
21822013-01-15 Alan Modra <amodra@gmail.com>
2183
2184 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2185 * testsuite/Makefile.in: Regenerate.
2186
0ec6429b
AM
21872013-01-14 Alan Modra <amodra@gmail.com>
2188
2189 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2190 * testsuite/Makefile.in: Regenerate.
2191
0bf402d5
ILT
21922013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2193
36af3926 2194 PR bfd/14430
0bf402d5
ILT
2195 Fix mingw gold build with plugins enabled
2196 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2197 * configure.ac: Export DLOPEN_LIBS and add headers check.
2198 * plugin.cc: Handle non-dlfcn case.
2199 * Makefile.in: Regenerate.
2200 * config.in: Regenerate.
2201 * configure: Regenerate.
2202 * testsuite/Makefile.in: Regenerate.
2203
9e9143bc
ST
22042013-01-09 Sriraman Tallam <tmsriram@google.com>
2205
2206 * output.h (sort_attached_input_sections): Change to be public.
2207 * script-sections.cc
2208 (Output_section_definition::set_section_addresses): Sort
2209 attached input sections according to section order before linker
2210 script assigns section addresses.
2211 (Orphan_output_section::set_section_addresses): Sort
2212 attached input sections according to section order before linker
2213 script assigns section addresses.
2214 * Makefile.am (final_layout.sh): Use a simple linker script to
2215 check if section ordering still works.
2216 * Makefile.in: Regenerate.
2217
679af368
ILT
22182013-01-09 Ben Cheng <bccheng@google.com>
2219
2220 * arm.cc (Target_arm::attributes_accept_div): New function.
2221 (Target_arm::attributes_forbid_div): New function.
2222 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2223 attribute using the same new functions as what bfd/elf32_arm.c
2224 does.
2225
3136a00e
CC
22262013-01-07 Cary Coutant <ccoutant@google.com>
2227
2228 PR gold/14993
2229 * output.cc (Output_section::add_input_section): For incremental
2230 updates, don't track input sections that are allocated from patch
2231 space.
2232
f2a6224b
L
22332013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2234 Ian Lance Taylor <iant@google.com>
2235
2236 PR gold/14897
2237 * configure.ac (--enable-ld): Removed.
2238 (install_as_default): Set to yes only for --enable-gold=default
2239 or --disable-ld.
2240 * configure: Regenerated.
2241
4f46f626
L
22422013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2243
2244 * options.h (General_options): Add -fuse-ld= for GCC linker
2245 option compatibility.
2246
26e4ef59
CC
22472013-01-04 Cary Coutant <ccoutant@google.com>
2248
2249 * configure.ac: Fix typo restoring CXXFLAGS.
2250 * configure: Regenerate.
2251
3d587466
CC
22522013-01-04 Cary Coutant <ccoutant@google.com>
2253
4f46f626
L
2254 * testsuite/Makefile.am (CXXLINK_S): New macro.
2255 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2256 * testsuite/Makefile.in: Regenerate.
3d587466 2257
44db6695
L
22582013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2259
2260 * version.cc (print_version): Update copyright year to 2013.
2261
edcac0c1
ILT
22622012-12-20 Ian Lance Taylor <iant@google.com>
2263
2264 * layout.cc (Layout::special_ordering_of_input_section): New
2265 function.
2266 (Layout::layout): If input section requires special ordering, must
2267 sort input sections.
2268 (Layout::make_output_section): May sort .text input sections.
2269 (Layout::is_section_name_prefix_grouped): Remove.
2270 * layout.h (class Layout): Declare
2271 special_ordering_of_input_section. Don't declare
2272 is_section_name_prefix_grouped.
2273 * output.cc (Output_section::add_input_section): Revert last
2274 change.
2275 (Output_section::Input_section_sort::match_file_name): Don't crash
2276 if called on output section data.
2277 (Output_section::Input_section_sort_compare): Sort based on
2278 special ordering.
2279 (Output_section::Input_section_sort_section_order_index_compare):
2280 Revert last patch.
2281 (Output_section::sort_attached_input_sections): Likewise.
2282
28f2a4ac
ST
22832012-12-18 Sriraman Tallam <tmsriram@google.com>
2284
edcac0c1 2285 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2286 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2287 * output.cc (Output_section::add_input_section): Check if section
2288 name contains special prefix. Keep input sections to sort such
2289 sections.
2290 (Output_section::Input_section_sort_section_order_index_compare
2291 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2292 (Output_section::sort_attached_input_sections): Add condition to
2293 Input_section_entry constructor call.
28f2a4ac
ST
2294 * testsuite/Makefile.am (text_section_grouping): New test.
2295 * testsuite/Makefile.in: Regenerate.
2296 * testsuite/text_section_grouping.cc: New file.
2297 * testsuite/text_section_grouping.sh: New file.
2298
5bf135a7
NC
22992012-12-17 Nick Clifton <nickc@redhat.com>
2300
2301 * Makefile.am: Add copyright notice.
2302 * NEWS: Likewise.
2303 * README: Likewise.
2304 * configure.ac: Likewise.
2305 * ftruncate.c: Likewise.
2306 * Makefile.in: Regenerate.
2307
59965708
CC
23082012-12-14 Cary Coutant <ccoutant@google.com>
2309
a4034750
AM
2310 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2311 --no-as-needed flag.
2312 (exception_separate_shared_12_test): Likewise.
2313 (incremental_copy_test): Likewise.
2314 * testsuite/Makefile.in: Regenerate.
59965708 2315
2a77e2ab
CC
23162012-12-14 Cary Coutant <ccoutant@google.com>
2317
2318 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2319 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2320
e3deeb9c
AM
23212012-12-12 Alan Modra <amodra@gmail.com>
2322
2323 * powerpc.cc (class Track_tls): New.
2324 (class Relocate, class Scan): Inherit Track_tls.
2325 (Target_powerpc::Scan::local, global): Track tls optimization
2326 and avoid creating plt entry for __tls_get_addr if all uses
2327 are optimized away.
2328 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2329
d8f5a274
AM
23302012-12-12 Alan Modra <amodra@gmail.com>
2331
2332 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2333 Replace no_toc_optimize with toc_optimize.
2334 * output.h (Output_section::input_sections): Provide non-const variant.
2335 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2336 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2337 accessors.
2338 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2339 (class Sort_toc_sections): New.
2340 (Target_powerpc::do_finalize_sections): Sort toc sections.
2341 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2342
4c8a1de1
RM
23432012-12-10 Roland McGrath <mcgrathr@google.com>
2344
2345 * testsuite/binary_unittest.cc (read_all): New function.
2346 (Sized_binary_test): Use it instead of ::read.
2347 * fileread.cc (do_read): Don't assume pread always reads the whole
2348 amount in a single call.
2349
edc27beb
AM
23502012-12-10 Alan Modra <amodra@gmail.com>
2351
2352 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2353 Set EM_PPC64 or EM_PPC here.
2354 (Target_selector_powerpc::do_recognize): Delete.
2355
906b9150
AM
23562012-12-10 Alan Modra <amodra@gmail.com>
2357
2358 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2359 stub_table_.
2360 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2361
418c15ae
RM
23622012-12-07 Roland McGrath <mcgrathr@google.com>
2363
2364 * testsuite/binary_unittest.cc (Sized_binary_test):
2365 Use open_descriptor rather than ::open.
2366
decdd3bc
AM
23672012-12-07 Alan Modra <amodra@gmail.com>
2368
2369 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2370 typedef and invalid_address constant.
2371 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2372 instantiate constants.
2373
db399005
ILT
23742012-12-06 Roland McGrath <mcgrathr@google.com>
2375
2376 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2377 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2378 * aclocal.m4: Regenerate.
2379 * configure: Regenerate.
2380 * Makefile.in: Regenerate.
2381 * testsuite/Makefile.in: Regenerate.
2382
aba6bc71
AM
23832012-12-07 Alan Modra <amodra@gmail.com>
2384
2385 * options.h (General_options): Add no_toc_optimize.
2386 * powerpc.cc (ok_lo_toc_insn): New function.
2387 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2388
9e69ed50
AM
23892012-12-06 Alan Modra <amodra@gmail.com>
2390
2391 * options.h (General_options): Add plt_align, plt_static_chain,
2392 plt_thread_safe. Update stub_group_size help text.
2393 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2394 for new plt_thread_safe_ var.
2395 (use_plt_offset): Correct comments.
2396 (Target_powerpc::do_relax): Look for thread creation symbols to
2397 determine default plt_thread_safe value. Clear plt call stubs
2398 as well as branch stubs each iteration.
2399 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2400 insn constants.
2401 (l, hi, ha, write_insn): Move earlier.
2402 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2403 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2404 plt stubs too.
2405 (Stub_table::update_size): Adjust.
2406 (Stub_table::prev_size, set_prev_size): Delete.
2407 (Stub_table::stub_align): Let --plt-align affect result.
2408 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2409 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2410 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2411 (Stub_table::do_write): Support more stub variants.
2412
f43ba157
AM
24132012-12-04 Alan Modra <amodra@gmail.com>
2414
2415 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2416 (Target_powerpc::do_define_standard_symbols): New function.
2417
34171bc5
AM
24182012-12-03 Alan Modra <amodra@gmail.com>
2419
2420 * output.h: Formatting, whitespace.
2421
dc9589e9 24222012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2423
2424 * layout.h (Layout::get_executable_sections): Declare.
2425 * layout.cc (Layout::get_executable_sections): New function.
2426 * arm.cc (Target_arm::group_sections): Use it.
2427 (Arm_output_section::group_sections): Delete now redundant test.
2428 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2429 param to handle relative relocs.
2430 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2431 (Output_data_reloc::add_absolute): Adjust.
2432 (Output_data_reloc::add_relative): New function.
2433 (Output_data::reset_data_size): New function.
2434 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2435 (Output_section::set_addralign): New function.
2436 (Output_section::checkpoint_set_addralign): New function.
2437 (Output_section::clear_section_offsets_need_adjustment): New function.
2438 (Output_section::input_sections): Make public.
2439 * powerpc.cc (class Output_data_brlt_powerpc): New.
2440 (class Stub_table, class Stub_control): New.
2441 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2442 stub_table_, set_stub_table, stub_table): New vectors and accessor
2443 functions.
2444 (Target_powerpc::do_may_relax, do_relax, push_branch,
2445 new_stub_table, stub_tables, brlt_section, group_sections,
2446 add_branch_lookup_table, find_branch_lookup_table,
2447 write_branch_lookup_table, make_brlt_section): New functions.
2448 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2449 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2450 branch_info_): New vars.
2451 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2452 make call stubs here.
2453 (Output_data_glink): Remove all call stub handling from this class.
2454 (Target_powerpc::Scan::local, global): Save interesting branch
2455 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2456 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2457 functions on final link.
2458 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2459 Handle long branch destinations too.
2460 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2461 do_plt_address_for_local): Adjust lookup of plt call stubs.
2462
627b30b7
AM
24632012-11-30 Alan Modra <amodra@gmail.com>
2464
2465 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2466 relocs against protected symbols when building 32-bit shared libs.
2467
40b469d7
AM
24682012-11-30 Alan Modra <amodra@gmail.com>
2469
2470 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2471 param. Call got_section() to make .got. Update all callers
2472 and their callers and so on.
2473
bb66a627
AM
24742012-11-30 Alan Modra <amodra@gmail.com>
2475
2476 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2477 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2478 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2479 value if it already exists.
2480
d2cf1c6c
L
24812012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2482
2483 PR gold/14858
2484 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2485
edccdf7c
RM
24862012-11-14 Roland McGrath <mcgrathr@google.com>
2487
2488 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2489 than bfc instruction for data sandboxing.
2490
6febeb74
AM
24912012-11-08 Alan Modra <amodra@gmail.com>
2492
2493 * po/POTFILES.in: Regenerate.
2494
0a6f1bf2
AM
24952012-11-05 Alan Modra <amodra@gmail.com>
2496
2497 * configure.ac: Apply 2012-09-10 change to config.in here.
2498 * configure: Regenerate.
2499
26a4e9cb
AM
25002012-11-05 Alan Modra <amodra@gmail.com>
2501
2502 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2503 (struct Opd_ent): Use "Address" rather than "Offset".
2504 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2505 (Target_powerpc::got_section): Make public.
2506 (Target_powerpc::scan_relocs): Move code setting symbols..
2507 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2508 Create _SDA_BASE_ only when referenced.
2509
cc928013
RM
25102012-11-02 Roland McGrath <mcgrathr@google.com>
2511
2512 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2513 from last change.
2514
50ed5eb1
RM
25152012-11-01 Roland McGrath <mcgrathr@google.com>
2516
62fe925a
RM
2517 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2518 for offset_in_output_section parameter.
2519 (Sized_target::relocate_special_relocatable): Likewise.
2520 * arm.cc (Target_arm::relocate_relocs): Likewise.
2521 (Target_arm::relocate_special_relocatable): Likewise.
2522 * i386.cc (Target_i386::relocate_relocs): Likewise.
2523 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2524 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2525 * target-reloc.h (relocate_relocs): Likewise.
2526 * testsuite/testfile.cc (Target_test): Likewise.
2527 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2528 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2529
2530 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2531 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2532
2533 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2534 parameter, which is unused in the [!F_SETFD] case.
2535
50ed5eb1
RM
2536 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2537 SYMNDX to off_t before comparing it to this->data_size().
2538 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2539 * incremental.cc (Output_section_incremental_inputs::do_write):
2540 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2541
2cadc0bf
RM
2542 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2543
3bfcb652
NC
25442012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2545
2546 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2547 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2548 in EABI_VER5.
2549
c1a8d56e
CC
25502012-10-29 Cary Coutant <ccoutant@google.com>
2551
2552 * dwp.cc (usage): Add file and exit status parameters;
2553 add --help and --version options.
2554 (print_version): New function.
2555 (main): Add --help and --version options.
2556
b2490a7b
L
25572012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2558
2559 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2560 final_layout_sequence.txt.
2561 * testsuite/Makefile.in: Regenerated.
2562
aa543512
L
25632012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2564
2565 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2566 COMPILE generated by automake.
2567 (LINK1): Likewise.
2568 (CXXCOMPILE1): Likewise.
2569 (CXXLINK1): Likewise.
2570 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2571 (LINK): Likewise.
2572 (CXXCOMPILE): Likewise.
2573 (CXXLINK): Likewise.
2574 * testsuite/Makefile.in: Regenerated.
2575
d361fafb
L
25762012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2577
2578 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2579 on bad fwrite return.
2580
598c7410
L
25812012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2582
2583 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2584 on val.
2585
35c813e2
CC
25862012-10-23 Cary Coutant <ccoutant@google.com>
2587
2588 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2589 * testsuite/Makefile.in: Regenerate.
2590 * testsuite/dwp_test.h: New source file.
2591 * testsuite/dwp_test_1.cc: New source file.
2592 * testsuite/dwp_test_1.s: New source file.
2593 * testsuite/dwp_test_1.sh: New source file.
2594 * testsuite/dwp_test_1b.cc: New source file.
2595 * testsuite/dwp_test_1b.s: New source file.
2596 * testsuite/dwp_test_2.cc: New source file.
2597 * testsuite/dwp_test_2.s: New source file.
2598 * testsuite/dwp_test_2.sh: New source file.
2599 * testsuite/dwp_test_main.cc: New source file.
2600 * testsuite/dwp_test_main.s: New source file.
2601
77429909
CC
26022012-10-23 Cary Coutant <ccoutant@google.com>
2603
2604 * dwp.h: New header file.
2605 * dwp.cc: New source file.
2606 * gold.h: Move shared declarations to system.h.
2607 * system.h: New header file.
2608 * Makefile.am: Add dwp.
2609 * Makefile.in: Regenerate.
2610
ed5d6712
CC
26112012-10-23 Cary Coutant <ccoutant@google.com>
2612
2613 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2614 Dwarf_info_reader::read_from_pointer.
2615 (Dwarf_pubnames_table::read_header): Likewise.
2616 (Dwarf_pubnames_table::next_name): Likewise.
2617 (Dwarf_die::read_attributes): Likewise.
2618 (Dwarf_die::skip_attributes): Likewise.
2619 (Dwarf_info_reader::read_from_pointer): New function template.
2620 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2621 (Dwarf_pubnames_table): Likewise.
2622 (Dwarf_info_reader::read_from_pointer): New function template.
2623 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2624 Dwarf_pubnames_table ctor.
2625
8787852d
CC
26262012-10-23 Cary Coutant <ccoutant@google.com>
2627
2628 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2629 abbrev_shndx.
2630 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2631 abbrev_shndx_.
2632 (Dwarf_info_reader::set_abbrev_shndx): New method.
2633 (Dwarf_info_reader::abbrev_shndx_): New data member.
2634
9fc236f3
CC
26352012-10-23 Cary Coutant <ccoutant@google.com>
2636
2637 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2638 from object, not parameters.
2639 (Dwarf_info_reader::parse): Likewise.
2640 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2641 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2642 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2643 methods.
2644
effe8365
CC
26452012-10-23 Cary Coutant <ccoutant@google.com>
2646
2647 * fileread.cc (Input_file::Input_file): New constructor.
2648 * fileread.h (class Input_file): Add new constructor.
2649
1698990d
AM
26502012-10-18 Alan Modra <amodra@gmail.com>
2651
2652 PR gold/14727
2653 * object.cc (Relobj::is_section_name_included): Also match
2654 .sdata personality section.
2655
168a4726
AM
26562012-10-18 Alan Modra <amodra@gmail.com>
2657
2658 * target-reloc.h (class Default_comdat_behavior): New, package up..
2659 (get_comdat_behaviour): ..this.
2660 (relocate_section): Add Relocate_comdat_behavior template arg,
2661 adjust code to suit.
2662 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2663 (Target_arm::scan_reloc_section): Likewise.
2664 * i386.cc (Target_i386::relocate_section): Likewise.
2665 * sparc.cc (Target_sparc::relocate_section): Likewise.
2666 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2667 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2668 * powerpc.cc (class Relocate_comdat_behavior): New.
2669 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2670 gold::relocate_section with new template arg.
2671
acc276d8
AM
26722012-10-18 Alan Modra <amodra@gmail.com>
2673
2674 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2675 dynamic relocs for GOT_TPREL got entries, without symbol if
2676 resolving locally.
2677 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2678 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2679 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2680
e10f9870
AM
26812012-10-17 Alan Modra <amodra@gmail.com>
2682
2683 PR gold/14726
2684 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2685
ae034989
ST
26862012-10-16 Sriraman Tallam <tmsriram@google.com>
2687
2688 * layout.cc (Layout::include_section): Keep sections marked
2689 SHF_EXCLUDE when doing relocatable links.
2690
f3a0ed29
AM
26912012-10-16 Alan Modra <amodra@gmail.com>
2692
2693 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2694 (Target_powerpc::do_finalize_sections): Call it.
2695 (Output_data_save_res): New class and supporting functions.
2696 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2697 normal symbols defined in object files.
2698
c6de8ed4
AM
26992012-10-12 Alan Modra <amodra@gmail.com>
2700
2701 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2702 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2703 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2704 section if scan_opd_relocs not yet called.
2705 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2706
03e25981
AM
27072012-10-12 Alan Modra <amodra@gmail.com>
2708
2709 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2710 add_local_ifunc_entry): Revert last change.
2711 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2712
c9824451
AM
27132012-10-05 Alan Modra <amodra@gmail.com>
2714
2715 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2716 do_plt_address_for_global): New functions.
2717 (Output_data_got_powerpc::do_write): Don't segfault when linking
2718 statically.
2719 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2720 add_local_ifunc_entry): Return true on adding entry..
2721 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2722 glink->add_entry call. Remove unused symtab param. Adjust calls.
2723 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2724 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2725 set up symbols here.
2726 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2727 syms here. Do so even when no .iplt. Don't segfault when linking
2728 statically.
2729 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2730 new variants without reloc param.
2731 (Glink_sym_ent::Glink_sym_ent): Likewise.
2732 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2733 reloc when refs will resolve to plt call stub.
2734 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2735 R_PPC_PLTREL24 to resolve locally.
2736 (Target_powerpc::Scan::global): Correct ifunc handling.
2737 (Target_powerpc::Relocate::relocate): Correct local sym glink
2738 lookup. Don't destroy "value" when we have a plt call stub,
2739 and when checking plt call validity.
2740 (Target_powerpc::do_dynsym_value): Simplify.
2741
19fec8c1
AM
27422012-10-05 Alan Modra <amodra@gmail.com>
2743
2744 * i386.cc (Output_data_plt_i386::address_for_global,
2745 address_for_local): Add plt offset to returned value. Adjust uses.
2746 * sparc.cc (Output_data_plt_sparc::address_for_global,
2747 address_for_local): Likewise.
2748 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2749 address_for_local): Likewise.
2750 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2751 address_for_local): Likewise.
2752 * target.h (Target::plt_address_for_global, plt_address_for_local):
2753 Update comment.
2754 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2755 (Output_data_got::Got_entry::write): Nor here.
2756 * output.h: Comment fix.
2757
e867b647
WL
27582012-10-02 Jiong Wang <jiwang@tilera.com>
2759
2760 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2761 global_offset_table_ value for larget got.
2762 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2763
e5d5f5ed
AM
27642012-09-29 Alan Modra <amodra@gmail.com>
2765
2766 * powerpc.cc (Target_powerpc::iplt_): New output section.
2767 (Target_powerpc::iplt_section, make_iplt_section,
2768 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2769 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2770 Target_powerpc::plt_entry_count): Count iplt entries too.
2771 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2772 reloc section in constructor. New params.
2773 (Target_powerpc::make_plt_section): Create reloc section here instead.
2774 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2775 functions.
2776 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2777 (Output_data_glink::add_entry, find_entry): New functions to
2778 deal with local syms.
2779 (Glink_sym_ent): Add support for local syms.
2780 (Output_data_glink::do_write): Handle ifunc plt entries.
2781 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2782 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2783 (Target_powerpc::Relocate::relocate): Likewise.
2784 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2785
ec4dbad3
AM
27862012-09-25 Alan Modra <amodra@gmail.com>
2787
2788 * object.h (Sized_relobj_file::adjust_local_symbol,
2789 do_adjust_local_symbol): New functions.
2790 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2791 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2792 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2793 and irregular opd entry spacing.
2794 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2795 (Global_symbol_visitor_opd): New functor.
2796 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2797 on deleted opd entries.
2798
5c0b3823
WL
27992012-09-15 Jiong Wang <jiwang@tilera.com>
2800
2801 * tilegx.cc: New file.
2802 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2803 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2804 * configure.tgt: Add entries for tilegx*.
2805 * configure.ac: Likewise.
2806 * Makefile.in: Rebuild.
2807 * configure: Likewise.
2808 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2809 tilegx.
2810
bfdfa4cd
AM
28112012-09-13 Alan Modra <amodra@gmail.com>
2812
2813 * target-reloc.h (scan_relocs): Call scan.local for relocs
2814 against symbols in discarded sections. Pass is_discarded
2815 param.
2816 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2817 Add is_discarded param.
2818 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2819 is_discarded to flag opd entry as discarded. Don't emit dyn
2820 relocs on such entries.
2821 (Target_powerpc::Scan::global): Similarly detect and handle
2822 such opd entries.
2823 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2824 opd_ent_. Update all uses.
2825 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2826 (Target_powerpc::relocate_section): Zero out discarded opd
2827 entry relocs.
2828
d77a0555
ILT
28292012-09-12 Ian Lance Taylor <iant@google.com>
2830
2831 PR gold/14570
2832 * output.cc: Rename Output_data_got template parameter from size
2833 to got_size for all functions. Compile all variants of
2834 Output_data_got.
2835 (Output_data_got::Got_entry::write): Correct use of size for
2836 symbol value. Use local_is_tls rather than casting to
2837 Sized_relobj_file.
2838 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2839 (class Sized_relobj_file): Add do_local_is_tls.
2840 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2841
815a1205
AM
28422012-09-11 Alan Modra <amodra@gmail.com>
2843
2844 PR gold/14566
2845 * layout.cc (Layout::set_segment_offsets): When using
2846 common-page-size alignment, ensure we are on a new max-page-size
2847 page.
2848 * output.cc (Output_segment::set_section_addresses): Use
2849 abi_pagesize, not common_pagesize for relro boundary.
2850 (Output_segment::set_offset): Likewise.
2851
bd73a62d
AM
28522012-09-11 Alan Modra <amodra@gmail.com>
2853
2854 * output.h (Output_data_got::add_global_tls, add_local_tls,
2855 add_local_tls_pair): New functions.
2856 (Output_data_got::add_local_pair_with_rel): Remove second
2857 reloc param. Expand comment.
2858 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2859 use_plt_or_tls_offset_, similarly for constructor param.
2860 (Output_data_got::Got_entry::write): Add got_index param.
2861 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2862 add_local_tls_pair): New functions.
2863 (Output_data_got::Got_entry::write): Handle tls symbols
2864 with use_plt_or_tls_offset_ set specially.
2865 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2866 (Output_data_got::do_write): Replace iterator with index, pass
2867 index to entry write function.
2868 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2869 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2870 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2871 call.
2872 * i386.cc (Target_i386::Scan::local): Likewise.
2873 * sparc.cc (Target_sparc::Scan::local): Likewise.
2874 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2875 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2876 do_tls_offset_for_global): New functions.
2877 (Target_powerpc::Scan::local): Correct TLS relocations and got
2878 entry values.
2879 (Target_powerpc::Scan::global): Don't emit unnecessary
2880 dynamic relocations on TLS GOT entries.
2881
00716ab1
AM
28822012-09-10 Matthias Klose <doko@ubuntu.com>
2883
2884 * config.in: Disable sanity check for kfreebsd.
2885
c891b3f9
SA
28862012-09-10 Sterling Augustine <saugustine@google.com>
2887
2888 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2889 (Gdb_index::pubtypes_read): New parameter.
2890 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2891 to calls.
2892 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2893 pubtypes_object_.
2894
e81fea4d
AM
28952012-09-09 Alan Modra <amodra@gmail.com>
2896
2897 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
2898 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
2899 * gc.h (gc_process_relocs): Call target gc_add_reference.
2900 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
2901 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
2902 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
2903 unnecessary cast.
2904 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
2905 to cater for when we don't need code offset. Update use.
2906 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
2907 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
2908 set_opd_valid): New functions.
2909 (Target_powerpc::do_gc_add_reference): New function.
2910 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
2911 stashed refs.
2912 (Target_powerpc::do_gc_mark_symbol): New function.
2913
d2d60eef
CC
29142012-09-06 Cary Coutant <ccoutant@google.com>
2915
2916 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
2917 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
2918 (Dwarf_die::skip_attributes): Likewise.
2919 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
2920 * testsuite/gdb_index_test.cc (inline_func_1): New function.
2921 (main): Call it.
2922 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
2923
32ed4573
L
29242012-09-05 H.J. Lu <hongjiu.lu@intel.com>
2925
2926 * testsuite/script_test_3.t: Add .got.plt output section
2927 statement.
2928 * testsuite/script_test_4.t: Likewise.
2929
f4baf0d4
AM
29302012-09-05 Alan Modra <amodra@gmail.com>
2931
2932 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
2933 update all uses and lose "enum" when using type.
2934
864a1b56
AM
29352012-09-05 Alan Modra <amodra@gmail.com>
2936
2937 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
2938 * configure: Regenerate.
2939 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
2940 (plugin_final_layout.stdout): Likewise.
2941 (memory_test): Set page sizes to 0x1000.
2942 * testsuite/Makefile.in: Regenerate.
2943 * testsuite/discard_locals_test.sh: Add FIXME comment.
2944 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
2945 * testsuite/pr14265.t: Add .got output section statement.
2946 * testsuite/script_test_2.t: Likewise.
2947 * testsuite/script_test_3.t: Likewise.
2948 * testsuite/script_test_4.t: Likewise.
2949 * testsuite/script_test_5.t: Likewise.
2950 * testsuite/script_test_6.t: Likewise.
2951 * testsuite/script_test_7.t: Likewise.
2952 * testsuite/script_test_9.t: Likewise.
2953
3ea0a085
AM
29542012-09-05 Alan Modra <amodra@gmail.com>
2955
2956 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
2957 (Powerpc_relocate_functions::Status): New typedef.
2958 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2959 (Target_powerpc::Scan::local): Handle REL64.
2960 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
2961 for REL32 and REL64.
2962 (Target_powerpc::symval_for_branch): New function, extracted from..
2963 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
2964 checks. Report overflow errors.
2965
7404fe1b
AM
29662012-09-05 Alan Modra <amodra@gmail.com>
2967
2968 * object.h (Sized_relobj_file::emit_relocs): Delete.
2969 (Sized_relobj_file::emit_relocs_reltype): Delete.
2970 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
2971 relocate_relocs for --emit-relocs.
2972 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
2973 * output.h: Update comment.
2974 (Output_segment::first_section): New function.
2975 (Output_segment::first_section_load_address): Use first_section.
2976 * output.cc (Output_segment::first_section): New function extracted..
2977 (Output_segment::first_section_load_address): ..from here. Delete.
2978 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
2979 * target.h (Sized_target::relocate_for_relocatable): Likewise.
2980 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
2981 adjust call to target.h function.
2982 * i386.cc (Target_i386): Likewise.
2983 * sparc.cc (Target_sparc): Likewise.
2984 * x86_64.cc (Target_x86_64): Likewise.
2985 * powerpc.cc (Target_powerpc): Likewise.
2986 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
2987 first tls section has section symbol for optimised local dynamic
2988 output relocs.
2989 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
2990 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
2991 optimised tls code.
2992 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
2993 Rename to relocate_relocs. Update error message.
2994
957564c9
AS
29952012-09-04 Andreas Schwab <schwab@linux-m68k.org>
2996
2997 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
2998 --just-symbols.
2999
dd93cd0a
AM
30002012-08-31 Alan Modra <amodra@gmail.com>
3001
3002 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3003 (Powerpc_relobj::toc_base_offset): New stub function.
3004 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3005 got_mod_index_offset to tlsld_got_offset. Update all refs.
3006 (Target_powerpc::Relocate::enum skip_tls): New.
3007 (Target_powerpc::call_tls_get_addr_): New var.
3008 (Target_powerpc::is_branch_reloc): Move to file scope.
3009 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3010 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3011 New functions.
3012 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3013 (powerpc_info): Correct common_pagesize for ppc64.
3014 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3015 (Powerpc_relocate_functions): Add overflow check enums and functions.
3016 Add non-shift version of rela, rela_ua. Delete all rel public
3017 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3018 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3019 addr16_ha3, addr14 functions.
3020 (Output_data_got_powerpc::add_constant_pair): New function.
3021 (Output_data_got_powerpc::got_base_offset): Likewise.
3022 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3023 (instruction constants): Sort, add some more.
3024 (Output_data_glink::do_write): Add and use Address typedef. Use
3025 object->toc_base_offset() stub for 64-bit.
3026 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3027 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3028 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3029 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3030 Always treat .opd relocs as against locally defined symbol.
3031 Correct condition for RELATIVE relocs.
3032 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3033 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3034 for 32-bit syms with a plt entry. Correct ppc64 toc base
3035 calculations. Handle TLS relocs, and more. Add overflow
3036 checking and adjust for Powerpc_relocate_functions changes.
3037 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3038 Reinstate --emit-relocs code with FIXME.
3039
a1373b60
AM
30402012-08-30 Alan Modra <amodra@gmail.com>
3041
3042 * layout.cc (Layout::set_segment_offsets): Set p_align to
3043 abi_pagesize, not common_pagesize.
3044 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3045 to determine whether file header can go in segment.
3046
703d02da
AM
30472012-08-30 Alan Modra <amodra@gmail.com>
3048
3049 * output.h (Output_reloc::Output_reloc <output section>): Add
3050 is_relative param. Adjust calls.
3051 (Output_reloc::add_output_section_relative): New functions.
3052 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3053 is_relative.
3054 (Output_reloc::symbol_value): Handle SECTION_CODE.
3055
16164a6b
ST
30562012-08-24 Sriraman Tallam <tmsriram@google.com>
3057
3058 * gold.cc (queue_middle_tasks): Call layout again when unique
3059 segments for sections is desired.
3060 * layout.cc (Layout::Layout): Initialize new members.
3061 (Layout::get_output_section_flags): New function.
3062 (Layout::choose_output_section): Call get_output_section_flags.
3063 (Layout::layout): Make output section for mapping to a unique segment.
3064 (Layout::insert_section_segment_map): New function.
3065 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 3066 output sections marked so.
16164a6b
ST
3067 (Layout::segment_precedes): Check for unique segments when sorting.
3068 * layout.h (Layout::Unique_segment_info): New struct.
3069 (Layout::Section_segment_map): New typedef.
3070 (Layout::insert_section_segment_map): New function.
3071 (Layout::get_output_section_flags): New function.
3072 (Layout::is_unique_segment_for_sections_specified): New function.
3073 (Layout::set_unique_segment_for_sections_specified): New function.
3074 (Layout::unique_segment_for_sections_specified_): New member.
3075 (Layout::section_segment_map_): New member.
3076 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3077 Rename is_gc_pass_one to is_pass_one.
3078 Rename is_gc_pass_two to is_pass_two.
3079 Rename is_gc_or_icf to is_two_pass.
3080 Check for which pass based on whether symbols data is present.
3081 Make it two pass when unique segments for sections is desired.
3082 * output.cc (Output_section::Output_section): Initialize new
3083 members.
3084 * output.h (Output_section::is_unique_segment): New function.
3085 (Output_section::set_is_unique_segment): New function.
3086 (Output_section::is_unique_segment_): New member.
3087 (Output_section::extra_segment_flags): New function.
3088 (Output_section::set_extra_segment_flags): New function.
3089 (Output_section::extra_segment_flags_): New member.
3090 (Output_section::segment_alignment): New function.
3091 (Output_section::set_segment_alignment): New function.
3092 (Output_section::segment_alignment_): New member.
3093 (Output_segment::Output_segment): Initialize is_unique_segment_.
3094 (Output_segment::is_unique_segment): New function.
3095 (Output_segment::set_is_unique_segment): New function.
3096 (Output_segment::is_unique_segment_): New member.
3097 * plugin.cc (allow_unique_segment_for_sections): New function.
3098 (unique_segment_for_sections): New function.
3099 (Plugin::load): Add new functions to transfer vector.
3100 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3101 * Makefile.in: Regenerate.
3102 * testsuite/plugin_final_layout.sh: Check if unique segment
3103 functionality works.
3104 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3105 are available.
3106 (allow_unique_segment_for_sections): New global.
3107 (unique_segment_for_sections): New global.
3108 (claim_file_hook): Call allow_unique_segment_for_sections.
3109 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 3110
1e2bee4f
CC
31112012-08-22 Cary Coutant <ccoutant@google.com>
3112
3113 * layout.cc (Layout::include_section): Don't assert on GROUP
3114 sections with --emit-relocs.
3115
1d5dfe78
CC
31162012-08-21 Cary Coutant <ccoutant@google.com>
3117
3118 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3119 if --export-dynamic-symbol names an undef symbol.
3120
c9269dff
AM
31212012-08-18 Alan Modra <amodra@gmail.com>
3122
3123 * powerpc.cc: Formatting and white space.
3124 (Powerpc_relobj): Rename got2_section_ to special_.
3125 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3126 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3127 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3128 (Target_powerpc): Add Address typedef and invalid_address. Use
3129 throughout.
3130 (Target_powerpc::is_branch_reloc): New function.
3131 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3132 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3133 for dst_mask, value and addend.
3134 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3135 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3136 (Output_data_glink::do_write): Correct toc base. Don't try to use
3137 uint16_t for 24-bit offset. Use get_output_section_offset and
3138 check return.
3139 (Target_powerpc::Scan::local): Handle more relocs.
3140 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3141 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3142 Plug in toc restoring insn after plt calls. Translate branches
3143 to function descriptor symbols to corresponding entry point.
3144 (Target_powerpc::relocate_for_relocatable): Check return from
3145 get_output_section_offset.
3146 * symtab.h: Comment typo.
3147
b1759dce
ILT
31482012-08-14 Ian Lance Taylor <iant@google.com>
3149
3150 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3151 unsupported_relocal_local to call unsupported_reloc_global.
3152
b9b2ae8b
NC
31532012-08-14 Nick Clifton <nickc@redhat.com>
3154
3155 PR ld/14265
3156 * script-sections.cc (Sections_element::output_section_name): Add
3157 keep return parameter.
3158 (Output_section_element::match_name): Add keep return parameter.
3159 Return the value of the keep_ member.
3160 * script-sections.h (class Output_section): Update
3161 output_section_name prototype.
3162 * layout.cc (Layout::keep_input_section): New public member
3163 function.
3164 (Layout::choose_output_section): Pass keep parameter to
3165 output_section_name.
3166 * layout.h (class Layout): Add keep_input_section.
3167 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3168 sections.
3169 * testsuite/Makefile.am: Add a test.
3170 * testsuite/Makefile.in: Regenerate.
3171 * testsuite/pr14265.c: Source file for the test.
3172 * testsuite/pr14265.t: Linker script for the test.
3173 * testsuite/pr14265.sh: Shell script for the test.
3174
921b5322
AM
31752012-08-14 Alan Modra <amodra@gmail.com>
3176
3177 * target.h (Target::output_section_name): New function.
3178 (Target::do_output_section_name): New function.
3179 * layout.cc (Layout::choose_output_section): Call the above.
3180 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3181
6ce78956
AM
31822012-08-14 Alan Modra <amodra@gmail.com>
3183
3184 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3185 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3186 for replace_constant call.
3187 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3188 (Output_data_glink::do_print_to_mapfile): New function.
3189 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3190 (Target_powerpc::Relocate::relocate): Likewise.
3191
d1a8cabd
AM
31922012-08-14 Alan Modra <amodra@gmail.com>
3193
3194 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3195 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3196 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3197 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3198 all references to shndx_. Handle special case for R_PPC_PLTREL24
3199 here.
3200 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3201 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3202 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3203 here.
3204 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3205 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3206
d83ce4e3
AM
32072012-08-12 Alan Modra <amodra@gmail.com>
3208
3209 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3210 (glink insn constants): Use uint32_t.
3211 (Output_data_glink::add_entry): Use insert, not [] operator.
3212
cf43a2fe
AM
32132012-08-11 Alan Modra <amodra@gmail.com>
3214
3215 * object.h (Sized_relobj_file::find_shdr): New function.
3216 (Sized_relobj_file::find_special_sections): New function.
3217 * object.cc (Sized_relobj_file::find_shdr): New function.
3218 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3219 (Sized_relobj_file::find_special_sections): New function, split out..
3220 (Sized_relobj_file::do_read_symbols): ..from here.
3221 * output.h (Output_data_got::replace_constant): New function.
3222 (Output_data_got::num_entries): New function.
3223 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3224 (Output_data_got::got_offset): Protected rather than private.
3225 (Output_data_got::replace_got_entry): New function.
3226 * output.cc (Output_data_got::replace_got_entry): New function.
3227 * powerpc.cc (class Powerpc_relobj): New.
3228 (class Powerpc_relocate_functions): Delete all psymval variants or
3229 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3230 Implement _ha functions using corresponding _hi function.
3231 (Powerpc_relobj::find_special_sections): New function.
3232 (Target_powerpc::do_make_elf_object): New function.
3233 (class Output_data_got_powerpc): New.
3234 (class Output_data_glink): New.
3235 (class Powerpc_scan_relocatable_reloc): New.
3236 Many more changes througout file.
3237
3c892704
NC
32382012-08-09 Nick Clifton <nickc@redhat.com>
3239
3240 * po/vi.po: Updated Vietnamese translation.
3241
82435b3b
ILT
32422012-08-07 Ian Lance Taylor <iant@google.com>
3243
3244 * layout.cc (Layout::add_target_dynamic_tags): If
3245 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3246 plt_rel.
3247
a6dc81d2
NC
32482012-07-30 Nick Clifton <nickc@redhat.com>
3249
3250 * po/gold.pot: Updated template.
3251 * po/es.po: Updated Spanish translation.
3252
f1415016
CC
32532012-07-18 Cary Coutant <ccoutant@google.com>
3254
3255 PR gold/14344
3256 * configure.ac: Add check for -gpubnames support.
3257 * configure: Regenerate.
3258 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3259 support; force -gno-pubnames.
3260 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3261 support.
3262 (gdb_index_test_4): New test.
3263 * testsuite/Makefile.in: Regenerate.
3264 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3265 * testsuite/gdb_index_test_2.sh: Likewise.
3266 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3267 * testsuite/gdb_index_test_4.sh: New script.
3268 * testsuite/gdb_index_test_comm.sh: New script with common code;
3269 don't look for space after colon.
3270
b7fd7c37
ST
32712012-07-16 Sriraman Tallam <tmsriram@google.com>
3272
3273 * gold.cc (queue_middle_tasks): Update function order only after
3274 deferred objects due to plugins are processed.
3275
1f3212db
ILT
32762012-07-11 Ian Lance Taylor <iant@google.com>
3277
3278 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3279 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3280 (Target_arm::scan_reloc_for_stub): Likewise.
3281 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3282 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3283 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3284 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3285 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3286
81c82a68
ILT
32872012-07-10 Dodji Seketeli <dodji@redhat.com>
3288 Ian Lance Taylor <iant@google.com>
3289
3290 PR gold/14309
3291 * configure.ac: Test whether std::tr1::hash<off_t> works.
3292 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3293 needed.
3294 * output.h (class Output_fill): Add virtual destructor.
3295 * configure, config.in: Rebuild.
3296
eabc84f4
RM
32972012-06-22 Roland McGrath <mcgrathr@google.com>
3298
3299 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3300
370e30b6
RÁE
33012012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3302
3303 * plugin.cc (Plugin::load): Handle position independent executables.
3304
fb1b895d
CC
33052012-06-06 Cary Coutant <ccoutant@google.com>
3306
3307 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3308 add .debug_macro.
3309 (lines_only_debug_sections): Likewise.
3310 (gdb_fast_lookup_sections): New static array.
3311 (is_gdb_debug_section): Rename formal parameter.
3312 (is_lines_only_debug_section): Likewise.
3313 (is_gdb_fast_lookup_section): New function.
3314 (Layout::include_section): Check for ".zdebug_" prefix; pass
3315 section name suffix to is_gdb_debug_section, et al.; check for
3316 fast-lookup sections when building .gdb_index.
3317 * options.h (--strip-debug-gdb): Update GDB version number.
3318
7c0640fa
CC
33192012-06-06 Cary Coutant <ccoutant@google.com>
3320
3321 * configure.ac: Add check for fallocate.
3322 * configure: Regenerate.
3323 * config.in: Regenerate.
3324
3325 * options.h (class General_options): Add --mmap-output-file and
3326 --posix-fallocate options.
3327 * output.cc: (posix_fallocate): Remove; replace with...
3328 (gold_fallocate): New function.
3329 (Output_file::map_no_anonymous): Call gold_fallocate.
3330 (Output_file::map): Check --mmap-output-file option.
3331
2a49eb69
DK
33322012-06-05 Jing Yu <jingyu@google.com>
3333
3334 * gold.h (textdomain): Add do {} to empty while(0).
3335 (bindtextdomain): Likewise.
3336
fad072ac
CC
33372012-06-04 Cary Coutant <ccoutant@google.com>
3338
3339 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3340 has_dynsym_index.
3341
8cc69fb6
ST
33422012-05-25 Sriraman Tallam <tmsriram@google.com>
3343
3344 * symtab.cc (Symbol_table::define_special_symbol):
3345 Initialize *poldsym to prevent uninitialized variable errors.
3346
1be75daa
CC
33472012-05-23 Cary Coutant <ccoutant@google.com>
3348
3349 * layout.cc (Layout::section_name_mapping): Add rules to handle
3350 exact match on .data.rel.ro.local or .data.rel.ro.
3351 (Layout::output_section_name): Check for exact matches.
3352
9b689de0
CC
33532012-05-23 Cary Coutant <ccoutant@google.com>
3354
3355 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3356 more carefully.
3357
b24fdbf5
CC
33582012-05-22 Cary Coutant <ccoutant@google.com>
3359
3360 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3361 object before exporting symbol.
3362
e550e1a2
L
33632012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3364
3365 * testsuite/tls_test.cc: Include "config.h" first.
3366 * testsuite/tls_test_c.c: Likewise.
3367
df7b86aa
NC
33682012-05-17 Daniel Richard G. <skunk@iskunk.org>
3369 Nick Clifton <nickc@redhat.com>
3370
3371 PR 14072
3372 * configure.in: Add check that sysdep.h has been included before
3373 any system header files.
3374 * configure: Regenerate.
3375 * config.in: Regenerate.
3376
1007b503
CC
33772012-05-14 Cary Coutant <ccoutant@google.com>
3378
3379 * layout.cc (Layout::make_output_section): Mark .tdata section
3380 as RELRO.
3381 * testsuite/relro_test.cc: Add a TLS variable.
3382
fd885f3a
L
33832012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3384
3385 PR gold/14091
3386 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3387 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3388 R_X86_64_64.
3389
80f5885c
CC
33902012-05-08 Cary Coutant <ccoutant@google.com>
3391
3392 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3393 (lines_only_debug_sections): Likewise.
3394
2e702c99
RM
33952012-05-02 Roland McGrath <mcgrathr@google.com>
3396
3397 * nacl.cc: New file.
3398 * nacl.h: New file.
3399 * Makefile.am (CCFILES, HFILES): Add them.
3400 * Makefile.in: Regenerate.
3401 * i386.cc (Output_data_plt_i386_nacl): New class.
3402 (Output_data_plt_i386_nacl_exec): New class.
3403 (Output_data_plt_i386_nacl_dyn): New class.
3404 (Target_i386_nacl): New class.
3405 (Target_selector_i386_nacl): New class.
3406 (target_selector_i386): Use it instead of Target_selector_i386.
3407 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3408 (Target_x86_64_nacl): New class.
3409 (Target_selector_x86_64_nacl): New class.
3410 (target_selector_x86_64, target_selector_x32): Use it instead of
3411 Target_selector_x86_64.
3412 * arm.cc (Output_data_plt_arm_nacl): New class.
3413 (Target_arm_nacl): New class.
3414 (Target_selector_arm_nacl): New class.
3415 (target_selector_arm, target_selector_armbe): Use it instead of
3416 Target_selector_arm.
3417
3418 * target-select.cc (select_target): Take new Input_file* and off_t
3419 arguments, pass them on to recognize method of selector.
3420 * object.cc (make_elf_sized_object): Update caller.
3421 * parameters.cc (parameters_force_valid_target): Likewise.
3422 * incremental.cc (make_sized_incremental_binary): Likewise.
3423 * target-select.h: Update decl.
3424 (Target_selector::recognize): Take new Input_file* argument,
3425 pass it on to do_recognize.
3426 (Target_selector::do_recognize): Take new Input_file* argument.
3427 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3428 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3429 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3430 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3431
3432 * target.h (Target::Target_info): New members isolate_execinstr
3433 and rosegment_gap.
3434 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3435 * arm.cc (Target_arm::arm_info): Update initializer.
3436 * i386.cc (Target_i386::i386_info): Likewise.
3437 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3438 * sparc.cc (Target_sparc::sparc_info): Likewise.
3439 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3440 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3441 * layout.cc (Layout::attach_allocated_section_to_segment):
3442 Take new const Target* argument. If target->isolate_execinstr(), act
3443 like --rosegment.
3444 (Layout::find_first_load_seg): Take new const Target* argument;
3445 if target->isolate_execinstr(), reject PF_X segments.
3446 (Layout::relaxation_loop_body): Update caller.
3447 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3448 reset file offset to zero when we hit LOAD_SEG, and then do a second
3449 loop over the segments before LOAD_SEG to reassign offsets after
3450 addresses have been determined. Handle target->rosegment_gap().
3451 (Layout::attach_section_to_segment): Take new const Target* argument;
3452 pass it to attach_allocated_section_to_segment.
3453 (Layout::make_output_section): Update caller.
3454 (Layout::attach_sections_to_segments): Take new const Target* argument;
3455 pass it to attach_section_to_segment.
3456 * gold.cc (queue_middle_tasks): Update caller.
3457 * layout.h (Layout): Update method decls with new arguments.
3458
3459 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3460 Target_info pointer to use.
3461 (Target_arm::do_make_data_plt): New virtual method.
3462 (Target_arm::make_data_plt): New method that calls it.
3463 (Target_arm::make_plt_entry): Use it.
3464 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3465 for the section alignment.
3466 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3467 method.
3468 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3469 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3470 method.
3471 (Output_data_plt_arm::get_plt_entry_size): Call it.
3472 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3473 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3474 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3475 method.
3476 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3477 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3478 method instead of sizeof(plt_entry).
3479 (Output_data_plt_arm::add_entry): Likewise.
3480 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3481 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3482 than static method.
3483 (Target_arm::plt_entry_size): Likewise.
3484 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3485 Move to ...
3486 (Output_data_plt_arm_standard): ... here, new class.
3487 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3488 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3489 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3490
3491 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3492 Take additional argument for the PLT entry size.
3493 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3494 Use get_plt_entry_size method rather than plt_entry_size variable.
3495 (Output_data_plt_x86_64::reserve_slot): Likewise.
3496 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3497 (Output_data_plt_x86_64::add_entry): Likewise.
3498 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3499 (Output_data_plt_x86_64::address_for_global): Likewise.
3500 (Output_data_plt_x86_64::address_for_local): Likewise.
3501 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3502 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3503 Make method non-static.
3504 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3505 method.
3506 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3507 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3508 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3509 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3510 virtual method.
3511 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3512 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3513 virtual method.
3514 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3515 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3516 virtual method.
3517 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3518 (Output_data_plt_x86_64::plt_entry_size)
3519 (Output_data_plt_x86_64::first_plt_entry)
3520 (Output_data_plt_x86_64::plt_entry)
3521 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3522 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3523 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3524 (Output_data_plt_x86_64_standard): ... here, new class.
3525 (Target_x86_64::Target_x86_64): Take optional argument for the
3526 Target_info pointer to use.
3527 (Target_x86_64::do_make_data_plt): New virtual method.
3528 (Target_x86_64::make_data_plt): New method to call it.
3529 (Target_x86_64::init_got_plt_for_update): Use that.
3530 Call this->plt_->add_eh_frame method here.
3531 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3532 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3533 rather than static method.
3534 (Target_x86_64::plt_entry_size): Likewise.
3535 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3536 rather than plt_entry_size variable. Move guts of PLT filling to...
3537 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3538 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3539 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3540
3541 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3542 additional argument for the section alignment.
3543 Don't do add_eh_frame_for_plt here.
3544 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3545 non-static. Use get_plt_entry_size method rather than plt_entry_size
3546 variable.
3547 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3548 method.
3549 (Output_data_plt_i386::get_plt_entry_size): Call it.
3550 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3551 (Output_data_plt_i386::add_eh_frame): New method to call it.
3552 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3553 method.
3554 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3555 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3556 method.
3557 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3558 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3559 method instead of plt_entry_size.
3560 (Output_data_plt_i386::plt_entry_size)
3561 (Output_data_plt_i386::plt_eh_frame_fde_size)
3562 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3563 (Output_data_plt_i386_standard): ... here, new class.
3564 (Output_data_plt_i386_exec): New class.
3565 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3566 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3567 (Output_data_plt_i386::exec_plt_entry): Move to ...
3568 (Output_data_plt_i386_exec::plt_entry): ... here.
3569 (Output_data_plt_i386_dyn): New class.
3570 (Output_data_plt_i386::first_plt_entry): Move to ...
3571 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3572 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3573 (Output_data_plt_i386_dyn::plt_entry): ... here.
3574 (Target_i386::Target_i386): Take optional argument for the Target_info
3575 pointer to use.
3576 (Target_i386::do_make_data_plt): New virtual method.
3577 (Target_i386::make_data_plt): New method to call it.
3578 (Target_i386::make_plt_section): Use that.
3579 Call this->plt_->add_eh_frame method here.
3580 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3581 rather than plt_entry_size variable.
3582 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3583 (Output_data_plt_i386::address_for_local): Likewise.
3584 (Output_data_plt_i386::do_write): Likewise.
3585 Move guts of PLT filling to...
3586 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3587 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3588 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3589 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3590
b9b9f2ee
CC
35912012-05-01 Cary Coutant <ccoutant@google.com>
3592
3593 * dwarf_reader.cc (Dwarf_die::read_attributes)
3594 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3595 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3596 * reduced_debug_output.cc
3597 (Output_reduced_debug_info_section::get_die_end): Remove
3598 DW_FORM_GNU_ref_index. Add default case.
3599
57923f48
MW
36002012-04-26 Mark Wielaard <mjw@redhat.com>
3601
3602 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3603 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3604 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3605 DW_AT_high_pc as offset from DW_AT_low_pc.
3606
3607 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3608 * testsuite/Makefile.in: Regenerate.
3609 * testsuite/gdb_index_test_3.c: New test source file.
3610 * testsuite/gdb_index_test_3.sh: New test source file.
3611
2c54b4f4
ILT
36122012-04-25 Ian Lance Taylor <iant@google.com>
3613
3614 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3615 pointer.
3616 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3617 as a class, not a struct.
3618 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3619 (Target_arm::apply_cortex_a8_workaround): Likewise.
3620 * gc.h: Declare Reloc_types as a struct, not a class.
3621 * object.h: Declare Symbols_data as a struct.
3622 * reloc.h: Declare Read_relocs_data as a struct.
3623 * target.h: Declare Relocate_info as a struct.
3624
a5a5f7a3
DM
36252012-04-24 David S. Miller <davem@davemloft.net>
3626
3627 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3628 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3629 and R_SPARC_WPLT30.
3630
f038d496
CC
36312012-04-24 Cary Coutant <ccoutant@google.com>
3632
3633 * incremental-dump.cc (find_input_containing_global): Replace
3634 magic number with symbolic constant.
3635 (dump_incremental_inputs): Update version number.
3636 * incremental.cc (Output_section_incremental_inputs): Update version
3637 number; import symbolic constants from Incremental_inputs_reader.
3638 (Incremental_inputs::create_data_sections): Align relocations
3639 section correctly for 64-bit targets.
3640 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3641 constants; add padding.
3642 (Output_section_incremental_inputs::write_header): Add assert for
3643 header_size.
3644 (Output_section_incremental_inputs::write_input_files): Add assert
3645 for input_entry_size.
3646 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3647 add assert for object_info_size, input_section_entry_size,
3648 global_sym_entry_size.
3649 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3650 for data structure sizes; use them.
3651 (Incremental_input_entry_reader): Import symbolic constants from
3652 Incremental_inputs_reader; use them.
3653
a4d85145
DM
36542012-04-23 David S. Miller <davem@davemloft.net>
3655
3656 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3657 and elf_flags_set_.
3658 (Target_sparc::Target_sparc): Initialize new fields.
3659 (Target_sparc::do_make_elf_object): New function.
3660 (Target_sparc::do_adjust_elf_header): New function.
3661
1d509098
CC
36622012-04-23 Cary Coutant <ccoutant@google.com>
3663
3664 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3665 CU range table of gdb index.
3666
7ebeff7f
DM
36672012-04-20 David S. Miller <davem@davemloft.net>
3668
3669 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3670 instead of false.
3671
13cf9988
DM
36722012-04-16 David S. Miller <davem@davemloft.net>
3673
2a1079e8
DM
3674 * sparc.cc (Target_sparc::got_address): New function.
3675 (Sparc_relocate_functions::gdop_hix22): New function.
3676 (Sparc_relocate_functions::gdop_lox10): New function.
3677 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3678 relocs.
3679 (Target_sparc::Scan::local): Likewise if the global symbol is not
3680 preemptible and is not IFUNC.
3681 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3682 transformations for local and non-preemptible non-IFUNC global
3683 symbols.
3684
0bc964fc
DM
3685 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3686 writing out 64-bit part of ranges.
3687
661d7a80
DM
3688 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3689 -fpic and -fpie respectively.
3690 * Makefile.in: Regenerate.
3691
8c2bf391
DM
3692 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3693 (Target_sparc::Target_sparc): Initialize new field.
3694 (Target_sparc::do_plt_section_for_global): New function.
3695 (Target_sparc::do_plt_section_for_local): New function.
3696 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3697 (Target_sparc::make_plt_section): New function, broken out of
3698 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3699 (Target_sparc::make_plt_entry): Call make_plt_section.
3700 (Target_sparc::make_local_ifunc_plt_entry): New function.
3701 (Target_sparc::rela_ifunc_section): New function.
3702 (Target_sparc::plt_section): Remove const.
3703 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3704 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3705 and ifunc_count_ fields.
3706 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3707 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3708 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3709 (Output_data_plt_sparc::rela_ifunc): New function.
3710 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3711 (Output_data_plt_sparc::has_ifunc_section): New function.
3712 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3713 (Output_data_plt_sparc::address_for_global): New function.
3714 (Output_data_plt_sparc::address_for_local): New function.
3715 (Output_data_plt_sparc::plt_index_to_offset): New function.
3716 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3717 and entry_count.
3718 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3719 entry_count.
3720 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3721 R_SPARC_JMP_IREL to switch.
3722 (Target_sparc::Scan::check_non_pic): Likewise.
3723 (Target_sparc::Scan::local): Handle IFUNC symbols.
3724 (Target_sparc::Scan::local): Likewise.
3725 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3726 and plt_address_for_local.
3727 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3728 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3729
13cf9988
DM
3730 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3731 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3732 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3733 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3734 global relocs too.
3735 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3736 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3737 calls.
3738 * sparc.cc (Target_sparc::Scan::global): Likewise.
3739 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3740
31821be0
CC
37412012-04-16 Cary Coutant <ccoutant@google.com>
3742
3743 * archive.cc (Library_base::should_include_member): Check for
3744 --export-dynamic-symbol.
3745 * options.h (class General_options): Add --export-dynamic-symbol.
3746 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3747 --export-dynamic-symbol.
3748 (Symbol_table::gc_mark_undef_symbols): Likewise.
3749 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3750
2615994e
DM
37512012-04-12 David S. Miller <davem@davemloft.net>
3752
3753 * sparc.cc (Reloc::wdisp10): New relocation method.
3754 (Reloc::h34): Likewise.
3755 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3756 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3757 R_SPARC_WDISP10.
3758 (Target_sparc::Scan::local): Likewise.
3759 (Target_sparc::Scan::global): Likewise.
3760 (Target_sparc::Relocate::relocate): Likewise.
3761
6782735d
CC
37622012-04-09 Cary Coutant <ccoutant@google.com>
3763
3764 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3765 low_pc == 0.
3766
8c7a0b00
ILT
37672012-04-06 Ian Lance Taylor <iant@google.com>
3768
3769 * timer.cc: #include <unistd.h>.
3770
58797674
RM
37712012-04-06 Roland McGrath <mcgrathr@google.com>
3772
3773 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3774 * config.in: Regenerate.
3775 * configure: Regenerate.
3776
44350750
NC
37772012-04-05 Nick Clifton <nickc@redhat.com>
3778
3779 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3780 (AM_LC_MESSAGES): Add.
3781 * aclocal.m4: Regenerate.
3782 * config.in: Regenerate.
3783 * configure: Regenerate.
3784
c1027032
CC
37852012-03-21 Cary Coutant <ccoutant@google.com>
3786
3787 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3788 * Makefile.in: Regenerate.
3789 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3790 (Sized_elf_reloc_mapper::symbol_section): New function.
3791 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3792 (make_elf_reloc_mapper): New function.
3793 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3794 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3795 (Dwarf_abbrev_table::do_get_abbrev): New function.
3796 (Dwarf_ranges_table::read_ranges_table): New function.
3797 (Dwarf_ranges_table::read_range_list): New function.
3798 (Dwarf_pubnames_table::read_section): New function.
3799 (Dwarf_pubnames_table::read_header): New function.
3800 (Dwarf_pubnames_table::next_name): New function.
3801 (Dwarf_die::Dwarf_die): New function.
3802 (Dwarf_die::read_attributes): New function.
3803 (Dwarf_die::skip_attributes): New function.
3804 (Dwarf_die::set_name): New function.
3805 (Dwarf_die::set_linkage_name): New function.
3806 (Dwarf_die::attribute): New function.
3807 (Dwarf_die::string_attribute): New function.
3808 (Dwarf_die::int_attribute): New function.
3809 (Dwarf_die::uint_attribute): New function.
3810 (Dwarf_die::ref_attribute): New function.
3811 (Dwarf_die::child_offset): New function.
3812 (Dwarf_die::sibling_offset): New function.
3813 (Dwarf_info_reader::check_buffer): New function.
3814 (Dwarf_info_reader::parse): New function.
3815 (Dwarf_info_reader::do_parse): New function.
3816 (Dwarf_info_reader::do_read_string_table): New function.
3817 (Dwarf_info_reader::lookup_reloc): New function.
3818 (Dwarf_info_reader::get_string): New function.
3819 (Dwarf_info_reader::visit_compilation_unit): New function.
3820 (Dwarf_info_reader::visit_type_unit): New function.
3821 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3822 Sized_elf_reloc_mapper.
3823 (Sized_dwarf_line_info::symbol_section): Remove function.
3824 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3825 (Sized_dwarf_line_info::read_line_mappings): Remove object
3826 parameter, adjust callers.
3827 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3828 * dwarf_reader.h: Include <sys/types.h>.
3829 (class Track_relocs): Remove forward declaration.
3830 (class Elf_reloc_mapper): New class.
3831 (class Sized_elf_reloc_mapper): New class.
3832 (class Dwarf_abbrev_table): New class.
3833 (class Dwarf_range_list): New class.
3834 (class Dwarf_ranges_table): New class.
3835 (class Dwarf_pubnames_table): New class.
3836 (class Dwarf_die): New class.
3837 (class Dwarf_info_reader): New class.
3838 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3839 (Sized_dwarf_line_info::symbol_section): Remove member function.
3840 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3841 base class.
3842 * gdb-index.cc: New source file.
3843 * gdb-index.h: New source file.
3844 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3845 and .debug_types sections, call Layout::add_to_gdb_index.
3846 (Sized_relobj_incr::do_section_name): Implement.
3847 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3848 return type; Implement.
3849 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3850 return type.
3851 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3852 parameter list and return type.
3853 (Sized_incr_dynobj::do_section_contents): Likewise.
3854 * layout.cc: Include gdb-index.h.
3855 (Layout::Layout): Initialize gdb_index_data_.
3856 (Layout::init_fixed_output_section): Check for .gdb_index section.
3857 (Layout::add_to_gdb_index): New function. Instantiate.
3858 * layout.h: Add forward declaration for class Gdb_index.
3859 (Layout::add_to_gdb_index): New member function.
3860 (Layout::gdb_index_data_): New data member.
3861 * main.cc: Include gdb-index.h.
3862 (main): Print statistics for gdb index.
3863 * object.cc (Object::section_contents): Move code into
3864 do_section_contents.
3865 (need_decompressed_section): Check for sections needed when building
3866 gdb index.
3867 (build_compressed_section_map): Likewise.
3868 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3869 gdb index.
3870 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3871 sections; call Layout::add_to_gdb_index.
3872 (Sized_relobj_file::do_decompressed_section_contents): Call
3873 do_section_contents directly.
3874 * object.h (Object::do_section_contents): Adjust parameter list and
3875 return type.
3876 (Object::do_decompressed_section_contents): Call do_section_contents
3877 directly.
3878 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3879 return type.
3880 * options.h (class General_options): Add --gdb-index option.
3881 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3882 list and return type.
3883 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3884 * reloc.h (Track_relocs::checkpoint): New function.
3885 (Track_relocs::reset): New function.
3886
3887 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3888 New test cases.
3889 * testsuite/Makefile.in: Regenerate.
3890 * testsuite/gdb_index_test.cc: New test source file.
3891 * testsuite/gdb_index_test_1.sh: New test source file.
3892 * testsuite/gdb_index_test_2.sh: New test source file.
3893
647f1574
DK
38942012-03-19 Doug Kwan <dougkwan@google.com>
3895
3896 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 3897 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
3898 __exidx_start and __exidx_end. Make symbol table parameter
3899 anonymous as it is not used.
3900 * gold.cc (queue_middle_tasks): Call target hook to define any
3901 target-specific symbols.
3902 * target.h (Target::define_standard_symbols): New method.
3903 (Target::do_define_standard_symbols): Same.
3904 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
3905 * testsuite/Makefile.in: Regenerate.
3906 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
3907 and __exidx_end.
3908 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
3909 relocations are generated for __exidx_start and __exidx_end.
3910
7c6109da
DK
39112012-03-16 Doug Kwan <dougkwan@google.com>
3912
3913 * testsuite/Makefile.am: Disable test initpri3b.
3914 * testsuite/Makefile.in: Regenerate.
3915
7b8957f8
DK
39162012-03-15 Doug Kwan <dougkwan@google.com>
3917
3918 * arm.cc (Target_arm::got_section): Make .got section read-only
3919 if -z now is given.
3920
14dc9ef7
ILT
39212012-03-15 Ian Lance Taylor <iant@google.com>
3922
3923 PR gold/13850
3924 * layout.cc (Layout::make_output_section): Correctly mark
3925 SHT_INIT_ARRAY, et. al., as relro.
3926
fa40b62a
DK
39272012-03-14 Doug Kwan <dougkwan@google.com>
3928
3929 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
3930 dynamic relocations for protected symbols in shared objects.
3931
fd325007
ILT
39322012-03-13 Ian Lance Taylor <iant@google.com>
3933
3934 * resolve.cc (Symbol_table::resolve): When merging common symbols,
3935 keep the larger alignment.
3936
e8dd54e1
CC
39372012-03-12 Cary Coutant <ccoutant@google.com>
3938
3939 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
3940 handling of DW_LNE_define_file.
3941
feb5f3b0
CC
39422012-03-12 Cary Coutant <ccoutant@google.com>
3943
3944 * reduced_debug_output.cc
3945 (Output_reduced_debug_info_section::get_die_end): Add new FORM
3946 codes to switch.
3947
a1fb4256
CC
39482012-02-29 Cary Coutant <ccoutant@google.com>
3949
3950 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
3951
5dd8762a
CC
39522012-02-29 Cary Coutant <ccoutant@google.com>
3953
3954 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3955 Call Object::decompressed_section_contents.
3956 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
3957 New dtor.
3958 (Sized_dwarf_line_info::buffer_start_): New data member.
3959 * merge.cc (Output_merge_data::do_add_input_section): Call
3960 Object::decompressed_section_contents.
3961 (Output_merge_string::do_add_input_section): Likewise.
3962 * object.cc (need_decompressed_section): New function.
3963 (build_compressed_section_map): Decompress sections needed later.
3964 (Sized_relobj_file::do_decompressed_section_contents): New function.
3965 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3966 * object.h (Object::decompressed_section_contents): New function.
3967 (Object::discard_decompressed_sections): New function.
3968 (Object::do_decompressed_section_contents): New function.
3969 (Object::do_discard_decompressed_sections): New function.
3970 (Compressed_section_info): New type.
3971 (Compressed_section_map): Include decompressed section contents.
3972 (Sized_relobj_file::do_decompressed_section_contents): New function.
3973 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3974
7b5de7ee
CC
39752012-02-16 Cary Coutant <ccoutant@google.com>
3976
3977 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
3978 * testsuite/Makefile.in: Regenerate.
3979
f9fa4a63
CC
39802012-02-14 Cary Coutant <ccoutant@google.com>
3981
3982 * options.cc (General_options::finalize): Disallow -pie and -static.
3983
2c175ebc
DK
39842012-02-03 Doug Kwan <dougkwan@google.com>
3985
3986 * arm.cc (Arm_relocate_functions::abs8,
3987 Arm_relocate_functions::abs16): Use
3988 Bits::has_signed_unsigned_overflow32.
3989 (Arm_relocate_functions::thm_abs8): Correct range of
3990 overflow check.
3991 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
3992 in assertions.
3993
90cff06f
DK
39942012-02-02 Doug Kwan <dougkwan@google.com>
3995
3996 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
3997 position independent outputs, not just shared objects.
3998
63887f3d
L
39992012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4000
4001 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4002 * configure: Regenerated.
4003
bef2b434
ILT
40042012-01-27 Ian Lance Taylor <iant@google.com>
4005
4006 * reloc.h (Bits): New class with static functions, copied from
4007 namespace utils in arm.cc.
4008 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4009 instead.
4010
c335b55d
L
40112012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4012
4013 * incremental.cc (write_info_blocks): Correct relocation offset.
4014
41194d9f
L
40152012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4016
4017 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4018 (Relocate::tls_gd_to_le): Likewise.
4019
1bae613c
L
40202012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4021
4022 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4023
24482ca0
L
40242012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4025
4026 * configure.ac: Check if -mcmodel=medium works.
4027 * configure: Regenerated.
4028
c2c7840a
CC
40292012-01-24 Cary Coutant <ccoutant@google.com>
4030
4031 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4032 definition and ...
4033 (read_unsigned_LEB_128_x): ... this new function.
4034 (read_signed_LEB_128): Replaced with inline definition and ...
4035 (read_signed_LEB_128_x): ... this new function.
4036 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4037 (read_unsigned_LEB_128): Add inline definition.
4038 (read_signed_LEB_128_x): New function.
4039 (read_signed_LEB_128): Add inline definition.
4040 * testsuite/Makefile.am (leb128_unittest): New unit test.
4041 * testsuite/Makefile.in: Regenerate.
4042 * testsuite/leb128_unittest.cc: New unit test.
4043
833de760 40442012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
4045
4046 PR gold/13617
4047 * i386.cc (Target_i386::do_code_fill): When using a jmp
4048 instruction, pad with nop instructions.
4049 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4050
618d6666
L
40512012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4052
4053 * x86_64.cc (gc_process_relocs): Add typename on types used in
4054 template.
4055 (scan_relocs): Likewise.
4056 (relocate_section): Likewise.
4057 (apply_relocation): Likewise.
4058
3660ff06
L
40592012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4060
4061 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4062 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4063 under x32.
4064
fc51264f
L
40652012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4066
4067 * x86_64.cc: Initial support for x32.
4068
dd74ae06
CC
40692012-01-03 Cary Coutant <ccoutant@google.com>
4070
4071 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4072 Use abstract base class for GOT.
4073 * gold/output.h (class Output_data_got_base): New abstract base class.
4074 (class Output_data_got): Derive from new base class, adjust ctors.
4075 (Output_data_got::reserve_slot): Make virtual; rename to
4076 do_reserve_slot; Adjust callers.
4077 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4078 pointer to abstract base class.
4079 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4080
83896202
ILT
40812011-12-18 Ian Lance Taylor <iant@google.com>
4082
4083 * object.h (Relobj::local_symbol_value): New function.
4084 (Relobj::local_plt_offset): New function.
4085 (Relobj::local_has_got_offset): New function.
4086 (Relobj::local_got_offset): New function.
4087 (Relobj::set_local_got_offset): New function.
4088 (Relobj::do_local_symbol_value): New pure virtual function.
4089 (Relobj::do_local_plt_offset): Likewise.
4090 (Relobj::do_local_has_got_offset): Likewise.
4091 (Relobj::do_local_got_offset): Likewise.
4092 (Relobj::do_set_local_got_offset): Likewise.
4093 (Sized_relobj::do_local_has_got_offset): Rename from
4094 local_has_got_offset.
4095 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4096 (Sized_relobj::do_set_local_got_offset): Rename from
4097 set_local_got_offset.
4098 (Sized_relobj_file::do_local_plt_offset): Rename from
4099 local_plt_offset.
4100 (Sized_relobj_file::do_local_symbol_value): New function.
4101 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4102 local_plt_offset.
4103 * output.cc (Output_data_got::Got_entry::write): Change object to
4104 Relobj. Use local_symbol_value.
4105 (Output_data_got::add_global_with_rel): Change rel_dyn to
4106 Output_data_reloc_generic*. Use add_global_generic.
4107 (Output_data_got::add_global_with_rela): Remove. Change all
4108 callers to use add_global_with_rel.
4109 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4110 Output_data_reloc_generic*. Use add_global_generic.
4111 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4112 callers to use add_global_pair_with_rel.
4113 (Output_data_got::add_local): Change object to Relobj*.
4114 (Output_data_got::add_local_plt): Likewise.
4115 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4116 change rel_dyn to Output_data_reloc_generic*. Use
4117 add_local_generic.
4118 (Output_data_got::add_local_with_rela): Remove. Change all
4119 callers to use all_local_with_rel.
4120 (Output_data_got::add_local_pair_with_rel): Change object to
4121 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4122 add_output_section_generic.
4123 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4124 callers to use add_local_pair_with_rel.
4125 (Output_data_got::reserve_local): Change object to Relobj*.
4126 * output.h: (class Output_data_reloc_generic): Add pure virtual
4127 declarations for add_global_generic, add_local_generic,
4128 add_output_section_generic.
4129 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4130 functions for Output_data_reloc_generic. Update declarations for
4131 changes listed in output.cc.
4132 (class Output_data_got): Change template parameter to got_size.
4133 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4134 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4135 function.
4136 (Sized_relobj_incr::do_local_plt_offset): New function.
4137 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4138 add_global_generic.
4139
76677ad0
CC
41402011-12-17 Cary Coutant <ccoutant@google.com>
4141
4142 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4143 * resolve.cc (Symbol_table::resolve): Likewise.
4144 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4145 arrays.
4146 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4147
8b8dd8d5
ILT
41482011-12-16 Ian Lance Taylor <iant@google.com>
4149
4150 * output.h (Output_data_reloc_generic::add): Only call
4151 add_dynamic_reloc if this is a dynamic reloc section.
4152
d55525b9
L
41532011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4154
4155 PR gold/13505
4156 * target-reloc.h (apply_relocation): Replace <64, false> with
4157 <size, big_endian>.
4158
ff81c7c1
NC
41592011-11-25 Nick Clifton <nickc@redhat.com>
4160
4161 * po/it.po: New Italian translation.
4162
628f39be
SA
41632011-11-17 Sterling Augustine <saugustine@google.com>
4164
4165 * script.cc (script_include_directive): Implement.
4166 (read_script_file): New local variables name and search_path. Update
4167 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4168 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4169 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4170
98ef3ea4
SA
41712011-11-11 Sterling Augustine <saugustine@google.com>
4172
4173 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4174 (file_or_sections_cmd): Likewise.
4175
f4a8b6d7
DK
41762011-11-11 Doug Kwan <dougkwan@google.com>
4177
4178 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4179 if --just-symbols is given.
4180
29ab395d
DK
41812011-11-10 Doug Kwan <dougkwan@google.com>
4182
4183 PR gold/13362
4184 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4185 when processing data relocs.
4186 * reloc.h (Relocate_functions::rel_unaligned): New method.
4187 (Relocate_functions::pcrel_unaligned): Ditto.
4188 (Relocate_functions::rel32_unaligned): Ditto.
4189 (Relocate_functions::pcrel32_unaligned): Ditto.
4190
2c339f71
DK
41912011-11-09 Doug Kwan <dougkwan@google.com>
4192
4193 PR gold/13362
4194 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4195 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4196 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4197 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4198 (Relocate_functions::rel_unaligned): New.
4199 (Relocate_functions::rel32_unaligned): New.
4200 * target-reloc.h (relocate_for_relocatable): Add code to handle
4201 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4202 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4203 arm_unaligned_reloc_r): New targets.
4204 * testsuite/Makefile.in: Regenerate.
4205 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4206 linking.
4207
3f3cddf1
ILT
42082011-11-02 Ian Lance Taylor <iant@google.com>
4209
4210 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4211 NATIVE_LINKER.
4212 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4213 * options.cc (General_options::finalize): Use library search path
4214 from configure script if specified. If not native and no sysroot,
4215 only search TOOLLIBDIR.
4216 * options.h (Search_directory::Search_directory): Change name to
4217 const std::string&.
4218 (General_options::add_to_library_path_with_sysroot): Change arg to
4219 const std::string&.
4220 * configure, Makefile.in, config.in: Rebuild.
4221
a8e2273b
ILT
42222011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4223
4224 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4225 we are working around the ARM1176 Erratum.
4226 * options.h (General_options::fix_arm1176): Add option.
4227 * testsuite/Makefile.am: Add testcases, and keep current ones
4228 working.
4229 * testsuite/Makefile.in: Regenerate.
4230 * testsuite/arm_fix_1176.s: New file.
4231 * testsuite/arm_fix_1176.sh: Likewise.
4232
cd6eab1c
ILT
42332011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4234
4235 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4236 may_use_blx_.
4237 (Target_arm::may_use_blx): Remove method.
4238 (Target_arm::set_may_use_blx): Likewise.
4239 (Target_arm::may_use_v4t_interworking): New method.
4240 (Target_arm::may_use_v5t_interworking): Likewise.
4241 (Target_arm::may_use_blx_): Remove member variable.
4242 (Arm_relocate_functions::arm_branch_common): Check for v5T
4243 interworking.
4244 (Arm_relocate_functions::thumb_branch_common): Likewise.
4245 (Reloc_stub::stub_type_for_reloc): Likewise.
4246 (Target_arm::do_finalize_sections): Correct interworking checks.
4247 * testsuite/Makefile.am: Add new tests.
4248 * testsuite/Makefile.in: Regenerate.
4249 * testsuite/arm_farcall_arm_arm.s: New test.
4250 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4251 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4252 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4253 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4254 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4255 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4256 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4257
286adcf4
CC
42582011-10-31 Cary Coutant <ccoutant@google.com>
4259
4260 PR gold/13023
4261 * expression.cc (Expression::eval_with_dot): Add
4262 is_section_dot_assignment parameter.
4263 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4264 absolute and assigning to dot within a section.
4265 * script-sections.cc
4266 (Output_section_element_assignment::set_section_addresses): Pass
4267 dot_section to set_if_absolute.
4268 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4269 as is_section_dot_assignment flag to eval_with_dot.
4270 (Output_section_element_dot_assignment::set_section_addresses):
4271 Likewise.
4272 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4273 parameter. Also set value if relative to dot_section; set the
4274 symbol's output_section.
4275 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4276 parameter. Adjust all callers.
4277 (Expression::eval_maybe_dot): Likewise.
4278 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4279 Adjust all callers.
4280 * testsuite/script_test_2.t: Test assignment of an absolute value
4281 to dot within an output section element.
4282
9634ed06
CC
42832011-10-31 Cary Coutant <ccoutant@google.com>
4284
4285 * options.h (class General_options): Add --[no-]gnu-unique options.
4286 * symtab.cc (Symbol_table::sized_write_globals): Convert
4287 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4288
de4101c7
CC
42892011-10-31 Cary Coutant <ccoutant@google.com>
4290
4291 PR gold/13359
4292 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4293 unnecessary assertion.
4294 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4295
7257cc92
ST
42962011-10-31 Sriraman Tallam <tmsriram@google.com>
4297
4298 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4299 gc_mark_symbol.
4300 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4301 gc_mark_symbol.
4302 Change to just keep the section associated with symbol.
4303 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4304 they are externally visible and --export-dynamic is turned on.
4305 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4306
bfc34b3f
ILT
43072011-10-19 Ian Lance Taylor <iant@google.com>
4308
4309 PR gold/13163
4310 * script-sections.cc
4311 (Output_section_element_dot_assignment::needs_output_section): New
4312 function.
4313
ea0d8c47
ILT
43142011-10-19 Ian Lance Taylor <iant@google.com>
4315
4316 PR gold/13204
4317 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4318 --section-start option was seen.
4319 * options.h (General_options::any_section_start): New function.
4320
abd242a9
DM
43212011-10-18 David S. Miller <davem@davemloft.net>
4322
4323 PR binutils/13301
4324 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4325 member to track relocation locations that have moved during TLS
4326 reloc optimizations.
4327 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4328 (Target_sparc::Relocate::relocate): Adjust view down by 4
4329 bytes if it matches reloc_adjust_addr_.
4330 (Target_sparc::Relocate::relocate_tls): Always move the
4331 __tls_get_addr call delay slot instruction forward 4 bytes when
4332 performing relaxation.
4333
bab9090f
CC
43342011-10-18 Cary Coutant <ccoutant@google.com>
4335
4336 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4337 (Output_file::map_no_anonymous): Check for non-zero
4338 return code from posix_fallocate.
4339
f7c5b166
CC
43402011-10-17 Cary Coutant <ccoutant@google.com>
4341
4342 PR gold/13245
4343 * plugin.cc (is_visible_from_outside): Check for symbols
4344 referenced from dynamic objects.
4345 * resolve.cc (Symbol_table::resolve): Don't count references
4346 from dynamic objects as references from real ELF files.
4347 * testsuite/plugin_test_2.sh: Adjust expected result.
4348
b490c0bb
CC
43492011-10-17 Cary Coutant <ccoutant@google.com>
4350
4351 * gold.cc: Include timer.h.
4352 (queue_middle_tasks): Stamp time.
4353 (queue_final_tasks): Likewise.
4354 * main.cc (main): Store timer in parameters. Print timers
4355 for each pass.
4356 * parameters.cc (Parameters::Parameters): Initialize timer_.
4357 (Parameters::set_timer): New function.
4358 (set_parameters_timer): New function.
4359 * parameters.h (Parameters::set_timer): New function.
4360 (Parameters::timer): New function.
4361 (Parameters::timer_): New data member.
4362 (set_parameters_timer): New function.
4363 * timer.cc (Timer::stamp): New function.
4364 (Timer::get_pass_time): New function.
4365 * timer.h (Timer::stamp): New function.
4366 (Timer::get_pass_time): New function.
4367 (Timer::pass_times_): New data member.
4368
f475cf7b
CC
43692011-10-17 Cary Coutant <ccoutant@google.com>
4370
4371 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4372 task for members of lib groups.
4373
cdd7e244
CC
43742011-10-17 Cary Coutant <ccoutant@google.com>
4375
4376 PR gold/13288
4f95c8b4 4377 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
4378 (File_read::make_view): Move bounds check (replace with assert)...
4379 (File_read::find_or_make_view): ... to here.
4380
dfb45471
CC
43812011-10-12 Cary Coutant <ccoutant@google.com>
4382
4f95c8b4 4383 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
4384 ::read returns less than requested size.
4385
53bbcc1b
CC
43862011-10-10 Cary Coutant <ccoutant@google.com>
4387
4f95c8b4 4388 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
4389 Initialize defined_count_.
4390 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4391 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4392 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4393 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4394 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4395 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4396 member.
4397 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4398 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4399 Return zeroes instead of internal error.
4400
397b129b
CC
44012011-10-10 Cary Coutant <ccoutant@google.com>
4402
4403 PR gold/13249
4f95c8b4 4404 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4405 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4406 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4407 (Output_reloc::type_): Adjust size of bit field.
4408 (Output_reloc::use_plt_offset_): New bit field.
4409 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4410 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4411 flag. Adjust all callers.
4f95c8b4 4412 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4413 creating RELATIVE relocations.
4414
d5698657
NC
44152011-10-10 Nick Clifton <nickc@redhat.com>
4416
4417 * po/es.po: Updated Spanish translation.
4418 * po/fi.po: Updated Finnish translation.
4419
6a59a5c2
DN
44202011-10-03 Diego Novillo <dnovillo@google.com>
4421
4422 * options.cc (parse_uint): Fix dereference of RETVAL.
4423
f0558624
ST
44242011-09-29 Sriraman Tallam <tmsriram@google.com>
4425
4426 * layout.h (section_order_map_): New member.
4427 (get_section_order_map): New member function.
4428 * output.cc (Output_section::add_input_section): Check for patterns
4429 only when --section-ordering-file is specified.
4430 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4431 output_sections have been formed.
4432 * layout.cc (Layout_Layout): Initialize section_order_map_.
4433 * plugin.cc (update_section_order): Store order in order_map. Do not
4434 update the order.
4435 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4436 * testsuite/Makefile.in: Regenerate.
4437 * testsuite/plugin_section_order.c: New file.
4438 * testsuite/plugin_final_layout.cc: New file.
4439 * testsuite/plugin_final_layout.sh: New file.
4440
a7dac153
CC
44412011-09-29 Cary Coutant <ccoutant@google.com>
4442
4f95c8b4 4443 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4444 Check for NULL.
4f95c8b4 4445 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4446 symbols during incremental update.
4447 (Symbol_table::add_from_dynobj): Likewise.
4448
eebd87a5
ILT
44492011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4450 Ian Lance Taylor <iant@google.com>
4451
4452 * symtab.cc (Symbol_table::define_special_symbol): Always
4453 canonicalize version string.
4454
403a3331
CC
44552011-09-26 Cary Coutant <ccoutant@google.com>
4456
4f95c8b4
CC
4457 * gold.cc (queue_initial_tasks): Move option checks ...
4458 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
4459 some options; make others fatal.
4460
235061c2
CC
44612011-09-26 Cary Coutant <ccoutant@google.com>
4462
4463 gcc PR lto/47247
4464 * plugin.cc (get_symbols_v2): New function.
4465 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4466 (is_referenced_from_outside): New function.
4467 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4468 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4469 (get_symbols): Pass version parameter.
4470 (get_symbols_v2): New function.
4471 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4472 parameter.
4473 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4474 (onload): Add LDPT_GET_SYMBOLS_V2.
4475 (all_symbols_read_hook): Use get_symbols_v2; check for
4476 LDPR_PREVAILING_DEF_IRONLY_EXP.
4477 * testsuite/plugin_test_3.sh: Update expected results.
4478
dc87f620
ILT
44792011-09-23 Simon Baldwin <simonb@google.com>
4480
4481 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4482 configuration options.
4483 * configure: Regenerate.
4484 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4485 * Makefile.in: Regenerate.
4486 * testsuite/Makefile.in: Regenerate.
4487
a8279f82
ST
44882011-09-19 Sriraman Tallam <tmsriram@google.com>
4489
4490 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4491
0c9350c8
CC
44922011-09-19 Cary Coutant <ccoutant@google.com>
4493
4494 * incremental.cc (can_incremental_update): Fix typo in comment.
4495 * incremental.h (can_incremental_update): Likewise.
4496
aa06ae28
CC
44972011-09-18 Cary Coutant <ccoutant@google.com>
4498
4499 * incremental.cc (can_incremental_update): New function.
4500 * incremental.h (can_incremental_update): New function.
4501 * layout.cc (Layout::init_fixed_output_section): Call it.
4502 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4503 * object.cc (Sized_relobj_file::do_layout): Call
4504 can_incremental_update.
4505
ebb300b2
CC
45062011-09-13 Cary Coutant <ccoutant@google.com>
4507
4508 * configure.ac: Check for glibc support for gnu_indirect_function
4509 support with static linking, setting automake conditional
4510 IFUNC_STATIC.
4511 * Makefile.in: Regenerate.
4512 * configure: Regenerate.
4513
4514 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4515 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4516 for IFUNC_STATIC.
4517 * testsuite/Makefile.in: Regenerate.
4518
1206d0d5
CC
45192011-09-13 Cary Coutant <ccoutant@google.com>
4520
4521 * incremental.cc (Sized_relobj_incr::do_layout): Call
4522 report_comdat_group for kept comdat sections.
4523 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4524 * testsuite/Makefile.in: Regenerate.
4525 * testsuite/incr_comdat_test_1.cc: New source file.
4526 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4527 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4528 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4529
40b29874
ILT
45302011-09-13 Ian Lance Taylor <iant@google.com>
4531
4532 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4533 variable external_symbols_offset.
4534
1b045aac
ILT
45352011-09-12 Ian Lance Taylor <iant@google.com>
4536
4537 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4538 triggered if object has no symbols.
4539
24c6c55a
DM
45402011-09-09 David S. Miller <davem@davemloft.net>
4541
4542 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4543 (Output_fill_debug_line::do_write): Likewise.
4544
66570254
CC
45452011-08-29 Cary Coutant <ccoutant@google.com>
4546
4547 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4548 casts to match formatting specs.
4549 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4550
8ea8cd50
CC
45512011-08-26 Cary Coutant <ccoutant@google.com>
4552
4553 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4554 remaining hole size when allocating.
4555 (Layout::make_output_section): Set fill methods for debug sections.
4556 * layout.h (Free_list::Free_list_node): Move from private to
4557 public.
4558 (Free_list::set_min_hole_size): New function.
4559 (Free_list::begin, Free_list::end): New functions.
4560 (Free_list::min_hole_): New data member.
4561 * output.cc: Include dwarf.h.
4562 (Output_fill_debug_info::do_minimum_hole_size): New function.
4563 (Output_fill_debug_info::do_write): New function.
4564 (Output_fill_debug_line::do_minimum_hole_size): New function.
4565 (Output_fill_debug_line::do_write): New function.
4566 (Output_section::Output_section): Initialize new data member.
4567 (Output_section::set_final_data_size): Ensure patch space is larger
4568 than minimum hole size.
4569 (Output_section::do_write): Fill holes in debug sections.
4570 * output.h (Output_fill): New class.
4571 (Output_fill_debug_info): New class.
4572 (Output_fill_debug_line): New class.
4573 (Output_section::set_free_space_fill): New function.
4574 (Output_section::free_space_fill_): New data member.
4575 * testsuite/Makefile.am (incremental_test_3): Add
4576 --incremental-patch option.
4577 (incremental_test_4): Likewise.
4578 (incremental_test_5): Likewise.
4579 (incremental_test_6): Likewise.
4580 (incremental_copy_test): Likewise.
4581 (incremental_common_test_1): Likewise.
4582 * testsuite/Makefile.in: Regenerate.
4583
7cf80422
NC
45842011-08-26 Nick Clifton <nickc@redhat.com>
4585
4586 * po/es.po: Updated Spanish translation.
4587
c3f7b0e5
CC
45882011-08-01 Cary Coutant <ccoutant@google.com>
4589
4590 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4591 * gold/testsuite/Makefile.in: Regenerate.
4592 * gold/testsuite/justsyms_exec.c: New source file.
4593 * gold/testsuite/justsyms_lib.c: New source file.
4594
9590bf25
CC
45952011-08-01 Cary Coutant <ccoutant@google.com>
4596
4597 * layout.cc (Layout::set_segment_offsets): Don't realign text
4598 segment if -Ttext was specified.
4599 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4600 file type.
4601 * object.h (Sized_relobj_file::e_type): New function.
4602 (Sized_relobj_file::e_type_): New data member.
4603 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4604 base address for ET_EXEC files.
4605 * target.cc (Target::do_make_elf_object_implementation): Allow
4606 ET_EXEC files with --just-symbols option.
4607
dcd8d12e
CC
46082011-07-28 Cary Coutant <ccoutant@google.com>
4609
4610 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4611 Add thread_number parameter.
4612 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4613 * workqueue-threads.cc
4614 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4615 current thread if its thread number is greater than desired thread
4616 count.
4617 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4618 Add thread_number parameter.
4619 (Workqueue::should_cancel_thread): Likewise.
4620 (Workqueue::find_runnable_or_wait): Pass thread_number to
4621 should_cancel_thread.
4622 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4623 parameter.
4624
804eb480
ST
46252011-07-22 Sriraman Tallam <tmsriram@google.com>
4626
4627 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4628 only after checking if it cannot be forced local.
4629 * symtab.h (is_externally_visible): Check if the symbol is not forced
4630 local.
4631
f1ddb600
ILT
46322011-07-15 Ian Lance Taylor <iant@google.com>
4633
4634 * options.h (class General_options): Add --print-output-format.
4635 Move -EL next to -EB, for better --help output.
4636 * target-select.cc: Include <cstdio>, "options.h", and
4637 "parameters.h".
4638 (Target_selector::do_target_bfd_name): New function.
4639 (print_output_format): New function.
4640 * target-select.h (class Target_selector): Update declarations.
4641 (Target_selector::target_bfd_name): New function.
4642 (print_output_format): Declare.
4643 * main.cc: Include "target-select.h".
4644 (main): Handle --print-output-format.
4645 * gold.cc: Include "target-select.h".
4646 (queue_initial_tasks): Handle --print-output-format when there are
4647 no input files.
4648 * parameters.cc (parameters_force_valid_target): Give a better
4649 error message if -EB/-EL does not match target.
4650 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4651 function.
4652
7d172687
ILT
46532011-07-15 Ian Lance Taylor <iant@google.com>
4654
4655 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4656 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4657 (Output_data_plt_i386::do_write): Write address of .dynamic
4658 section to first entry in .got.plt section.
4659 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4660 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4661 Initialize layout_.
4662 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4663 section to first entry in .got.plt section.
4664 * layout.h (Layout::dynamic_section): New function.
4665
e9552f7e
ST
46662011-07-13 Sriraman Tallam <tmsriram@google.com>
4667
4668 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4669 to claim_file call.
4670 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4671 input_section_position_, and input_section_glob_.
4672 (read_layout_from_file): Call function section_ordering_specified.
4673 * layout.h (is_section_ordering_specified): New function.
4674 (section_ordering_specified): New function.
4675 (section_ordering_specified_): New boolean member.
4676 * main.cc(main): Call load_plugins after layout object is defined.
4677 * output.cc (Output_section::add_input_section): Use
4678 function section_ordering_specified to check if section ordering is
4679 needed.
4680 * output.cc (Output_section::add_relaxed_input_section): Use
4681 function section_ordering_specified to check if section ordering is
4682 needed.
4683 (Output_section::update_section_layout): New function.
4684 (Output_section::sort_attached_input_sections): Check if input section
4685 must be reordered.
4686 * output.h (Output_section::update_section_layout): New function.
4687 * plugin.cc (get_section_count): New function.
4688 (get_section_type): New function.
4689 (get_section_name): New function.
4690 (get_section_contents): New function.
4691 (update_section_order): New function.
58797674 4692 (allow_section_ordering): New function.
e9552f7e
ST
4693 (Plugin::load): Add the new interfaces to the transfer vector.
4694 (Plugin_manager::load_plugins): New parameter.
4695 (Plugin_manager::all_symbols_read): New parameter.
4696 (Plugin_manager::claim_file): New parameter. Save the elf object for
4697 unclaimed objects.
4698 (Plugin_manager::get_elf_object): New function.
4699 (Plugin_manager::get_view): Change to directly use the bool to check
4700 if get_view is called from claim_file_hook.
4701 * plugin.h (input_objects): New function
4702 (Plugin__manager::load_plugins): New parameter.
4703 (Plugin_manager::claim_file): New parameter.
4704 (Plugin_manager::get_elf_object): New function.
4705 (Plugin_manager::in_claim_file_handler): New function.
4706 (Plugin_manager::in_claim_file_handler_): New member.
4707 (layout): New function.
4708 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4709 handler with an extra parameter. Make the elf object before calling
4710 claim_file handler.
4711 * testsuite/plugin_test.c (get_section_count): New function pointer.
4712 (get_section_type): New function pointer.
4713 (get_section_name): New function pointer.
4714 (get_section_contents): New function pointer.
4715 (update_section_order): New function pointer.
4716 (allow_section_ordering): New function pointer.
4717 (onload): Check if the new interfaces exist.
4718
9446efde
ILT
47192011-07-13 Ian Lance Taylor <iant@google.com>
4720
4721 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4722 relro section.
4723 * x86_64.cc (Target_x86_64::got_section): Likewise.
4724 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4725 (relro_now_test_SOURCES): New variable.
4726 (relro_now_test_DEPENDENCIES): New variable.
4727 (relro_now_test_LDFLAGS): New variable.
4728 (relro_now_test_LDADD): New variable.
4729 (relro_now_test.so): New target.
4730 * testsuite/Makefile.in: Rebuild.
4731
07aa62f2
ILT
47322011-07-12 Ian Lance Taylor <iant@google.com>
4733
4734 PR gold/12980
4735 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4736 GLOB_DAT relocation rather than a RELATIVE relocation for a
4737 protected symbol when creating a shared library.
4738 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4739 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4740 * testsuite/protected_main_1.cc (main): Test that protected
4741 function has same address.
4742
e2153196
ILT
47432011-07-11 Ian Lance Taylor <iant@google.com>
4744
4745 PR gold/12979
4746 * options.h (class General_options): Add -Bgroup.
4747 * options.cc (General_options::finalize): If -Bgroup is set,
4748 default to --unresolved-symbols=report-all.
4749 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4750 * target-reloc.h (issue_undefined_symbol_error): Handle
4751 --unresolved-symbols=report-all.
4752
6daf5215
ILT
47532011-07-08 Ian Lance Taylor <iant@google.com>
4754
4755 PR gold/11985
4756 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4757 if linker script discards key sections.
4758 (Layout::create_dynamic_symtab): Likewise.
4759 (Layout::assign_local_dynsym_offsets): Likewise.
4760 (Layout::sized_create_version_sections): Likewise.
4761 (Layout::create_interp): Likewise.
4762 (Layout::finish_dynamic_section): Likewise.
4763 (Layout::set_dynamic_symbol_size): Likewise.
4764
beabb2c6
ILT
47652011-07-08 Ian Lance Taylor <iant@google.com>
4766
4767 PR gold/12386
4768 * options.h (class General_options): Add --unresolved-symbols.
4769 * target-reloc.h (issue_undefined_symbol_error): Check
4770 --unresolved-symbols. Add comments.
4771
9c16daf1
ILT
47722011-07-08 Ian Lance Taylor <iant@google.com>
4773
4774 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4775 expression more complex.
4776
191f1a2d
ILT
47772011-07-08 Ian Lance Taylor <iant@google.com>
4778
4779 PR gold/11317
4780 * target-reloc.h (issue_undefined_symbol_error): New inline
4781 function, broken out of relocate_section.
4782 (relocate_section): Call issue_undefined_symbol_error.
4783 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4784 there is no TLS segment if we are about to issue an undefined
4785 symbol error.
4786 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4787
62855347
ILT
47882011-07-08 Ian Lance Taylor <iant@google.com>
4789
4790 PR gold/12279
4791 * resolve.cc (Symbol_table::should_override): Add fromtype
4792 parameter. Change all callers. Give error when linking together
4793 TLS and non-TLS symbol.
4794 (Symbol_table::should_override_with_special): Add fromtype
4795 parameter. Change all callers.
4796 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4797 there is no TLS segment if we have reported some errors.
4798 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4799
67181c72
ILT
48002011-07-08 Ian Lance Taylor <iant@google.com>
4801
4802 PR gold/12372
4803 * target.h (Target::plt_address_for_global): New function.
4804 (Target::plt_address_for_local): New function.
4805 (Target::plt_section_for_global): Remove.
4806 (Target::plt_section_for_local): Remove.
4807 (Target::do_plt_address_for_global): New virtual function.
4808 (Target::do_plt_address_for_local): New virtual function.
4809 (Target::do_plt_section_for_global): Remove.
4810 (Target::do_plt_section_for_local): Remove.
4811 (Target::register_global_plt_entry): Add Symbol_table and Layout
4812 parameters.
4813 * output.cc (Output_data_got::Got_entry::write): Use
4814 plt_address_for_global and plt_address_for_local.
4815 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4816 address of output section.
4817 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4818 got_irelative_, and irelative_count_ fields. Update
4819 declarations.
4820 (Output_data_plt_i386::has_irelative_section): New function.
4821 (Output_data_plt_i386::entry_count): Add irelative_count_.
4822 (Output_data_plt_i386::set_final_data_size): Likewise.
4823 (class Target_i386): Add got_irelative_ and rel_irelative_
4824 fields. Update declarations.
4825 (Target_i386::Target_i386): Initialize new fields.
4826 (Target_i386::do_plt_address_for_global): New function replacing
4827 do_plt_section_for_global.
4828 (Target_i386::do_plt_address_for_local): New function replacing
4829 do_plt_section_for_local.
4830 (Target_i386::got_section): Create got_irelative_.
4831 (Target_i386::rel_irelative_section): New function.
4832 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4833 fields. Don't define __rel_iplt_{start,end}.
4834 (Output_data_plt_i386::add_entry): Add symtab and layout
4835 parameters. Change all callers. Use different PLT and GOT for
4836 IFUNC symbols.
4837 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4838 layout parameters. Change all callers. Use different PLT and
4839 GOT.
4840 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4841 (Output_data_plt_i386::rel_irelative): New function.
4842 (Output_data_plt_i386::address_for_global): New function.
4843 (Output_data_plt_i386::address_for_local): New function.
4844 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4845 IRELATIVE GOT when changing IFUNC GOT entries.
4846 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4847 reloc.
4848 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4849 if we didn't create an IRELATIVE GOT.
4850 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4851 plt_address_for_local.
4852 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4853 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4854 got_irelative_, and irelative_count_ fields. Update
4855 declarations.
4856 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4857 Initialize new fields. Remove symtab parameter. Change all
4858 callers.
4859 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4860 irelative_count_.
4861 (Output_data_plt_x86_64::has_irelative_section): New function.
4862 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4863 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4864 fields. Update declarations.
4865 (Target_x86_64::Target_x86_64): Initialize new fields.
4866 (Target_x86_64::do_plt_address_for_global): New function replacing
4867 do_plt_section_for_global.
4868 (Target_x86_64::do_plt_address_for_local): New function replacing
4869 do_plt_section_for_local.
4870 (Target_x86_64::got_section): Create got_irelative_.
4871 (Target_x86_64::rela_irelative_section): New function.
4872 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4873 all callers. Don't create __rel_iplt_{start,end}.
4874 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4875 parameters. Change all callers. Use different PLT and GOT for
4876 IFUNC symbols.
4877 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4878 layout parameters. Change all callers. Use different PLT and
4879 GOT.
4880 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4881 parameters. Change all callers. Use different PLT and GOT for
4882 IFUNC symbols.
4883 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4884 (Output_data_plt_x86_64::rela_irelative): New function.
4885 (Output_data_plt_x86_64::address_for_global): New function.
4886 (Output_data_plt_x86_64::address_for_local): New function.
4887 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4888 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4889 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4890 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4891 parameters.
4892 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4893 reloc.
4894 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4895 symbols if we didn't create an IRELATIVE GOT.
4896 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
4897 plt_address_for_local.
4898 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
4899 * testsuite/ifuncvar1.c: New test file.
4900 * testsuite/ifuncvar2.c: New test file.
4901 * testsuite/ifuncvar3.c: New test file.
4902 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
4903 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
4904 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
4905 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
4906 * testsuite/Makefile.in: Rebuild.
4907
33c15b45
CC
49082011-07-07 Cary Coutant <ccoutant@google.com>
4909
4910 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
4911 (two_file_test_1_ndebug.o): Likewise.
4912 (two_file_test_1b_ndebug.o): Likewise.
4913 (two_file_test_2_ndebug.o): Likewise.
4914 (two_file_test_main_ndebug.o): Likewise.
4915 (incremental_test_2): Link with no-debug versions.
4916
f48b5fb7
CC
49172011-07-06 Cary Coutant <ccoutant@google.com>
4918
4919 * gold/incremental.cc
4920 (Output_section_incremental_inputs::write_info_blocks): Check for
4921 hidden and internal symbols.
4922
221597a5
CC
49232011-07-06 Cary Coutant <ccoutant@google.com>
4924
4925 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
4926 Check disposition for startup file.
4927 (Incremental_inputs::report_command_line): Ignore
4928 --incremental-startup-unchanged option.
4929 * options.cc (General_options::parse_incremental_startup_unchanged):
4930 New function.
4931 (General_options::General_options): Initialize new data member.
4932 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
4933 (General_options): Add --incremental-startup-unchanged option.
4934 (General_options::incremental_startup_disposition): New function.
4935 (General_options::incremental_startup_disposition_): New data member.
4936
e24719f6
CC
49372011-07-06 Cary Coutant <ccoutant@google.com>
4938
4939 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
4940 input file index to Script_info ctor.
4941 (Sized_incremental_binary::do_file_has_changed): Find the
4942 command-line argument for files named in scripts.
4943 * incremental.h (Script_info::Script_info): New ctor
4944 with input file index.
4945 (Script_info::input_file_index): New function.
4946 (Script_info::input_file_index_): New data member.
4947 (Incremental_binary::get_library): Add const.
4948 (Incremental_binary::get_script_info): Add const.
4949 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
4950 * testsuite/Makefile.am (incremental_test_5): New test case.
4951 (incremental_test_6): New test case.
4952 * testsuite/Makefile.in: Regenerate.
4953
8f7c81e8
CC
49542011-07-06 Cary Coutant <ccoutant@google.com>
4955
4956 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
4957 debug output when command lines differ.
4958
9fbd3822
CC
49592011-07-06 Cary Coutant <ccoutant@google.com>
4960
4961 * incremental.cc (Incremental_inputs::report_command_line): Ignore
4962 --incremental-patch option.
4963 * layout.cc (Free_list::allocate): Extend allocation beyond original
4964 end if enabled.
4965 (Layout::make_output_section): Mark sections that should get
4966 patch space.
4967 * options.cc (parse_percent): New function.
4968 * options.h (parse_percent): New function.
4969 (DEFINE_percent): New macro.
4970 (General_options): Add --incremental-patch option.
4971 * output.cc (Output_section::Output_section): Initialize new data
4972 members.
4973 (Output_section::add_input_section): Print section name when out
4974 of patch space.
4975 (Output_section::add_output_section_data): Likewise.
4976 (Output_section::set_final_data_size): Add patch space when
4977 doing --incremental-full.
4978 (Output_section::do_reset_address_and_file_offset): Remove patch
4979 space.
4980 (Output_segment::set_section_list_addresses): Print debug output
4981 only if --incremental-update.
4982 * output.h (Output_section::set_is_patch_space_allowed): New function.
4983 (Output_section::is_patch_space_allowed_): New data member.
4984 (Output_section::patch_space_): New data member.
4985 * parameters.cc (Parameters::incremental_full): New function.
4986 * parameters.h (Parameters::incremental_full): New function
4987 * testsuite/Makefile.am (incremental_test_2): Add test for
4988 --incremental-patch option.
4989 * testsuite/Makefile.in: Regenerate.
4990 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
4991 (t18): Remove function body.
4992
f6cccc2c
DK
49932011-07-05 Doug Kwan <dougkwan@google.com>
4994
4995 PR gold/12771
4996 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
4997 Arm_Address type for relocation result.
4998 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
4999 overflow check.
5000 (Arm_relocate_functions::abs32): Use unaligned access.
5001 (Arm_relocate_functions::rel32): Ditto.
5002 (Arm_relocate_functions::prel31): Ditto.
5003 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5004 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5005 static data relocations.
5006 * testsuite/Makefile.in: Regnerate.
5007 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5008
28a13fec
ILT
50092011-07-05 Ian Lance Taylor <iant@google.com>
5010
5011 PR gold/12392
5012 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5013 symbols if necessary.
5014 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5015
24d47b34
ILT
50162011-07-05 Ian Lance Taylor <iant@google.com>
5017
5018 PR gold/12952
5019 * resolve.cc (Symbol::override_base_with_special): Simply override
5020 version with special symbol version, ignoring previous version.
5021
41f9cbbe
ILT
50222011-07-05 Ian Lance Taylor <iant@google.com>
5023
5024 * object.cc (Sized_relobj_file::include_section_group): Add
5025 information to comment about signature location.
5026
886288f1
ILT
50272011-07-02 Ian Lance Taylor <iant@google.com>
5028
5029 PR gold/12957
5030 * options.h (class General_options): Add -f and -F.
5031 * options.cc (General_options::finalize): Fatal error if -f/-F
5032 are used without -shared.
5033 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5034
ae3a6d4f
ILT
50352011-07-02 Ian Lance Taylor <iant@google.com>
5036
5037 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5038
21131061
ILT
50392011-07-01 Ian Lance Taylor <iant@google.com>
5040
5041 PR gold/12525
5042 PR gold/12952
5043 * resolve.cc (Symbol::override_base_with_special): Don't override
5044 the version if the overriding symbol has a different name.
5045 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5046 all callers. If we give an error about an undefined version,
5047 define the base version if necessary.
5048 * dynobj.h (class Versions): Update declaration.
5049 * testsuite/weak_alias_test_5.cc: New file.
5050 * testsuite/weak_alias_test.script: New file.
5051 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5052 and versioned_alias have the right value, and call t2.
5053 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5054 weak_alias_test_5.so.
5055 (weak_alias_test_LDADD): Likewise.
5056 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5057 * testsuite/Makefile.in: Rebuild.
5058
611062c0
ILT
50592011-07-01 Ian Lance Taylor <iant@google.com>
5060
5061 PR gold/12525
5062 * options.h (class General_options): Support -z notext.
5063 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5064 -Wl,-z,notext.
5065 (two_file_shared_nonpic.so): Likewise.
5066 (two_file_shared_mixed.so): Likewise.
5067 (two_file_shared_mixed_1.so): Likewise.
5068 (weak_undef_lib_nonpic.so): Likewise.
5069 (alt/weak_undef_lib_nonpic.so): Likewise.
5070 (tls_test_shared_nonpic.so): Likewise.
5071 * testsuite/Makefile.in: Rebuild.
5072
328c7c2f
ILT
50732011-07-01 Ian Lance Taylor <iant@google.com>
5074
5075 PR gold/12525
5076 * configure.ac: Test whether static linking works, setting
5077 the automake conditional HAVE_STATIC.
5078 * testsuite/Makefile.am: Disable tests using -static if
5079 HAVE_STATIC is not true.
5080 * configure, testsuite/Makefile.in: Rebuild.
5081
02d7cd44
ILT
50822011-07-01 Ian Lance Taylor <iant@google.com>
5083
5084 PR gold/12525
5085 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5086 Assert if we see DW_EH_PE_indirect.
5087 * target.h (Target::ehframe_datarel_base): New function.
5088 (Target::do_ehframe_datarel_base): New target function.
5089 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5090 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5091 function.
5092
07a60597
ILT
50932011-07-01 Ian Lance Taylor <iant@google.com>
5094
5095 PR gold/12571
5096 * options.h (class General_options): Add
5097 --ld-generated-unwind-info.
5098 * ehframe.cc (Fde::write): Add address parameter. Change all
5099 callers. If associated with PLT, fill in address and size.
5100 (Cie::set_output_offset): Only add merge mapping if there is an
5101 object.
5102 (Cie::write): Add address parameter. Change all callers.
5103 (Eh_frame::add_ehframe_for_plt): New function.
5104 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5105 input_offset_ fields into union u_, with new plt field.
5106 (Fde::Fde): Adjust for new union field.
5107 (Fde::Fde) [Output_data version]: New constructor.
5108 (Fde::add_mapping): Only add merge mapping if there is an object.
5109 (class Cie): Update declarations.
5110 (class Eh_frame): Declare add_ehframe_for_plt.
5111 * layout.cc (Layout::layout_eh_frame): Break out code into
5112 make_eh_frame_section, and call it.
5113 (Layout::make_eh_frame_section): New function.
5114 (Layout::add_eh_frame_for_plt): New function.
5115 * layout.h (class Layout): Update declarations.
5116 * merge.cc (Merge_map::add_mapping): Add assertion.
5117 * i386.cc: Include "dwarf.h".
5118 (class Output_data_plt_i386): Make first_plt_entry,
5119 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5120 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5121 and plt_eh_frame_fde.
5122 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5123 boundary. Call add_eh_frame_for_plt if appropriate.
5124 * x86_64.cc: Include "dwarf.h".
5125 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5126 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5127 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5128 and plt_eh_frame_fde.
5129 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5130 appropriate.
5131
14788a3f
ILT
51322011-06-29 Ian Lance Taylor <iant@google.com>
5133
5134 PR gold/12629
5135 * object.cc (Sized_relobj_file::layout_section): Change shdr
5136 parameter to be const.
5137 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5138 out of do_layout.
5139 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5140 appropriate. Call layout_eh_frame_section.
5141 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5142 sections.
5143 * object.h (class Sized_relobj_file): Update declarations.
5144
6c21fce1
ILT
51452011-06-29 Ian Lance Taylor <iant@google.com>
5146
37e41b03 5147 PR gold/12652
6c21fce1
ILT
5148 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5149 modifier.
5150 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5151
4d5e4e62
ILT
51522011-06-29 Ian Lance Taylor <iant@google.com>
5153
5154 PR gold/12675
5155 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5156 SHT_X86_64_UNWIND.
5157 * layout.cc (Layout::layout_eh_frame): Likewise.
5158
886f533a
ILT
51592011-06-29 Ian Lance Taylor <iant@google.com>
5160
5161 PR gold/12695
5162 * layout.cc (Layout::symtab_section_shndx): New function.
5163 * layout.h (class Layout): Declare symtab_section_shndx.
5164 * output.cc (Output_section::write_header): Call it.
5165
f3ae1b28
ILT
51662011-06-29 Ian Lance Taylor <iant@google.com>
5167
5168 PR gold/12818
5169 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5170 symbols which are not used in a relocation.
5171
aecf301f
ILT
51722011-06-28 Ian Lance Taylor <iant@google.com>
5173
5174 PR gold/12898
5175 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5176 script create indistinguishable segments.
5177 (Layout::set_segment_offsets): Use stable_sort when sorting
5178 segments. Pass this to Compare_segments constructor.
5179 * layout.h (class Layout): Make segment_precedes non-static.
5180 (class Compare_segments): Change from struct to class. Add
5181 layout_ field. Add constructor.
5182 * script-sections.cc
5183 (Script_sections::attach_sections_using_phdrs_clause): Rename
5184 local orphan to is_orphan. Don't report failure to put empty
5185 section in segment. On attachment failure, report name of
5186 section, and attach to first PT_LOAD segment.
5187
03ef7571
ILT
51882011-06-28 Ian Lance Taylor <iant@google.com>
5189
5190 PR gold/12934
5191 * target-select.cc (Target_selector::Target_selector): Add
5192 emulation parameter. Change all callers.
5193 (select_target_by_bfd_name): Rename from select_target_by_name.
5194 Change all callers.
5195 (select_target_by_emulation): New function.
5196 (supported_emulation_names): New function.
5197 * target-select.h (class Target_selector): Add emulation_ field.
5198 Update declarations.
5199 (Target_selector::recognize_by_bfd_name): Rename from
5200 recognize_by_name. Change all callers.
5201 (Target_selector::supported_bfd_names): Rename from
5202 supported_names. Change all callers.
5203 (Target_selector::recognize_by_emulation): New function.
5204 (Target_selector::supported_emulations): New function.
5205 (Target_selector::emulation): New function.
5206 (Target_selector::do_recognize_by_bfd_name): Rename from
5207 do_recognize_by_name. Change all callers.
5208 (Target_selector::do_supported_bfd_names): Rename from
5209 do_supported_names. Change all callers.
5210 (Target_selector::do_recognize_by_emulation): New function.
5211 (Target_selector::do_supported_emulations): New function.
5212 (select_target_by_bfd_name): Change name in declaration.
5213 (select_target_by_emulation): Declare.
5214 (supported_emulation_names): Declare.
5215 * parameters.cc (parameters_force_valid_target): Try to find
5216 target based on emulation from -m option.
5217 * options.h (class General_options): Change doc string for -m.
5218 * options.cc (help): Print emulations.
5219 (General_options::parse_V): Likewise.
5220 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5221 Add emulation parameter. Change all callers.
5222
200b2bb9
ILT
52232011-06-28 Ian Lance Taylor <iant@google.com>
5224
5225 * target.h (class Target): Add osabi_ field.
5226 (Target::osabi): New function.
5227 (Target::set_osabi): New function.
5228 (Target::Target): Initialize osabi_.
5229 (Target::do_adjust_elf_header): Make pure virtual.
5230 (Sized_target::do_adjust_elf_header): Declare.
5231 * target.cc (Sized_target::do_adjust_elf_header): New function.
5232 (class Sized_target): Instantiate all versions.
5233 * freebsd.h (class Target_freebsd): Remove.
5234 (Target_selector_freebsd::do_recognize): Call set_osabi on
5235 Target.
5236 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5237 (Target_selector_freebsd::set_osabi): Remove.
5238 * i386.cc (class Target_i386): Inherit from Sized_target rather
5239 than Target_freebsd.
5240 * x86_64.cc (class Target_x86_64): Likewise.
5241
b3ce541e
ILT
52422011-06-28 Ian Lance Taylor <iant@google.com>
5243
5244 * target.h (Target::can_check_for_function_pointers): Rewrite.
5245 Make non-virtual.
5246 (Target::can_icf_inline_merge_sections): Likewise.
5247 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5248 (Target::Target_info): Add can_icf_inline_merge_sections field.
5249 (Target::do_can_check_for_function_pointers): New virtual
5250 function.
5251 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5252 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5253 from can_check_for_function_pointers, move in file.
5254 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5255 section_may_have_icf_unsafe_poineters, move in file.
5256 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5257 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5258 Rename from can_check_for_function_pointers, move in file.
5259 (Target_i386::can_icf_inline_merge_sections): Remove.
5260 (Target_i386::i386_info): Initialize
5261 can_icf_inline_merge_sections.
5262 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5263 Initialize can_icf_inline_merge_sections.
5264 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5265 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5266 Rename from can_check_for_function_pointers, move in file.
5267 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5268 (Target_x86_64::x86_64_info): Initialize
5269 can_icf_inline_merge_sections.
5270 * testsuite/testfile.cc (Target_test::test_target_info):
5271 Likewise.
5272 * icf.cc (get_section_contents): Correct formatting.
5273
6d1c4efb
ILT
52742011-06-27 Ian Lance Taylor <iant@google.com>
5275
5276 * symtab.cc (Symbol::versioned_name): New function.
5277 (Symbol_table::add_to_final_symtab): Use versioned_name when
5278 appropriate.
5279 (Symbol_table::sized_write_symbol): Likewise.
5280 * symtab.h (class Symbol): Declare versioned_name.
5281 * stringpool.h (class Stringpool_template): Add variant of add
5282 which takes a std::basic_string.
5283 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5284 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5285 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5286 (ver_test_12.o): New target.
5287 * testsuite/Makefile.in: Rebuild.
5288
57eb9b50
DK
52892011-06-27 Doug Kwan <dougkwan@google.com>
5290
5291 * arm.cc (Arm_relocate_functions::thm_jump8,
5292 Arm_relocate_functions::thm_jump11): Use a wider signed
5293 type to compute offset.
5294 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5295 arm_thm_jump8.
5296 * testsuite/Makefile.in: Regenerate.
5297 * testsuite/arm_branch_in_range.sh: Check test results of
5298 arm_thm_jump11 and arm_thm_jump8.
5299 * testsuite/arm_thm_jump11.s: New test source file.
5300 * testsuite/arm_thm_jump11.t: New linker script.
5301 * testsuite/arm_thm_jump8.s: New test source file.
5302 * testsuite/arm_thm_jump8.t: New linker script.
5303
487b39df
ILT
53042011-06-24 Ian Lance Taylor <iant@google.com>
5305
5306 * layout.cc: Include "object.h".
5307 (ctors_sections_in_init_array): New static variable.
5308 (Layout::is_ctors_in_init_array): New function.
5309 (Layout::layout): Add entry to ctors_sections_in_init_array if
5310 appropriate.
5311 * layout.h (class Layout): Declare is_ctors_in_init_array.
5312 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5313 is_ctors_reverse_view is set.
5314 (Sized_relobj_file::write_sections): Add layout parameter. Change
5315 all callers. Set is_ctors_reverse_view field of View_size.
5316 (Sized_relobj_file::reverse_words): New function.
5317 * object.h (Sized_relobj_file::View_size): Add
5318 is_ctors_reverse_view field.
5319 (class Sized_relobj_file): Update declarations.
5320 * testsuite/initpri3.c: New test.
5321 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5322 initpri3b.
5323 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5324 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5325 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5326 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5327 * testsuite/Makefile.in: Rebuild.
5328
472076e4
CC
53292011-06-24 Cary Coutant <ccoutant@google.com>
5330
5331 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5332 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5333 (debug_msg_cdebug.err): New targets.
5334 * testsuite/Makefile.in: Regenerate.
5335 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5336 Fix checks for link with shared library.
5337
a60af0db
DK
53382011-06-24 Doug Kwan <dougkwan@google.com>
5339
5340 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5341 skip empty text sections.
5342 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5343
5393d741
ILT
53442011-06-22 Ian Lance Taylor <iant@google.com>
5345
5346 PR gold/12910
5347 * options.h (class General_options): Add --ctors-in-init-array.
5348 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5349 friends as SHT_PROGBITS for merging sections.
5350 (Layout::layout): Remove special handling of .init_array and
5351 friends. Don't sort if doing relocatable link. Sort for .ctors
5352 and .dtors if ctors_in_init_array.
5353 (Layout::make_output_section): Force correct section types for
5354 .init_array and friends. Don't sort if doing relocatable link,
5355 Don't sort .ctors and .dtors if ctors_in_init_array.
5356 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5357 (Layout::output_section_name): Add relobj parameter. Change all
5358 callers. Handle .ctors. and .dtors. in code rather than table.
5359 Handle .ctors and .dtors if ctors_in_init_array.
5360 (Layout::match_file_name): New function, moved from output.cc.
5361 * layout.h (class Layout): Update declarations.
5362 * output.cc: Include "layout.h".
5363 (Input_section_sort_entry::get_priority): New function.
5364 (Input_section_sort_entry::match_file_name): Just call
5365 Layout::match_file_name.
5366 (Output_section::Input_section_sort_init_fini_compare::operator()):
5367 Handle .ctors and .dtors. Sort by explicit priority rather than
5368 by name.
5369 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5370 * testsuite/initpri2.c: New test.
5371 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5372 (check_PROGRAMS): Add initpri2.
5373 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5374 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5375 * configure, testsuite/Makefile.in: Rebuild.
5376
e1f74f98
ILT
53772011-06-19 Ian Lance Taylor <iant@google.com>
5378
5379 PR gold/12880
5380 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5381 .interp section to a PT_INTERP segment even if we have seen a
5382 --dynamic-linker option. Don't do it if we have seen a PHDRS
5383 clause in a linker script.
5384 (Layout::finalize): Don't create a .interp section if we've
5385 already create a PT_INTERP segment.
5386 (Layout::create_interp): Always call choose_output_section (revert
5387 patch of 2011-06-17). Don't create PT_INTERP segment.
5388 * script-sections.cc
5389 (Script_sections::create_note_and_tls_segments): Add a .interp
5390 section to a PT_INTERP segment even if we have seen a
5391 --dynamic-linker option.
5392
766f91bb
ILT
53932011-06-18 Ian Lance Taylor <iant@google.com>
5394
5395 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5396 merely because a non-PT_LOAD segment has a dynamic reloc.
5397
0d212c3a
ILT
53982011-06-18 Ian Lance Taylor <iant@google.com>
5399
5400 * layout.cc (Layout::finish_dynamic_section): Don't create
5401 DT_FLAGS entry if not needed.
5402
911a5072
ILT
54032011-06-18 Ian Lance Taylor <iant@google.com>
5404
5405 PR gold/12745
5406 * layout.cc (Layout::layout_eh_frame): Correct handling of
5407 writable .eh_frame section.
5408
534b4e5f
ILT
54092011-06-17 Ian Lance Taylor <iant@google.com>
5410
5411 PR gold/12893
5412 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5413 symbol is redefined with the exact same object and value.
5414
10b4f102
ILT
54152011-06-17 Ian Lance Taylor <iant@google.com>
5416
5417 PR gold/12880
5418 * layout.h (class Layout): Add interp_segment_ field.
5419 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5420 (Layout::attach_allocated_section_to_segment): If making shared
5421 library, put .interp section in PT_INTERP segment.
5422 (Layout::finalize): Also call create_interp if -dynamic-linker
5423 option was used.
5424 (Layout::create_interp): Assert that there is no PT_INTERP
5425 segment. If not using a SECTIONS clause, use make_output_section.
5426 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5427 * script-sections.cc
5428 (Script_sections::create_note_and_tls_segments): If making shared
5429 library, put .interp section in PT_INTERP segment.
5430
a29b0dad
ILT
54312011-06-17 Ian Lance Taylor <iant@google.com>
5432
e588ea8d
ILT
5433 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5434 when making a shared library.
5435
54362011-06-17 Ian Lance Taylor <iant@google.com>
5437
5438 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5439 parameter. Change all callers. Don't issue warning about PC32
5440 against locally defined symbol.
a29b0dad 5441
9d3b0698
ILT
54422011-06-16 Ian Lance Taylor <iant@google.com>
5443
5444 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5445 occurs in same object.
5446
85b0f90c
AM
54472011-06-14 Alan Modra <amodra@gmail.com>
5448
5449 * po/POTFILES.in: Regenerate.
5450
a94907d9
ILT
54512011-06-09 Ian Lance Taylor <iant@google.com>
5452
5453 * script-sections.cc
5454 (Orphan_output_section::set_section_addresses): For a relocatable
5455 link set address to 0.
5456
4fb3a1c3
CC
54572011-06-09 Cary Coutant <ccoutant@google.com>
5458
5459 PR gold/12804
5460 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5461 used with --compress-debug-sections.
5462 * gold/object.cc (Sized_relobj_file::do_layout): Report
5463 uncompressed size of compressed input sections.
5464
61220854
CC
54652011-06-08 Cary Coutant <ccoutant@google.com>
5466
5467 PR gold/12804
5468 * testsuite/two_file_test_2_v1.cc: Change initialization of
5469 v2 to keep it in .data.
5470
e6455dfb
CC
54712011-06-07 Cary Coutant <ccoutant@google.com>
5472
5473 * common.cc (Symbol_table::do_allocate_commons_list): Call
5474 gold_fallback.
5475 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5476 (Errors::fallback): New function.
5477 (gold_fallback): New function.
5478 * errors.h (Errors::fallback): New function.
5479 * gold.cc (gold_exit): Change status parameter to enum; adjust
5480 all callers.
5481 (queue_initial_tasks): Call gold_fallback.
5482 * gold.h: Include cstdlib.
5483 (Exit_status): New enum type.
5484 (gold_exit): Change status parameter to enum.
5485 (gold_fallback): New function.
5486 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5487 (Layout::create_symtab_sections): Likewise.
5488 (Layout::create_shdrs): Likewise.
5489 * main.cc (main): Adjust call to gold_exit.
5490 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5491 (Output_data_got::add_got_entry_pair): Likewise.
5492 (Output_section::add_input_section): Likewise.
5493 (Output_section::add_output_section_data): Likewise.
5494 (Output_segment::set_section_list_addresses): Likewise.
5495 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5496
fb0e076f
CC
54972011-06-07 Cary Coutant <ccoutant@google.com>
5498
5499 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5500 for incremental links.
5501 * output.cc (Output_segment::set_section_list_addresses): Remove
5502 FIXME and test for TLS or BSS.
5503
a5ee4d5d
CC
55042011-06-07 Cary Coutant <ccoutant@google.com>
5505
5506 * testsuite/Makefile.am: Add incremental_copy_test,
5507 incremental_common_test_1.
5508 * testsuite/Makefile.in: Regenerate.
5509 * testsuite/common_test_1_v1.c: New source file.
5510 * testsuite/common_test_1_v2.c: New source file.
5511 * testsuite/copy_test_v1.cc: New source file.
5512
5146f448
CC
55132011-06-07 Cary Coutant <ccoutant@google.com>
5514
5515 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5516 update, allocate common from bss section's free list.
5517 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5518 linker-defined symbols.
5519 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5520 Skip GOT and PLT entries that are no longer referenced.
5521 (Output_section_incremental_inputs::write_info_blocks): Mark
5522 linker-defined symbols.
5523 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5524 * output.cc (Output_section::allocate): New function.
5525 * output.h (Output_section::allocate): New function.
5526 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5527 linker-defined symbols.
5528 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5529 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5530 (Symbol::init_base_output_data): Likewise.
5531 (Symbol::init_base_output_segment): Likewise.
5532 (Symbol::init_base_constant): Likewise.
5533 (Sized_symbol::init_output_data): Likewise.
5534 (Sized_symbol::init_output_segment): Likewise.
5535 (Sized_symbol::init_constant): Likewise.
5536 (Symbol_table::do_define_in_output_data): Likewise.
5537 (Symbol_table::do_define_in_output_segment): Likewise.
5538 (Symbol_table::do_define_as_constant): Likewise.
5539 * symtab.h (Symbol::is_predefined): New function.
5540 (Symbol::init_base_output_data): Add is_predefined parameter.
5541 (Symbol::init_base_output_segment): Likewise.
5542 (Symbol::init_base_constant): Likewise.
5543 (Symbol::is_predefined_): New data member.
5544 (Sized_symbol::init_output_data): Add is_predefined parameter.
5545 (Sized_symbol::init_output_segment): Likewise.
5546 (Sized_symbol::init_constant): Likewise.
5547 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5548
26d3c67d
CC
55492011-06-07 Cary Coutant <ccoutant@google.com>
5550
5551 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5552 instead of emit_copy_reloc.
5553 (Copy_relocs::emit_copy_reloc): Refactor.
5554 (Copy_relocs::make_copy_reloc): New function.
5555 (Copy_relocs::add_copy_reloc): Remove.
5556 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5557 section.
5558 (Copy_relocs::make_copy_reloc): New function.
5559 (Copy_relocs::add_copy_reloc): Remove.
5560 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5561 unchanged input files.
5562 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5563 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5564 Reserve BSS space for COPY relocations.
5565 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5566 (Output_section_incremental_inputs::write_info_blocks): Record
5567 whether a symbol is copied from a shared object.
5568 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5569 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5570 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5571 (Incremental_input_entry_reader::get_output_symbol_index): Add
5572 is_copy parameter.
5573 (Incremental_binary::emit_copy_relocs): New function.
5574 (Incremental_binary::do_emit_copy_relocs): New function.
5575 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5576 new data member.
5577 (Sized_incremental_binary::add_copy_reloc): New function.
5578 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5579 (Sized_incremental_binary::Copy_reloc): New struct.
5580 (Sized_incremental_binary::Copy_relocs): New typedef.
5581 (Sized_incremental_binary::copy_relocs_): New data member.
5582 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5583 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5584 * target.h (Sized_target::emit_copy_reloc): New function.
5585 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5586
7cdb37d9
CC
55872011-06-02 Cary Coutant <ccoutant@google.com>
5588
5589 PR gold/12163
5590 * gold/archive.cc (Archive::Archive): Initialize new data member.
5591 (Archive::include_all_members): Return if archive has already been
5592 included.
5593 * gold/archive.h (Archive::include_all_members_): New data member.
5594
cc643b88
NC
55952011-06-02 Nick Clifton <nickc@redhat.com>
5596
5597 * dynobj.h: Fix spelling mistake in comment.
5598 * output.cc: Likewise.
5599
f62a3ca7 56002011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 5601 Asier Llano
f62a3ca7
DK
5602
5603 PR gold/12826
cc643b88 5604 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
5605 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5606 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5607 redundant arm_exidx_test.so.
5608 * testsuite/Makefile.in: Regenerate.
5609 (check_SCRIPTS): Add pr12826.sh
5610 (check_DATA): Add pr12826.stdout
5611 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5612 * testsuite/pr12826.sh: New file.
5613 * testsuite/pr12826_1.s: Ditto.
5614 * testsuite/pr12826_1.s: Ditto.
5615
8dbe1edc
ILT
56162011-05-30 Ian Lance Taylor <iant@google.com>
5617
5618 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5619 sections.
5620
c49875be
ILT
56212011-05-29 Ian Lance Taylor <iant@google.com>
5622
5623 PR gold/12804
5624 * testsuite/Makefile.am: Use different file name for two_file_test
5625 temporary file for each incremental test.
5626 * testsuite/Makefile.in: Rebuild.
5627
69d53f7a
ILT
56282011-05-29 Ian Lance Taylor <iant@google.com>
5629
5630 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5631 binary input file is empty.
5632
41d0ab5f
ILT
56332011-05-27 Ian Lance Taylor <iant@google.com>
5634
5635 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5636 (ver_test_9.so): Likewise.
5637 * testsuite/Makefile.in: Rebuild.
5638
89d8a36b
CC
56392011-05-26 Cary Coutant <ccoutant@google.com>
5640
5641 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5642 * incremental.cc (Incremental_inputs::report_input_section): Fix
5643 comment, indentation.
5644 (Incremental_inputs::report_comdat_group): New function.
5645 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5646 of data for incremental input file entry.
5647 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5648 group count, COMDAT group signatures.
5649 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5650 an unchanged input file.
5651 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5652 Initialize new data member.
5653 (Incremental_object_entry::add_comdat_group): New function.
5654 (Incremental_object_entry::get_comdat_group_count): New function.
5655 (Incremental_object_entry::get_comdat_signature_key): New function.
5656 (Incremental_object_entry::groups_): New data member.
5657 (Incremental_inputs::report_comdat_group): New function.
5658 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5659 data for incremental input file entry.
5660 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5661 (Incremental_input_entry_reader::get_input_section): Adjust size of
5662 data for incremental input file entry.
5663 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5664 (Incremental_input_entry_reader::get_comdat_group_signature): New
5665 function.
5666 * object.cc (Sized_relobj::include_section_group): Report kept
5667 COMDAT groups for incremental links.
5668
1706a06f
ILT
56692011-05-24 David Meyer <pdox@google.com>
5670
5671 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5672 with name parameter. Add found_name parameter.
5673 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5674 * dirsearch.h (class Dirsearch): Update declaration.
5675
a10ae760
ILT
56762011-05-24 Ian Lance Taylor <iant@google.com>
5677
5678 * archive.cc (Library_base::should_include_member): Pull in object
5679 from archive if it defines the entry symbol.
5680 * parameters.cc (Parameters::entry): New function.
5681 * parameters.h (class Parameters): Declare entry.
5682 * output.h (class Output_file_header): Remove entry_ field.
5683 * output.cc (Output_file_header::Output_file_header): Remove entry
5684 parameter. Change all callers.
5685 (Output_file_header::entry): Use parameters->entry.
5686 * gold.cc (queue_middle_tasks): Likewise.
5687 * plugin.cc (Plugin_hook::run): Likewise.
5688
aa92d6ed
CC
56892011-05-24 Cary Coutant <ccoutant@google.com>
5690
5691 * gold.cc (queue_initial_tasks): Pass incremental base filename
5692 to Output_file::open_base_file; don't print error message.
5693 * incremental-dump.cc (main): Adjust call to
5694 Output_file::open_for_modification.
5695 * incremental-dump.cc (main): Likewise.
5696 * incremental.cc (Incremental_inputs::report_command_line):
5697 Ignore --incremental-base option when comparing command lines.
5698 Ignore parameter when given as separate argument.
5699 * options.h (class General_options): Add --incremental-base.
5700 * output.cc (Output_file::Output_file):
5701 (Output_file::open_base_file): Add base_name and writable parameters;
5702 read base file into new file; print error message here.
5703 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5704 callers.
5705 * output.h (Output_file::open_for_modification): Rename to...
5706 (Output_file::open_base_file): ...this; add base_name and
5707 writable parameters; adjust all callers.
5708 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5709 callers.
5710 * testsuite/Makefile.am (incremental_test_4): Test
5711 --incremental-base.
5712 * testsuite/Makefile.in: Regenerate.
5713
2eedd706
CC
57142011-05-24 Cary Coutant <ccoutant@google.com>
5715
5716 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5717 incremental_test_4.
5718 * testsuite/Makefile.in: Regenerate.
5719 * testsuite/two_file_test_1_v1.cc: New test source file.
5720 * testsuite/two_file_test_1b_v1.cc: New test source file.
5721 * testsuite/two_file_test_2_v1.cc: New test source file.
5722
0f1c85a6
CC
57232011-05-24 Cary Coutant <ccoutant@google.com>
5724
5725 * dynobj.h (Dynobj::do_dynobj): New function.
5726 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5727 flag and soname for shared objects.
5728 * incremental.cc (Incremental_inputs::report_object): Make
5729 either Incremental_object_entry or Incremental_dynobj_entry; add
5730 soname to string table.
5731 (Incremental_inputs::report_input_section): Add assertion.
5732 (Output_section_incremental_inputs::set_final_data_size): Adjust
5733 type of input file entry for shared libraries; adjust size of
5734 shared library info entry.
5735 (Output_section_incremental_inputs::write_input_files): Write
5736 as_needed flag for shared libraries.
5737 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5738 of input file entry for shared libraries; write soname.
5739 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5740 soname from incremental info.
5741 * incremental.h (enum Incremental_input_flags): Add
5742 INCREMENTAL_INPUT_AS_NEEDED.
5743 (Incremental_input_entry::Incremental_input_entry): Initialize new
5744 data member.
5745 (Incremental_input_entry::set_as_needed): New function.
5746 (Incremental_input_entry::as_needed): New function.
5747 (Incremental_input_entry::do_dynobj_entry): New function.
5748 (Incremental_input_entry::as_needed_): New data member.
5749 (Incremental_object_entry::Incremental_object_entry): Don't check
5750 for shared library.
5751 (Incremental_object_entry::do_type): Likewise.
5752 (class Incremental_dynobj_entry): New class.
5753 (Incremental_input_entry_reader::as_needed): New function.
5754 (Incremental_input_entry_reader::get_soname): New function.
5755 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5756 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5757 size of shared library info entry.
58797674 5758 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
5759 incremental link when adding DT_NEEDED entries.
5760 * object.h (Object::Object): Initialize new data member.
5761 (Object::dynobj): New function.
5762 (Object::set_as_needed): New function.
5763 (Object::as_needed): New function.
5764 (Object::do_dynobj): New function.
5765 (Object::as_needed_): New data member.
5766
6fa2a40b
CC
57672011-05-24 Cary Coutant <ccoutant@google.com>
5768
5769 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5770 info; adjust display of GOT entries.
5771 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5772 vector of input objects; remove file_status_.
5773 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5774 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5775 got_plt reader; call target hooks to reserve GOT entries.
5776 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5777 of input file info header and GOT info entry.
5778 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5779 relocation info.
5780 (Got_plt_view_info::got_descriptor): Remove.
5781 (Got_plt_view_info::sym_index): New data member.
5782 (Got_plt_view_info::input_index): New data member.
5783 (Local_got_offset_visitor::visit): Write input file index.
5784 (Global_got_offset_visitor::visit): Write 0 for input file index.
5785 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5786 with sym_index and input_index.
5787 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5788 incremental info GOT entry; replace got_descriptor with input_index.
5789 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5790 map from input file index to object.
5791 (Sized_relobj_incr::do_layout): Replace direct data member reference
5792 with accessor function.
5793 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5794 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5795 Adjust size of input file info header.
5796 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5797 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5798 (Incremental_input_entry_reader::get_input_section): Adjust size of
5799 input file info header.
5800 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5801 of incremental info GOT entry.
5802 (Incremental_got_plt_reader::get_got_desc): Remove.
5803 (Incremental_got_plt_reader::get_got_symndx): New function.
5804 (Incremental_got_plt_reader::get_got_input_index): New function.
5805 (Sized_incremental_binary::Sized_incremental_binary): Remove
5806 file_status_; add input_objects_.
5807 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5808 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5809 (Sized_incremental_binary::file_is_unchanged): Remove.
5810 (Sized_incremental_binary::set_input_object): New function.
5811 (Sized_incremental_binary::input_object): New function.
5812 (Sized_incremental_binary::file_status_): Remove.
5813 (Sized_incremental_binary::input_objects_): New data member.
5814 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5815 references.
5816 (Sized_relobj_incr::invalid_address): Move to base class.
5817 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5818 class.
5819 (Sized_relobj_incr::do_output_section_offset): Likewise.
5820 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5821 (Sized_relobj_incr::section_offsets_): Likewise.
5822 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5823 function.
5824 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5825 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5826 with accessor function.
5827 (Sized_relobj_file::do_layout): Likewise.
5828 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5829 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5830 (Sized_relobj_file::compute_final_local_value): Replace refs to
5831 section_offsets_ with accessor function.
5832 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5833 * object.h (Relobj::Relobj): Initialize new data members.
5834 (Relobj::add_dyn_reloc): New function.
5835 (Relobj::first_dyn_reloc): New function.
5836 (Relobj::dyn_reloc_count): New function.
5837 (Relobj::first_dyn_reloc_): New data member.
5838 (Relobj::dyn_reloc_count_): New data member.
5839 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5840 references.
5841 (Sized_relobj::Address): New typedef.
5842 (Sized_relobj::invalid_address): Move here from child class.
5843 (Sized_relobj::Sized_relobj): Initialize new data members.
5844 (Sized_relobj::sized_relobj): New function.
5845 (Sized_relobj::is_output_section_offset_invalid): Move here from
5846 child class.
5847 (Sized_relobj::get_output_section_offset): Likewise.
5848 (Sized_relobj::local_has_got_offset): Likewise.
5849 (Sized_relobj::local_got_offset): Likewise.
5850 (Sized_relobj::set_local_got_offset): Likewise.
5851 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5852 (Sized_relobj::clear_got_offsets): New function.
5853 (Sized_relobj::section_offsets): Move here from child class.
5854 (Sized_relobj::do_output_section_offset): Likewise.
5855 (Sized_relobj::do_set_section_offset): Likewise.
5856 (Sized_relobj::Local_got_offsets): Likewise.
5857 (Sized_relobj::local_got_offsets_): Likewise.
5858 (Sized_relobj::section_offsets_): Likewise.
5859 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5860 references.
5861 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5862 class.
5863 (Sized_relobj_file::sized_relobj): New function
5864 (Sized_relobj_file::local_has_got_offset): Move to base class.
5865 (Sized_relobj_file::local_got_offset): Likewise.
5866 (Sized_relobj_file::set_local_got_offset): Likewise.
5867 (Sized_relobj_file::get_output_section_offset): Likewise.
5868 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5869 (Sized_relobj_file::do_output_section_offset): Likewise.
5870 (Sized_relobj_file::do_set_section_offset): Likewise.
5871 (Sized_relobj_file::Local_got_offsets): Likewise.
5872 (Sized_relobj_file::local_got_offsets_): Likewise.
5873 (Sized_relobj_file::section_offsets_): Likewise.
5874 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5875 (all constructors).
5876 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5877 (Output_reloc::get_symbol_index): Likewise.
5878 (Output_reloc::local_section_offset): Likewise.
5879 (Output_reloc::get_address): Likewise.
5880 (Output_reloc::symbol_value): Likewise.
5881 (Output_data_got::reserve_slot): Move to class definition.
5882 (Output_data_got::reserve_local): New function.
5883 (Output_data_got::reserve_slot_for_global): Remove.
5884 (Output_data_got::reserve_global): New function.
5885 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5886 (all constructors, two instantiations).
5887 (Output_reloc::get_relobj): New function (two instantiations).
5888 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5889 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5890 (Output_data_reloc::add_global): Adjust type of relobj.
5891 (Output_data_reloc::add_global_relative): Likewise.
5892 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5893 (Output_data_reloc::add_local): Likewise.
5894 (Output_data_reloc::add_local_relative): Likewise.
5895 (Output_data_reloc::add_symbolless_local_addend): Likewise.
5896 (Output_data_reloc::add_local_section): Likewise.
5897 (Output_data_reloc::add_output_section): Likewise.
5898 (Output_data_reloc::add_absolute): Likewise.
5899 (Output_data_reloc::add_target_specific): Likewise.
5900 (Output_data_got::reserve_slot): Move definition here.
5901 (Output_data_got::reserve_local): New function.
5902 (Output_data_got::reserve_global): New function.
5903 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
5904 section_offsets_ with accessor function.
5905 (Sized_relobj_file::write_sections): Likewise.
5906 (Sized_relobj_file::do_relocate_sections): Likewise.
5907 * target.h (Sized_target::reserve_local_got_entry): New function.
5908 (Sized_target::reserve_global_got_entry): New function.
5909 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
5910 (Target_x86_64::reserve_global_got_entry): New function.
5911 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
5912
4829d394
CC
59132011-05-23 Cary Coutant <ccoutant@google.com>
5914
5915 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
5916 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
5917 bit when checking got_type.
5918 * incremental.cc (Sized_incremental_binary::setup_readers):
5919 Store symbol table and string table locations; initialize bit vector
5920 of file status flags.
5921 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
5922 unchanged files.
5923 (Sized_incremental_binary::do_process_got_plt): New function.
5924 (Sized_incremental_binary::get_symtab_view): Use stored locations.
5925 (Output_section_incremental_inputs::set_final_data_size): Record
5926 file index for each input file.
5927 (Output_section_incremental_inputs::write_got_plt): Store file index
5928 instead of input entry offset for each GOT entry.
5929 * incremental.h
5930 (Incremental_input_entry::Incremental_input_entry): Initialize new
5931 data member.
5932 (Incremental_input_entry::set_offset): Store file index.
5933 (Incremental_input_entry::get_file_index): New function.
5934 (Incremental_input_entry::file_index_): New data member.
5935 (Incremental_binary::process_got_plt): New function.
5936 (Incremental_binary::do_process_got_plt): New function.
5937 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5938 data members.
5939 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
5940 (Sized_incremental_binary::set_file_is_unchanged): New function.
5941 (Sized_incremental_binary::file_is_unchanged): New function.
5942 (Sized_incremental_binary::do_process_got_plt): New function.
5943 (Sized_incremental_binary::file_status_): New data member.
5944 (Sized_incremental_binary::main_symtab_loc_): New data member.
5945 (Sized_incremental_binary::main_strtab_loc_): New data member.
5946 * output.cc (Output_data_got::Got_entry::write): Add case
5947 RESERVED_CODE.
5948 (Output_data_got::add_global): Call add_got_entry.
5949 (Output_data_got::add_global_plt): Likewise.
5950 (Output_data_got::add_global_with_rel): Likewise.
5951 (Output_data_got::add_global_with_rela): Likewise.
5952 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
5953 (Output_data_got::add_global_pair_with_rela): Likewise.
5954 (Output_data_got::add_local): Call add_got_entry.
5955 (Output_data_got::add_local_plt): Likewise.
5956 (Output_data_got::add_local_with_rel): Likewise.
5957 (Output_data_got::add_local_with_rela): Likewise.
5958 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
5959 (Output_data_got::add_local_pair_with_rela): Likewise.
5960 (Output_data_got::reserve_slot): New function.
5961 (Output_data_got::reserve_slot_for_global): New function.
5962 (Output_data_got::add_got_entry): New function.
5963 (Output_data_got::add_got_entry_pair): New function.
5964 (Output_section::add_output_section_data): Edit FIXME.
5965 * output.h
5966 (Output_section_data_build::Output_section_data_build): New
5967 constructor with size parameter.
5968 (Output_data_space::Output_data_space): Likewise.
5969 (Output_data_got::Output_data_got): Initialize new data member; new
5970 constructor with size parameter.
5971 (Output_data_got::add_constant): Call add_got_entry.
5972 (Output_data_got::reserve_slot): New function.
5973 (Output_data_got::reserve_slot_for_global): New function.
5974 (class Output_data_got::Got_entry): Add RESERVED_CODE.
5975 (Output_data_got::add_got_entry): New function.
5976 (Output_data_got::add_got_entry_pair): New function.
5977 (Output_data_got::free_list_): New data member.
5978 * target.h (Sized_target::init_got_plt_for_update): New function.
5979 (Sized_target::register_global_plt_entry): New function.
5980 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5981 Initialize new data member; call init; add constructor with PLT count.
5982 (Output_data_plt_x86_64::init): New function.
5983 (Output_data_plt_x86_64::add_relocation): New function.
5984 (Output_data_plt_x86_64::reserve_slot): New function.
5985 (Output_data_plt_x86_64::free_list_): New data member.
5986 (Target_x86_64::init_got_plt_for_update): New function.
5987 (Target_x86_64::register_global_plt_entry): New function.
5988 (Output_data_plt_x86_64::add_entry): Allocate from free list for
5989 incremental updates.
5990 (Output_data_plt_x86_64::add_relocation): New function.
5991 * testsuite/object_unittest.cc (Object_test): Set default options.
5992
ec69d6da
ILT
59932011-05-16 Ian Lance Taylor <iant@google.com>
5994
5995 * options.h (class General_options): Make -i a synonym for -r.
5996
732e31de
ILT
59972011-05-16 Ian Lance Taylor <iant@google.com>
5998
5999 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6000
403676b5
CC
60012011-05-10 Cary Coutant <ccoutant@google.com>
6002
6003 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6004 strip_all (-s).
6005
5b7b7d6e
ILT
60062011-05-06 Ian Lance Taylor <iant@google.com>
6007
6008 * layout.cc (Layout::layout): If the output section flags change,
6009 update the ordering.
6010
f0f9babf
CC
60112011-04-25 Cary Coutant <ccoutant@google.com>
6012
6013 * incremental-dump.cc (dump_incremental_inputs): Print local
6014 symbol info for each input file.
6015 * incremental.cc
6016 (Output_section_incremental_inputs::set_final_data_size): Add local
6017 symbol info to input file entries in incremental info.
6018 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6019 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6020 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6021 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6022 implementation.
6023 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6024 (Sized_incr_relobj::do_relocate): Write the local symbols.
6025 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6026 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6027 Adjust size of input file header.
6028 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6029 (Incremental_inputs_reader::get_local_symbol_count): New function.
6030 (Incremental_inputs_reader::get_input_section): Adjust size of input
6031 file header.
6032 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6033 (Sized_incr_relobj::This): New typedef.
6034 (Sized_incr_relobj::sym_size): New const data member.
6035 (Sized_incr_relobj::Local_symbol): New struct.
6036 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6037 (Sized_incr_relobj::do_local_symbol_offset): New function.
6038 (Sized_incr_relobj::local_symbol_count_): New data member.
6039 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6040 (Sized_incr_relobj::local_symbol_index_): New data member.
6041 (Sized_incr_relobj::local_symbol_offset_): New data member.
6042 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6043 (Sized_incr_relobj::local_symbols_): New data member.
6044 * object.h (Relobj::output_local_symbol_count): New function.
6045 (Relobj::local_symbol_offset): New function.
6046 (Relobj::do_output_local_symbol_count): New function.
6047 (Relobj::do_local_symbol_offset): New function.
6048 (Sized_relobj::do_output_local_symbol_count): New function.
6049 (Sized_relobj::do_local_symbol_offset): New function.
6050
d0a9ace3
ILT
60512011-04-22 Vladimir Simonov <sv@sw.ru>
6052
6053 * descriptors.cc (set_close_on_exec): New function.
6054 (Descriptors::open): Use set_close_on_exec.
6055 * output.cc (S_ISLNK): Define if not defined.
6056
94a3fc8b
CC
60572011-04-22 Cary Coutant <ccoutant@google.com>
6058
6059 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6060 global symbol map.
6061 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6062 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6063 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6064 relocations.
6065 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6066 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6067 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6068 * incremental.h
6069 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6070 function.
6071 (Incremental_binary::apply_incremental_relocs): New function.
6072 (Incremental_binary::do_apply_incremental_relocs): New function.
6073 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6074 data member.
6075 (Sized_incremental_binary::add_global_symbol): New function.
6076 (Sized_incremental_binary::global_symbol): New function.
6077 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6078 (Sized_incremental_binary::symbol_map_): New data member.
6079 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6080 * target.h (Sized_target::apply_relocation): New function.
6081 * target-reloc.h (apply_relocation): New function.
6082 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6083
c87e4302
DK
60842011-04-22 Doug Kwan <dougkwan@google.com>
6085
6086 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6087 flag of a SHT_ARM_EXIDX section.
2e702c99 6088 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
6089 * testsuite/Makefile.in: Regenerate.
6090 * testsuite/arm_exidx_test.s: New file.
6091 * testsuite/arm_exidx_test.sh: Same.
6092
e7782cf6
CC
60932011-04-20 Cary Coutant <ccoutant@google.com>
6094
6095 PR gold/12689
6096 * archive.h (Incremental_archive_entry::Archive_member):
6097 Initialize arg_serial_ (second constructor).
6098
308ecdc7
ILT
60992011-04-17 Ian Lance Taylor <iant@google.com>
6100
6101 * object.cc (Relocate_info::location): Simplify location string.
6102 * errors.cc (Errors::error_at_location): Don't print program
6103 name.
6104 (Errors::warning_at_location): Likewise.
6105 (Errors::undefined_symbol): Likewise.
6106 * testsuite/debug_msg.sh: Update accordingly.
6107
bec5b579
CC
61082011-04-14 Cary Coutant <ccoutant@google.com>
6109
6110 * gold/layout.cc (Layout::symtab_section_offset): New function.
6111 * gold/layout.h (Layout::symtab_section_offset): New function.
6112 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6113
88597d34
ILT
61142011-04-12 Ian Lance Taylor <iant@google.com>
6115
6116 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6117 with MREMAP_MAYMOVE.
6118 * output.h (class Output_file): Add map_is_allocated_ field.
6119 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6120 not available, provide stubs. If mremap is not available, #define
6121 it to gold_mremap.
6122 (MREMAP_MAYMOVE): Define if not defined.
6123 (Output_file::Output_file): Initialize map_is_allocated_.
6124 (Output_file::resize): Check map_is_allocated_.
6125 (Output_file::map_anonymous): If mmap fails, use malloc.
6126 (Output_file::unmap): Don't do anything for an anonymous map.
6127 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6128 is not available, provide stubs.
6129 (File_read::View::~View): Use free rather than delete[].
6130 (File_read::make_view): Use malloc rather than new[]. If mmap
6131 fails, use malloc.
6132 (File_read::find_or_make_view): Use malloc rather than new[].
6133 * gold.h: Remove HAVE_REMAP code.
6134 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6135 exists. Rename mremap to gold_mremap. If mmap is not available
6136 don't do anything.
6137 * configure, config.in: Rebuild.
6138
11e361bc
ILT
61392011-04-11 Ian Lance Taylor <iant@google.com>
6140
6141 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6142 initialize local variable v.
6143
cdc29364
CC
61442011-04-11 Cary Coutant <ccoutant@google.com>
6145
6146 * archive.cc (Archive::include_member): Adjust call to
6147 report_object.
6148 (Add_archive_symbols::run): Track argument serial numbers.
6149 (Lib_group::include_member): Likewise.
6150 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6151 * archive.h (Incremental_archive_entry::Archive_member):
6152 Initialize arg_serial_.
6153 (Archive_member::arg_serial_): New data member.
6154 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6155 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6156 incremental link.
6157 (Sized_dynobj::do_for_all_local_got_entries): New function.
6158 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6159 function.
6160 * fileread.cc (get_mtime): New function.
6161 * fileread.h (get_mtime): New function.
6162 * gold.cc (queue_initial_tasks): Check for incremental update.
6163 (process_incremental_input): New function.
6164 (queue_middle_tasks): Don't force valid target for incremental
6165 update.
6166 * incremental-dump.cc (find_input_containing_global): Adjust
6167 size of symbol info entry.
6168 (dump_incremental_inputs): Dump argument serial number and
6169 in_system_directory flag; bias shndx by 1; print symbol names
6170 when dumping per-file symbol lists; use new symbol info readers.
6171 * incremental.cc
6172 (Output_section_incremental_inputs:update_data_size): New function.
6173 (Sized_incremental_binary::setup_readers): Setup input readers
6174 for each input file; build maps for files added from libraries
6175 and scripts.
6176 (Sized_incremental_binary::check_input_args): New function.
6177 (Sized_incremental_binary::do_check_inputs): Build map of argument
6178 serial numbers to input arguments.
6179 (Sized_incremental_binary::do_file_has_changed): Rename
6180 do_file_is_unchanged to this; compare file modification times.
6181 (Sized_incremental_binary::do_init_layout): New function.
6182 (Sized_incremental_binary::do_reserve_layout): New function.
6183 (Sized_incremental_binary::do_get_input_reader): Remove.
6184 (Sized_incremental_binary::get_symtab_view): New function.
6185 (Incremental_checker::can_incrementally_link_output_file): Remove.
6186 (Incremental_inputs::report_command_line): Exclude --debug options.
6187 (Incremental_inputs::report_archive_begin): Add parameter; track
6188 argument serial numbers; don't put input file entry for archive
6189 before archive members.
6190 (Incremental_inputs::report_archive_end): Put input file entry
6191 for archive after archive members.
6192 (Incremental_inputs::report_object): Add parameter; track argument
6193 serial numbers and in_system_directory flag.
6194 (Incremental_inputs::report_script): Add parameter; track argument
6195 serial numbers.
6196 (Output_section_incremental_inputs::set_final_data_size): Adjust
6197 size of symbol info entry; check for forwarding symbols.
6198 (Output_section_incremental_inputs::write_input_files): Write
6199 in_system_directory flag and argument serial number.
6200 (Output_section_incremental_inputs::write_info_blocks): Map section
6201 indices between incremental info and original input file; store
6202 input section index for each symbol.
6203 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6204 change operator() to visit().
6205 (class Global_got_offset_visitor): Likewise.
6206 (class Global_symbol_visitor_got_plt):
6207 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6208 classes.
6209 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6210 (Sized_incr_relobj::do_read_symbols): New function.
6211 (Sized_incr_relobj::do_layout): New function.
6212 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6213 (Sized_incr_relobj::do_add_symbols): New function.
6214 (Sized_incr_relobj::do_should_include_member): New function.
6215 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6216 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6217 (Sized_incr_relobj::do_section_size): New function.
6218 (Sized_incr_relobj::do_section_name): New function.
6219 (Sized_incr_relobj::do_section_contents): New function.
6220 (Sized_incr_relobj::do_section_flags): New function.
6221 (Sized_incr_relobj::do_section_entsize): New function.
6222 (Sized_incr_relobj::do_section_address): New function.
6223 (Sized_incr_relobj::do_section_type): New function.
6224 (Sized_incr_relobj::do_section_link): New function.
6225 (Sized_incr_relobj::do_section_info): New function.
6226 (Sized_incr_relobj::do_section_addralign): New function.
6227 (Sized_incr_relobj::do_initialize_xindex): New function.
6228 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6229 (Sized_incr_relobj::do_read_relocs): New function.
6230 (Sized_incr_relobj::do_gc_process_relocs): New function.
6231 (Sized_incr_relobj::do_scan_relocs): New function.
6232 (Sized_incr_relobj::do_count_local_symbols): New function.
6233 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6234 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6235 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6236 (Sized_incr_relobj::do_relocate): New function.
6237 (Sized_incr_relobj::do_set_section_offset): New function.
6238 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6239 (Sized_incr_dynobj::do_read_symbols): New function.
6240 (Sized_incr_dynobj::do_layout): New function.
6241 (Sized_incr_dynobj::do_add_symbols): New function.
6242 (Sized_incr_dynobj::do_should_include_member): New function.
6243 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6244 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6245 (Sized_incr_dynobj::do_section_size): New function.
6246 (Sized_incr_dynobj::do_section_name): New function.
6247 (Sized_incr_dynobj::do_section_contents): New function.
6248 (Sized_incr_dynobj::do_section_flags): New function.
6249 (Sized_incr_dynobj::do_section_entsize): New function.
6250 (Sized_incr_dynobj::do_section_address): New function.
6251 (Sized_incr_dynobj::do_section_type): New function.
6252 (Sized_incr_dynobj::do_section_link): New function.
6253 (Sized_incr_dynobj::do_section_info): New function.
6254 (Sized_incr_dynobj::do_section_addralign): New function.
6255 (Sized_incr_dynobj::do_initialize_xindex): New function.
6256 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6257 (make_sized_incremental_object): New function.
6258 (Incremental_library::copy_unused_symbols): New function.
6259 (Incremental_library::do_for_all_unused_symbols): New function.
6260 * incremental.h (enum Incremental_input_flags): New type.
6261 (class Incremental_checker): Remove.
6262 (Incremental_input_entry::Incremental_input_entry): Add argument
6263 serial number.
6264 (Incremental_input_entry::arg_serial): New function.
6265 (Incremental_input_entry::set_is_in_system_directory): New function.
6266 (Incremental_input_entry::is_in_system_directory): New function.
6267 (Incremental_input_entry::arg_serial_): New data member.
6268 (Incremental_input_entry::is_in_system_directory_): New data member.
6269 (class Script_info): Move here from script.h.
6270 (Script_info::Script_info): Add filename parameter.
6271 (Script_info::filename): New function.
6272 (Script_info::filename_): New data member.
6273 (Incremental_script_entry::Incremental_script_entry): Add argument
6274 serial number.
6275 (Incremental_object_entry::Incremental_object_entry): Likewise.
6276 (Incremental_object_entry::add_input_section): Build list of input
6277 sections with map to original shndx.
6278 (Incremental_object_entry::get_input_section_index): New function.
6279 (Incremental_object_entry::shndx_): New data member.
6280 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6281 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6282 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6283 serial number.
6284 (Incremental_inputs::report_archive_begin): Likewise.
6285 (Incremental_inputs::report_object): Likewise.
6286 (Incremental_inputs::report_script): Likewise.
6287 (class Incremental_global_symbol_reader): New class.
6288 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6289 and store flags and input file type.
6290 (Incremental_input_entry_reader::arg_serial): New function.
6291 (Incremental_input_entry_reader::type): Extract type from flags.
6292 (Incremental_input_entry_reader::is_in_system_directory): New function.
6293 (Incremental_input_entry_reader::get_input_section_count): Call
6294 accessor function for type.
6295 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6296 function for type; adjust size of global symbol entry.
6297 (Incremental_input_entry_reader::get_global_symbol_count): Call
6298 accessor function for type.
6299 (Incremental_input_entry_reader::get_object_count): Likewise.
6300 (Incremental_input_entry_reader::get_object_offset): Likewise.
6301 (Incremental_input_entry_reader::get_member_count): Likewise.
6302 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6303 (Incremental_input_entry_reader::get_member_offset): Likewise.
6304 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6305 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6306 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6307 (Incremental_input_entry_reader::get_global_symbol_reader): New
6308 function.
6309 (Incremental_input_entry_reader::get_output_symbol_index): New
6310 function.
6311 (Incremental_input_entry_reader::type_): Remove.
6312 (Incremental_input_entry_reader::flags_): New data member.
6313 (Incremental_inputs_reader::input_file_offset): New function.
6314 (Incremental_inputs_reader::input_file_index): New function.
6315 (Incremental_inputs_reader::input_file): Call input_file_offset.
6316 (Incremental_inputs_reader::input_file_at_offset): New function.
6317 (Incremental_relocs_reader::get_r_type): Reformat.
6318 (Incremental_relocs_reader::get_r_shndx): Reformat.
6319 (Incremental_relocs_reader::get_r_offset): Reformat.
6320 (Incremental_relocs_reader::data): New function.
6321 (Incremental_binary::Incremental_binary): Initialize new data members.
6322 (Incremental_binary::check_inputs): Add cmdline parameter.
6323 (Incremental_binary::file_is_unchanged): Remove.
6324 (Input_reader::arg_serial): New function.
6325 (Input_reader::get_unused_symbol_count): New function.
6326 (Input_reader::get_unused_symbol): New function.
6327 (Input_reader::do_arg_serial): New function.
6328 (Input_reader::do_get_unused_symbol_count): New function.
6329 (Input_reader::do_get_unused_symbol): New function.
6330 (Incremental_binary::input_file_count): New function.
6331 (Incremental_binary::get_input_reader): Change signature to use
6332 index instead of filename.
6333 (Incremental_binary::file_has_changed): New function.
6334 (Incremental_binary::get_input_argument): New function.
6335 (Incremental_binary::get_library): New function.
6336 (Incremental_binary::get_script_info): New function.
6337 (Incremental_binary::init_layout): New function.
6338 (Incremental_binary::reserve_layout): New function.
6339 (Incremental_binary::output_file): New function.
6340 (Incremental_binary::do_check_inputs): New function.
6341 (Incremental_binary::do_file_is_unchanged): Remove.
6342 (Incremental_binary::do_file_has_changed): New function.
6343 (Incremental_binary::do_init_layout): New function.
6344 (Incremental_binary::do_reserve_layout): New function.
6345 (Incremental_binary::do_input_file_count): New function.
6346 (Incremental_binary::do_get_input_reader): Change signature.
6347 (Incremental_binary::input_args_map_): New data member.
6348 (Incremental_binary::library_map_): New data member.
6349 (Incremental_binary::script_map_): New data member.
6350 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6351 new data members.
6352 (Sized_incremental_binary::output_section): New function.
6353 (Sized_incremental_binary::inputs_reader): Add const.
6354 (Sized_incremental_binary::symtab_reader): Add const.
6355 (Sized_incremental_binary::relocs_reader): Add const.
6356 (Sized_incremental_binary::got_plt_reader): Add const.
6357 (Sized_incremental_binary::get_symtab_view): New function.
6358 (Sized_incremental_binary::Inputs_reader): New typedef.
6359 (Sized_incremental_binary::Input_entry_reader): New typedef.
6360 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6361 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6362 (Sized_incremental_binary::do_file_has_changed): New function.
6363 (Sized_incremental_binary::do_init_layout): New function.
6364 (Sized_incremental_binary::do_reserve_layout): New function.
6365 (Sized_input_reader::Inputs_reader): Remove.
6366 (Sized_input_reader::Input_entry_reader): Remove.
6367 (Sized_input_reader::do_arg_serial): New function.
6368 (Sized_input_reader::do_get_unused_symbol_count): New function.
6369 (Sized_input_reader::do_get_unused_symbol): New function.
6370 (Sized_incremental_binary::do_input_file_count): New function.
6371 (Sized_incremental_binary::do_get_input_reader): Change signature;
6372 use index instead of filename.
6373 (Sized_incremental_binary::section_map_): New data member.
6374 (Sized_incremental_binary::input_entry_readers_): New data member.
6375 (class Sized_incr_relobj): New class.
6376 (class Sized_incr_dynobj): New class.
6377 (make_sized_incremental_object): New function.
6378 (class Incremental_library): New class.
6379 * layout.cc (Free_list::num_lists): New static data member.
6380 (Free_list::num_nodes): New static data member.
6381 (Free_list::num_removes): New static data member.
6382 (Free_list::num_remove_visits): New static data member.
6383 (Free_list::num_allocates): New static data member.
6384 (Free_list::num_allocate_visits): New static data member.
6385 (Free_list::init): New function.
6386 (Free_list::remove): New function.
6387 (Free_list::allocate): New function.
6388 (Free_list::dump): New function.
6389 (Free_list::print_stats): New function.
6390 (Layout_task_runner::run): Resize output file for incremental updates.
6391 (Layout::Layout): Initialize new data members.
6392 (Layout::set_incremental_base): New function.
6393 (Layout::init_fixed_output_section): New function.
6394 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6395 incremental updates.
6396 (Layout::create_gold_note): Do not create gold note section for
6397 incremental updates.
6398 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6399 for incremental updates.
6400 (Layout::set_section_offsets): For incremental updates, allocate space
6401 from free list.
6402 (Layout::create_symtab_sections): Layout with offsets relative to
6403 start of section; for incremental updates, allocate space from free
6404 list.
6405 (Layout::create_shdrs): For incremental updates, allocate space from
6406 free list.
6407 (Layout::finish_dynamic_section): For incremental updates, do not
6408 check --as-needed (fixed in subsequent patch).
6409 * layout.h (class Free_list): New class.
6410 (Layout::set_incremental_base): New function.
6411 (Layout::incremental_base): New function.
6412 (Layout::init_fixed_output_section): New function.
6413 (Layout::allocate): New function.
6414 (Layout::incremental_base_): New data member.
6415 (Layout::free_list_): New data member.
6416 * main.cc (main): Print Free_list statistics.
6417 * object.cc (Relobj::finalize_incremental_relocs): Add
6418 clear_counts parameter; clear counts only when clear_counts is set.
6419 (Sized_relobj::Sized_relobj): Initialize new base class.
6420 (Sized_relobj::do_layout): Don't report special sections.
6421 (Sized_relobj::do_for_all_local_got_entries): New function.
6422 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6423 symtab_off to all symbol table offsets.
6424 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6425 * object.h (class Got_offset_list): Move to top of file.
6426 (Object::Object): Allow case where input_file == NULL.
6427 (Object::~Object): Likewise.
6428 (Object::input_file): Assert that input_file != NULL.
6429 (Object::lock): Allow case where input_file == NULL.
6430 (Object::unlock): Likewise.
6431 (Object::is_locked): Likewise.
6432 (Object::token): Likewise.
6433 (Object::release): Likewise.
6434 (Object::is_incremental): New function.
6435 (Object::get_mtime): New function.
6436 (Object::for_all_local_got_entries): New function.
6437 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6438 (Object::set_is_in_system_directory): New function.
6439 (Object::is_in_system_directory): New function.
6440 (Object::do_is_incremental): New function.
6441 (Object::do_get_mtime): New function.
6442 (Object::do_for_all_local_got_entries): New function.
6443 (Object::is_in_system_directory_): New data member.
6444 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6445 (class Sized_relobj_base): New class.
6446 (class Sized_relobj): Derive from Sized_relobj_base.
6447 (class Sized_relobj::Symbols): Redeclare from base class.
6448 (class Sized_relobj::local_got_offset_list): Remove.
6449 (class Sized_relobj::Output_sections): Redeclare from base class.
6450 (class Sized_relobj::do_for_all_local_got_entries): New function.
6451 (class Sized_relobj::write_local_symbols): Add offset parameter.
6452 (class Sized_relobj::local_symbol_offset_): Update comment.
6453 (class Sized_relobj::local_dynsym_offset_): Update comment.
6454 * options.cc (Input_arguments::add_file): Remove const.
6455 * options.h (Input_file_argument::Input_file_argument):
6456 Initialize arg_serial_ (all constructors).
6457 (Input_file_argument::set_arg_serial): New function.
6458 (Input_file_argument::arg_serial): New function.
6459 (Input_file_argument::arg_serial_): New data member.
6460 (Input_arguments::Input_arguments): Initialize file_count_.
6461 (Input_arguments::add_file): Remove const.
6462 (Input_arguments::number_of_input_files): New function.
6463 (Input_arguments::file_count_): New data member.
6464 (Command_line::number_of_input_files): Call
6465 Input_arguments::number_of_input_files.
6466 * output.cc (Output_segment_headers::Output_segment_headers):
6467 Set current size.
6468 (Output_section::Input_section::current_data_size): New function.
6469 (Output_section::Output_section): Initialize new data members.
6470 (Output_section::add_input_section): Don't do merge sections for
6471 an incremental link; allocate space from free list for an
6472 incremental update.
6473 (Output_section::add_output_section_data): Allocate space from
6474 free list for an incremental update.
6475 (Output_section::update_data_size): New function.
6476 (Output_section::set_fixed_layout): New function.
6477 (Output_section::reserve): New function.
6478 (Output_segment::set_section_addresses): Remove const.
6479 (Output_segment::set_section_list_addresses): Remove const; allocate
6480 space from free list for an incremental update.
6481 (Output_segment::set_offset): Adjust size of RELRO segment for an
6482 incremental update.
6483 * output.h (Output_data::current_data_size): Move here from
6484 child classes.
6485 (Output_data::pre_finalize_data_size): New function.
6486 (Output_data::update_data_size): New function.
6487 (Output_section_headers::update_data_size): new function.
6488 (Output_section_data_build::current_data_size): Move to Output_data.
6489 (Output_data_strtab::update_data_size): New function.
6490 (Output_section::current_data_size): Move to Output_data.
6491 (Output_section::set_fixed_layout): New function.
6492 (Output_section::has_fixed_layout): New function.
6493 (Output_section::reserve): New function.
6494 (Output_section::update_data_size): New function.
6495 (Output_section::has_fixed_layout_): New data member.
6496 (Output_section::free_list_): New data member.
6497 (Output_segment::set_section_addresses): Remove const.
6498 (Output_segment::set_section_list_addresses): Remove const.
6499 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6500 New function.
6501 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6502 New function.
6503 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6504 parameter when calling Add_symbols constructor; store argument
6505 serial number for members of a lib group.
6506 (Add_symbols::locks): Allow case where token == NULL.
6507 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6508 (Read_member::~Read_member): New function.
6509 (Read_member::is_runnable): New function.
6510 (Read_member::locks): New function.
6511 (Read_member::run): New function.
6512 (Check_script::~Check_script): New function.
6513 (Check_script::is_runnable): New function.
6514 (Check_script::locks): New function.
6515 (Check_script::run): New function.
6516 (Check_library::~Check_library): New function.
6517 (Check_library::is_runnable): New function.
6518 (Check_library::locks): New function.
6519 (Check_library::run): New function.
6520 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6521 (Add_symbols::library_): New data member.
6522 (class Read_member): New class.
6523 (class Check_script): New class.
6524 (class Check_library): New class.
6525 * reloc.cc (Read_relocs::is_runnable): Allow case where
6526 token == NULL.
6527 (Read_relocs::locks): Likewise.
6528 (Scan_relocs::locks): Likewise.
6529 (Relocate_task::locks): Likewise.
6530 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6531 to clear counters.
6532 (Sized_relobj::incremental_relocs_scan): Fix comment.
6533 (Sized_relobj::do_relocate): Pass output file offset to
6534 write_local_symbols.
6535 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6536 from class declaration.
6537 * script.cc (read_input_script): Allocate Script_info; pass
6538 argument serial number to report_script.
6539 * script.h (class Script_info): Move to incremental.h.
6540 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6541 * symtab.h (Symbol_table::add_from_incrobj): New function.
6542 (Symbol_table::set_file_offset): New function.
6543
b961d0d7
CC
65442011-04-05 Cary Coutant <ccoutant@google.com>
6545
6546 * incremental-dump.cc (dump_incremental_inputs): Change signature
6547 to take a Sized_incremental_binary; change caller. Use readers
6548 in Sized_incremental_binary.
6549 * incremental.cc
6550 (Sized_incremental_binary::find_incremental_inputs_sections):
6551 Rename do_find_incremental_inputs_sections to this.
6552 (Sized_incremental_binary::setup_readers): New function.
6553 (Sized_incremental_binary::do_check_inputs): Check
6554 has_incremental_info_ flag; move setup code to setup_readers;
6555 use input readers.
6556 (Sized_incremental_binary::do_file_is_unchanged): New function.
6557 (Sized_incremental_binary::do_get_input_reader): New function.
6558 * incremental.h (class Incremental_binary): Move to end of file.
6559 (Incremental_binary::file_is_unchanged): New function.
6560 (Incremental_binary::do_file_is_unchanged): New function.
6561 (Incremental_binary::Input_reader): New class.
6562 (Incremental_binary::get_input_reader): New function.
6563 (class Sized_incremental_binary): Move to end of file.
6564 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6565 input section reader classes.
6566 (Sized_incremental_binary::has_incremental_info): New function.
6567 (Sized_incremental_binary::inputs_reader): New function.
6568 (Sized_incremental_binary::symtab_reader): New function.
6569 (Sized_incremental_binary::relocs_reader): New function.
6570 (Sized_incremental_binary::got_plt_reader): New function.
6571 (Sized_incremental_binary::do_file_is_unchanged): New function.
6572 (Sized_incremental_binary::Sized_input_reader): New class.
6573 (Sized_incremental_binary::get_input_reader): New function.
6574 (Sized_incremental_binary::find_incremental_inputs_sections):
6575 Rename do_find_incremental_inputs_sections to this.
6576 (Sized_incremental_binary::setup_readers): New function.
6577 (Sized_incremental_binary::has_incremental_info_): New data member.
6578 (Sized_incremental_binary::inputs_reader_): New data member.
6579 (Sized_incremental_binary::symtab_reader_): New data member.
6580 (Sized_incremental_binary::relocs_reader_): New data member.
6581 (Sized_incremental_binary::got_plt_reader_): New data member.
6582 (Sized_incremental_binary::current_input_file_): New data member.
6583
a869183f
PP
65842011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6585
6586 PR gold/12640
6587 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6588 violation.
6589
65902011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
6591
6592 * archive.cc (Archive::include_member): Adjust call to report_object.
6593 (Add_archive_symbols::run): Add script_info to call to
6594 report_archive_begin.
6595 (Lib_group::include_member): Adjust call to report_object.
6596 (Add_lib_group_symbols::run): Adjust call to report_object.
6597 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6598 blocks. Add object count for script input files.
6599 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6600 script_info parameter; change all callers.
6601 (Incremental_inputs::report_object): Add script_info parameter;
6602 change all callers.
6603 (Incremental_inputs::report_script): Store backpointer to
6604 incremental info entry.
6605 (Output_section_incremental_inputs::set_final_data_size): Record
6606 additional information for scripts.
6607 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6608 * incremental.h (Incremental_script_entry::add_object): New function.
6609 (Incremental_script_entry::get_object_count): New function.
6610 (Incremental_script_entry::get_object): New function.
6611 (Incremental_script_entry::objects_): New data member; adjust
6612 constructor.
6613 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6614 (Incremental_inputs::report_object): Add script_info parameter.
6615 (Incremental_inputs_reader::get_object_count): New function.
6616 (Incremental_inputs_reader::get_object_offset): New function.
6617 * options.cc (Input_arguments::add_file): Return reference to
6618 new input argument.
6619 * options.h (Input_argument::set_script_info): New function.
6620 (Input_argument::script_info): New function.
6621 (Input_argument::script_info_): New data member; adjust all
6622 constructors.
6623 (Input_file_group::add_file): Return reference to new input argument.
6624 (Input_file_lib::add_file): Likewise.
6625 (Input_arguments::add_file): Likewise.
6626 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6627 * script.cc (Parser_closure::Parser_closure): Add script_info
6628 parameter; adjust all callers.
6629 (Parser_closure::script_info): New function.
6630 (Parser_closure::script_info_): New data member.
6631 (read_input_script): Report scripts earlier to incremental info.
6632 (script_add_file): Set script_info in Input_argument.
6633 (script_add_library): Likewise.
6634 * script.h (Script_options::Script_info): Rewrite class.
6635
a869183f 66362011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
6637
6638 * archive.cc (Library_base::should_include_member): Move
6639 method here from class Archive.
6640 (Archive::Archive): Initialize base class.
6641 (Archive::should_include_member): Move to base class.
6642 (Archive::do_for_all_unused_symbols): New function.
6643 (Add_archive_symbols::run): Remove redundant access to
6644 incremental_inputs.
6645 (Lib_group::Lib_group): Initialize base class.
6646 (Lib_group::do_filename): New function.
6647 (Lib_group::include_member): Pass pointer to Lib_group to
6648 report_object.
6649 (Lib_group::do_for_all_unused_symbols): New function.
6650 (Add_lib_group_symbols::run): Report archive information for
6651 incremental links.
6652 * archive.h (class Library_base): New base class.
6653 (class Archive): Derive from Library_base.
6654 (Archive::filename): Move to base class.
6655 (Archive::set_incremental_info): Likewise.
6656 (Archive::incremental_info): Likewise.
6657 (Archive::Should_include): Likewise.
6658 (Archive::should_include_member): Likewise.
6659 (Archive::Armap_entry): Remove.
6660 (Archive::Unused_symbol_iterator): Remove.
6661 (Archive::unused_symbols_begin): Remove.
6662 (Archive::unused_symbols_end): Remove.
6663 (Archive::do_filename): New function.
6664 (Archive::do_get_mtime): New function.
6665 (Archive::do_for_all_unused_symbols): New function.
6666 (Archive::task_): Move to base class.
6667 (Archive::incremental_info_): Likewise.
6668 (class Lib_group): Derive from Library_base.
6669 (Lib_group::do_filename): New function.
6670 (Lib_group::do_get_mtime): New function.
6671 (Lib_group::do_for_all_unused_symbols): New function.
6672 (Lib_group::task_): Move to base class.
6673 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6674 function.
6675 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6676 function.
6677 * incremental.cc (Incremental_inputs::report_archive_begin):
6678 Use Library_base; call library's get_mtime; add incremental inputs
6679 entry before members.
6680 (class Unused_symbol_visitor): New class.
6681 (Incremental_inputs::report_archive_end): Use Library_base; use
6682 visitor class to record unused symbols; don't add incremental inputs
6683 entry after members.
6684 (Incremental_inputs::report_object): Use Library_base.
6685 * incremental.h
6686 (Incremental_archive_entry::Incremental_archive_entry): Remove
6687 unused Archive parameter.
6688 (Incremental_inputs::report_archive_begin): Use Library_base.
6689 (Incremental_inputs::report_archive_end): Likewise.
6690 (Incremental_inputs::report_object): Likewise.
6691 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6692 function.
6693 * object.h (Object::for_all_global_symbols): New function.
6694 (Object::do_for_all_global_symbols): New function.
6695 (Sized_relobj::do_for_all_global_symbols): New function.
6696 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6697 function.
6698 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6699 function.
6700
61ab3e40
ILT
67012011-03-27 Ian Lance Taylor <iant@google.com>
6702
6703 * archive.cc (Archive::interpret_header): Return -1 if something
6704 goes wrong. Change callers accordingly.
6705
30e1f9e6
CC
67062011-03-25 Cary Coutant <ccoutant@google.com>
6707
6708 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6709 * testsuite/Makefile.in: Regenerate.
6710
9370ce59 67112011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
6712
6713 * plugin.cc (get_view): New.
6714 (Plugin::load): Pass get_view to the plugin.
6715 (Plugin_manager::get_view): New.
6716
9312bb0a
ILT
67172011-03-21 Ian Lance Taylor <iant@google.com>
6718
6719 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 6720 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 6721
7e12ba9e
ST
67222011-03-21 Sriraman Tallam <tmsriram@google.com>
6723
6724 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6725 Change == to -eq.
6726 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6727 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6728 Change == to -eq.
6729 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6730 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6731
fd7a005d
ILT
67322011-03-14 Ian Lance Taylor <iant@google.com>
6733
6734 * script-sections.cc (Sort_output_sections::script_compare):
6735 Rename from is_before, change return type.
6736 (Sort_output_sections::operator()): Adjust accordingly.
6737
ed16fd1b
ILT
67382011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6739
6740 PR gold/12572
6741 * testsuite/odr_violation2.cc: Add comment to make all error line
6742 numbers double digits.
6743 * testsuite/debug_msg.sh: Adjust expected errors.
6744
71ff8986
ILT
67452011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6746
6747 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6748 but mark earlier ones as non-canonical
6749 (offset_to_iterator): Update search target and example
6750 (do_addr2line): Return extra lines in a vector*
6751 (format_file_lineno): Extract from do_addr2line
6752 (one_addr2line): Add vector* out-param
6753 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6754 when a lineno entry appeared last for its instruction
6755 (Dwarf_line_info): Add vector* out-param
6756 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6757 * symtab.cc (Odr_violation_compare): Include the lineno in the
6758 comparison again.
6759 (linenos_from_loc): New. Combine the canonical line for an
6760 address with its other lines.
6761 (True_if_intersect): New. Helper functor to make
6762 std::set_intersection a query.
6763 (detect_odr_violations): Compare sets of lines instead of just
6764 one line for each function. This became less deterministic, but
6765 has fewer false positives.
6766 * symtab.h: Declarations.
6767 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6768 mix an optimized and non-optimized object in the same binary
6769 (odr_violation2.so): Same.
6770 * testsuite/Makefile.in: Regenerate from Makefile.am.
6771 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6772 * testsuite/debug_msg.sh: Update line numbers and add
6773 assertions.
6774 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6775 non-optimized context.
6776 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6777 isn't inlined, and use OdrDerived in an optimized context.
6778 * testsuite/odr_header1.h: Defines OdrDerived, where
6779 optimization will change the
6780 first-instruction-in-the-destructor's file and line number.
6781 * testsuite/odr_header2.h: Defines OdrBase.
6782
a19fefdc
ILT
67832011-03-09 Ian Lance Taylor <iant@google.com>
6784
6785 * fileread.cc (File_read::clear_views): Don't delete the whole
6786 file view.
6787
ecb351e9
ILT
67882011-03-08 Ian Lance Taylor <iant@google.com>
6789
6790 PR gold/12525
6791 * fileread.cc: #include <climits>.
6792 (GOLD_IOV_MAX): Define.
6793 (File_read::read_multiple): Limit number of entries by iov_max.
6794 * fileread.h (class File_read): Always set max_readv_entries to
6795 128.
6796
b821d13c
ILT
67972011-03-07 Ian Lance Taylor <iant@google.com>
6798
6799 PR gold/12525
6800 * options.h (class General_options): Add -dy and -dn.
6801
89243142
CC
68022011-03-02 Cary Coutant <ccoutant@google.com>
6803
6804 * testsuite/script_test_9.t: Add TLS segment.
6805
d0773f31
ILT
68062011-03-02 Simon Baldwin <simonb@google.com>
6807
6808 * configure.ac: Add check for gnu_indirect_function support in
6809 the toolchain building binutils.
6810 * configure: Rebuild.
6811
9370ce59 68122011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
6813
6814 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6815 plugin only symbols.
6816 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6817 in plugin files as not needed in the symbol table.
6818
4cf7a849
ST
68192011-02-11 Sriraman Tallam <tmsriram@google.com>
6820
6821 * output.cc (Output_section::add_input_section): Delay fill
6822 generation for section ordering.
6823
b578bd7d
ILT
68242011-02-09 Ian Lance Taylor <iant@google.com>
6825
6826 PR gold/12316
6827 * object.h (class Sized_relobj): Remove clear_local_symbols.
6828 * reloc.cc (Sized_relobj::do_relocate): Don't call
6829 clear_local_symbols.
6830
9370ce59 68312011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
6832
6833 * plugin.cc (is_visible_from_outside): Return true for symbols
6834 in the -u option.
6835
55382fb7
ILT
68362011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6837
6838 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6839 filename.
6840
4e271fff
ST
68412011-02-02 Sriraman Tallam <tmsriram@google.com>
6842
6843 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 6844 to std::string.
4e271fff 6845 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 6846 section_name to be std::string.
4e271fff
ST
6847 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6848
d433c3ac
ILT
68492011-01-25 Ian Lance Taylor <iant@google.com>
6850
6851 * script.cc (script_add_extern): Rewrite to use
6852 add_symbol_reference.
6853
880473a6
DK
68542011-01-25 Doug Kwan <dougkwan@google.com>
6855
d433c3ac 6856 * icf.cc (get_section_contents): Always lock section's object.
880473a6 6857
f30f86fa
ILT
68582011-01-24 Ian Lance Taylor <iant@google.com>
6859
6860 * options.h (class General_options): Accept
6861 --no-detect-odr-violations.
6862
8e51a0b9
ILT
68632011-01-24 Ian Lance Taylor <iant@google.com>
6864
6865 * version.cc (version_string): Bump to 1.11.
6866
0f3b89d8
ILT
68672011-01-24 Ian Lance Taylor <iant@google.com>
6868
6869 * plugin.cc (class Plugin_rescan): Define new class.
6870 (Plugin_manager::claim_file): Set any_claimed_.
6871 (Plugin_manager::save_archive): New function.
6872 (Plugin_manager::save_input_group): New function.
6873 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6874 necessary.
6875 (Plugin_manager::new_undefined_symbol): New function.
6876 (Plugin_manager::rescan): New function.
6877 (Plugin_manager::rescannable_defines): New function.
6878 (Plugin_manager::add_input_file): Set any_added_.
6879 * plugin.h (class Plugin_manager): define new fields rescannable_,
6880 undefined_symbols_, any_claimed_, and any_added_. Declare
6881 Plugin_rescan as friend. Declare new functions.
6882 (Plugin_manager::Rescannable): Define type.
6883 (Plugin_manager::Rescannable_list): Define type.
6884 (Plugin_manager::Undefined_symbol_list): Define type.
6885 (Plugin_manager::Plugin_manager): Initialize new fields.
6886 * archive.cc (Archive::defines_symbol): New function.
6887 (Add_archive_symbols::run): Pass archive to plugins if any.
6888 * archive.h (class Archive): Declare defines_symbol.
6889 * readsyms.cc (Input_group::~Input_group): New function.
6890 (Finish_group::run): Pass input_group to plugins if any.
6891 * readsyms.h (class Input_group): Declare destructor.
6892 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6893 any.
6894
3bb951e5
ILT
68952011-01-10 Ian Lance Taylor <iant@google.com>
6896
6897 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
6898 section as relro.
6899 (Layout::set_segment_offsets): Reset increase_relro before calling
6900 set_section_addresses a second time.
6901
0aa45fac
CC
69022011-01-04 Cary Coutant <ccoutant@google.com>
6903
6904 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
6905 sections before NOBITS sections.
6906
0db46eb4
L
69072011-01-01 H.J. Lu <hongjiu.lu@intel.com>
6908
6909 * version.cc (print_version): Update copyright to 2011.
6910
829c9745
CC
69112010-12-23 Cary Coutant <ccoutant@google.com>
6912
6913 * output.h (Output_data_reloc::add_output_section): Pass OD instead
6914 of OS to this->add. Add OD parameter to second form of the function.
6915
7500420b
ILT
69162010-12-20 Ian Lance Taylor <iant@google.com>
6917
6918 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
6919 second of two consecutive entries with same offset.
6920
f8e9a930
RW
69212010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6922
6923 * testsuite/Makefile.am (ifuncmain2static_LDADD)
6924 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
6925 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
6926 to avoid unneeded links against $(LDADD).
6927 * testsuite/Makefile.in: Regenerate.
6928
2fbb4320
ILT
69292010-12-15 Ian Lance Taylor <iant@google.com>
6930
6931 PR gold/12324
6932 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
6933 for R_X86_64_32 and R_X86_64_PC32.
6934 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
6935 ver_matching_def_pic.o.
6936 (ver_matching_def_pic.o): New target.
6937
fedb228d
RW
69382010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6939
6940 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
6941 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
6942 Move definition before File_read::View member definitions.
6943 (File_read::View::~View): Initialize and hold lock before
6944 updating current_mapped_bytes.
6945
9b547ce6
RW
69462010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6947
6948 * dwarf_reader.cc: Remove outdated comment.
6949 * gold-threads.cc: Fix typo in error message.
6950 * archive.cc: Fix typos in comments.
6951 * archive.h: Likewise.
6952 * arm-reloc-property.cc: Likewise.
6953 * arm-reloc-property.h: Likewise.
6954 * arm-reloc.def: Likewise.
6955 * arm.cc: Likewise.
6956 * attributes.h: Likewise.
6957 * cref.cc: Likewise.
6958 * ehframe.cc: Likewise.
6959 * fileread.h: Likewise.
6960 * gold.h: Likewise.
6961 * i386.cc: Likewise.
6962 * icf.cc: Likewise.
6963 * incremental.h: Likewise.
6964 * int_encoding.cc: Likewise.
6965 * layout.h: Likewise.
6966 * main.cc: Likewise.
6967 * merge.h: Likewise.
6968 * object.cc: Likewise.
6969 * object.h: Likewise.
6970 * options.cc: Likewise.
6971 * readsyms.cc: Likewise.
6972 * reduced_debug_output.cc: Likewise.
6973 * reloc.cc: Likewise.
6974 * script-sections.cc: Likewise.
6975 * sparc.cc: Likewise.
6976 * symtab.h: Likewise.
6977 * target-reloc.h: Likewise.
6978 * target.cc: Likewise.
6979 * target.h: Likewise.
6980 * timer.cc: Likewise.
6981 * timer.h: Likewise.
6982 * x86_64.cc: Likewise.
6983
83e17bd5
CC
69842010-12-09 Cary Coutant <ccoutant@google.com>
6985
6986 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
6987 stack.
6988 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
6989 parameter; change all callers.
6990 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
6991 * options.h (warn_execstack): New option.
6992
017257f8
DK
69932010-12-07 Doug Kwan <dougkwan@google.com>
6994
6995 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
6996 like function call relocations.
6997
c20cbc06
ILT
69982010-12-07 Ian Lance Taylor <iant@google.com>
6999
7000 * archive.cc (Archive::get_elf_object_for_member): Permit
7001 punconfigured to be NULL.
7002 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7003 (Archive::include_member): Pass NULL to get_elf_object_for_member
7004 if we searched for the archive and this is the first included
7005 object.
7006
4dbfafcc
ILT
70072010-12-01 Ian Lance Taylor <iant@google.com>
7008
7009 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7010 track_relocs_type_ field.
7011 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7012 Set track_relocs_type_.
7013 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7014 contents when using RELA relocs.
7015 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7016 reloc_map_.
7017 * reloc.cc (Track_relocs::next_addend): New function.
7018 * reloc.h (class Track_relocs): Declare next_addend.
7019
e5e19edd
ILT
70202010-12-01 Ian Lance Taylor <iant@google.com>
7021
7022 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7023 virtual destructor.
7024
9a5ce24c
ILT
70252010-12-01 Ian Lance Taylor <iant@google.com>
7026
7027 * README: Update compilers known to work and fail.
7028
c7791212
NC
70292010-11-23 Matthias Klose <doko@ubuntu.com>
7030
7031 * configure.in: For --enable-gold, handle value `default' instead of
7032 `both*'. Always install ld as ld.bfd, install as ld if gold is
7033 not the default.
7034 * configure: Regenerate.
7035
0ad220c9
DK
70362010-11-18 Doug Kwan <dougkwan@google.com>
7037
7038 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7039 and right_alignment to be zero. Store result alignment only if it is
7040 greater than existing alignment.
7041
ab8056e0
CC
70422010-11-16 Cary Coutant <ccoutant@google.com>
7043
7044 PR gold/12220
7045 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7046 Check for ".zdebug_line".
7047
fd064a5b
CC
70482010-11-16 Doug Kwan <dougkwan@google.com>
7049 Cary Coutant <ccoutant@google.com>
7050
7051 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7052 by reference; adjust all callers.
7053 * output.cc (Output_segment::set_section_addresses): Adjust references
7054 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7055 list is empty.
7056 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7057 end at page boundary.
7058
6fc6ea19
CC
70592010-11-16 Cary Coutant <ccoutant@google.com>
7060
7061 PR gold/12220
7062 * layout.cc (Layout::choose_output_section): Transform names of
7063 compressed sections even when using a script with a SECTIONS clause.
7064 (Layout::output_section_name): Remove code to transform
7065 compressed debug section names.
7066 * output.cc (Output_section::add_input_section): Use uncompressed
7067 section size when tracking input sections.
7068
95a2c8d6
RS
70692010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7070
7071 * symtab.h (Symbol::NON_PIC_REF): Remove.
7072 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7073 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7074 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7075 (Symbol::use_plt_offset): Take a flags argument and pass it
7076 directly to needs_dynamic_reloc. Restrict check for undefined
7077 weak symbols to function calls.
7078 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7079 (Target_arm::Scan::global): Use it.
7080 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7081 (Target_arm::Relocate::relocate): Likewise.
7082 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7083 parameter with an r_type parameter. Use get_reference_flags
7084 to get the flags.
7085 (Target_arm::Relocate::relocate): Update accordingly.
7086 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7087 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7088 (Target_i386::Scan::global): Likewise.
7089 (Target_i386::Relocate::relocate): Likewise.
7090 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7091 parameter with an r_type parameter. Use get_reference_flags
7092 to get the flags.
7093 (Target_i386::Relocate::relocate): Update accordingly.
7094 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7095 (Target_powerpc::Scan::global): Use it.
7096 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7097 (Target_powerpc::Relocate::relocate): Likewise.
7098 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7099 (Target_sparc::Scan::global): Use it.
7100 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7101 (Target_sparc::Relocate::relocate): Likewise.
7102 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7103 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7104 (Target_x86_64::Scan::global): Likewise.
7105 (Target_x86_64::Relocate::relocate): Likewise.
7106
f625ae50
DK
71072010-11-08 Doug Kwan <dougkwan@google.com>
7108 Cary Coutant <ccoutant@google.com>
7109
7110 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7111 (Arm_exidx_merge_section::section_contents_): New data member.
7112 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7113 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 7114 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
7115 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7116 in parameters instead of calling Object::section_contents without
7117 locking.
7118 (Arm_output_section::group_section): New parameter TASK. Pass it
7119 to callees that need locking objects.
7120 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7121 to lock EXIDX input sections. Fix a formatting issue. Call
7122 Arm_exidx_merged_section::build_contents to create merged section
7123 contents.
7124 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7125 to lock object of stub table owner.
7126 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7127 TEXT_SIZE to initialize data member TEXT_SIZE_.
7128 (Arm_exidx_input_section::addralign): Fix typo in comment.
7129 (Arm_exidx_input_section::text_size): New method.
7130 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7131 that require locking objects. Lock objects before scanning for stubs
7132 and updating local symbols.
7133 (Arm_input_section<big_endian>::init): Copy contents of original
7134 input section.
2e702c99 7135 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
7136 original input section instead of calling Object::section_contents
7137 without locking.
7138 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7139 size without calling Object::section_size().
7140 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7141 for size. Allocate a buffer for merged EXIDX entries.
7142 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7143 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7144 building code to Arm_exidx_merged_section::build_contetns. Write
7145 out contetns in buffer instead of building it on the fly.
7146 (Arm_relobj::make_exidx_input_section): Also pass text section size
7147 to Arm_exidx_input_section constructor.
7148 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7149 (Arm_dynobj::do_read_symbols): Fix memory leak.
7150 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7151 * target.h: (class Task): Add forward declaration.
7152 (Target::relax): Add new parameter TASK and pass it to
7153 Target::do_relax().
7154 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7155
5f9bcf58
CC
71562010-11-05 Cary Coutant <ccoutant@google.com>
7157
7158 PR gold/10708
7159 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7160 object when reading from the file.
7161 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7162 second layout pass.
7163 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7164 when reading section contents.
7165 (get_section_contents): Likewise.
7166 (icf::find_identical_sections): Likewise.
7167 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7168 object when reading from the file.
7169 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7170 the object when doing deferred section layout.
7171
e597fa08
NC
71722010-11-03 Nick Clifton <nickc@redhat.com>
7173
7174 PR gold/12001
7175 * script.h (class Symbol_assignment: name): New member. Returns
7176 the name of the symbol.
7177 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7178 Returns true if the given symbol name is on the list of
7179 assignments wating to be processed.
7180 * archive.cc (should_incldue_member): If the symbol is undefined,
7181 check to see if it is on the list of symbols pending assignment.
7182
3f9a3278
ILT
71832010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7184
7185 * script-sections.cc (Script_sections::find_memory_region): Check
7186 for a NULL output section pointer.
7187
d06fb4d1
DK
71882010-10-29 Doug Kwan <dougkwan@google.com>
7189
7190 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7191 Output_section::add_relaxed_input_section.
7192 * output.cc (Output_section::add_relaxed_input_section): Add new
7193 arguments LAYOUT and NAME. Set section order index.
7194 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7195 Copy section order index.
7196 * output.h (Output_section::add_relaxed_input_section): Add new
7197 arguments LAYOUT and NAME.
7198
90e24de5
ILT
71992010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7200
7201 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7202 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7203 * testsuite/Makefile.in: Regenerate.
7204
c9484ea5
DK
72052010-10-20 Doug Kwan <dougkwan@google.com>
7206
7207 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7208 without SHF_LINK_ORDER flags.
7209 * layout.cc (Layout::choose_output_section): Do not filter
7210 SHF_LINK_ORDER flag in a relocatable link.
7211
5bc2f5be
CC
72122010-10-17 Cary Coutant <ccoutant@google.com>
7213
7214 * output.h (Output_segment::set_section_addresses): Change function
7215 signature. Update all callers.
7216 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7217 sections.
7218 (Output_segment::set_section_addresses): Align after last TLS
7219 section. Add padding before last relro section instead of after.
7220
0c91cf04
DK
72212010-10-17 Doug Kwan <dougkwan@google.com>
7222
7223 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7224 GOT output section to be writable.
7225
8c21d9d3
CC
72262010-10-14 Cary Coutant <ccoutant@google.com>
7227
7228 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7229 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7230 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7231 mode.
7232 * incremental.cc (report_command_line): Ignore all forms of
7233 --incremental.
7234 * layout.cc (Layout::Layout): Check parameters for incremental link
7235 mode.
7236 * options.cc (General_options::parse_incremental): New function.
7237 (General_options::parse_no_incremental): New function.
7238 (General_options::parse_incremental_full): New function.
7239 (General_options::parse_incremental_update): New function.
7240 (General_options::incremental_mode_): New data member.
7241 (General_options::finalize): Check incremental_mode_.
7242 * options.h (General_options): Update help text for --incremental.
7243 Add --no-incremental, --incremental-full, --incremental-update.
7244 (General_options::Incremental_mode): New enum type.
7245 (General_options::incremental_mode): New function.
7246 (General_options::incremental_mode_): New data member.
7247 * parameters.cc (Parameters::incremental_mode_): New data member.
7248 (Parameters::set_options): Set incremental_mode_.
7249 (Parameters::set_incremental_full): New function.
7250 (Parameters::incremental): New function.
7251 (Parameters::incremental_update): New function.
7252 (set_parameters_incremental_full): New function.
7253 * parameters.h (Parameters::set_incremental_full): New function.
7254 (Parameters::incremental): New function.
7255 (Parameters::incremental_update): New function.
7256 (Parameters::incremental_mode_): New data member.
7257 (set_parameters_incremental_full): New function.
7258 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7259 incremental link mode.
7260 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7261 (Sized_relobj::do_relocate_sections): Likewise.
7262 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7263 option.
7264 * testsuite/Makefile.in: Regenerate.
7265 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7266
bb32aa18 72672010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7268
7269 * script-sections.h (class Script_sections): Make
7270 Sections_elements typedef public.
7271 * script-sections.cc (class Sort_output_sections): Add elements_
7272 field. Add constructor which sets it; change all callers.
7273 (Sort_output_sections::is_before): New function.
7274 (Sort_output_sections::operator()): Call is_before.
7275 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7276 conditional.
7277 * testsuite/script_test_10.sh: New test. Test script section
7278 order.
7279 * testsuite/script_test_10.t: Likewise.
7280 * testsuite/script_test_10.s: Likewise.
7281 * testsuite/Makefile.am: Wrap the cross linker tests and the
7282 common tests into NATIVE_OR_CROSS_LINKER.
7283 (check_SCRIPTS): Add script_test_10.sh.
7284 (check_DATA): Add script_test_10.stdout.
7285 (script_test_10.o, script_test_10): New targets.
7286 (script_test_10.stdout): New target.
7287 * configure, testsuite/Makefile.in: Regenerate.
7288
3cef7179
ILT
72892010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7290
7291 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7292 error for the deprecated relocations.
7293 (Target_arm::Scan::global): Likewise.
7294 (Target_arm::Relocate::relocate): Likewise.
7295
7411e9a8
RS
72962010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7297
7298 * fileread.cc (Input_file::find_file): Initialize *found_name
7299 and *namep when using the fallback search for case 4.
7300
6a9da32a
CC
73012010-10-11 Cary Coutant <ccoutant@google.com>
7302
7303 * options.h (class General_options): Redefine -z lazy as an alias for
7304 the negation of -z now.
7305
ac897c20
ILT
73062010-10-11 Ian Lance Taylor <iant@google.com>
7307
7308 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7309 binding.
7310
ea5cae92
NC
73112010-10-06 Nick Clifton <nickc@redhat.com>
7312
7313 * script-sections.cc(class Memory_region): Remove
7314 current_lma_offset_ field. Rename current_vma_offset_ to
7315 current_offset_. Add last_section_ field.
7316 (Memory_region::get_current_vma_address): Rename to
7317 get_current_address.
7318 (Memory_region::get_current_lma_address): Delete.
7319 (Memory_region::increment_vma_offset): Rename to
7320 increment_offset.
7321 (Memory_region::increment_lma_offset): Delete.
7322 (Memory_region::attributes_compatible): New method. Returns
7323 true if the provided section is compatible with the region.
7324 (Memory_region::get_last_section): New method. Returns the last
7325 section to use the region.
7326 (Memory_region::set_last_section): New method. Stores the last
7327 section to use the region.
7328 (Script_sections::block_in_region): New method. Returns true if
7329 a block of memory is contained within a region.
7330 (Script_sections::find_memory_region): New method. Locates a
7331 memory region to be used to set a VMA or LMA address.
7332 (Output_section_definition::set_section_addresses): Add code to
7333 check for addresses set by memory regions.
7334 (Output_segment::set_section_addresses): Remove memory region
7335 walking code.
7336 (Script_sections::create_segment): Add a warning if a header
7337 segment is created outside of any region.
7338 * script-sections.h (class Script_sections): Add prototypes for
7339 find_memory_region and block_in_region methods.
7340 * testsuite/memory_test.s: Use .long instead of .word.
7341 * testsuite/memory_test.t: Add some more output sections.
7342 * testsuite/memory_test.sh: Update expected output.
7343
a9bfd952
DK
73442010-10-02 Doug Kwan <dougkwan@google.com>
7345
7346 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7347 defintion to symtab.h
7348 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7349 declaration to defintion.
7350
bacff3ab
NC
73512010-10-01 Nick Clifton <nickc@redhat.com>
7352
7353 * expression.cc (eval): Replace dummy argument with NULL.
7354 (eval_maybe_dot): Check for a NULL result section pointer.
7355 (Symbol_expression::value): Likewise.
7356 (Dot_expression::value): Likewise.
7357 (BINARY_EXPRESSION): Likewise.
7358 (Max_expression::value): Likewise.
7359 (Min_expression::value): Likewise.
7360 (Absolute_expression::value): Likewise.
7361 (Addr_expression::value_from_output_section): Likewise.
7362 (Loaddddr_expression::value_from_output_section): Likewise.
7363 (Segment_start_expression::value): Likewise.
7364 * script-sections.cc
7365 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7366 argument with NULL.
7367 (Sections_elememt_dot_assignment::set_section_addresses):
7368 Likewise.
7369 (Output_data_expression::do_write_to_buffer): Likewise.
7370 (Output_section_definition::finalize_symbols): Likewise.
7371 (Output_section_definition::set_section_addresses): Likewise.
7372
f81bc8b5
DK
73732010-09-30 Doug Kwan <dougkwan@google.com>
7374
7375 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7376
c95e9f27
ST
73772010-09-28 Sriraman Tallam <tmsriram@google.com>
7378
7379 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 7380 function.
c95e9f27
ST
7381 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7382 virtual function.
7383 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7384 virtual function.
7385 * icf.cc (get_section_contents): Inline merge sections only when
7386 target allows it.
7387
3cac54d2
RW
73882010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7389
7390 * configure: Regenerate.
7391
2904037a
ILT
73922010-09-17 Ian Lance Taylor <iant@google.com>
7393
7394 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7395 * testsuite/Makefile.am (memory_test.o): New target.
7396 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7397 memory_test.t.
7398 * testsuite/Makefile.in: Rebuild.
2904037a 7399
bca7fb63
DK
74002010-09-17 Doug Kwan <dougkwan@google.com>
7401
7402 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7403 defintion if relocation uses GOT entries of the symbol.
7404 * testsuite/icf_safe_test.sh: Fix test.
7405 * testsuite/icf_safe_so_test.sh: Fix test.
7406
4ef28648
CC
74072010-09-16 Cary Coutant <ccoutant@google.com>
7408
7409 * script_sections.cc (class Memory_region): Remove "NULL" from
7410 vector initializations.
7411
793990de
CC
74122010-09-15 Cary Coutant <ccoutant@google.com>
7413
7414 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7415 Resolve forwarding symbols.
7416
81e015e2
DK
74172010-09-15 Doug Kwan <dougkwan@google.com>
7418
7419 * gold/testsuite/script_test_3.t: Add ARM special sections.
7420 * gold/testsuite/script_test_4.t: Same.
7421 * gold/testsuite/script_test_5.t: Same.
7422 * gold/testsuite/script_test_6.t: Same.
7423 * gold/testsuite/script_test_7.t: Same.
7424 * gold/testsuite/script_test_7.t: Same.
7425 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7426
36171d64
CC
74272010-09-14 Cary Coutant <ccoutant@google.com>
7428
7429 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7430 (Target_x86_64::Relocate::relocate_tls): Replace check for
7431 saw_tls_block_reloc_ with test for executable section.
7432
d89051bd
CC
74332010-09-12 Cary Coutant <ccoutant@google.com>
7434
7435 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7436 position-independent executables to shared libraries need dynamic
7437 relocations.
7438 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7439 position-independent executables.
7440 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7441 * testsuite/Makefile.in: Regenerate.
7442
fca41f0f
NC
74432010-09-10 Nick Clifton <nickc@redhat.com>
7444
7445 PR gold/11997
7446 * testsuite/memory_test.t: Discard any sections that are not
7447 needed.
7448
6695e4b3
L
74492010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7450
7451 PR gold/11996
7452 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7453 "This::" to work around a bug in gcc 4.2.
7454
7455 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7456
0f72bf6f
RÁE
74572010-09-09 Rafael Espindola <espindola@google.com>
7458
7459 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7460 sections with different PF_X flags in the same segment.
7461 (Layout::find_first_load_seg): Search all segments to find the first
7462 one.
7463 * options.h (rosegment): New.
7464
74652010-09-08 Rafael Espindola <espindola@google.com>
a6577478 7466
05a79166 7467 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 7468
aa98ff75
DK
74692010-09-08 Doug Kwan <dougkwan@google.com>
7470
7471 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7472 (Arm_relobj::do_relocate_sections): Add new parameter for output
7473 file to match the parent.
7474 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7475 of local symbols instead of input values. Update code to track
7476 changes in gold::relocate_section.
7477 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7478 (Sized_relobj::compute_final_local_value_internal): New methods.
7479 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7480 body into private version of Sized_relobj::compute_final_local_value.
7481 Call the inline method.
7482 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7483 merged symbol value if there is one.
7484 (Symbol_value::has_output_value): New method defintiion.
7485 (Sized_relobj::Compute_final_local_value_status): New enum type.
7486 (Sized_relobj::compute_final_local_value): New methods.
7487 (Sized_relobj::compute_final_local_value_internal): New methods.
7488 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7489 and arm_cortex_a8.sh.
7490 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7491 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7492 New tests.
7493 * Makefile.in: Regenerate.
7494 * testsuite/arm_bl_out_of_range.s: Update test.
7495 * testsuite/thumb_bl_out_of_range.s: Ditto.
7496 * testsuite/thumb_blx_out_of_range.s: Ditto.
7497 * testsuite/arm_branch_out_of_range.sh: New file.
7498 * testsuite/arm_cortex_a8.sh: Ditto.
7499 * testsuite/arm_cortex_a8_b.s: Ditto.
7500 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7501 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7502 * testsuite/arm_cortex_a8_bl.s: Ditto.
7503 * testsuite/arm_cortex_a8_blx.s: Ditto.
7504 * testsuite/arm_cortex_a8_local.s: Ditto.
7505 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7506 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7507
05a79166
L
75082010-09-08 Rafael Espindola <espindola@google.com>
7509
7510 * Makefile.am (memory_test.stdout): Run readelf with -W.
7511 * Makefile.in: Regenerate.
7512 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7513 64 bit output.
7514
33dbc701
RÁE
75152010-09-08 Rafael Espindola <espindola@google.com>
7516
7517 * script-sections.cc (Script_sections::add_memory_region): Convert
7518 field precision to int.
7519 * script.cc (script_set_section_region, script_set_section_region):
7520 Convert field precision to int.
7521
731ca54a
RÁE
75222010-09-08 Rafael Espindola <espindola@google.com>
7523
7524 * arm.cc (do_finalize_sections): Create the __exidx_start and
7525 __exdix_end symbols even when the section is missing.
7526
7f8cd844
NC
75272010-09-08 Nick Clifton <nickc@redhat.com>
7528
7529 * README: Remove claim that MEMORY is not supported.
7530 * expression.cc (script_exp_function_origin)
7531 (script_exp_function_length): Move from here to ...
7532 * script.cc: ... here.
7533 (script_set_section_region, script_add_memory)
7534 (script_parse_memory_attr, script_include_directive): New
7535 functions.
7536 * script-sections.cc
7537 (class Memory_region): New class.
7538 (class Output_section_definition): Add set_memory_region,
7539 set_section_vma, set_section_lma and get_section_name methods.
7540 (class Script_Sections): Add add_memory_region,
7541 find_memory_region, find_memory_region_origin,
7542 find_memory_region_length and set_memory_region methods.
7543 Have set_section_addresses method walk the list of set memory
7544 regions.
7545 Extend the print methos to display memory regions.
7546 * script-sections.h: Add prototypes for new methods.
7547 Add enum for MEMORY region attributes.
7548 * yyscript.y: Add support for parsing MEMORY regions.
7549 * script-c.h: Add prototypes for new functions.
7550 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7551 * testsuite/Makefile.in: Regenerate.
7552 * testsuite/memory_test.sh: New script.
7553 * testsuite/memory_test.s: New assembler source file.
7554 * testsuite/memory_test.t: New linker script.
7555
a4649286
DK
75562010-08-27 Doug Kwan <dougkwan@google.com>
7557
7558 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7559 reference override an existing dynamic weak reference.
7560 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7561 * testsuite/Makefile.in: Regenerate.
7562 * testsuite/dyn_weak_ref.sh: New file.
7563 * testsuite/dyn_weak_ref_1.c: Ditto.
7564 * testsuite/dyn_weak_ref_2.c: Ditto.
7565
b56648ad
ILT
75662010-08-27 Ian Lance Taylor <iant@google.com>
7567
7568 * incremental.h (class Incremental_input_entry): Add virtual
7569 destructor.
7570
809313cb
ILT
75712010-08-27 Ian Lance Taylor <iant@google.com>
7572
7573 * testsuite/start_lib_test_3.c: Mark t3 as used.
7574
11e32464
NC
75752010-08-27 Nick Clifton <nickc@redhat.com>
7576
7577 * options.cc (version_script): Fix small typo in previous
7578 whitespace tidyup.
7579
ca09d69a
NC
75802010-08-25 Nick Clifton <nickc@redhat.com>
7581
7582 * archive.cc: Formatting fixes: Remove whitespace between
7583 typename and following asterisk. Remove whitespace between
7584 function name and opening parenthesis.
7585 * archive.h: Likewise.
7586 * arm.cc: Likewise.
7587 * attributes.cc: Likewise.
7588 * attributes.h: Likewise.
7589 * common.cc: Likewise.
7590 * copy-relocs.cc: Likewise.
7591 * dirsearch.h: Likewise.
7592 * dynobj.cc: Likewise.
7593 * ehframe.cc: Likewise.
7594 * ehframe.h: Likewise.
7595 * expression.cc: Likewise.
7596 * fileread.cc: Likewise.
7597 * fileread.h: Likewise.
7598 * gc.h: Likewise.
7599 * gold-threads.cc: Likewise.
7600 * gold.cc: Likewise.
7601 * i386.cc: Likewise.
7602 * icf.h: Likewise.
7603 * incremental-dump.cc: Likewise.
7604 * incremental.cc: Likewise.
7605 * layout.cc: Likewise.
7606 * layout.h: Likewise.
7607 * main.cc: Likewise.
7608 * merge.cc: Likewise.
7609 * merge.h: Likewise.
7610 * object.cc: Likewise.
7611 * object.h: Likewise.
7612 * options.cc: Likewise.
7613 * options.h: Likewise.
7614 * output.cc: Likewise.
7615 * output.h: Likewise.
7616 * plugin.cc: Likewise.
7617 * plugin.h: Likewise.
7618 * powerpc.cc: Likewise.
7619 * reloc.cc: Likewise.
7620 * script-c.h: Likewise.
7621 * script-sections.cc: Likewise.
7622 * script.cc: Likewise.
7623 * stringpool.cc: Likewise.
7624 * symtab.cc: Likewise.
7625 * symtab.h: Likewise.
7626 * target.cc: Likewise.
7627 * timer.cc: Likewise.
7628 * timer.h: Likewise.
7629 * version.cc: Likewise.
7630 * x86_64.cc: Likewise.
7631
b8fa8750
NC
76322010-08-24 Nick Clifton <nickc@redhat.com>
7633
7634 PR 11899
7635 * layout.cc (segment_precedes): Sort segments by their physical
7636 addresses, if they have been set.
7637
9919d93b
CC
76382010-08-23 Cary Coutant <ccoutant@google.com>
7639
7640 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7641 symbols data.
7642 (Lib_group::include_member): Unlock object after deleting its
7643 symbols data.
7644 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7645 the bug fixed here.
7646
97b4be1c
CC
76472010-08-19 Neil Vachharajani <nvachhar@google.com>
7648 Cary Coutant <ccoutant@google.com>
7649
7650 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7651 constructor, and set_blocker.
7652 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7653 readsyms_blocker_.
7654 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7655 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7656 * testsuite/Makefile.am (start_lib_test): New test case.
7657 * testsuite/Makefile.in: Regenerate.
7658 * testsuite/start_lib_test_main.c: New file.
7659 * testsuite/start_lib_test_1.c: New file.
7660 * testsuite/start_lib_test_2.c: New file.
7661 * testsuite/start_lib_test_3.c: New file.
7662
dd0b1884
ILT
76632010-08-19 Ian Lance Taylor <iant@google.com>
7664
7665 * Makefile.in: Rebuild with automake 1.11.1.
7666 * aclocal.m4: Likewise.
7667 * testsuite/Makefile.in: Likewise.
7668
7223e9ca
ILT
76692010-08-19 Ian Lance Taylor <iant@google.com>
7670
7671 PR 10893
7672 * i386.cc (class Output_data_plt_i386): Update declarations.
7673 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7674 local_ifuncs_ fields.
7675 (Target_i386::do_plt_section_for_global): New function.
7676 (Target_i386::do_plt_section_for_local): New function.
7677 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7678 parameter; change all callers. Initialize global_ifuncs_ and
7679 local_ifuncs_. If doing a static link define __rel_iplt_start and
7680 __rel_iplt_end.
7681 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7682 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7683 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7684 symbols.
7685 (Target_i386::make_plt_section): New function, broken out of
7686 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7687 (Target_i386::make_plt_entry): Call make_plt_section.
7688 (Target_i386::make_local_ifunc_plt_entry): New function.
7689 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7690 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7691 R_386_IRELATIVE to switch.
7692 (Target_i386::Scan::global): Likewise.
7693 (Target_i386::Relocate::relocate): Likewise.
7694 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7695 switch.
7696 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7697 (Target_x86_64::do_plt_section_for_global): New function.
7698 (Target_x86_64::do_plt_section_for_local): New function.
7699 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7700 parameter; change all callers. If doing a static link define
7701 __rela_iplt_start and __rela_iplt_end.
7702 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7703 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7704 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7705 to point to .plt.
7706 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7707 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7708 switch.
7709 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7710 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7711 R_X86_64_IRELATIVE to switch.
7712 (Target_x86_64::Scan::global): Likewise.
7713 (Target_x86_64::Relocate::relocate): Likewise.
7714 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7715 switch.
7716 * target.h (class Target): Add plt_section_for_global and
7717 plt_section_for_local functions. Add do_plt_section_for_global
7718 and do_plt_section_for_local virtual functions.
7719 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7720 clarifying comments.
7721 (Symbol::use_plt_offset): Handle IFUNC symbol.
7722 * object.cc (Sized_relobj::Sized_relobj): Initialize
7723 local_plt_offsets_.
7724 (Sized_relobj::local_has_plt_offset): New function.
7725 (Sized_relobj::local_plt_offset): New function.
7726 (Sized_relobj::set_local_plt_offset): New function.
7727 (Sized_relobj::do_count): Handle IFUNC symbol.
7728 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7729 a bit away from input_shndx_ field. Add set_is_func_symbol and
7730 is_ifunc_symbol functions.
7731 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7732 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7733 local_plt_offsets_ field.
7734 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7735 * output.h (class Output_section_data): Add non-const
7736 output_section function.
7737 (class Output_data_got): Update declarations.
7738 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7739 Add use_plt_offset parameter to global and local constructors.
7740 Change all callers. Change local_sym_index_ field to 31 bits.
7741 Change GSYM_CODE and CONSTANT_CODE accordingly.
7742 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7743 doing a static link don't set sh_link field.
7744 (Output_data_got::Got_entry::write): Use PLT offset if
7745 appropriate.
7746 (Output_data_got::add_global_plt): New function.
7747 (Output_data_got::add_local_plt): New function.
7748 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7749 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7750 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7751 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7752 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7753 IFUNC conditional.
7754 * testsuite/ifunc-sel.h: New file.
7755 * testsuite/ifuncmain1.c: New file.
7756 * testsuite/ifuncmain1vis.c: New file.
7757 * testsuite/ifuncmod1.c: New file.
7758 * testsuite/ifuncdep2.c: New file.
7759 * testsuite/ifuncmain2.c: New file.
7760 * testsuite/ifuncmain3.c: New file.
7761 * testsuite/ifuncmod3.c: New file.
7762 * testsuite/ifuncmain4.c: New file.
7763 * testsuite/ifuncmain5.c: New file.
7764 * testsuite/ifuncmod5.c: New file.
7765 * testsuite/ifuncmain6pie.c: New file.
7766 * testsuite/ifuncmod6.c: New file.
7767 * testsuite/ifuncmain7.c: New file.
7768 * configure, testsuite/Makefile.in: Rebuild.
7769
56f75c03
ILT
77702010-08-18 Ian Lance Taylor <iant@google.com>
7771
7772 * incremental.cc
7773 (Output_section_incremental_inputs::write_input_files): Add cast
7774 to avoid signed/unsigned comparison warning.
7775 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7776
55455f89
CC
77772010-08-12 Cary Coutant <ccoutant@google.com>
7778
7779 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7780
e2054bcb
ILT
77812010-08-13 Ian Lance Taylor <iant@google.com>
7782
7783 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7784
74f67560
DK
77852010-08-12 Cary Coutant <ccoutant@google.com>
7786 Doug Kwan <dougkwan@google.com>
7787
7788 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7789 defintion overrides non-weak undef, remember that the original undef
7790 is not weak.
7791 * symtab.cc (Symbol_table::sized_write_global): For undef without
7792 an original weak binding, set binding to global in output.
7793 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7794 * testsuite/Makefile.in: Regenerate.
7795 * testsuite/strong_ref_weak_def.sh: New file.
7796 * testsuite/strong_ref_weak_def_1.c: Ditto.
7797 * testsuite/strong_ref_weak_def_2.c: Ditto.
7798
d1238d12
CC
77992010-08-12 Cary Coutant <ccoutant@google.com>
7800
7801 * testsuite/incremental_test.sh: Rewrite.
7802 * testsuite/incremental_test_1.c: Rewrite.
7803 * testsuite/incremental_test_2.c: Rewrite.
7804
0e70b911
CC
78052010-08-12 Cary Coutant <ccoutant@google.com>
7806
7807 * arm.cc (Target_arm::got_size): Add const.
7808 (Target_arm::got_entry_count): New function.
7809 (Target_arm::plt_entry_count): New function.
7810 (Target_arm::first_plt_entry_offset): New function.
7811 (Target_arm::plt_entry_size): New function.
7812 (Output_data_plt_arm::entry_count): New function.
7813 (Output_data_plt_arm::first_plt_entry_offset): New function.
7814 (Output_data_plt_arm::get_plt_entry_size): New function.
7815 * i386.cc (Target_i386::got_size): Add const.
7816 (Target_i386::got_entry_count): New function.
7817 (Target_i386::plt_entry_count): New function.
7818 (Target_i386::first_plt_entry_offset): New function.
7819 (Target_i386::plt_entry_size): New function.
7820 (Output_data_plt_i386::entry_count): New function.
7821 (Output_data_plt_i386::first_plt_entry_offset): New function.
7822 (Output_data_plt_i386::get_plt_entry_size): New function.
7823 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7824 find_incremental_inputs_sections. Dump incremental_got_plt section.
7825 * incremental.cc: Include target.h.
7826 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7827 parameter. Adjust all callers. Find incremental_got_plt section.
7828 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7829 section.
7830 (Output_section_incremental_inputs::set_final_data_size): Calculate
7831 size of incremental_got_plt section.
7832 (Output_section_incremental_inputs::do_write): Write the
7833 incremental_got_plt section.
7834 (Got_plt_view_info): New struct.
7835 (Local_got_offset_visitor): New class.
7836 (Global_got_offset_visitor): New class.
7837 (Global_symbol_visitor_got_plt): New class.
7838 (Output_section_incremental_inputs::write_got_plt): New function.
7839 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7840 Add parameter. Adjust all callers.
7841 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7842 (Incremental_inputs::got_plt_section): New function.
7843 (Incremental_inputs::got_plt_section_): New data member.
7844 (Incremental_got_plt_reader): New class.
7845 * layout.cc (Layout::create_incremental_info_sections): Add the
7846 incremental_got_plt section.
7847 * object.h (Got_offset_list::get_list): New function.
7848 (Got offset_list::for_all_got_offsets): New function.
7849 (Sized_relobj::local_got_offset_list): New function.
7850 * powerpc.cc (Target_powerpc::got_size): Add const.
7851 (Target_powerpc::got_entry_count): New function.
7852 (Target_powerpc::plt_entry_count): New function.
7853 (Target_powerpc::first_plt_entry_offset): New function.
7854 (Target_powerpc::plt_entry_size): New function.
7855 (Output_data_plt_powerpc::entry_count): New function.
7856 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7857 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7858 * sparc.cc (Target_sparc::got_size): Add const.
7859 (Target_sparc::got_entry_count): New function.
7860 (Target_sparc::plt_entry_count): New function.
7861 (Target_sparc::first_plt_entry_offset): New function.
7862 (Target_sparc::plt_entry_size): New function.
7863 (Output_data_plt_sparc::entry_count): New function.
7864 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7865 (Output_data_plt_sparc::get_plt_entry_size): New function.
7866 * symtab.h (Symbol::got_offset_list): New function.
7867 (Symbol_table::for_all_symbols): New function.
7868 * target.h (Sized_target::got_entry_count): New function.
7869 (Sized_target::plt_entry_count): New function.
7870 (Sized_target::plt_entry_size): New function.
7871 * x86_64.cc (Target_x86_64::got_size): Add const.
7872 (Target_x86_64::got_entry_count): New function.
7873 (Target_x86_64::plt_entry_count): New function.
7874 (Target_x86_64::first_plt_entry_offset): New function.
7875 (Target_x86_64::plt_entry_size): New function.
7876 (Output_data_plt_x86_64::entry_count): New function.
7877 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7878 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7879
09ec0418
CC
78802010-08-12 Cary Coutant <ccoutant@google.com>
7881
7882 * archive.cc: Include incremental.h.
7883 (Archive::Archive): Initialize incremental_info_.
7884 (Archive::include_member): Record archive members in incremental info.
7885 (Add_archive_symbols::run): Record begin and end of an archive in
7886 incremental info.
7887 (Lib_group::include_member): Record objects in incremental info.
7888 * archive.h (Incremental_archive_entry): Forward declaration.
7889 (Archive::set_incremental_info): New member function.
7890 (Archive::incremental_info): New member function.
7891 (Archive::Unused_symbol_iterator): New class.
7892 (Archive::unused_symbols_begin): New member function.
7893 (Archive::unused_symbols_end): New member function.
7894 (Archive::incremental_info_): New data member.
7895 * incremental-dump.cc (find_input_containing_global): New function.
7896 (dump_incremental_inputs): Dump new incremental info sections.
7897 * incremental.cc: Include symtab.h.
7898 (Output_section_incremental_inputs): New class.
7899 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
7900 new incremental info sections.
7901 (Sized_incremental_binary::do_check_inputs): Likewise.
7902 (Incremental_inputs::report_archive): Remove.
7903 (Incremental_inputs::report_archive_begin): New function.
7904 (Incremental_inputs::report_archive_end): New function.
7905 (Incremental_inputs::report_object): New function.
7906 (Incremental_inputs::finalize_inputs): Remove.
7907 (Incremental_inputs::report_input_section): New function.
7908 (Incremental_inputs::report_script): Rewrite.
7909 (Incremental_inputs::finalize): Do nothing but finalize string table.
7910 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7911 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7912 (Incremental_inputs::create_data_sections): New function.
7913 (Incremental_inputs::relocs_entsize): New function.
7914 (Output_section_incremental_inputs::set_final_data_size): New function.
7915 (Output_section_incremental_inputs::do_write): New function.
7916 (Output_section_incremental_inputs::write_header): New function.
7917 (Output_section_incremental_inputs::write_input_files): New function.
7918 (Output_section_incremental_inputs::write_info_blocks): New function.
7919 (Output_section_incremental_inputs::write_symtab): New function.
7920 * incremental.h (Incremental_script_entry): Forward declaration.
7921 (Incremental_object_entry): Forward declaration.
7922 (Incremental_archive_entry): Forward declaration.
7923 (Incremental_inputs): Forward declaration.
7924 (Incremental_inputs_header_data): Remove.
7925 (Incremental_inputs_header): Remove.
7926 (Incremental_inputs_header_write): Remove.
7927 (Incremental_inputs_entry_data): Remove.
7928 (Incremental_inputs_entry): Remove.
7929 (Incremental_inputs_entry_write): Remove.
7930 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
7931 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
7932 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7933 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
7934 Likewise.
7935 (Incremental_input_entry): New class.
7936 (Incremental_script_entry): New class.
7937 (Incremental_object_entry): New class.
7938 (Incremental_archive_entry): New class.
7939 (Incremental_inputs::Incremental_inputs): Initialize new data members.
7940 (Incremental_inputs::report_inputs): Remove.
7941 (Incremental_inputs::report_archive): Remove.
7942 (Incremental_inputs::report_archive_begin): New function.
7943 (Incremental_inputs::report_archive_end): New function.
7944 (Incremental_inputs::report_object): Change prototype.
7945 (Incremental_inputs::report_input_section): New function.
7946 (Incremental_inputs::report_script): Change prototype.
7947 (Incremental_inputs::get_reloc_count): New function.
7948 (Incremental_inputs::set_reloc_count): New function.
7949 (Incremental_inputs::create_data_sections): New function.
7950 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7951 (Incremental_inputs::inputs_section): New function.
7952 (Incremental_inputs::symtab_section): New function.
7953 (Incremental_inputs::relocs_section): New function.
7954 (Incremental_inputs::get_stringpool): Add const.
7955 (Incremental_inputs::command_line): Add const.
7956 (Incremental_inputs::inputs): Remove.
7957 (Incremental_inputs::command_line_key): New function.
7958 (Incremental_inputs::input_file_count): New function.
7959 (Incremental_inputs::input_files): New function.
7960 (Incremental_inputs::relocs_entsize): New function.
7961 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7962 (Incremental_inputs::finalize_inputs): Remove.
7963 (Incremental_inputs::Input_info): Remove.
7964 (Incremental_inputs::lock_): Remove.
7965 (Incremental_inputs::inputs_): Change type.
7966 (Incremental_inputs::inputs_map_): Remove.
7967 (Incremental_inputs::current_object_entry_): New data member.
7968 (Incremental_inputs::inputs_section_): New data member.
7969 (Incremental_inputs::symtab_section_): New data member.
7970 (Incremental_inputs::relocs_section_): New data member.
7971 (Incremental_inputs::reloc_count_): New data member.
7972 (Incremental_inputs_reader): New class.
7973 (Incremental_symtab_reader): New class.
7974 (Incremental_relocs_reader): New class.
7975 * layout.cc (Layout::finalize): Move finalization of incremental info
7976 and creation of incremental info sections to follow finalization of
7977 symbol table. Set offsets for postprocessing sections.
7978 (Layout::create_incremental_info_sections): Call
7979 Incremental_inputs::create_data_sections. Add incremental symtab
7980 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
7981 sections to layout after input sections.
7982 * layout.h (struct Timespec): Forward declaration.
7983 (Layout::incremental_inputs): Add const.
7984 (Layout::create_incremental_info_sections): Add parameter.
7985 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
7986 * object.cc: Include incremental.h.
7987 (Relobj::finalize_incremental_relocs): New function.
7988 (Sized_relobj::do_layout): Record input sections in incremental info.
7989 * object.h (Object::output_section): New function.
7990 (Object::output_section_offset): Moved from Relobj.
7991 (Object::get_incremental_reloc_base): New function.
7992 (Object::get_incremental_reloc_count): New function.
7993 (Object::do_output_section): New function.
7994 (Object::do_output_section_offset): Moved from Relobj.
7995 (Object::do_get_incremental_reloc_base): New function.
7996 (Object::do_get_incremental_reloc_count): New function.
7997 (Object::Object): Initialize new data members.
7998 (Relobj::output_section): Renamed do_output_section and moved to
7999 protected.
8000 (Relobj::output_section_offset): Moved to Object.
8001 (Relobj::do_get_incremental_reloc_base): New function.
8002 (Relobj::do_get_incremental_reloc_count): New function.
8003 (Relobj::allocate_incremental_reloc_counts): New function.
8004 (Relobj::count_incremental_reloc): New function.
8005 (Relobj::finalize_incremental_relocs): New function.
8006 (Relobj::next_incremental_reloc_index): New function.
8007 (Relobj::reloc_counts_): New data member.
8008 (Relobj::reloc_bases_): New data member.
8009 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8010 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8011 (Sized_relobj::incremental_relocs_scan): New function.
8012 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8013 (Sized_relobj::incremental_relocs_write): New function.
8014 (Sized_relobj::incremental_relocs_write_reltype): New function.
8015 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8016 incremental link.
8017 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8018 archives and object files elsewhere.
8019 (Add_symbols::run): Report object files here.
8020 (Finish_group::run): Report end of archive at end of group.
8021 * reloc.cc: Include layout.h, incremental.h.
8022 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8023 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8024 (Sized_relobj::incremental_relocs_scan): New function.
8025 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8026 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8027 (Sized_relobj::incremental_relocs_write): New function.
8028 (Sized_relobj::incremental_relocs_write_reltype): New function.
8029 * script.cc (read_input_script): Rewrite test for incremental link.
8030 Change call to Incremental_inputs::report_script.
8031 * symtab.h (Symbol_table::first_global_index): New function.
8032 (Symbol_table::output_count): New function.
8033
ce0d1972
DK
80342010-08-12 Doug Kwan <dougkwan@google.com>
8035
8036 * arm.cc (Target_arm::merge_object_attributes): Check command line
8037 options --no-wchar-size-warning and --no-enum-size-warning.
8038 * options.h (General_options): Add ld-compatible options
8039 --no-enum-size-warning and --no-wchar-size-warning.
8040
6e5710ce
ILT
80412010-08-04 Ian Lance Taylor <iant@google.com>
8042
8043 * x86_64.cc (Target_x86_64::Scan::local): Use
8044 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8045 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8046 (Target_x86_64::Scan::global): Likewise.
8047 (Target_x86_64::Relocate::relocate): Likewise.
8048 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8049 Likewise.
8050
fef830db
CC
80512010-08-03 Cary Coutant <ccoutant@google.com>
8052
8053 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8054 to reserve space in merged_strings vector. Keep total input size
8055 for stats.
8056 (Output_merge_string::do_print_merge_stats): Print total input size.
8057 * merge.h (Output_merge_string): Add input_size_ field.
8058 * stringpool.cc (Stringpool_template::string_length): Move
8059 implementations out of Stringpool_template class and place in
8060 stringpool.h.
8061 * stringpool.h (string_length): Move out of Stringpool_template.
8062
1e3811b0
ILT
80632010-08-03 Ian Lance Taylor <iant@google.com>
8064
8065 PR 11712
8066 * layout.cc (relaxation_loop_body): If address of load segment is
8067 set, adjust address to include headers if possible.
8068
7af0c620
ILT
80692010-08-03 Ian Lance Taylor <iant@google.com>
8070
8071 * version.cc (version_string): Bump to 1.10.
8072
22f0da72
ILT
80732010-08-03 Ian Lance Taylor <iant@google.com>
8074
8075 PR 11805
8076 * layout.h (enum Output_section_order): Define.
8077 (class Layout): Update declarations.
8078 * layout.cc (Layout::get_output_section): Add order parameter.
8079 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8080 is_first_non_relro parameters. Change all callers.
8081 (Layout::choose_output_section): Likewise.
8082 (Layout::add_output_section_data): Likewise.
8083 (Layout::make_output_section): Likewise. Set order.
8084 (Layout::default_section_order): New function.
8085 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8086 * output.cc (Output_section::Output_section): Initialize order_.
8087 Don't initialize deleted fields.
8088 (Output_segment::Output_segment): Don't initialize deleted
8089 fields.
8090 (Output_segment::add_output_section_to_load): New function
8091 replacing add_output_section. Change all callers to call this or
8092 add_output_section_to_nonload.
8093 (Output_segment::add_output_section_to_nonload): New function.
8094 (Output_segment::remove_output_section): Rewrite.
8095 (Output_segment::add_initial_output_data): Likewise.
8096 (Output_segment::has_any_data_sections): Likewise.
8097 (Output_segment::is_first_section_relro): Likewise.
8098 (Output_segment::maximum_alignment): Likewise.
8099 (Output_segment::has_dynamic_reloc): New function replacing
8100 dynamic_reloc_count. Change all callers.
8101 (Output_segment::has_dynamic_reloc_list): New function replacing
8102 dynamic_reloc_count_list. Change all callers.
8103 (Output_segment::set_section_addresses): Rewrite.
8104 (Output_segment::set_offset): Rewrite.
8105 (Output_segment::find_first_and_last_list): Remove.
8106 (Output_segment::set_tls_offsets): Rewrite.
8107 (Output_segment::first_section_load_address): Likewise.
8108 (Output_segment::output_section_count): Likewise.
8109 (Output_segment::section_with_lowest_load_address): Likewise.
8110 (Output_segment::write_section_headers): Likewise.
8111 (Output_segment::print_sections_to_map): Likewise.
8112 * output.h (class Output_data): Remove dynamic_reloc_count_
8113 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8114 (Output_data::add_dynamic_reloc): Rewrite.
8115 (Output_data::has_dynamic_reloc): New function.
8116 (Output_data::dynamic_reloc_count): Remove.
8117 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8118 is_last_relro_, is_first_non_relro_, is_interp_,
8119 is_dynamic_linker_section_ fields. Add order and set_order
8120 functions. Remove is_relro_local, set_is_relro_local,
8121 is_last_relro, set_is_last_relro, is_first_non_relro,
8122 set_is_first_non_relro functions, is_interp, set_is_interp,
8123 is_dynamic_linker_section, and set_is_dynamic_linker_section
8124 functions.
8125 (class Output_segment): Change Output_data_list from std::list to
8126 std:;vector. Add output_lists_ field. Remove output_data_ and
8127 output_bss_ fields. Update declarations.
8128
3ff2ccb0
ILT
81292010-08-02 Ian Lance Taylor <iant@google.com>
8130
8131 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8132 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8133 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8134
88a4108b
ILT
81352010-08-02 Ian Lance Taylor <iant@google.com>
8136
8137 PR 11855
8138 * script.cc (Script_options::Script_options): Initialize
8139 symbol_definitions_ and symbol_references_.
8140 (Script_options::add_symbol_assignment): Update
8141 symbol_definitions_ and symbol_references_.
8142 (Script_options::add_symbol_reference): New function.
8143 (script_symbol): New function.
8144 * script.h (class Script_options): Add symbol_definitions_ and
8145 symbol_references_ fields.
8146 (Script_options::referenced_const_iterator): New type.
8147 (Script_options::referenced_begin): New function.
8148 (Script_options::referenced_end): New function.
8149 (Script_options::is_referenced): New function.
8150 (Script_options::any_unreferenced): New function.
8151 * script-c.h (script_symbol): Declare.
8152 * yyscript.y (exp): Call script_symbol.
8153 * symtab.cc: Include "script.h".
8154 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8155 Change all callers. Check symbols referenced by scripts.
8156 (Symbol_table::add_undefined_symbols_from_command_line): Add
8157 layout parameter. Change all callers.
8158 (Symbol_table::do_add_undefined_symbols_from_command_line):
8159 Likewise. Break out loop body. Check symbols referenced by
8160 scripts.
8161 (Symbol_table::add_undefined_symbol_from_command_line): New
8162 function broken out of
8163 do_add_undefined_symbols_from_command_line.
8164 * symtab.h (class Symbol_table): Update declarations.
8165 * archive.cc: Include "layout.h".
8166 (Archive::should_include_member): Add layout parameter. Change
8167 all callers. Check for symbol mentioned in expression.
8168 * archive.h (class Archive): Update declaration.
8169 * object.cc (Sized_relobj::do_should_include_member): Add layout
8170 parameter.
8171 * object.h (Object::should_include_member): Add layout parameter.
8172 Change all callers.
8173 (Object::do_should_include_member): Add layout parameter.
8174 (class Sized_relobj): Update declaration.
8175 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8176 parameter.
8177 * dynobj.h (class Sized_dynobj): Update declaration.
8178 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8179 layout parameter.
8180 * plugin.h (class Sized_pluginobj): Update declaration.
8181
5f1ab67a
ILT
81822010-08-02 Ian Lance Taylor <iant@google.com>
8183
8184 PR 11866
8185 * output.cc (Output_segment::set_offset): Search for the first and
8186 last sections rather than assuming that the list is in order.
8187 (Output_segment::find_first_and_last_list): New function.
8188 * output.h (class Output_segment): Update declarations.
8189 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8190 (relro_strip_test_SOURCES): New variable.
8191 (relro_strip_test_DEPENDENCIES): New variable.
8192 (relro_strip_test_LDFLAGS): New variable.
8193 (relro_strip_test_LDADD): New variable.
8194 (relro_strip_test.so): New target.
8195
a8df5856
ILT
81962010-08-02 Ian Lance Taylor <iant@google.com>
8197
8198 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8199 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8200 (Target_i386::got_tlsdesc_section): New function.
8201 (Target_i386::got_section): Create space for GOT entries for
8202 TLSDESC relocations.
8203 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8204 R_386_TLS_GOTDESC.
8205 (Target_i386::Scan::global): Likewise.
8206 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8207 using TLSDESC GOT.
8208 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8209 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8210 (Target_x86_64::got_tlsdesc_section): New function.
8211 (Target_x86_64::got_section): Create space for GOT entries for
8212 TLSDESC relocations.
8213 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8214 R_386_TLS_GOTDESC.
8215 (Target_x86_64::Scan::global): Likewise.
8216 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8217 using TLSDESC GOT.
8218
0c10a0a6
ILT
82192010-08-02 Ian Lance Taylor <iant@google.com>
8220
8221 * testsuite/final_layout.sh: Use dc to convert from hex to
8222 decimal.
8223
41cbeecc
ST
82242010-07-29 Sriraman Tallam <tmsriram@google.com>
8225
8226 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8227 paramter to the call to gold::gc_process_relocs.
8228 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8229 paramter to the call to gold::gc_process_relocs.
8230 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8231 parameter to the call to gold::gc_process_relocs.
8232 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8233 template parameter to the call to gold::gc_process_relocs.
8234 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8235 paramter to the call to gold::gc_process_relocs.
8236 * gc.h (get_embedded_addend_size): New function.
8237 (gc_process_relocs): Save the size of the reloc for use by ICF.
8238 * icf.cc (get_section_contents): Get the addend from the text section
8239 for SHT_REL relocation sections.
8240 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8241 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8242 * int_encoding.h (read_from_pointer): New overloaded function.
8243 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8244 * testsuite/icf_sht_rel_addend_test.sh: New file.
8245 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8246 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8247
6ea55b82
RW
82482010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8249
8250 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8251 * Makefile.in: Regenerate.
8252 * testsuite/Makefile.in: Regenerate.
8253
9691462b
ILT
82542010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8255
8256 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8257 * gold/testsuite/debug_msg.cc: Likewise.
8258 * gold/testsuite/odr_violation1.cc
8259 * gold/testsuite/odr_violation2.cc
8260
76897331
CC
82612010-07-21 Cary Coutant <ccoutant@google.com>
8262
8263 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8264 string, and length fields.
8265 (Output_merge_string::Merged_strings_list): New type.
8266 (Output_merge_string::Merged_strings_lists): New typedef.
8267 (Output_merge_string): Replace merged_strings_ with
8268 merged_strings_lists_.
8269 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8270 Merged_strings_list per input object and section. Don't store pointer
8271 to the string. Don't store length with each merged string entry.
8272 (Output_merge_string::finalize_merged_data): Loop over list of merged
8273 strings lists. Recompute length of each merged string.
8274
78384e8f
CC
82752010-07-15 Cary Coutant <ccoutant@google.com>
8276
8277 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8278 here.
8279
783659f9
ILT
82802010-07-14 Ian Lance Taylor <iant@google.com>
8281
8282 * descriptors.cc (Descriptors::open): Report correct name in error
8283 message.
8284
131687b4
DK
82852010-07-13 Doug Kwan <dougkwan@google.com>
8286
8287 * arm.cc (Arm_input_section::Arm_input_section): For a
8288 SHT_ARM_EXIDX section, always keeps the input sections.
8289 (Arm_input_section::set_exidx_section_link): New method.
8290 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8291 has_errors_ to false.
8292 (Arm_exidx_input_section::has_errors,
8293 Arm_exidx_input_section::set_has_errors): New methods.
8294 (Arm_exidx_input_section::has_errors_): New data member.
8295 (Arm_relobj::get_exidx_shndx_list): New method.
8296 (Arm_output_section::append_text_sections_to_list): Do not skip
8297 section without SHF_EXECINSTR.
8298 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8299 errors.
2e702c99 8300 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8301 section header. Make error messages more verbose. Check for
8302 a non-executable section linked to an EXIDX section.
8303 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8304 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8305 check that there is no deferred EXIDX section if we exit early.
8306 Instead of not making an EXIDX section in case of an error, make one
8307 and set the has_errors flag of it.
8308 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8309 in a relocatable link.
8310 (Target_arm::do_relax): Look for the EXIDX output section instead of
8311 assuming that it is called .ARM.exidx.
2e702c99 8312 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8313 section list. Do not check for SHF_EXECINSTR section flags but
8314 skip any input section with errors.
8315 * output.cc (Output_section::Output_section): Initialize
8316 always_keeps_input_sections_ to false.
8317 (Output_section::add_input_section): Check for
8318 always_keeps_input_sections_.
8319 * output.h (Output_section::always_keeps_input_sections,
8320 Output_section::set_always_keeps_input_sections): New methods.
8321 (Output_section::always_keeps_input_sections): New data member.
8322
69517287
RÁE
83232010-07-13 Rafael Espindola <espindola@google.com>
8324
8325 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8326 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8327
82742395
ILT
83282010-07-13 Philip Herron <herron.philip@googlemail.com>
8329 Ian Lance Taylor <iant@google.com>
8330
8331 * output.h (Output_section_lookup_maps::add_merge_section):
8332 Correct check of whether value was inserted.
8333 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8334 (Output_section_lookup_maps::add_relaxed_input_section):
8335 Likewise.
8336 * arm.cc (Target_arm::got_section): Remove used local os.
8337 * i386.cc (Target_i386::got_section): Likewise.
8338 * x86_64.cc (Target_x86_64::got_section): Likewise.
8339 * sparc.cc (Target_sparc::got_section): Likewise.
8340 (Target_sparc::relocate): Remove unused local have_got_offset.
8341 * powerpc.cc (Target_powerpc::relocate): Likewise.
8342
f2d707b5
ILT
83432010-07-13 Ian Lance Taylor <iant@google.com>
8344
241531d6
ILT
8345 * compressed_output.cc (zlib_decompress): Fix signature in
8346 !HAVE_ZLIB_H case.
8347
f2d707b5
ILT
8348 * archive.cc (Archive::include_member): Unlock an external member
8349 of a thin archive. Don't bother to delete an object we know is
8350 NULL.
8351
a2e47362
CC
83522010-07-12 Cary Coutant <ccoutant@google.com>
8353
8354 * compressed_output.cc (zlib_decompress): New function.
8355 (get_uncompressed_size): New function.
8356 (decompress_input_section): New function.
8357 * compressed_output.h (get_uncompressed_size): New function.
8358 (decompress_input_section): New function.
8359 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8360 Handle compressed debug sections.
8361 * layout.cc (is_compressed_debug_section): New function.
8362 (Layout::output_section_name): Map compressed section names to
8363 canonical names.
8364 * layout.h (is_compressed_debug_section): New function.
8365 (is_debug_info_section): Recognize compressed debug sections.
8366 * merge.cc: Include compressed_output.h.
8367 (Output_merge_data::do_add_input_section): Handle compressed
8368 debug sections.
8369 (Output_merge_string::do_add_input_section): Handle compressed
8370 debug sections.
8371 * object.cc: Include compressed_output.h.
8372 (Sized_relobj::Sized_relobj): Initialize new data members.
8373 (build_compressed_section_map): New function.
8374 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8375 * object.h (Object::section_is_compressed): New method.
8376 (Object::do_section_is_compressed): New method.
8377 (Sized_relobj::Compressed_section_map): New type.
8378 (Sized_relobj::do_section_is_compressed): New method.
8379 (Sized_relobj::compressed_sections_): New data member.
8380 * output.cc (Output_section::add_input_section): Handle compressed
8381 debug sections.
8382 * reloc.cc: Include compressed_output.h.
8383 (Sized_relobj::write_sections): Handle compressed debug sections.
8384
ce279a62
CC
83852010-07-08 Cary Coutant <ccoutant@google.com>
8386
8387 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8388 weak when resolving to a dynamic def.
8389 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8390 for weak undef/dynamic def cases. Adjust callers.
8391 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8392 undef_binding_weak_.
8393 (Symbol_table::sized_write_globals): Adjust symbol binding.
8394 (Symbol_table::sized_write_symbol): Add binding parameter.
8395 * symtab.h (Symbol::set_undef_binding): New method.
8396 (Symbol::is_undef_binding_weak): New method.
8397 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8398 (Symbol_table::should_override): Add new parameter.
8399 (Symbol_table::sized_write_symbol): Add new parameter.
8400
8401 * testsuite/weak_undef_file1.cc: Add new test case.
8402 * testsuite/weak_undef_file2.cc: Fix header comment.
8403 * testsuite/weak_undef_test.cc: Add new test case.
8404
b2286c10
DK
84052010-06-29 Doug Kwan <dougkwan@google.com>
8406
8407 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8408 Initialize USE_SYMBOL_.
8409 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8410 definition.
8411 (Arm_reloc_property::uses_symbol_): New data member declaration.
8412 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8413 uses symbol value and symbol is undefined but not weakly undefined.
8414
4802450a
RÁE
84152010-06-28 Rafael Espindola <espindola@google.com>
8416
8417 * plugin.cc (Plugin::load): Use dlerror.
8418
e5ca47ba
ILT
84192010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8420
8421 * symtab.cc (detect_odr_violations): When reporting an ODR
8422 violation, report an object where the symbol is defined.
8423
8a75a161
DK
84242010-06-25 Doug Kwan <dougkwan@google.com>
8425
8426 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8427 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8428 definition.
8429 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8430 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8431 target hook to detect function points.
8432 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8433 * icf.h (Icf::check_section_for_function_pointers): Change type of
8434 parameter SECTION_NAME to const reference to std::string. Use
8435 target hook to determine if section may have unsafe pointers.
8436 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8437 method definition.
8438
42218b9f
RÁE
84392010-06-21 Rafael Espindola <espindola@google.com>
8440
8441 * fileread.cc (Input_file::find_fie): New
8442 (Input_file::open): Use Input_file::find_fie.
8443 * fileread.h (Input_file::find_fie): New
8444 * plugin.cc (set_extra_library_path): New.
8445 (Plugin::load): Add set_extra_library_path to the transfer vector.
8446 (Plugin_manager::set_extra_library_path): New.
8447 (Plugin_manager::add_input_file): Use the extra search path if set.
8448 (set_extra_library_path(): New.
8449 * plugin.h (Plugin_manager): Add set_extra_library_path and
8450 extra_search_path_.
8451
a0506cca
CC
84522010-06-19 Cary Coutant <ccoutant@google.com>
8453
8454 * layout.cc (gdb_sections): Add .debug_types.
8455 (lines_only_debug_sections): Likewise.
8456
6508b958
RÁE
84572010-06-18 Rafael Espindola <espindola@google.com>
8458
8459 * plugin.cc (add_input_file,add_input_library)
8460 (Plugin_manager::add_input_file): Make filename arguments const.
8461 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8462 const.
8463
3e235302
DK
84642010-06-16 Doug Kwan <dougkwan@google.com>
8465
8466 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8467 .ARM.attributes section if we have not merged any input
8468 attributes sections.
8469
106e8a6c
DK
84702010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8471
8472 * arm.cc: Allow combining objects with no EABI version
8473 information.
8474
91ff43fe
RÁE
84752010-06-15 Rafael Espindola <espindola@google.com>
8476
8477 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8478
68ed838c
ILT
84792010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8480
8481 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8482 (struct iovec): Correct !HAVE_READV definition.
8483
f3a2388f
CC
84842010-06-10 Cary Coutant <ccoutant@google.com>
8485
8486 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8487 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8488 reloc sections.
8489 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8490
8491 PR 11683
8492 * symtab.h (Symbol::is_placeholder): New member function.
8493 * target-reloc.h (relocate_section): Check for placeholder symbols.
8494
8495 * testsuite/Makefile.am (plugin_test_8): New test.
8496 (plugin_test_9): New test.
8497 * testsuite/Makefile.in: Regenerate.
8498
e1df38aa
NC
84992010-06-09 Nick Clifton <nickc@redhat.com>
8500
8501 * yyscript.y (input_list_element): Allow strings prefixed with
8502 the '-' character. Treat these as libraries.
8503 * script.cc (script_add_library): New function. Adds a library
8504 specified by "-l<name>" found in an input script.
8505 * script-c.h: Add prototype for script_add_library.
8506
25bbe950
DK
85072010-06-07 Doug Kwan <dougkwan@google.com>
8508
8509 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8510 Restrict stub-group size to be within long conditional branch
8511 range when working around cortex-A8 erratum.
8512
0f32ea4c
ILT
85132010-06-07 Damien Diederen <dd@crosstwine.com>
8514
8515 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8516 #ifdef typo.
8517
8fe2a369
ST
85182010-06-03 Sriraman Tallam <tmsriram@google.com>
8519
8520 PR gold/11658
8521 * output.cc
8522 (Output_section::Input_section_sort_entry::compare_section_ordering):
8523 Change to return non-zero correctly.
8524 (Output_section::Input_section_sort_section_order_index_compare
8525 ::operator()): Change to fix ambiguity in comparisons.
8526
6e9ba2ca
ST
85272010-06-01 Sriraman Tallam <tmsriram@google.com>
8528
8529 * gold.h (is_wildcard_string): New function.
8530 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8531 (Layout::layout_eh_frame): Ditto.
8532 (Layout::find_section_order_index): New method.
8533 (Layout::read_layout_from_file): New method.
8534 * layout.h (Layout::find_section_order_index): New method.
8535 (Layout::read_layout_from_file): New method.
8536 (Layout::input_section_position_): New private member.
8537 (Layout::input_section_glob_): New private member.
8538 * main.cc (main): Call read_layout_from_file here.
8539 * options.h (--section-ordering-file): New option.
8540 * output.cc (Output_section::input_section_order_specified_): New
8541 member.
8542 (Output_section::Output_section): Initialize new member.
8543 (Output_section::add_input_section): Add new parameter.
8544 Keep input sections when --section-ordering-file is used.
8545 (Output_section::set_final_data_size): Sort input sections when
8546 section ordering file is specified.
8547 (Output_section::Input_section_sort_entry): Add new parameter.
8548 Check sorting type.
8549 (Output_section::Input_section_sort_entry::compare_section_ordering):
8550 New method.
8551 (Output_section::Input_section_sort_compare::operator()): Change to
8552 consider section_order_index.
8553 (Output_section::Input_section_sort_init_fini_compare::operator()):
8554 Change to consider section_order_index.
8555 (Output_section::Input_section_sort_section_order_index_compare
8556 ::operator()): New method.
8557 (Output_section::sort_attached_input_sections): Change to sort
8558 according to section order when specified.
e1df38aa
NC
8559 (Output_section::add_input_section<32, true>): Add new parameter.
8560 (Output_section::add_input_section<64, true>): Add new parameter.
8561 (Output_section::add_input_section<32, false>): Add new parameter.
8562 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
8563 * output.h (Output_section::add_input_section): Add new parameter.
8564 (Output_section::input_section_order_specified): New
8565 method.
8566 (Output_section::set_input_section_order_specified): New method.
8567 (Input_section::Input_section): Initialize section_order_index_.
8568 (Input_section::section_order_index): New method.
8569 (Input_section::set_section_order_index): New method.
8570 (Input_section::section_order_index_): New member.
8571 (Input_section::Input_section_sort_section_order_index_compare): New
8572 struct.
8573 (Output_section::input_section_order_specified_): New member.
8574 * script-sections.cc (is_wildcard_string): Delete and move modified
8575 method to gold.h.
8576 (Output_section_element_input::Output_section_element_input): Modify
8577 call to is_wildcard_string.
8578 (Output_section_element_input::Input_section_pattern
8579 ::Input_section_pattern): Ditto.
8580 (Output_section_element_input::Output_section_element_input): Ditto.
8581 * testsuite/Makefile.am (final_layout): New test case.
8582 * testsuite/Makefile.in: Regenerate.
8583 * testsuite/final_layout.cc: New file.
8584 * testsuite/final_layout.sh: New file.
8585
3537c84b
RÁE
85862010-06-01 Rafael Espindola <espindola@google.com>
8587
8588 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8589
105b6afd
RÁE
85902010-06-01 Rafael Espindola <espindola@google.com>
8591
8592 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8593 visibility of symbols.
8594
29e11421
DK
85952010-05-27 Doug Kwan <dougkwan@google.com>
8596
8597 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8598 from start of output section instead of address for a local symbol
8599 in a merged or relaxed section when doing a relocatable link.
8600
5e0f337e
RÁE
86012010-05-26 Rafael Espindola <espindola@google.com>
8602
703d02da 8603 PR 11604
5e0f337e
RÁE
8604 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8605 adding sections the garbage collector removed.
8606 * gold/testsuite/Makefile.am: Add test.
8607 * gold/testsuite/Makefile.in: Regenerate.
8608 * gold/testsuite/plugin_test_7.sh: New.
8609 * gold/testsuite/plugin_test_7_1.c: New.
8610 * gold/testsuite/plugin_test_7_2.c: New.
8611
f4187277
RÁE
86122010-05-26 Rafael Espindola <espindola@google.com>
8613
8614 * script-sections.cc (Output_section_definition::set_section_addresses):
8615 Check for --section-start.
8616
5c388529
DK
86172010-05-26 Doug Kwan <dougkwan@google.com>
8618
8619 * arm.cc (Arm_scan_relocatable_relocs): New class.
8620 (Target_arm::relocate_special_relocatable): New method.
8621 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8622 (Arm_relocate_functions::thumb_branch_common): Same.
8623 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8624 instead of Default_scan_relocatable_relocs.
8625 * target-reloc.h (relocate_for_relocatable): Let target handle
8626 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8627 * target.h (Sized_target::relocate_special_relocatable): New method.
8628
bca1c3ae
ILT
86292010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8630
8631 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8632
0439c796
DK
86332010-05-23 Doug Kwan <dougkwan@google.com>
8634
8635 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8636 instead of a cast.
8637 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8638 with a direct branch, not a conditional branch, to a stub.
8639 * merge.cc (Output_merge_base::record_input_section): New method
8640 defintion.
8641 (Output_merge_data::do_add_input_section): Record input section if
8642 keeps-input-sections flag is set.
8643 (Output_merge_string::do_add_input_section): Ditto.
8644 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8645 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8646 INPUT_SECTIONS_.
8647 (Output_merge_base::keeps_input_sections,
8648 Output_merge_base::set_keeps_input_sections,
8649 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8650 method definitions.
8651 (Output_merge_base::Input_sections): New type declaration.
8652 (Output_merge_base::input_sections_begin,
8653 Output_merge_base::input_sections_end,
8654 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8655 (Output_merge_base::bool keeps_input_sections_,
8656 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8657 Output_merge_base::input_sections_): New data members.
8658 (Output_merge_data::do_set_keeps_input_sections): New method
8659 defintion.
8660 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8661 * output.cc (Output_section::Input_section::relobj): Move method
8662 defintion from class declaration to here and handle merge sections.
8663 (Output_section::Input_section::shndx): Ditto.
8664 (Output_section::Output_section): Remove initializations of removed
8665 data members and initialize new data member LOOKUP_MAPS_.
8666 (Output_section::add_input_section): Set keeps-input-sections flag
8667 for a newly created merge output section as appropriate. Adjust code
8668 to use Output_section_lookup_maps class.
8669 (Output_section::add_relaxed_input_section): Adjst code for lookup
8670 maps code refactoring.
2e702c99 8671 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
8672 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8673 class. If adding input section to a newly created merge output
8674 section fails, remove the new merge section.
8675 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 8676 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 8677 (Output_section::find_merge_section): Ditto.
0439c796 8678 (Output_section::build_lookup_maps): New method defintion.
2e702c99 8679 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
8680 Output_section_lookup_maps class.
8681 (Output_section::get_input_sections): Export merge sections. Adjust
8682 code to use Output_section_lookup_maps class.
8683 (Output_section:::add_script_input_section): Adjust code to use
8684 Output_section_lookup_maps class. Update lookup maps for merge
8685 sections also.
8686 (Output_section::discard_states): Use Output_section_lookup_maps.
8687 (Output_section::restore_states): Same.
8688 * output.h (Merge_section_properties): Move class defintion out of
8689 Output_section.
8690 (Output_section_lookup_maps): New class.
8691 (Output_section::Input_section::is_merge_section): New method
8692 defintion.
8693 (Output_section::Input_section::relobj): Move defintion out of class
8694 defintion. Declare method only.
8695 (Output_section::Input_section::shndx): Ditto.
8696 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 8697 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
8698 (Output_section::Merge_section_by_properties_map,
8699 Output_section::Output_section_data_by_input_section_map,
8700 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8701 Remove types.
2e702c99 8702 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
8703 KEEPS_INPUT_SECTIONS.
8704 (Output_section::build_lookup_maps): New method declaration.
8705 (Output_section::merge_section_map_,
8706 Output_section::merge_section_by_properties_map_,
8707 Output_section::relaxed_input_section_map_,
8708 Output_section::is_relaxed_input_section_map_valid_): Remove data
8709 members.
8710 (Output_section::lookup_maps_): New data member.
8711
76295588
L
87122010-05-21 Doug Kwan <dougkwan@google.com>
8713
8714 PR gold/11619
8715 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8716 avoid a compilation error.
8717
d103a984
RÁE
87182010-05-19 Rafael Espindola <espindola@google.com>
8719
8720 * script-sections.cc (Output_section_definition::allocate_to_segment):
8721 Update the phdrs_list even when the output section is NULL.
8722 * testsuite/Makefile.am: Add test.
8723 * testsuite/Makefile.in: Regenerate.
8724 * testsuite/script_test_9.cc: New.
8725 * testsuite/script_test_9.sh: New.
8726 * testsuite/script_test_9.t: New.
8727
6625d24e
DK
87282010-05-19 Doug Kwan <dougkwan@google.com>
8729
8730 * arm.cc (Arm_input_section::original_size): New method.
8731 (Arm_input_section::do_addralign): Add a cast.
8732 (Arm_input_section::do_output_offset): Remove static cast.
8733 (Arm_input_section::original_addralign,
8734 Arm_input_section::original_size_): Change type to uint32_t.
8735 (Arm_input_section::init): Add safe casts for section alignment
8736 and size.
8737 (Arm_input_section::set_final_data_size): Do not set address and
8738 offset of stub table.
8739 (Arm_output_section::fix_exidx_coverage): Change use of of
8740 Output_section::Simple_input_section to that of
8741 Output_section::Input_section.
8742 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8743 except for the first pass.
8744 * output.cc (Output_section::get_input_sections): Change type of
8745 input_sections to std::list<Input_section>.
8746 (Output_section::add_script_input_section): Rename from
8747 Output_section::add_simple_input_section. Change type of SIS
8748 parameter from Simple_input_section to Input_section.
8749 * output.h (Output_section::Simple_input_section): Remove class.
8750 (Output_section::Input_section): Change class visibility to public.
8751 (Output_section::Input_section::addralign): Use stored alignments
8752 for special input sections if set.
8753 (Output_section::Input_section::set_addralign): New method.
8754 (Output_section::get_input_sections): Change parameter type from
8755 list of Simple_input_section to list of Input_section.
8756 (Output_section::add_script_input_section): Rename from
8757 Output_section::add_simple_input_section. Change first parameter's
8758 type from Simple_input_section to Input_section and remove the
8759 second and third parameters.
8760 * script-sections.cc (Input_section::Input_section_list): Change
8761 type to list of Output_section::Input_section/
8762 (Input_section_info::Input_section_info): Change parameter type of
8763 INPUT_SECTION to Output_section::Input_section.
8764 (Input_section_info::input_section): Change return type.
8765 (Input_section_info::input_section_): Change type to
8766 Output_section::Input_section.
8767 (Output_section_element_input::set_section_addresses): Adjust code
8768 to use Output_section::Input_section instead of
8769 Output_section::Simple_input_section. Adjust code for renaming
8770 of Output_section::add_simple_input_section.
8771 (Orphan_output_section::set_section_addresses): Ditto.
8772
e1e82ea4
RW
87732010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8774
8775 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8776 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8777
91e75c8a
RÁE
87782010-05-18 Rafael Espindola <espindola@google.com>
8779
8780 * options.cc (General_options::finalize): Handle -nostdlib.
8781 * options.h (nostdlib): New option.
8782 * script.cc (script_add_search_dir): Handle -nostdlib.
8783
da59ad79
DK
87842010-05-12 Doug Kwan <dougkwan@google.com>
8785
8786 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8787 attributes section only if there no attributes section after merging.
8788 (Target_arm::merge_object_attributes): Move value of
e1df38aa 8789 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
8790 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8791 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8792 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8793 and arm_attr_merge_7.stdout.
8794 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8795 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8796 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8797 arm_attr_merge_7b.o): New rules.
8798 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8799 arm_attr_merge_7
8800 * testsuite/Makefile.in: Regenerate.
8801 * testsuite/arm_attr_merge.sh: New file.
8802 * testsuite/arm_attr_merge_[67][ab].s: Same.
8803
3e01a7fd
NC
88042010-05-05 Nick Clifton <nickc@redhat.com>
8805
8806 * po/es.po: Updated Spanish translation.
8807
7ad2014a
L
88082010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8809
8810 * Makefile.am (install-exec-local): Properly install gold as
8811 default cross linker.
8812 * Makefile.in: Regenerated.
8813
4fda8867
NC
88142010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8815 Nick Clifton <nickc@redhat.com>
8816
8817 * configure.ac (install_as_default): Define and set to false
8818 unless --enable-gold or --enable-gold=both/gold has been
8819 specified.
8820 * configure: Regenerate.
8821
8822 * Makefile.am (install-exec-local): Install the executable as
8823 'ld.gold'. If install_as_default is true then also install it as
8824 'ld'.
8825 * Makefile.in: Regenerated.
8826
bd288ea2
ILT
88272010-04-24 Ian Lance Taylor <iant@google.com>
8828
8829 * layout.cc (Layout::layout_reloc): In relocatable link don't
8830 combine reloc sections for grouped sections.
8831
ef38fd8a
ST
88322010-04-23 Sriraman Tallam <tmsriram@google.com>
8833
8834 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8835 sections that are not ordinary to icf.
8836 * icf.cc (get_section_contents): Handle relocation pointing to section
8837 with no object or shndx information.
8838 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8839 * testsuite/Makefile.in: Regenerate.
8840 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8841 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8842
f6973bdc
ILT
88432010-04-22 Ian Lance Taylor <iant@google.com>
8844
8845 * expression.cc (Expression::Expression_eval_info): Add
8846 result_alignment_pointer field.
8847 (Expression::eval_with_dot): Add result_alignment_pointer
8848 parameter. Change all callers.
8849 (Expression::eval_maybe_dot): Likewise.
8850 (class Binary_expression): Add alignment_pointer parameter to
8851 left_value and right_value. Change all callers.
8852 (BINARY_EXPRESSION): Set result alignment.
8853 (class Trinary_expression): Add alignment_pointer parameter to
8854 arg2_value and arg3_value. Change all callers.
8855 (Trinary_cond::value): Set result alignment.
8856 (Max_expression::value, Min_expression::value): Likewise.
8857 (Align_expression::value): Likewise.
8858 * script-sections.cc (class Sections_element): Add dot_alignment
8859 parameter to set_section_addresses virtual function. Update
8860 instantiations.
8861 (class Output_section_element): Likewise.
8862 (Script_sections::create_segments): Add dot_alignment parameter.
8863 Change all callers.
8864 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8865 (Script_sections::set_phdrs_clause_addresses): Likewise.
8866 * script-sections.h: Update declarations.
8867 * script.h: Update declarations.
8868 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8869 min_p_align.
8870 * testsuite/script_test_3.t: Set large alignment.
8871 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8872 segment has expected alignment.
8873
9c9c98a5
NC
88742010-04-22 Nick Clifton <nickc@redhat.com>
8875
8876 * po/gold.pot: Updated by the Translation project.
8877 * po/vi.po: Updated Vietnamese translation.
8878
2253bfba
L
88792010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8880
8881 * testsuite/Makefile.am (check_PROGRAMS): Add
8882 icf_virtual_function_folding_test.
8883 * testsuite/Makefile.in: Regenerated.
8884
85fdf906
AH
88852010-04-15 Andrew Haley <aph@redhat.com>
8886
8887 * options.h (merge_exidx_entries): New option.
8888 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8889 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8890 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8891 (Target_arm::merge_exidx_entries): New function.
8892 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8893 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8894 to Arm_exidx_fixup constructor.
8895 Add new arg, merge_exidx_entries.
8896 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
8897 Arm_output_section::fix_exidx_coverage.
8898
ce97fa81
ST
88992010-04-18 Sriraman Tallam <tmsriram@google.com>
8900
8901 * icf.cc (get_section_contents): Check for preemptible functions.
8902 Ignore addend when appropriate.
8903 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
8904 section folded.
8905 (add_from_relobj): Check for section folded.
8906 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
8907 * symtab.h (should_add_dynsym_entry): Add new parameter.
8908 * target-reloc.h (scan_relocs): Check for section folded.
8909 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
8910 Check reloc types for function pointers in shared objects.
8911 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
8912 case.
8913 (icf_preemptible_functions_test): New test case.
8914 (icf_string_merge_test): New test case.
8915 * testsuite.Makefile.in: Regenerate.
8916 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
8917 bar_glob. Refactor code.
8918 * testsuite/icf_preemptible_functions_test.cc: New file.
8919 * testsuite/icf_preemptible_functions_test.sh: New file.
8920 * testsuite/icf_string_merge_test.cc: New file.
8921 * testsuite/icf_string_merge_test.sh: New file.
8922 * testsuite/icf_virtual_function_folding_test.cc: New file.
8923 * testsuite/icf_virtual_function_folding_test.sh: New file.
8924
04ceb17c
DK
89252010-04-14 Doug Kwan <dougkwan@google.com>
8926
8927 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
8928 for local symbol recounting if we remove a section due to ICF.
8929 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
8930 there are no regular objects in input.
8931
153e7da4
DK
89322010-04-13 Doug Kwan <dougkwan@google.com>
8933
8934 * arm.cc (Arm_input_section::set_final_data_size): Compute
8935 accurate final data size instead of using current data size.
8936
4dbd9faf
DK
89372010-04-09 Doug Kwan <dougkwan@google.com>
8938
8939 * layout.cc (Layout::choose_output_section): Handle script section
8940 types.
8941 (Layout::make_output_section_for_script): Add section type parameter.
8942 Handle script section types.
8943 * layout.h (Layout::make_output_section_for_script): Add section
8944 type parameter.
8945 * output.cc (Output_section::Output_section): Initialize data member
8946 is_noload_.
8947 (Output_section::do_reset_address_and_file_offset): Do not set address
8948 to 0 if section is a NOLOAD section.
8949 * output.h (Output_section::is_noload): New method.
8950 (Output_section::set_is_noload): Ditto.
8951 (Output_section::is_noload_): New data member.
8952 * script-c.h (Script_section_type): New enum type.
8953 (struct Parser_output_section_header): Add new file section_type.
8954 * script-sections.cc (Sections_element::output_section_name): Add
8955 parameter for returning script section type.
8956 (Output_section_definition::output_section_name): Ditto.
8957 (Output_section_definition::section_type)P; New method.
8958 (Output_section_definiton::script_section_type_name): Ditto.
8959 (Output_section_definition::script_section_type_): New data member.
8960 (Output_section_definition::Output_section_definition): Initialize
8961 data member Output_section_definition::script_section_type_.
8962 (Output_section_definition::create_sections): Pass script section type
8963 to Layout::make_output_section_for_script.
8964 (Output_section_definition::output_section_name): Return script
8965 section type to caller.
8966 (Output_section_definition::set_section_address): Do not advance
8967 dot value and load address if section type is NOLOAD. Set address
8968 of NOLOAD sections regardless of section flags.
8969 (Output_section_definition::print): Print section type if it is
8970 not SCRIPT_SECTION_TYPE_NONE.
8971 (Output_section_definition::section_type): New method.
8972 (Output_section_definition::script_section_type_name): Ditto.
8973 (Script_sections::output_section_name): Add new parameter
8974 PSECTION_TYPE for returning script section type. Pass it to
8975 section elements. Handle discard sections.
8976 (Sort_output_sections::operator()): Handle NOLOAD sections.
8977 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 8978 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
8979 returning script section type.
8980 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
8981 INFO and NOLOAD.
8982 * yyscript.y (union): Add new field SECTION_TYPE.
8983 (COPY, DSECT, INFO, NOLOAD): New tokens.
8984 (opt_address_and_section_type): Change type to output_section_header.
8985 (section_type): New non-terminal
8986 (section_header): Handle section type.
2253bfba 8987 (opt_address_and_section_type): Return section type value.
4dbd9faf 8988
721ea635
L
89892010-04-09 H.J. Lu <hongjiu.lu@intel.com>
8990
8991 * testsuite/plugin_common_test_1.c (foo): Add prototype.
8992 * testsuite/plugin_common_test_2.c (foo): Likewise.
8993
6bf924b0
DK
89942010-04-08 Doug Kwan <dougkwan@google.com>
8995
8996 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
8997 Output_merge_data.
8998 * output.cc (Output_section::add_merge_input_section): Simplify
8999 code and return status of Output_merge_base::add_input_section.
e1df38aa 9000 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
9001 returns true.
9002
24af6f92
DK
90032010-04-07 Doug Kwan <dougkwan@google.com>
9004
9005 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9006 if section is marked as containing instructions but has no mapping
9007 symbols.
9008 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9009 correct section index.
9010 (Arm_relobj::find_linked_text_section): Ditto.
9011
00698fc5
CC
90122010-04-07 Cary Coutant <ccoutant@google.com>
9013
9014 * archive.cc (include_member): Destroy Read_symbols_data object before
9015 releasing file.
9016 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9017 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9018 (Read_symbols_data::~Read_symbols_data) New destructor.
9019 (Section_relocs::Section_relocs) New constructor.
9020 (Section_relocs::~Section_relocs) New destructor.
9021 (Read_relocs_data::Read_relocs_data) New constructor.
9022 (Read_relocs_data::~Read_relocs_data) New destructor.
9023 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9024 pointers to NULL after deleting.
9025
7296d933
DK
90262010-04-07 Doug Kwan <dougkwan@google.com>
9027
9028 * arm.cc: Replace "endianity" with "endianness" in comments.
9029 (Arm_exidx_cantunwind): Ditto.
9030 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9031 (Arm_relobj::merge_flags_and_attributes): New method.
9032 (Arm_relobj::merge_flags_and_attributes_): New data member.
9033 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9034 (Arm_relobj::scan_sections_for_stubs): Ditto.
9035 (Arm_relobj::do_read_symbols): Check to see if we really want to
9036 merge processor-specific flags and attributes. Exit early if
9037 an object is empty except for section names and the undefined symbol.
9038 (Target_arm::do_finalize_sections): Move check for ELF format to
9039 Arm_relobj::do_read_symbols. Merge processor specific flags and
9040 attributes from a regular object only when we have determined that
9041 it is aapropriate. Do not create an .ARM.attributes section in
9042 output if there is no regular input object.
9043 (Target_arm::merge_processor_specific_flags): Check
9044 --warn-mismatch before printing any error.
9045 (Target_arm::merge_object_attributes): Ditto.
9046 * gold.cc (queue_middle_tasks): Handle the case in which there is
9047 no regular object in input.
9048 * options.cc (General_options::parse_EB): New method.
9049 (General_options::parse_EL): Same.
9050 (General_options::General_options): Initialize endianness_.
9051 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9052 New options.
9053 (General_options::Endianness): New enum.
9054 (General_options::endianness): New method.
9055 (General_options::endianness_): New data member.
9056 * parameters.cc (Parameters::set_options): Check target endianness.
9057 (Parameters::set_target_once): Ditto.
9058 (Parameters::check_target_endianness): New method.
9059 (parameters_force_valid_target): If either -EL or -EB is specified,
9060 use it to define endianness of default target.
9061 * parameters.h (Parameters::check_target_endianness): New method
9062 declaration.
9063 * target.h (class Target): Change "endianity" to "endianness"
9064 in comments.
9065
efc8d4f2
RW
90662010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9067
9068 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9069 * configure: Regenerate.
9070 * Makefile.in: Regenerate.
9071 * testsuite/Makefile.in: Regenerate.
9072
be234d88
CC
90732010-04-06 Cary Coutant <ccoutant@google.com>
9074
9075 gcc PR lto/42757
9076 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9077 prevailing definitions of common symbols.
9078 * testsuite/plugin_test_6.sh: New test case.
9079 * testsuite/plugin_common_test_1.c: New test case.
9080 * testsuite/plugin_common_test_2.c: New test case.
9081 * testsuite/Makefile.am (plugin_test_6): New test case.
9082 * testsuite/Makefile.in: Regenerate.
9083
bd32c6bd
NC
90842010-04-06 Nick Clifton <nickc@redhat.com>
9085
9086 * po/vi.po: New Vietnamese translation.
9087
323c532f
DK
90882010-03-30 Doug Kwan <dougkwan@google.com>
9089
9090 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9091
4fcd97eb
DK
90922010-03-25 Doug Kwan <dougkwan@google.com>
9093
9094 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9095 to avoid a conversion warning on a 32-bit host.
9096
4ebf39db
ILT
90972010-03-24 Ian Lance Taylor <iant@google.com>
9098
9099 * testsuite/script_test_3.t: Add a TLS segment.
9100 * testsuite/Makefile.am (check_PROGRAMS): Add
9101 tls_phdrs_script_test.
9102 (tls_phdrs_script_test_SOURCES): Define.
9103 (tls_phdrs_script_test_DEPENDENCIES): Define.
9104 (tls_phdrs_script_test_LDFLAGS): Define.
9105 (tls_phdrs_script_test_LDADD): Define.
9106 * testsuite/Makefile.in: Rebuild.
9107
4a599bdd
CC
91082010-03-23 Cary Coutant <ccoutant@google.com>
9109
9110 * fileread.cc (find_or_make_view): Fix comment.
9111
6c93b22c
ILT
91122010-03-23 Ian Lance Taylor <iant@google.com>
9113
9114 * script-sections.cc (class Orphan_section_placement): Define
9115 PLACE_TLS and PLACE_TLS_BSS.
9116 (Orphan_section_placement::Orphan_section_placement): Initialize
9117 new places.
9118 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9119 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9120 (tls_script_test_SOURCES): Define.
9121 (tls_script_test_DEPENDENCIES): Define.
9122 (tls_script_test_LDFLAGS): Define.
9123 (tls_script_test_LDADD): Define.
9124 * testsuite/Makefile.in: Rebuild.
9125
a2c7281b
DK
91262010-03-22 Doug Kwan <dougkwan@google.com>
9127
9128 * arm.cc (Arm_relocate_functions::abs8,
9129 Arm_relocate_functions::abs16): Use correct check for overflow
9130 specified in the ARM ELF specs.
9131 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9132 target of a BLX instruction specially.
9133 (Reloc_stub::stub_type_for_reloc): Ditto.
9134 (Relocate::relocate): Use symbolic names instead of numeric relocation
9135 codes to report error.
9136 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9137 workaround.
9138 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9139 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9140 thumb2_blx_out_of_range.stdout
9141 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9142 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9143 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9144 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9145 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9146 thumb2_blx_in_range, thumb2_blx_in_range.o,
9147 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9148 thumb2_blx_out_of_range.o): New rules.
2e702c99 9149 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
9150 thumb2_blx_in_range and thumb2_blx_out_of_range.
9151 * testsuite/Makefile.in: Regenerate.
9152 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9153 * testsuite/thumb_blx_in_range.s: New file.
9154 * testsuite/thumb_blx_out_of_range.s: New file.
9155
b0193076
RÁE
91562010-03-22 Rafael Espindola <espindola@google.com>
9157
9158 * archive.cc (Should_include): Move to archive.h.
9159 (should_include_member): Make it a member of Archive.
9160 (Lib_group): New.
9161 (Add_lib_group_symbols): New.
9162 * archive.h: Include options.h.
9163 (Archive_member): Moved from Archive.
9164 (Should_include): Moved from archive.cc.
9165 (Lib_group): New.
9166 (Add_lib_group_symbols): New.
9167 * dynobj.cc (do_should_include_member): New.
9168 * dynobj.h (do_should_include_member): New.
9169 * gold.cc (queue_initial_tasks): Update call to queue.
9170 * main.cc (main): Print lib group stats.
9171 * object.cc (do_should_include_member): New.
9172 * object.h: Include archive.h.
9173 (Object::should_include_member): New.
9174 (Object::do_should_include_member): New.
9175 (Sized_relobj::do_should_include_member): New.
9176 * options.cc (General_options::parse_start_lib): New.
9177 (General_options::parse_end_lib): New.
9178 (Input_arguments::add_file): Handle lib groups.
9179 (Input_arguments::start_group): Check we are not in a lib.
9180 (Input_arguments::start_lib): New.
9181 (Input_arguments::end_lib): New.
9182 * options.h (General_options): Add start_lib and end_lib.
9183 (Input_argument::lib_): New.
9184 (Input_argument::lib): New.
9185 (Input_argument::is_lib): New.
9186 (Input_file_lib): New.
9187 (Input_arguments::in_lib_): New.
9188 (Input_arguments::in_lib): New.
9189 (Input_arguments::start_lib): New.
9190 (Input_arguments::end_lib_): New.
9191 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9192 in unused members as preempted.
9193 (Sized_pluginobj::do_should_include_member): New.
9194 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9195 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9196 return the blocker.
9197 (Read_symbols::do_whole_lib_group): New.
9198 (Read_symbols::do_lib_group): New.
9199 (Read_symbols::do_read_symbols): Handle lib groups.
9200 (Read_symbols::get_name): Handle lib groups.
9201 * readsyms.h (Read_symbols): Add an archive member pointer.
9202 (Read_symbols::do_whole_lib_group): New.
9203 (Read_symbols::do_lib_group): New.
9204 (Read_symbols::member_): New.
9205 * script.cc (read_input_script): Update call to queue_soon.
9206
d099120c
DK
92072010-03-19 Doug Kwan <dougkwan@google.com>
9208
9209 * arm.cc (Stub_table::Stub_table): Initialize new data members
9210 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9211 (Stub_table::add_reloc_stub): Assign stub offset and update
9212 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9213 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9214 New data members.
2e702c99 9215 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9216 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9217 instead of going over all reloc stubs.
2e702c99 9218 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9219 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9220 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9221 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9222 Stringpool_template::offset_.
9223 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9224 Stringpool_template::offset_ to zero.
9225
1aa37384
DK
92262010-03-15 Doug Kwan <dougkwan@google.com>
9227
9228 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9229 offset_.
9230 (Stringpool_template::new_key_offset): New method.
9231 (Stringpool_template::add_string): Assign offsets when adding new
9232 strings.
9233 (Stringpool_template::set_string_offsets): Do not set string offsets
9234 when not optimizing.
9235 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9236 member size_.
2e702c99
RM
9237 (Chunked_vector::clear): Clear size_.
9238 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9239 (Chunked_vector::size): Return size_.
9240 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9241 (Chunked_vector::size_): New data member.
1aa37384
DK
9242 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9243 (Stringpool_template::new_key_offset): New method declaration.
9244 (Stringpool_template::offset_): New data member.
9245
b672b057
RÁE
92462010-03-15 Rafael Espindola <espindola@google.com>
9247
9248 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9249 Add_symbols' constructor.
9250 * readsyms.h (Add_symbols): Remove the input_group member.
9251
b6848d3c
ILT
92522010-03-10 Ian Lance Taylor <iant@google.com>
9253
9254 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9255 target to ask whether a reference to a symbol requires a stack
9256 split.
9257 * target.h (Target::is_call_to_non_split): New function.
9258 (Target::do_is_call_to_non_split): Declare virtual function.
9259 * target.cc: Include "symtab.h".
9260 (Target::do_is_call_to_non_split): New function.
9261 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9262
a2a5469e
CC
92632010-03-10 Cary Coutant <ccoutant@google.com>
9264
9265 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9266 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9267 (File_read::open[2]): Add whole_file_view_ to list of views.
9268 (File_read::make_view): Remove test of whole_file_view_.
9269 (File_read::find_or_make_view): Create whole_file_view_ if
9270 necessary.
9271 (File_read::clear_views): Replace bool parameter with enum;
9272 adjust all callers. Don't delete views with permanent data;
9273 do delete cached views and views from archives if
9274 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9275 if clearing the corresponding view.
9276 * fileread.h (File_read::Clear_views_mode): New enum.
9277 (File_read::View::is_permanent_view): New method.
9278 (File_read::clear_views): Replace bool parameter
9279 with enum; adjust all callers.
9280 * options.h (General_options): Change keep_files_mapped option;
9281 add map_whole_files.
9282 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9283 releasing the file.
9284 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9285 the file.
9286
8861f32b
DM
92872010-03-10 David S. Miller <davem@davemloft.net>
9288
9289 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9290
d62d0f5f
ST
92912010-03-09 Sriraman Tallam <tmsriram@google.com>
9292
9293 * icf.cc (get_section_contents): Add '@' marker after processing the
9294 merge reloc.
9295
9177756d
DK
92962010-03-08 Doug Kwan <dougkwan@google.com>
9297
9298 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9299 due to a conversion warning.
9300 (Arm_relobj::update_output_local_symbol_count): Check for local
9301 symbol with unset output index.
9302
9e9e071b
ILT
93032010-03-05 Ian Lance Taylor <iant@google.com>
9304
9305 * options.h (class General_options): Add --spare-dynamic-tags.
9306 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9307 --spare-dynamic-tags.
9308
a81ee015
ILT
93092010-03-05 Ian Lance Taylor <iant@google.com>
9310
9311 * incremental.cc: Include "libiberty.h".
9312
44ec90b9
RO
93132010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9314
9315 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9316 function, is_info_ member.
9317 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9318 (Versions::Versions): Update caller.
9319 (Versions::define_base_version): Likewise.
9320 (Versions::add_def): Likewise.
9321
0897ed3b
ST
93222010-03-03 Sriraman Tallam <tmsriram@google.com>
9323
9324 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9325 (Scan::possible_function_pointer_reloc): New function.
9326 (Scan::local_reloc_may_be_function_pointer): Change to call
9327 possible_function_pointer_reloc.
9328 (Scan::global_reloc_may_be_function_pointer): Ditto.
9329 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9330 relocations in ".data.rel.ro._ZTV" section.
9331 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9332 * testsuite/icf_safe_so_test.cc: Ditto.
9333 * testsuite/icf_safe_test.cc: Ditto.
9334 * testsuite/icf_safe_test.sh: Ditto.
9335
d3bbad62
ILT
93362010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9337 Ian Lance Taylor <iant@google.com>
9338
9339 * target-reloc.h (relocate_section): Check the symbol table index
9340 for -1U before setting the local symbol index.
9341 (scan_relocatable_relocs): If copying the relocation, record that
9342 the local symbol is required.
9343 * object.h (Symbol_value::is_output_symtab_index_set): New
9344 function.
9345 (Symbol_value::may_be_discarded_from_output_symtab): New
9346 function.
9347 (Symbol_value::has_output_symtab_entry): New function.
9348 (Symbol_value::needs_output_symtab_entry): Remove.
9349 (Symbol_value::output_symtab_index): Make sure the symbol index is
9350 set.
9351 (Symbol_value::set_output_symtab_index): Make sure the symbol
9352 index is not set. Make sure the new index is valid.
9353 (Symbol_value::set_must_have_output_symtab_entry): New function.
9354 (Symbol_value::has_output_dynsym_entry): New function.
9355 (Symbol_value::set_output_dynsym_index): Make sure the new index
9356 is valid.
9357 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9358 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9359 local symbol if permitted.
9360 (Sized_relobj::do_finalize_local_symbols): Call
9361 is_output_symtab_index_set rather than needs_output_symtab_entry.
9362 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9363 rather than needs_output_symtab_entry. Call
9364 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9365 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9366 is_output_symtab_index_set rather than needs_output_symtab_entry.
9367 * testsuite/discard_locals_relocatable_test.c: New file.
9368 * testsuite/discard_locals_test.sh: Test -r.
9369 * testsuite/Makefile.am (check_DATA): Add
9370 discard_locals_relocatable_test1.syms,
9371 discard_local_relocatable_test2.syms.
9372 (MOSTLYCLEANFILES): Likewise. Also add
9373 discard_locals_relocatable_test1.lout and
9374 discard_locals_relocatable_test2.out.
9375 (discard_locals_relocatable_test1.syms): New target.
9376 (discard_locals_relocatable_test.o): New target.
9377 (discard_locals_relocatable_test1.out): New target.
9378 (discard_locals_relocatable_test2.syms): New target.
9379 (discard_locals_relocatable_test2.out): New target.
9380 (various): Add missing ../ld-new dependencies.
9381 * testsuite/Makefile.in: Rebuild.
9382
7e8ccf26
NC
93832010-03-03 Nick Clifton <nickc@redhat.com>
9384
9385 * po/fi.po: New Finnish translation.
9386
2a0ff005
DK
93872010-03-01 Doug Kwan <dougkwan@google.com>
9388
9389 * layout.cc (Layout::Layout): Force section types of .init_array*,
9390 .preinit_array* and .fini_array* sections.
9391 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9392 Fix check of return value of std::string::find.().
9393 (Output_section::Input_section_sort_compare::operator()): Remove
9394 comment about .init_array.
9395 (Output_section::Input_section_sort_init_fini_compare::operator()):
9396 New method.
9397 (Output_section::sort_attached_input_sections): Handle .init_array
9398 and .fini_array specially.
9399 * output.h (Output_section::Inut_section_sort_compare): Update
9400 comment.
9401 (Output_section::Input_section_sort_init_fini_compare): New struct.
9402
c3e4ae29
DK
94032010-02-26 Doug Kwan <dougkwan@google.com>
9404
9405 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9406 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9407 * testsuite/debug_msg.sh: Avoid matching source line number for
9408 use of global variable undef_int.
9409
2fd9ae7a
DK
94102010-02-26 Doug Kwan <dougkwan@google.com>
9411
9412 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9413 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9414 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9415 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9416 * options.cc (General_options::General_options): Initialize member
9417 fix_v4bx_.
9418 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9419 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9420 and rm_no_fix_v4bx.stdout
9421 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9422 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9423 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9424 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9425 and arm_no_fix_v4bx.
9426 * Makefile.in: Regenerate.
9427 * testsuite/arm_fix_v4bx.s: New file.
9428 * testsuite/arm_fix_v4bx.sh: Ditto.
9429
67ec7d0b
DK
94302010-02-24 Doug Kwan <dougkwan@google.com>
9431
9432 * arm.cc (Target_arm::got_section): Make the .got section the first
9433 non RELRO section in the data segment.
9434 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9435 suffixes of section names.
9436
10165461
DK
94372010-02-24 Doug Kwan <dougkwan@google.com>
9438
9439 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9440 flags and attributes merging if an input file is a binary file.
9441 * fileread.cc (Input_file::open): Record format of original file.
9442 * fileread.h (Input_file::Format): New enum type.
2e702c99 9443 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9444 (Input_file::format): New method definition.
9445 (Input_file::format_):: New data member.
9446
4a54abbb
DK
94472010-02-24 Doug Kwan <dougkwan@google.com>
9448
9449 * arm.cc (Arm_output_data_got): New class.
9450 (ARM_TCB_SIZE): New constant
9451 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9452 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9453 If user uses a script with a SECTIONS clause, issue only a warning
9454 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9455 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9456 garbage collection.
9457 (Target_arm::got_mode_index_entry): Handle static linking.
9458 (Target_arm::Scan::local): Ditto.
9459 (Target_arm::Scan::global): Ditto.
9460 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9461 all incorrectly implemented relocations.
e1df38aa 9462 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
9463 Arm_output_section::fix_exidx_coverage.
9464 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9465 from ".ARM.exidx." and ".ARM.extab.".
9466
ca419a6f
ILT
94672010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9468
9469 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9470 section if it does not already exist.
9471 * attributes.cc (Attributes_section_data::Attributes_section_data):
9472 Don't crash if size is zero.
9473
135b9c78
ILT
94742010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9475 Ian Lance Taylor <iant@google.com>
9476
9477 * gold.cc (queue_middle_tasks): If no input files were opened,
9478 exit.
9479 * workqueue.h (Task_function::Task_function): Assert that there is
9480 a blocker.
9481
bb0bfe4f
DK
94822010-02-22 Doug Kwan <dougkwan@google.com>
9483
9484 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9485 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9486 types to avoid warnings due to different uint64_t implementations
9487 on different hosts.
9488
2a2b6d42
DK
94892010-02-21 Doug Kwan <dougkwan@google.com>
9490
9491 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9492 handling of the maximum backward branch offset.
2e702c99 9493 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
9494 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9495 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 9496 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
9497 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9498 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9499 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9500 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9501 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9502 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9503 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9504 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9505 thumb2_bl_out_of_range.o): New rules.
9506 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9507 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9508 thumb2_bl_out_of_range
9509 * testsuite/Makefile.in: Regenerate.
9510 * testsuite/arm_bl_in_range.s: New file.
9511 * testsuite/arm_bl_out_of_range.s: Ditto.
9512 * testsuite/arm_branch_in_range.sh: Ditto.
9513 * testsuite/arm_branch_range.t: Ditto.
9514 * testsuite/thumb2_branch_range.t: Ditto.
9515 * testsuite/thumb_bl_in_range.s: Ditto.
9516 * testsuite/thumb_bl_out_of_range.s: Ditto.
9517 * testsuite/thumb_branch_range.t: Ditto.
9518
b487ad64
ST
95192010-02-20 Sriraman Tallam <tmsriram@google.com>
9520
9521 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9522 Add reloc offset information.
9523 * icf.cc (get_section_contents): Change iterators to point to the new
9524 vectors. Add reloc offset information to the contents.
9525 * icf.h (Icf::Sections_reachable_info): New typedef.
9526 (Icf::Sections_reachable_list): New typedef.
9527 (Icf::Offset_info): New typedef.
9528 (Icf::Reloc_info): New struct typedef.
9529 (Icf::Reloc_info_list): New typedef.
9530 (Icf::symbol_reloc_list): Delete method.
9531 (Icf::addend_reloc_list): Delete method.
9532 (Icf::section_reloc_list): Delete method.
9533 (Icf::reloc_info_list): New method.
9534 (Icf::reloc_info_list_): New member.
9535
f96accdf
DK
95362010-02-19 Doug Kwan <dougkwan@google.com>
9537
9538 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9539 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9540 * arm.cc (Arm_relocation_functions): New forward declaration.
9541 (Target_arm::Target_arm): Initialize new data members
9542 got_mod_index_offset_ and tls_base_symbol_defined_.
9543 (Target_arm::Relocate::relocate_tls): New method.
9544 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9545 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9546 New methods.
2e702c99 9547 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
9548 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9549 (Target_arm::got_mod_index_offset_,
9550 Target_arm::tls_base_symbol_defined_): New data members.
9551 (Target_arm::Scan::local, Target::Scan::global,
9552 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9553 relocations.
9554
c8761b9a
DK
95552010-02-18 Doug Kwan <dougkwan@google.com>
9556
9557 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9558 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9559 text section as a parameter becuase some broken tools may not set
9560 the link in section header.
9561 (Target_arm::has_got_section): New method.
9562 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9563 without any mapping symbol as data only. Remove warning.
9564 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9565 link in its section header, try to discover the link by inspecting the
9566 REL31 relocation at the beginning of the section.
9567 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9568 in error message.
9569 (Target_arm::Scan::global): Treat any reference to the symbol
9570 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9571
21bb3914
ST
95722010-02-12 Sriraman Tallam <tmsriram@google.com>
9573
9574 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9575 (Scan::global_reloc_may_be_function_pointer): New function.
9576 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9577 (Scan::global_reloc_may_be_function_pointer): New function.
9578 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9579 (Scan::global_reloc_may_be_function_pointer): New function.
9580 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9581 (Scan::global_reloc_may_be_function_pointer): New function.
9582 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9583 (Scan::global_reloc_may_be_function_pointer): New function.
9584 (Scan::possible_function_pointer_reloc): New function.
9585 (Target_x86_64::can_check_for_function_pointers): New function.
9586 * gc.h (gc_process_relocs): Scan relocation types to determine if
9587 function pointers were taken for targets that support it.
9588 * icf.cc (Icf::find_identical_sections): Include functions for
9589 folding in safe ICF whose pointer is not taken.
9590 * icf.h (Secn_fptr_taken_set): New typedef.
9591 (fptr_section_id_): New member.
9592 (section_has_function_pointers): New function.
9593 (set_section_has_function_pointers): New function.
9594 (check_section_for_function_pointers): New function.
9595 * options.h: Fix comment for safe ICF option.
9596 * target.h (can_check_for_function_pointers): New function.
9597 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9598 Modify icf_safe_test for X86-64.
9599 * testsuite/Makefile.in: Regenerate.
9600 * testsuite/icf_safe_so_test.cc: New file.
9601 * testsuite/icf_safe_so_test.sh: New file.
9602 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9603 (main): Change to take pointer to function kept_func_3.
9604 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9605 folding is done correctly for X86-64.
9606
0da6fa6c
DM
96072010-02-12 David S. Miller <davem@davemloft.net>
9608
9609 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9610 is_symbolless parameter.
9611 (Output_reloc<SHT_REL>::is_symbolless): New.
9612 (Output_reloc<SHT_REL>::is_symbolless_): New.
9613 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9614 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9615 (Output_reloc<SHT_RELA>::is_symbolless): New.
9616 (Output_data_reloc::add_global): Handle is_symbolless.
9617 (Output_data_reloc::add_global_relative): Likewise.
9618 (Output_data_reloc::add_local): Likewise.
9619 (Output_data_reloc::add_local_relative): Likewise.
9620 (Output_data_reloc::add_symbolless_global_addend): New.
9621 (Output_data_reloc::add_symbolless_local_addend): New.
9622 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9623 is_symbolless.
9624 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9625 instead of ->is_relative_
9626 (Output_reloc::write): Likewise.
9627 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9628 (Output_reloc::write_rel): Simplify.
9629
9630 * sparc.cc (Target_sparc::Scan::local): Use
9631 ->add_symbolless_local_addend as needed.
9632 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9633 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9634 based upon relocation offset.
9635
e4782e83
DK
96362010-02-11 Doug Kwan <dougkwan@google.com>
9637
9638 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9639 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9640 beginning of function.
9641 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9642 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9643 parameter is_32bit in calls to should_apply_static_reloc.
9644 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9645 (check_DATA): Add arm_abs_global.stdout.
9646 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9647 arm_abs_global.stdout): New rules.
9648 (MOSTLLYCLEANFILES): Add arm_abs_global
9649 * Makefile.in: Regenerate.
9650 * testsuite/arm_abs_global.s: New file.
9651 * testsuite/arm_abs_global.sh: Ditto.
9652 * testsuite/arm_abs_lib.s: Ditto.
9653
93ceb764
ILT
96542010-02-11 Ian Lance Taylor <iant@google.com>
9655
9656 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9657 Read_relocs task.
9658 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9659 Allocate_commons_task first.
9660 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9661 task, rather than symtab_lock_.
9662 (Gc_process_relocs::~Gc_process_relocs): New function.
9663 (Gc_process_relocs::is_runnable): Check this_blocker_.
9664 (Gc_process_relocs::locks): Use next_blocker_ rather than
9665 blocker_.
9666 (Scan_relocs::~Scan_relocs): New function.
9667 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9668 symtab_lock_.
9669 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9670 next_blocker_.
9671 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9672 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9673 constructor accordingly.
9674 (class Gc_process_relocs): Likewise.
9675 (class Scan_relocs): Likewise.
9676 * common.h (class Allocate_commons_task): Remove symtab_lock_
9677 field, and corresponding constructor parameter.
9678 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9679 symtab_lock_.
9680 (Allocate_commons_task::locks): Likewise.
9681
114dfbe1
ILT
96822010-02-11 Ian Lance Taylor <iant@google.com>
9683
9684 * gold-threads.h (class Once): Define.
9685 (class Initialize_lock): Rewrite as child of Once.
9686 * gold-threads.cc (class Once_initialize): Define.
9687 (once_pointer_control): New static variable.
9688 (once_pointer, once_arg): New static variables.
9689 (c_run_once): New static function.
9690 (Once::Once, Once::run_once, Once::internal_run): New functions.
9691 (class Initialize_lock_once): Remove.
9692 (initialize_lock_control): Remove.
9693 (initialize_lock_pointer): Remove.
9694 (initialize_lock_once): Remove.
9695 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9696 (Initialize_lock::initialize): Rewrite.
9697 (Initialize_lock::do_run_once): New function.
9698 * archive.cc (Archive::interpret_header): Only clear name if it is
9699 not already empty.
9700 * fileread.cc: Include "gold-threads.h"
9701 (file_counts_lock): New static variable.
9702 (file_counts_initialize_lock): Likewise.
9703 (File_read::release): Only increment counts when using --stats.
9704 Use a lock around the increment.
9705 * parameters.cc (class Set_parameters_target_once): Define.
9706 (set_parameters_target_once): New static variable.
9707 (Parameters::Parameters): Move here from parameters.h.
9708 (Parameters::set_target): Rewrite.
9709 (Parameters::set_target_once): New function.
9710 (Parameters::clear_target): Move here and rewrite.
9711 * parameters.h (class Parameters): Update declarations. Add
9712 set_parameters_target_once_ field.
9713 (Parameters::Parameters): Move to parameters.cc.
9714 (Parameters::clear_target): Likewise.
9715 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9716 task.
9717 (Start_group::~Start_group): New function.
9718 (Start_group::is_runnable): New function.
9719 (Start_group::locks, Start_group::run): New functions.
9720 (Finish_group::run): Change saw_undefined to size_t.
9721 * readsyms.h (class Start_group): Define.
9722 (class Finish_group): Change saw_undefined_ field to size_t.
9723 (Finish_group::Finish_group): Remove saw_undefined and
9724 this_blocker parameters. Change all callers.
9725 (Finish_group::set_saw_undefined): New function.
9726 (Finish_group::set_blocker): New function.
9727 * symtab.h (class Symbol_table): Change saw_undefined to return
9728 size_t. Change saw_undefined_ field to size_t.
9729 * target-select.cc (Set_target_once::do_run_once): New function.
9730 (Target_selector::Target_selector): Initialize set_target_once_
9731 field. Don't initialize lock_ and initialize_lock_ fields.
9732 (Target_selector::instantiate_target): Rewrite.
9733 (Target_selector::set_target): New function.
9734 * target-select.h (class Set_target_once): Define.
9735 (class Target_selector): Update declarations. Make
9736 Set_target_once a friend. Remove lock_ and initialize_lock_
9737 fields. Add set_target_once_ field.
9738
fa17a3f4
ILT
97392010-02-10 Ian Lance Taylor <iant@google.com>
9740
9741 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9742 queueing any tasks.
9743 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9744 (queue_middle_tasks): Add all blockers before queueing any tasks.
9745 (queue_final_tasks): Likewise.
9746 * token.h (Task_token::add_blockers): New function.
9747 * object.h (Input_objects::number_of_relobjs): New function.
9748
c7177d31
ILT
97492010-02-10 Ian Lance Taylor <iant@google.com>
9750
5de0e392
ILT
9751 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9752 shared, not if not position independent.
9753 * x86_64.cc (Relocate::relocate_tls): Likewise.
9754 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9755 (tls_pie_pic_test): New target.
9756 * testsuite/Makefile.in: Rebuild.
9757
c7177d31
ILT
9758 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9759 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9760 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9761 * testsuite/Makefile.in: Rebuild.
9762
684b268a
DM
97632010-02-09 David S. Miller <davem@davemloft.net>
9764
9765 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9766 R_SPARC_RELATIVE using ->add_local_relative().
9767 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9768
612a8d3d
DM
9769 * output.h (Output_data_dynamic::add_section_size): New method
9770 that takes two Output_data objects.
9771 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9772 entry param. Handle it in initializers.
9773 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9774 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9775 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9776 arg.
9777 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9778 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9779 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9780 for dynrel_includes_plt.
9781 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9782 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9783 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9784 before .rela.plt
9785 (Target_sparc::do_finalize_sections): Update to pass true for
9786 dynrel_includes_plt.
9787 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9788 output before .rela.plt
9789 (Target_powerpc::do_finalize_sections): Update to pass true for
9790 dynrel_includes_plt when 32-bit.
9791
cb1be87e
DK
97922010-02-08 Doug Kwan <dougkwan@google.com>
9793
9794 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9795 method.
9796 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9797 Arm_relobj::scan_section_for_cortex_a8_stubs,
9798 Arm_relobj::do_relocation_section): Instead of calling
9799 Output_section::output_address, use faster
9800 Arm_relobj::simple_input_section_output_address.
9801
705b5121
DM
98022010-02-08 David S. Miller <davem@davemloft.net>
9803
9804 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9805 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9806 relocation helper function.
9807
024c4466
DM
9808 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9809 just like R_SPARC_GOT{10,13,22}.
9810 (Target_sparc::Scan::local): Likewise.
9811 (Target_sparc::Relocate:relocate): Likewise.
9812
9109c078
ILT
98132010-02-06 Ian Lance Taylor <iant@google.com>
9814
9815 * configure.ac: Rewrite targetobjs duplicate removal code to use
9816 only shell constructs.
9817 * configure: Rebuild.
9818
cf846138
DK
98192010-02-05 Doug Kwan <dougkwan@google.com>
9820
9821 PR 11247
9822 * arm.cc (Arm_relobj::section_is_scannable): New method.
9823 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9824 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9825
6cfaf60b
DK
98262010-02-04 Doug Kwan <dougkwan@google.com>
9827
9828 PR 11247
9829 * arm-reloc-property.cc (cstdio): Include.
9830 * configure.ac (targetobjs): Remove duplicates.
9831 * configure: Regenerate.
9832 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9833 big and little endian version for a given address size.
9834
5c57f1be
DK
98352010-02-03 Doug Kwan <dougkwan@google.com>
9836
9837 * arm-reloc-property.cc
9838 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9839 definition.
9840 * arm-reloc-property.h
9841 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9842 New method definition.
9843 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9844 declaration.
9845 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9846 overflow to N.
9847 (GOT_PREL): Change implemented to Y.
9848 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9849 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9850 (Arm_relocate_functions::movw_abs_nc): Remove method.
9851 (Arm_relocate_functions::movt_abs): Ditto.
9852 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9853 (Arm_relocate_functions::thm_movt_abs): Ditto.
9854 (Arm_relocate_functions::movw_rel_nc): Ditto.
9855 (Arm_relocate_functions::movw_rel): Ditto.
9856 (Arm_relocate_functions::movt_rel): Ditto.
9857 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9858 (Arm_relocate_functions:thm_movw_rel): Ditto.
9859 (Arm_relocate_functions:thm_movt_rel): Ditto.
9860 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9861 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9862 New method definitions.
9863 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9864 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9865 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9866 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9867 (Target_arm::Relocate::relocate): Check for non-static or
9868 unimplemented relocation code and exit early. Change calls to
9869 Target_arm::reloc_uses_thumb_bit and
9870 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9871 instead. Refactor code to handle similar relocations to increase
9872 code sharing. Remove check for unsupported relocation code in switch
9873 statement.
9874 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9875 relocation property table to find out size. Change error message to
9876 print out the name of a relocation code instead of the numeric value.
9877 (Target_arm::scan_reloc_for_stub): Use relocation property table
9878 instead of calling Target_arm::reloc_uses_thumb_bit().
9879
218c5831
DK
98802010-02-02 Doug Kwan <dougkwan@google.com>
9881
9882 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9883 types of relaxed input section.
9884
0d31c79d
DK
98852010-02-02 Doug Kwan <dougkwan@google.com>
9886
9887 * Makefile.am (HFILES): Add arm-reloc-property.h.
9888 (DEFFILES): New.
2e702c99
RM
9889 (TARGETSOURCES): Add arm-reloc-property.cc
9890 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
9891 (libgold_a_SOURCES): $(DEFFILES)
9892 * Makefile.in: Regenerate.
9893 * arm-reloc-property.cc: New file.
9894 * arm-reloc-property.h: New file.
9895 * arm-reloc.def: New file.
9896 * arm.cc: Update comments.
9897 (arm-reloc-property.h): New included header.
9898 (arm_reloc_property_table): New global variable.
9899 (Target_arm::do_select_as_default_target): New method definition.
9900 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
9901 arm-reloc-property to targ_extra_obj.
9902 * parameters.cc (set_parameters_target): Call
9903 Target::select_as_default_target().
9904 * target.h (Target::select_as_default_target): New method definition.
9905 (Target::do_select_as_default_target): Same.
9906
546c7457
DK
99072010-02-01 Doug Kwan <dougkwan@google.com>
9908
9909 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
9910 first_output_text_section_.
9911 (Arm_exidx_fixup::first_output_text_section): New method definition.
9912 (Arm_exidx_fixup::first_output_text_section_): New data member.
9913 (Arm_exidx_fixup::process_exidx_section): Record the first text
9914 output section seen.
9915 (Arm_output_section::fix_exidx_coverage): Set correct linked section
9916 and entsize in output section header.
9917
11b861d5
DK
99182010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9919
9920 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
9921 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
9922 (Arm_relocate_functions::thm_alu11): New Method.
9923 (Arm_relocate_functions::thm_pc8): New Method.
9924 (Arm_relocate_functions::thm_pc12): New Method.
9925 (Target_arm::Scan::local): Handle the relocations.
9926 (Target_arm::Scan::global): Likewise.
9927 (Target_arm::Relocate::relocate): Likewise.
9928 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9929
c9a2c125
DK
99302010-01-29 Doug Kwan <dougkwan@google.com>
9931
9932 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
9933 of relocation types as ld.
9934
1521477a
DK
99352010-01-29 Doug Kwan <dougkwan@google.com>
9936
9937 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
9938 to public.
9939 (Arm_relocate_functions::thumb_branch_common): Ditto.
9940 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
9941 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
9942 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
9943 Arm_relocate_functions::jump24): Remove.
9944 (Target_arm::Relocate::relocate): Adjust code to call
9945 Arm_relocation_functions::arm_branch_common and
9946 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 9947 wrappers. Merge switch-cases together to reduce source code size.
1521477a 9948
e7eca48c
DK
99492010-01-29 Doug Kwan <dougkwan@google.com>
9950
9951 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
9952 output_local_symbol_count_needs_update_.
9953 (Arm_relobj::output_local_symbol_count_needs_update,
9954 Arm_relobj::set_output_local_symbol_count_needs_update,
9955 Arm_relobj::update_output_local_symbol_count): New methods.
9956 (Arm_relobj::output_local_symbol_count_needs_update_): New data
9957 member.
9958 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
9959 of pointed function as in a R_ARM_PREL31 relocation.
9960 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
9961 for output local symbol count updating.
9962 (Target_arm::do_relax): Update output local symbol counts in objects
9963 if necessary.
9964 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
9965
02961d7e
ILT
99662010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9967
9968 * arm.cc: Added support for the ARM relocations:
9969 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
9970 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
9971 (Arm_relocate_functions::movw_rel_nc): Renamed (was
9972 movw_prel_nc).
9973 (Arm_relocate_functions::movw_rel): New method.
9974 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
9975 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
9976 thm_movw_prel_nc).
9977 (Arm_relocate_functions::thm_movw_rel): New method.
9978 (Arm_relocate_functions::thm_movt_rel): Renamed (was
9979 thm_movt_prel).
9980 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
9981 relocations.
9982 (Target_arm::Scan::global): Likewise.
9983 (Target_arm::Relocate::relocate): Likewise.
9984 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9985 Likewise.
9986
b10d2873
ILT
99872010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9988
9989 * arm.cc: Added support for ARM group relocations.
9990 (Target_arm::reloc_needs_sym_origin): New method.
9991 (Arm_relocate_functions::calc_grp_kn): New method.
9992 (Arm_relocate_functions::calc_grp_residual): New method.
9993 (Arm_relocate_functions::calc_grp_gn): New method.
9994 (Arm_relocate_functions::arm_grp_alu): New Method.
9995 (Arm_relocate_functions::arm_grp_ldr): New Method.
9996 (Arm_relocate_functions::arm_grp_ldrs): New Method.
9997 (Arm_relocate_functions::arm_grp_ldc): New Method.
9998 (Target_arm::Scan::local): Handle the ARM group relocations.
9999 (Target_arm::Scan::global): Likewise.
10000 (Target_arm::Relocate::relocate): Likewise.
10001 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10002 Likewise.
10003
2b328d4e
DK
100042010-01-26 Doug Kwan <dougkwan@google.com>
10005
10006 * arm.cc (set): Include.
10007 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10008 pointer type.
2e702c99 10009 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
10010 (Arm_output_section::append_text_sections_to_list): New method.
10011 (Arm_output_section::fix_exidx_coverage): Ditto.
10012 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 10013 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
10014 Relobj::set_section_offset() instead of
10015 Sized_relobj::invalidate_section_offset().
2e702c99 10016 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
10017 parameter for section headers. Ignore relocation sections for
10018 unallocated sections and EXIDX sections.
10019 (Target_arm::fix_exidx_coverage): New method.
10020 (Target_arm::output_section_address_less_than): New type.
10021 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10022 linked text section instead of the EXIDX section.
10023 (Arm_output_section::create_stub_group): Add an assertion to check
10024 that this is not an EXIDX output section.
10025 (Arm_output_section::append_text_sections_to_list): New method.
10026 (Arm_output_section::fix_exidx_coverage): Ditto.
10027 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 10028 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
10029 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10030 first pass.
10031 (Target_arm::fix_exidx_coverage): New method.
10032 * object.h (Relobj::set_output_section): New method.
10033 (Sized_relobj::invalidate_section_offset): Remove method.
10034 (Sized_relobj::do_invalidate_section_offset): Remove method.
10035 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10036
c7f3c371
DK
100372010-01-25 Doug Kwan <dougkwan@google.com>
10038
10039 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10040 Fix warning due to signed and unsigned comparison on a 32-bit host.
10041
8923b24c
DK
100422010-01-22 Doug Kwan <dougkwan@google.com>
10043
10044 * arm.cc (Target_arm::do_relax): Record an output section for section
10045 offset adjustment it contains any stub table that has changed.
10046 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10047 offsets in an output section if necessary.
10048 * output.cc (Output_section::Output_section): Initialize
10049 section_offsets_need_adjustments_.
10050 (Output_section::add_input_section_for_script): Renamed to
10051 Output_section::add_simple_input_section.
10052 (Output_section::save_states): Add a comment.
10053 (Output_section::discard_states): New method defintion.
10054 (Output_section::adjust_section_offsets): Same.
10055 * output.h (Output_section::add_input_section_for_script): Renamed to
10056 Output_section::add_simple_input_section.
10057 (Output_section::discard_states): New method declaration.
10058 (Output_section::adjust_section_offsets): Same.
10059 (Output_section::section_offsets_need_adjustment,
10060 Output_section::set_section_offsets_need_adjustment): New method
10061 definitions.
10062 (Output_section::section_offsets_need_adjustment_): New data member.
10063 * script-sections.cc
10064 (Output_section_element_input::set_section_address): Adjust code for
10065 renaming of Output_section::add_input_section_for_script.
10066 (Orphan_output_section::set_section_address): Same.
10067
9b2fd367
DK
100682010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10069
10070 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10071 Fix_v4bx enum values .
10072 * gold/options.h (General_options): New option definitions.
10073 (General_options::fix_v4bx): New method.
10074 (General_options::Fix_v4bx): New enum.
10075 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10076 (General_options::parse_fix_v4bx_interworking): New method.
10077
80d0d023
DK
100782010-01-22 Doug Kwan <dougkwan@google.com>
10079
10080 * arm.cc (Arm_exidx_fixup): New class.
10081
af2cdeae
DK
100822010-01-21 Doug Kwan <dougkwan@google.com>
10083
10084 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10085 classes.
10086 (Arm_exidx_section_offset_map): New type.
10087
993d07c1
DK
100882010-01-21 Doug Kwan <dougkwan@google.com>
10089
10090 * arm.cc (Arm_exidx_input_section): New class.
10091 (Arm_relobj::exidx_input_section_by_link,
10092 Arm_relobj::exidx_input_section_by_shndx,
10093 Arm_relobj::make_exidx_input_section): New methods.
10094 (read_arm_attributes_section): Remove.
10095 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10096 information about them.
10097 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10098 to here.
10099
5ac169d4
DK
101002010-01-20 Doug Kwan <dougkwan@google.com>
10101
10102 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10103 Input_section_specifier to Section_id.
10104 (Target_arm::new_arm_input_section: Adjust code for change of key
10105 type.
10106 (Target_arm::find_arm_input_section): Ditto.
10107 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10108 (Section_id): Remove.
10109 (Garbage_collection::Section_id_hash): Remove.
10110 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10111 (Section_id): Remove.
10112 (Icf::Section_id_hash): Remove.
10113 * object.h (Section_id, Const_section_id, Section_id_hash,
10114 Const_section_id_hash): New type definitions.
10115 * output.cc (Output_section::add_relaxed_input_section): Change to
10116 use Const_section_id instead of Input_section_specifier as key type.
10117 (Output_section::add_merge_input_section): Ditto.
10118 (Output_section::build_relaxation_map): Change to use Section_id
10119 instead of Input_section_specifier as key type.
2e702c99 10120 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
10121 Ditto.
10122 (Output_section::convert_input_sections_to_relaxed_sections): Change
10123 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 10124 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
10125 (Output_section::find_relaxed_input_section): Ditto.
10126 * output.h (Input_section_specifier): Remove class.
10127 (Output_section::Output_section_data_by_input_section_map): Change
10128 key type to Const_section_id.
10129 (Output_section::Output_relaxed_input_section_by_input_section_map):
10130 Ditto.
10131 (Output_section::Relaxation_map): Change key type to Section_id.
10132
a2162063
ILT
101332010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10134
10135 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10136 (class Arm_v4bx_stub): New class.
10137 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10138 (Stub_factory::make_arm_v4bx_stub): New method.
10139 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10140 (Stub_table::empty): Handle v4bx stubs.
10141 (Stub_table::add_arm_v4bx_stub): New method.
10142 (Stub_table::find_arm_v4bx_stub): New method.
10143 (Arm_relocate_functions::v4bx): New method.
10144 (Target_arm::fix_v4bx): New method.
10145 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10146 (Stub_table::relocate_stubs): Likewise.
10147 (Stub_table::do_write): Likewise.
10148 (Stub_table::update_data_size_and_addralign): Likewise.
10149 (Stub_table::finalize_stubs): Likewise.
10150 (Target_arm::Scan::local): Likewise.
10151 (Target_arm::Scan::global): Likewise.
10152 (Target_arm::do_finalize_sections): Likewise.
10153 (Target_arm::Relocate::relocate): Likewise.
10154 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10155 Likewise.
10156 (Target_arm::scan_reloc_for_stub): Likewise.
10157 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10158
5696ab0b
ILT
101592010-01-19 Ian Lance Taylor <iant@google.com>
10160
10161 * output.cc (Output_section_headers::do_sized_write): Write large
10162 segment count to sh_info field.
10163 (Output_file_header::do_sized_write): For large segment count,
10164 write PN_XNUM to e_phnum field.
10165
800d0f56
ILT
101662010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10167
10168 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10169 (Arm_relocate_functions::thm_jump8): New function.
10170 (Arm_relocate_functions::thm_jump11): New function.
10171 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10172 R_ARM_THM_JUMP11.
10173 (Target_arm::Scan::global): Likewise.
10174 (Target_arm::Relocate::relocate): Likewise.
10175 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10176 Likewise.
10177
41263c05
DK
101782010-01-14 Doug Kwan <dougkwan@google.com>
10179
10180 * arm.cc (map, utility): Include headers.
10181 (Target_arm::apply_cortex_a8_workaround): New method.
10182 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10183 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10184 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10185 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10186 the --[no-]fix-cortex-a8 command line options.
10187 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10188 (Target_arm::relocate_stub): Use addend in instruction template.
10189 * options.h (DEFINE_bool): Set the user-set flag.
10190 (General_options): Add --[no-]-fix-cortex options.
10191 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10192 : Update fast look-up map after conversion.
41263c05 10193
459e9b03
ST
101942010-01-14 Sriraman Tallam <tmsriram@google.com>
10195
10196 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10197 in the first pass of do_layout.
10198
b521dfe4
DK
101992010-01-13 Doug Kwan <dougkwan@google.com>
10200
10201 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10202 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10203 apparent compiler problem of not folding static constant integral
10204 data members of elfcpp::Elf_sizes<32>.
10205
44272192
DK
102062010-01-13 Doug Kwan <dougkwan@google.com>
10207
10208 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10209 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10210 Arm_relobj::scan_section_for_cortex_a8_erratum,
10211 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10212 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10213 sections to scan for relocation stubs into a new method
10214 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10215 relocation and Cortex-A8 stub scanning.
10216 (Target_arm::do_relax): Force stubs to be after stubbed sections
10217 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10218 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10219 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10220
44b71ece
ILT
102212010-01-12 Ian Lance Taylor <iant@google.com>
10222
10223 * target-reloc.h (visibility_error): New inline function.
10224 (relocate_section): Call visibility_error.
10225 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10226 (MOSTLYCLEANFILES): Likewise.
10227 (protected_4_pic.o, protected_3.err): New targets.
10228 * testsuite/protected_4.cc: New file.
10229
a120bc7f
DK
102302010-01-12 Doug Kwan <dougkwan@google.com>
10231
10232 * arm.cc (Cortex_a8_reloc): New class.
10233 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10234 and cortex_a8_relocs_info_.
10235 (Target_arm::fix_cortex_a8): New method definition.
10236 (Target_arm::Cortex_a8_relocs_info): New type.
10237 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10238 New data member declarations.
10239 (Target_arm::scan_reloc_for_stub): Record information about
10240 relocations for THUMB branches that might be exempted from the
10241 Cortex-A8 workaround.
10242 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10243 at the beginning of a relaxation pass.
10244
20138696
DK
102452010-01-12 Doug Kwan <dougkwan@google.com>
10246
10247 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10248 (Arm_relobj::Mapping_symbol_position,
10249 Arm_reloj::Mapping_symbol_position_less,
10250 Arm_relobj::Mapping_symbols_info): New types.
10251 (Target_arm::is_mapping_symbol_name): New method definition.
10252 (Arm_relobj::do_count_local_symbols): Save information about mapping
10253 symbols.
10254
089d69dc
DK
102552010-01-11 Doug Kwan <dougkwan@google.com>
10256
10257 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10258 Arm_relocate_functions::thumb32_branch_upper,
10259 Arm_relocate_functions::thumb32_branch_lower,
10260 Arm_relocate_functions::thumb32_cond_branch_offset,
10261 Arm_relocate_functions::thumb32_cond_branch_upper,
10262 Arm_relocate_functions::thumb32_cond_branch_lower,
10263 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10264 branch offset encoding.
10265 (Arm_relocate_functions::thumb_branch_common): Use new branch
10266 offset encoding methods to avoid code duplication.
10267 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10268 (Stub_addend_reader::operator()): Use new branch encoding method
10269 to avoid code duplication.
10270
99e5bff2
DK
102712010-01-11 Doug Kwan <dougkwan@google.com>
10272
10273 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10274 (Target_arm::do_finalize_sections): Define special EXIDX section
10275 symbols only if referenced.
10276 * gc.h (Garbage_collection::add_reference): New method.
10277 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10278 code duplication.
10279
98e090bd
ILT
102802010-01-11 Ian Lance Taylor <iant@google.com>
10281
d0a91bd8
ILT
10282 * script.cc (Version_script_info::build_expression_list_lookup):
10283 Change complaing about duplicate wildcard match from error to
10284 warning.
10285
98e090bd
ILT
10286 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10287 of 2009-12-30.
10288 (Version_script_info::Version_script_info): Initialize globs_,
10289 default_version_, default_is_global_, and exact_. Don't
10290 initialize globals_ or locals_.
10291 (Version_script_info::build_lookup_tables): Build local symbols
10292 first.
10293 (Version_script_info::unquote): New function.
10294 (Version_script_info::add_exact_match): New function.
10295 (Version_script_info::build_expression_list_lookup): Remove lookup
10296 parameter. Add is_global parameter. Change all callers. Handle
10297 wildcard pattern specially. Unquote pattern. Call
10298 add_exact_match.
10299 (Version_script_info::get_name_to_match): New function.
10300 (Version_script_info::get_symbol_version): New function.
10301 (Version_script_info::get_symbol_version_helper): Remove.
10302 (Version_script_info::check_unmatched_names): Call unquote.
10303 * script.h (class Version_script_info): Change get_symbol_version
10304 to be non-inline and add is_global parameter; change all callers.
10305 Rewrite symbol_is_local. Update declarations. Define struct
10306 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10307 Remove globals_ and locals_ members. Add exact_, globs_,
10308 default_version_, is_global_.
10309 (Version_script_info::Glob): Remove pattern, add expression and
10310 is_global. Update constructor. Change all callers.
10311 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10312 default version.
10313 (Versions::symbol_section_contents): If a symbol is undefined, or
10314 defined in a dynamic object, set the version index to
10315 VER_NDX_LOCAL.
10316 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10317 symbol_is_local.
10318 (Symbol_table::add_from_pluginobj): Likewise.
10319 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10320
d56962d3
DK
103212010-01-11 Doug Kwan <dougkwan@google.com>
10322
10323 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10324 (incremental_dump_LDADD): Add linking option for libintl.
10325 * Makefile.in: Regenerate.
10326
94e6ee91
L
103272010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10328
10329 PR gold/11144
10330 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10331 instead of -Ds.
10332 * testsuite/Makefile.in: Regenerated.
10333
e96c574b
DK
103342010-01-10 Doug Kwan <dougkwan@google.com>
10335
10336 * options.h (DEFINE_var): Use parentheses around argument varname__
10337 in macro body to avoid any unintended subsequent substitutions.
10338
7198066b
ILT
103392010-01-10 Ian Lance Taylor <iant@google.com>
10340
ba4d53bf
ILT
10341 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10342 candidates before doing symbol resolution.
10343
7198066b
ILT
10344 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10345 ODR candidates if only one is weak.
10346
a2beed37
ILT
103472010-01-08 Ian Lance Taylor <iant@google.com>
10348
10349 * script.cc (Version_script_info::build_expression_list_lookup):
10350 Don't warn about ambiguous version, just record the ambiguity.
10351 (Version_script_info::get_symbol_version_helper): Give error if
10352 version is ambiguous.
10353
2fb7225c
DK
103542010-01-08 Doug Kwan <dougkwan@google.com>
10355
10356 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10357 prev_data_size_ and prev_addralign_. Remove initializer for
10358 deleted data member has_been_changed_.
10359 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10360 to determine if the table is empty.
10361 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10362 Remove.
10363 (Stub_table::add_reloc_stub): Define method in class definition
10364 instead of just declaring it there.
10365 (Stub_table::add_cortex_a8_stub): New method definition.
10366 (Stub_table::update_data_size_and_addralign): Ditto.
10367 (Stub_table::finalize_stubs): Ditto.
10368 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10369 (Stub_table::do_addralign_): Return address alignment in the
10370 (Stub_table::do_reset_address_and_file_offset): Define method in
10371 class definition instead of declaring it there. Set current data
10372 size to be the data size of the previous pass.
10373 (Stub_table::set_final_data_size): Use current data size as the
10374 final data size.
10375 (Stub_table::relocate_stub): Change parameter type of stub from
10376 Reloc_stub pointer to Stub pointer.
10377 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10378 (Stub_table::Cortex_a8_stub_list): New typedef.
10379 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10380 Stub_table::prev_addralign_): New data member.
10381 (Arm_relobj::Arm_relobj): Initialize data member
10382 section_has_cortex_a8_workaround_.
10383 (Arm_relobj::section_has_cortex_a8_workaround,
10384 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10385 definitions.
10386 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10387 declarations.
10388 (Target_arm::relocate_stub): Change parameter type of stub from
10389 Reloc_stub pointer to Stub pointer.
10390 (Insn_template::size, Insn_template::alignment): Handle
10391 THUMB16_SPECIAL_TYPE.
10392 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10393 Stub_table::update_data_size_and_addralign,
10394 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10395 definitions.
10396 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10397 (Stub_table::do_write): Ditto.
10398 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10399
880cd20d
ILT
104002010-01-08 Ian Lance Taylor <iant@google.com>
10401
10402 PR 11108
10403 * symtab.h (class Symbol): Remove fields is_target_special_ and
10404 has_plt_offset_. Add field is_defined_in_discarded_section_.
10405 (Symbol::is_defined_in_discarded_section): New function.
10406 (Symbol::set_is_defined_in_discarded_section): New function.
10407 (Symbol::has_plt_offset): Rewrite.
10408 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10409 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10410 Don't initialize is_target_special_ or has_plt_offset_.
10411 Initialize is_defined_in_discarded_section_.
10412 (Symbol_table::add_from_relobj): If appropriate, set
10413 is_defined_in_discarded_section.
10414 * resolve.cc (Symbol::override_base_with_special): Don't test
10415 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10416 * target-reloc.h (relocate_section): Do special handling for
10417 symbols defined in discarded sections for global symbols as well
10418 as local symbols.
10419
2703e3eb
ILT
104202010-01-08 Ian Lance Taylor <iant@google.com>
10421
10422 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10423 the SHT_SYMTAB case.
10424
339d40a3
ILT
104252010-01-08 Ian Lance Taylor <iant@google.com>
10426
10427 * object.cc (Sized_relobj::do_layout): Don't get confused if
10428 layout_eh_frame returns NULL.
10429
abecea76
ILT
104302010-01-08 Ian Lance Taylor <iant@google.com>
10431
10432 PR 11084
10433 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10434 dynamic symbol table, use the normal symbol table.
10435 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10436 symbol table.
10437
6b7dd3f3
ILT
104382010-01-08 Ian Lance Taylor <iant@google.com>
10439
10440 PR 11072
10441 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10442 sections.
10443
36c50e63
L
104442010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10445
10446 * version.cc (print_version): Change to "Copyright 2010".
10447
e291e7b9
ILT
104482010-01-08 Ian Lance Taylor <iant@google.com>
10449
10450 PR 10287
10451 PR 11063
10452 * i386.cc (class Target_i386): Change return type of plt_section
10453 to be non-const.
10454 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10455 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10456 tls_desc_rel_ field.
10457 (Output_data_plt_i386::rel_tls_desc): New function.
10458 (Target_i386::rel_tls_desc_section): New function.
10459 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10460 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10461 R_386_TLS_DESC reloc in rel_tls_desc_section.
10462 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10463 Define struct Tlsdesc_info.
10464 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10465 (Target_x86_64::do_reloc_symbol_index): New function.
10466 (Target_x86_64::add_tlsdesc_info): New function.
10467 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10468 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10469 tlsdesc_rel_ field.
10470 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10471 all callers.
10472 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10473 (Target_x86_64::rela_tlsdesc_section): New function.
10474 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10475 handling.
10476 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10477 (Target_x86_64::do_reloc_addend): New function.
10478 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10479 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10480 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10481 (Output_reloc::type): New function.
10482 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10483 (Output_reloc::is_target_specific): New function.
10484 (Output_reloc::target_arg): New function.
10485 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10486 absolute relocs and target specific relocs.
10487 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10488 add_target_specific.
10489 (class Output_data_reloc) [SHT_RELA]: Likewise.
10490 * output.cc (Output_reloc::Output_reloc): Add four new versions
10491 for absolute relocs and target specific relocs.
10492 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10493 (Output_reloc::get_symbol_index): Likewise.
10494 (Output_reloc::local_section_offset): Check that local_sym_index_
10495 is not TARGET_CODE or 0.
10496 (Output_reloc::symbol_value): Likewise.
10497 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10498 reloc.
10499 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10500 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10501 functions.
10502 * layout.cc (add_target_dynamic_tags): Use output section for
10503 DT_PLTRELSZ and DT_JMPREL.
10504
3a44184e
ILT
105052010-01-07 Ian Lance Taylor <iant@google.com>
10506
10507 PR 11061
10508 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10509 function.
10510 (class Output_data_reloc_generic): Define.
10511 (class Output_data_reloc_base): Change base class to
10512 Output_data_reloc_generic. Change add() method to call
10513 bump_relative_reloc_count for a relative reloc. Remove
10514 sort_relocs_ field.
10515 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10516 to sort_relocs().
10517 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10518 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10519 appropriate.
10520 * layout.h (class Layout): Update declaration.
10521
ea715a34
ILT
105222010-01-07 Ian Lance Taylor <iant@google.com>
10523
10524 * output.h (class Output_data): Add const version of
10525 output_section and do_output_section.
10526 (class Output_section_data): Add const version of
10527 do_output_section.
10528 (class Output_section): Likewise.
10529 * layout.cc (Layout::add_target_dynamic_tags): New function.
10530 * layout.h (class Layout): Update declarations.
10531 * arm.cc (Target_arm::do_finalize_sections): Use
10532 add_target_dynamic_tags.
10533 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10534 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10535 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10536 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10537
659948a4
ILT
105382010-01-07 Ian Lance Taylor <iant@google.com>
10539
10540 PR 11042
10541 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10542 object as needed.
10543
9d3b86f6
ILT
105442010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10545 Ian Lance Taylor <iant@google.com>
10546
10547 PR 11019
10548 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10549 Xindex::read_symtab_xindex.
10550
bb0d3eb0
DK
105512010-01-07 Doug Kwan <dougkwan@google.com>
10552
10553 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10554 (Insn_template::thumb16_bcond_insn): New method declaration.
10555 (Insn_template): Fix spelling.
10556 (Stub::thumb16_special): New method declaration.
10557 (Stub::do_write): Define virtual method which was previously pure
10558 virtual.
10559 (Stub::do_thumb16_special): New method declaration.
10560 (Stub::do_fixed_endian_write): New template member.
10561 (Reloc_stub::do_write): Remove.
10562 (Reloc_stub::do_fixed_endian_write): Remove.
10563 (Cortex_a8_stub): New class definition.
10564 (Stub_factory::make_cortex_a8_stub): New method definition.
10565 (Stub_factory::Stub_factory): Add missing static storage class
10566 qualifier for elf32_arm_stub_a8_veneer_blx.
10567
ffeef7df
ILT
105682010-01-07 Ian Lance Taylor <iant@google.com>
10569
dc3f80fe
ILT
10570 PR 10980
10571 * options.h (class General_options): Add --warn-unresolved-symbols
10572 and --error-unresolved-symbols.
10573 * errors.cc (Errors::undefined_symbol): Implement
10574 --warn-unresolved-symbols.
10575
ffeef7df
ILT
10576 * options.h (class General_options): Add -z text and -z textoff.
10577 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10578
f1ec9ded
ST
105792010-01-06 Sriraman Tallam <tmsriram@google.com>
10580
10581 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10582 (Garbage_collection::cident_sections): New function.
10583 (Garbage_collection::add_cident_section): New function.
10584 (Garbage_collection::cident_sections_): New member.
10585 (gc_process_relocs): Add references to sections whose names are C
10586 identifiers.
10587 * gold.h (cident_section_start_prefix): New constant.
10588 (cident_section_stop_prefix): New constant.
10589 (is_cident): New function.
10590 * layout.cc (Layout::define_section_symbols): Replace string constants
10591 with the newly defined constants.
10592 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10593 C identifiers.
10594 * testsuite/Makefile.am: Add gc_orphan_section_test.
10595 * testsuite/Makefile.in: Regenerate.
10596 * testsuite/gc_orphan_section_test.cc: New file.
10597 * testsuite/gc_orphan_section_test.sh: New file.
10598
6eda8c29
ILT
105992010-01-06 Ian Lance Taylor <iant@google.com>
10600
b9674e17
ILT
10601 PR 10980
10602 * options.h (class General_options): Add --warn-shared-textrel.
10603 * layout.cc (Layout::finish_dynamic_section): Implement
10604 --warn-shared-textrel.
10605
6eda8c29
ILT
10606 PR 10980
10607 * options.h (class General_options): Add --warn-multiple-gp.
10608
32dcd44e
ILT
106092010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10610
10611 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10612 $(THREADSLIB) and $(LIBDL).
10613 * Makefile.in: Rebuild.
10614
a192ba05
ILT
106152010-01-06 Ian Lance Taylor <iant@google.com>
10616
10617 PR 10980
10618 * options.cc (General_options::parse_section_start): New function.
10619 (General_options::section_start): New function.
10620 (General_options::General_options): Initialize all members.
10621 * options.h: Include <map>
10622 (class General_options): Add --section-start. Add section_starts_
10623 member.
10624 * layout.cc (Layout::attach_allocated_section_to_segment): If
10625 --section-start was used, set the address of the segment. Remove
10626 local sort_sections.
10627 (Layout::relaxation_loop_body): If the address of the load segment
10628 has been set by --section-start, don't use it.
10629 * output.h (Output_segment::update_flags_for_output_section): New
10630 function.
10631 * output.cc (Output_segment::add_output_section): Call
10632 update_flags_for_output_section.
10633
dde3f402
ILT
106342010-01-05 Ian Lance Taylor <iant@google.com>
10635
62dfdd4d
ILT
10636 PR 10980
10637 * options.h (class General_options): Add --undefined-version.
10638 * script.cc (struct Version_expression): Add was_matched_by_symbol
10639 field.
10640 (Version_script_info::matched_symbol): New function.
10641 (Version_script_info::get_symbol_version_helper): Call
10642 matched_symbol.
10643 (Version_script_info::check_unmatched_names): New function.
10644 * script.h (class Version_script_info): Update declarations.
10645 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10646
9c4ae156
ILT
10647 * options.h (class General_options): Use DEFINE_bool_alias for
10648 allow_multiple_definition.
10649 * resolve.cc (Symbol_table::should_override): Don't test
10650 allow_multiple_definition.
10651
dde3f402
ILT
10652 PR 10980
10653 * options.h (class General_options): Add --cref.
10654 * main.cc (main): Print cref table if --cref. Don't close mapfile
10655 until after printing cref table.
10656 * cref.cc: Include "symtab.h".
10657 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10658 (Cref_table_compare::operator()): New function.
10659 (Cref_inputs::gather_cref): New function.
10660 (filecol): New static const.
10661 (Cref_inputs::print_cref): New function.
10662 (Cref::print_cref): New function.
10663 * cref.h: Include <cstdio>.
10664 (class Cref): Update declarations.
10665 * mapfile.h (Mapfile::file): New function.
10666 * object.h (class Object): Define Symbols. Declare virtual
10667 do_get_global_symbols.
10668 (Object::get_global_symbols): New function.
10669 * object.cc (Input_objects::add_object): Pass object to cref_ if
10670 --cref.
10671 (Input_objects::archive_start): Likewise.
10672 (Input_objects::archive_stop): Likewise.
10673 (Input_objects::print_cref): New function.
10674 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10675 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10676 --cref.
10677 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10678 function.
10679 * plugin.h (class Sized_pluginobj): Update declarations.
10680
8781f709
ILT
106812010-01-05 Ian Lance Taylor <iant@google.com>
10682
10683 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10684 to is_default_version. Rename insdef to insdefault.
10685 (Symbol_table::add_from_relobj): Rename def to is_default_version
10686 and local to is_forced_local.
10687 (Symbol_table::add_from_pluginobj): Likewise.
10688 (Symbol_table::add_from_dynobj): Likewise.
10689 (Symbol_table::define_special_symbol): Rename insdef to
10690 insdefault.
10691
fe35d28d
ILT
106922010-01-04 Ian Lance Taylor <iant@google.com>
10693
30bc8c46
ILT
10694 PR 10980
10695 * options.h (class General_options): Add
10696 --allow-multiple-definition and -z muldefs.
10697 * resolve.cc (Symbol_table::should_override): Don't warn about a
10698 multiple symbol definition if --allow-multiple-definition or -z
10699 muldefs.
10700
7eaea549
ILT
10701 PR 10980
10702 * options.h (class General_options): Add --add-needed and
10703 --copy-dt-needed-entries. Tweak --as-needed help entry.
10704 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10705 error if --copy-dt-needed-entries aka --add-needed is used and
10706 would cause a change in behaviour.
10707
fe35d28d
ILT
10708 PR 10980
10709 * options.h (class General_options): Add -G as a short version of
10710 --shared. Add no-op options -assert, -g, and -i.
10711
55a2bb35
ST
107122010-01-04 Sriraman Tallam <tmsriram@google.com>
10713
10714 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10715 check for .text or .gnu.linkonce.t sections.
10716 * icf.cc (Icf::find_identical_sections): Ditto.
10717 Change the detection for mangled function name within the section
10718 name.
10719 * icf.h (is_section_foldable_candidate): New function.
10720
719328e1
ILT
107212009-12-30 Ian Lance Taylor <iant@google.com>
10722
10723 PR 10980
10724 * options.h (class General_options): Permit two dashes with
10725 --retain-symbols-file.
10726
d7bb5745
ILT
107272009-12-30 Ian Lance Taylor <iant@google.com>
10728
403a15dd
ILT
10729 PR 10979
10730 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10731 don't put the file header and segment headers in the text
10732 segment.
10733
eda294df
ILT
10734 PR 10979
10735 * common.cc (Sort_commons::operator()): Stabilize sort when both
10736 entries are NULL.
10737 (Symbol_table::do_allocate_commons_list): When allocating common
10738 symbols, skip a symbol which is no longer common.
10739 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10740 an object before checking its type.
10741 * testsuite/common_test_2.c: New file.
10742 * testsuite/common_test_3.c: New file.
10743 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10744 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10745 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10746 (common_test_2_pic.o, common_test_2.so): New targets.
10747 (common_test_3_pic.o, common_test_3.so): New targets.
10748 * testsuite/Makefile.in: Rebuild.
10749
d7bb5745
ILT
10750 PR 10979
10751 * script.cc (read_input_script): If we see a new SECTIONS clause,
10752 and we have added an input section, give an error.
10753 * layout.h (class Layout): Add have_added_input_section function.
10754 Add have_added_input_section_ field.
10755 * layout.cc (Layout::Layout): Initialize
10756 have_added_input_section_.
10757 (Layout::layout): Set have_added_input_section_.
10758 (Layout::layout_eh_frame): Likewise.
10759
fc59c572
ILT
107602009-12-30 Ian Lance Taylor <iant@google.com>
10761
10762 PR 10931
10763 * options.h (class General_options): Add --sort-common option.
10764 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10765 * common.cc (Sort_common): Add sort_order parameter to
10766 constructor. Add sort_order_ field.
10767 (Sort_commons::operator): Check sort_order_.
10768 (Symbol_table::allocate_commons): Determine the sort order.
10769 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10770 Change all callers.
10771 (Symbol_table::do_allocate_commons_list): Likewise.
10772
1c74fab0
ILT
107732009-12-30 Ian Lance Taylor <iant@google.com>
10774
10775 PR 10916
10776 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10777 symbols from this object, don't change the visibility of an
10778 undefined symbol.
10779 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10780
6affe781
ILT
107812009-12-30 Ian Lance Taylor <iant@google.com>
10782
10783 PR 10861
10784 * script.h (class Version_script_info): Define Language enum.
10785 Update declarations. Define Glob, Exact, and Lookup types. Add
10786 new fields globals_, locals_, and is_finalized_.
10787 * script.cc: Various formatting fixes.
10788 (class Parser_closure): Change language_stack_ from a vector of
10789 std::string to one of Version_script_info::Language. Adjust all
10790 uses accordingly.
10791 (class Lazy_demangler): Remove.
10792 (struct Version_expression): Change language from std::string to
10793 Version_script_info::Language.
10794 (Version_script_info::Version_script_info): New function.
10795 (Version_script_info::~Version_script_info): Don't call clear.
10796 (Version_script_info::finalize): New function.
10797 (Version_script_info::build_lookup_tables): New function.
10798 (Version_script_info::build_expression_list_lookup): New
10799 function.
10800 (Version_script_info::get_symbol_version_helper): Rewrite to use
10801 lookup tables.
10802 (Version_script_info::print_expression_list): Adjust to use
10803 Version_script_info::Language.
10804 (script_push_lex_into_version_mode): Check that the version script
10805 has not been finalized.
10806 (version_script_push_lang): Change language string to
10807 Version_script_info::Language.
10808 * options.cc (Command_line::version_script): New function.
10809 * options.h (class General_options): Add finalize_dynamic_list
10810 function. Change version_script from declaration to definition.
10811 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10812 * testsuite/version_script.map: Remove duplicate def of foo.
10813 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10814 version_script.map.
10815 * testsuite/Makefile.in: Rebuild.
10816
818bf354
ILT
108172009-12-30 Ian Lance Taylor <iant@google.com>
10818
10819 PR 10843
10820 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10821 if the input symbol index is 0, make the output symbol index 0.
10822
ebcc8304
ILT
108232009-12-30 Ian Lance Taylor <iant@google.com>
10824
10825 PR 10670
10826 * options.h (class General_options): Add -x/--discard-all.
10827 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10828 --discard-all. If the local symbol needs a dynamic entry, check
10829 that before handling --discard-locals.
10830
176fe33f
ILT
108312009-12-30 Ian Lance Taylor <iant@google.com>
10832
bb321bb1
ILT
10833 PR 10450
10834 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10835 flags to PF_R.
10836 (Output_segment::add_output_section): Don't change the flags if
10837 the type is PT_TLS.
10838
176fe33f
ILT
10839 PR 10450
10840 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10841 GNU hash table if they need a dynamic value. Otherwise, don't add
10842 them if they are defined in a dynamic object or are forced local.
10843
e8cd95c7
ILT
108442009-12-29 Ian Lance Taylor <iant@google.com>
10845
1b81fb71
ILT
10846 PR 10450
10847 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10848 .gnu.hash table for a 32-bit target.
10849
8d6d383d
ILT
10850 PR 10450
10851 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10852 regular and a dynamic object only needs a dynamic symbol table
10853 entry if it is externally visible.
10854
e785ec03
ILT
10855 PR 10450
10856 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10857 constructor. Add global_offset_table_ field.
10858 (Target_i386::got_section): Set global_offset_table_.
10859 (Target_i386::do_finalize_sections): Set global_offset_table_
10860 size.
10861 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10862 in constructor. Add global_offset_table_ field.
10863 (Target_x86_64::got_section): Set global_offset_table_.
10864 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10865 size.
10866
1a2dff53
ILT
10867 * layout.cc (Layout::Layout): Initialize increase_relro_.
10868 (Layout::get_output_section): Add is_relro, is_last_relro, and
10869 is_first_non_relro parameters. Change all callers.
10870 (Layout::choose_output_section): Likewise.
10871 (Layout::add_output_section_data): Likewise.
10872 (Layout::make_output_section): Likewise.
10873 (Layout::set_segment_offsets): Clear increase_relro when using a
10874 linker script.
10875 * layout.h (class Layout): Add increase_relro method. Add
10876 increase_relro_ field. Update declarations.
10877 * output.cc (Output_section::Output_section): Initialize
10878 is_last_relro_ and is_first_non_relro_.
10879 (Output_segment::add_output_section): Group relro sections is
10880 do_sort is true. Handle is_last_relro and is_first_non_relro.
10881 (Output_segment::maximum_alignment): Remove relro handling.
10882 (Output_segment::set_section_addresses): Add increase_relro
10883 parameter. Change all callers. Add initial alignment to align
10884 relro sections on separate page. Remove old relro handling.
10885 (Output_segment::set_section_list_addresses): Remove in_relro
10886 parameter. Change all callers.
10887 (Output_segment::set_offset): Add increase parameter. Change all
10888 callers. Remove old relro handling.
10889 * output.h (class Output_section): Add new methods: is_last_relro,
10890 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10891 Add is_last_relro_ and is_first_non_relro_ fields.
10892 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10893 Create separate .got.plt section. Call increase_relro.
10894 * x86_64.cc (Target_x86_64::got_section): Likewise.
10895 * testsuite/relro_script_test.t: Add .got.plt.
10896
f0ba79e2
ILT
10897 PR 10450
10898 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
10899 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
10900 (Layout::finalize): Call set_dynamic_symbol_size.
10901 (Layout::set_dynamic_symbol_size): New function.
10902 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
10903 set_dynamic_symbol_size.
10904
e8cd95c7
ILT
10905 PR 10450
10906 * output.h (class Output_section): Add is_entsize_zero_ field.
10907 * output.cc (Output_section::Output_section): Initialize
10908 is_entsize_zero_.
10909 (Output_section::set_entsize): If two different entsizes are
10910 requested, force it to zero.
10911 (Output_section::add_input_section): Set flags for .debug_str
10912 before updating section flags. Set entsize.
10913 (Output_section::update_flags_for_input_section): Set SHF_MERGE
10914 and SHF_STRING if all input sections have those flags.
10915
3e1b9a8a
RÁE
109162009-12-29 Rafael Espindola <espindola@google.com>
10917
10918 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
10919 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
10920 reporting.
3e1b9a8a 10921
3dcad376
ST
109222009-12-29 Sriraman Tallam <tmsriram@google.com>
10923
10924 * options.cc (General_options::parse_version): Allow -v to exit
10925 without an error if there is nothing to link.
10926
084e2665
ILT
109272009-12-29 Ian Lance Taylor <iant@google.com>
10928
10929 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
10930 using a version of gcc before 4.1.
10931 * configure: Rebuild.
10932
250acde3
CD
109332009-12-28 Chris Demetriou <cgd@google.com>
10934
10935 * attributes.cc (Output_attributes_section_data::do_write): Use
10936 std::vector::front rather than std::vector::data.
10937
99fff23b
ILT
109382009-12-28 Ian Lance Taylor <iant@google.com>
10939
10940 * symtab.h (class Symbol_table): Add enum Defined.
10941 * resolve.cc (Symbol_table::should_override): Add defined
10942 parameter. Change all callers. Test whether object is NULL
10943 before calling a method on it.
10944 (Symbol_table::report_resolve_problem): Add defined parameter.
10945 Change all callers.
10946 (Symbol_table::should_override_with_special): Likewise.
10947 * symtab.cc (Symbol_table::define_in_output_data): Add defined
10948 parameter. Change all callers.
10949 (Symbol_table::do_define_in_output_data): Likewise.
10950 (Symbol_table::define_in_output_segment): Likewise.
10951 (Symbol_table::do_define_in_output_segment): Likewise.
10952 (Symbol_table::define_as_constant): Likewise.
10953 (Symbol_table::do_define_as_constant): Likewise.
10954 * script.h (class Symbol_assignment): Add is_defsym parameter to
10955 constructor; change all callers.
10956 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
10957 parameter. Change all callers. Add is_defsym_ field.
10958 (class Parser_closure): Add parsing_defsym parameter to
10959 constructor; change all callers. Add parsing_defsym accessor
10960 function. Add parsing_defsym_ field.
10961
556bd683
ILT
109622009-12-28 Ian Lance Taylor <iant@google.com>
10963
10964 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 10965 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 10966
1782c879
ILT
109672009-12-23 Ian Lance Taylor <iant@google.com>
10968
10969 * i386.cc (Target_i386::do_calls_non_split): Recognize
10970 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
10971 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
10972 -fsplit-stack prologue when using %r11.
1782c879 10973
329ca2b1
ST
109742009-12-21 Sriraman Tallam <tmsriram@google.com>
10975
10976 * options.cc (General_options::parse_version): Make -v continue and do
10977 the link like GNU ld does.
10978
d675ff46
RÁE
109792009-12-17 Rafael Avila de Espindola <espindola@google.com>
10980
10981 * Makefile.am (CCFILES): Add timer.cc.
10982 (HFILES): Add timer.h.
10983 * configure.ac: Check for sysconf and times.
10984 * main.cc: include timer.h.
10985 (main): Use Timer instead of get_run_time.
10986 * timer.cc: New.
10987 * timer.h: New.
10988 * workqueue.cc: include timer.h.
10989 (Workqueue::find_and_run_task):
10990 Report user, sys and wall time.
10991 * Makefile.in: Regenerate.
10992 * config.in: Regenerate.
10993 * configure: Regenerate.
10994
d6344fb5
DK
109952009-12-16 Doug Kwan <dougkwan@google.com>
10996
10997 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
10998 sections.
10999 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11000 relaxed input sections.
11001 * output.cc (Output_section::find_relaxed_input_section): Change
11002 return type to Output_relaxed_input_section pointer. Adjust code
11003 for new type of relaxed_input_section_map_.
11004 * output.h (Output_section::find_relaxed_input_section): Change
11005 return type to Output_relaxed_input_section pointer.
11006 (Output_section::Output_relaxed_input_section_by_input_section_map):
11007 New type.
11008 (Output_section::relaxed_input_section_map_): Change type to
11009 Output_section::Output_relaxed_input_section_by_input_section_map.
11010 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11011 input section.
11012
0e0d5469
ILT
110132009-12-15 Ian Lance Taylor <iant@google.com>
11014
11015 * layout.cc (Layout::create_shstrtab): Only write out after input
11016 sections if we are compressing debug sections.
11017
0649a889
ILT
110182009-12-15 Ian Lance Taylor <iant@google.com>
11019
11020 * archive.cc (Archive::add_symbols): Only look up a symbol without
11021 a version if there is, in fact, a version.
11022
2ea97941
ILT
110232009-12-14 Ian Lance Taylor <iant@google.com>
11024
11025 Revert -Wshadow changes, all changes from:
11026 2009-12-11 Doug Kwan <dougkwan@google.com>
11027 2009-12-11 Nick Clifton <nickc@redhat.com>
11028 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11029
b0eec2cc
DK
110302009-12-11 Doug Kwan <dougkwan@google.com>
11031
11032 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11033 due to -Wshadow.
11034 * attributes.cc (Object_attribute::size): Ditto.
11035 (Attributes_section_data::size): Ditto.
11036 (Attributes_section_data::Attributes_section_data): Ditto.
11037 (Output_attributes_section_data::do_write): Ditto.
11038 * attributes.h (Object_attribute::set_type): Ditto.
11039 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11040
91d6fa6a
NC
110412009-12-11 Nick Clifton <nickc@redhat.com>
11042
11043 * archive.cc: Fix shadowed variable warnings.
11044 * arm.cc: Likewise.
11045 * compressed_output.cc: Likewise.
11046 * compressed_output.h: Likewise.
11047 * configure: Likewise.
11048 * dwarf_reader.cc: Likewise.
11049 * dynobj.cc: Likewise.
11050 * dynobj.h: Likewise.
11051 * ehframe.cc: Likewise.
11052 * ehframe.h: Likewise.
11053 * errors.cc: Likewise.
11054 * expression.cc: Likewise.
11055 * fileread.cc: Likewise.
11056 * fileread.h: Likewise.
11057 * freebsd.h: Likewise.
11058 * i386.cc: Likewise.
11059 * icf.cc: Likewise.
11060 * incremental.h: Likewise.
11061 * layout.cc: Likewise.
11062 * layout.h: Likewise.
11063 * mapfile.cc: Likewise.
11064 * merge.cc: Likewise.
11065 * merge.h: Likewise.
11066 * object.cc: Likewise.
11067 * object.h: Likewise.
11068 * options.h: Likewise.
11069 * output.cc: Likewise.
11070 * output.h: Likewise.
11071 * parameters.cc: Likewise.
11072 * plugin.cc: Likewise.
11073 * powerpc.cc: Likewise.
11074 * reduced_debug_output.cc: Likewise.
11075 * reduced_debug_output.h: Likewise.
11076 * reloc.cc: Likewise.
11077 * reloc.h: Likewise.
11078 * resolve.cc: Likewise.
11079 * script-sections.cc: Likewise.
11080 * script.cc: Likewise.
11081 * script.h: Likewise.
11082 * sparc.cc: Likewise.
11083 * symtab.cc: Likewise.
11084 * symtab.h: Likewise.
11085 * target-select.cc: Likewise.
11086 * target-select.h: Likewise.
11087 * token.h: Likewise.
11088 * workqueue.cc: Likewise.
11089 * workqueue.h: Likewise.
11090 * x86_64.cc: Likewise.
11091
a0351a69
DK
110922009-12-10 Doug Kwan <dougkwan@google.com>
11093
11094 * arm.cc (attributes.h): New include.
11095 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11096 (Arm_relobj::~Arm_relobj): Delete object pointed by
11097 attributes_section_data_.
11098 (Arm_relobj::attributes_section_data): New method definition.
11099 (Arm_relobj::attributes_section_data_): New data member declaration.
11100 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11101 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11102 attributes_section_data_.
11103 (Arm_dynobj::attributes_section_data): New method definition.
11104 (Arm_dynobj::attributes_section_data_): New data member declaration.
11105 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11106 initialization value of may_use_blx_ to false.
2e702c99 11107 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
11108 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11109 object attributes to compute results instead of hard-coding.
11110 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11111 Target_arm::get_secondary_compatible_arch,
11112 Target_arm::set_secondary_compatible_arch
11113 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11114 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11115 New method declarations.
11116 (Target_arm::get_aeabi_object_attribute): New method definition.
11117 (Target_arm::attributes_section_data_): New data member declaration.
11118 (read_arm_attributes_section): New template definition.
11119 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11120 (Arm_dynobj::do_read_symbols): Ditto.
11121 (Target_arm::do_finalize_sections): Merge attributes sections from
11122 input. Check for BLX use after attributes section merging.
11123 Fix __exidx_start and __exidx_end visibility. Create an
11124 .ARM.attributes section if necessary.
11125 (Target_arm::get_secondary_compatible_arch,
11126 Target_arm::set_secondary_compatible_arch,
11127 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11128 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 11129 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
11130 New method definitions.
11131
b59befec
ILT
111322009-12-09 Ian Lance Taylor <iant@google.com>
11133
11134 * plugin.cc (Plugin::load): Don't cast from void* to a function
11135 pointer.
11136
1276bc89
ILT
111372009-12-09 Ian Lance Taylor <iant@google.com>
11138
11139 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11140 information fields.
11141
2f2de248
L
111422009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11143
11144 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11145 Replace two_file_shared_1.so with two_file_shared_2.so.
11146 * testsuite/Makefile.in: Regenerated.
11147
4f787271
DK
111482009-12-08 Doug Kwan <dougkwan@google.com>
11149
11150 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11151 (HFILES): Add attributes.h and int_encoding.h.
11152 * Makefile.in: Regenerate.
11153 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11154 function definitions to int_encoding.cc
11155 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11156 prototypes to int_encoding.h
11157 * reduced_debug_output.cc (int_encoding.h): New include.
11158 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11159 function definitions to int_encoding.cc
11160 (insert_into_vector, read_from_pointer): Move template definitions to
11161 int_encoding.h
11162 * attributes.cc: New file.
11163 * attributes.h: New file.
11164 * int_encoding.cc: New file.
11165 * int_encoding.h: New file.
11166
20b52f1a
RÁE
111672009-12-07 Rafael Avila de Espindola <espindola@google.com>
11168
11169 PR gold/11055
11170 * incremental-dump.cc (dump_incremental_inputs): New.
11171 (main): Use dump_incremental_inputs.
11172
53d7974c
L
111732009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11174
11175 PR gold/10893
11176 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11177 checking elfcpp::STT_FUNC.
11178 (Target_i386::Relocate::relocate): Likewise.
11179 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11180
11181 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11182 symbols from shared libraries into normal FUNC symbols.
11183
11184 * symtab.h (Symbol): Add is_func and use it.
11185
05a352e6
DK
111862009-12-05 Doug Kwan <dougkwan@google.com>
11187
11188 * arm.cc (Target_arm::arm_info): Initialize new fields
11189 attributes_section and attributes_vendor.
11190 * i386.cc (Target_i386::i386_info): Same.
11191 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11192 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11193 fields attributes_section and attributes_vendor.
53d7974c 11194 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11195 * target.h (Target::attributes_section, Target::attributes_vendor,
11196 Target::is_attributes_section, Target::attribute_arg_type,
11197 Target::attributes_order): New method definitions.
11198 (Target::Target_info::attributes_section,
11199 Target::Target_info::attributes_vendor): New fields.
11200 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11201 virtual method definitions.
11202 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11203 attributes_section and attributes_vendor.
11204 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11205
f4e5969c
DK
112062009-12-05 Doug Kwan <dougkwan@google.com>
11207
11208 * arm.cc: Update comments about interworking and stub generation.
11209 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11210 considered as non-PIC.
11211 (Arm_relocate_functions::base_abs): Fix formatting.
11212 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11213 of function to use GOT entry address instead of offset.
11214 (Target_arm::Scan::global): Issue an error if a symbol would need a
11215 PLT does not get one because it is untyped. Remove code to create
11216 dynamic symbols for relative branches.
11217 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11218 takes unsigned integer instead of boolean.
11219
1abce4a6
L
112202009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11221
11222 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11223 (two_file_test_LDADD): Likewise.
11224 (common_test_1_LDADD): Likewise.
11225 (exception_test_LDADD) Likewise.
11226 (weak_test_LDADD): Likewise.
11227 (many_sections_test_LDADD): Likewise.
11228 (initpri1_LDADD): Likewise.
11229 (script_test_1_LDADD): Likewise.
11230 (script_test_2_LDADD): Likewise.
11231 (justsyms_LDADD): Likewise.
11232 (binary_test_LDADD): Likewise.
11233 (large_LDADD): Likewise.
11234 * testsuite/Makefile.in: Regenerated.
11235
adcf2816 112362009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11237
adcf2816
L
11238 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11239 (Symbol_table::override_with_special): Likewise.
11240 (Symbol_table::add_from_object): Likewise.
11241
28e67f5d
RÁE
112422009-12-04 Rafael Avila de Espindola <espindola@google.com>
11243
11244 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11245 Don't set the data_offset twice.
11246
ae10a101
RÁE
112472009-12-04 Rafael Avila de Espindola <espindola@google.com>
11248
11249 * testsuite/Makefile.in: Regenerate.
11250
f59f41f3
DK
112512009-12-03 Doug Kwan <dougkwan@google.com>
11252
11253 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11254 (Target_arm::do_finalize_sections): Add parameter for symbol table
11255 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11256 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11257 parameter for symbol table pointer.
11258 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11259 an additional parameter for a pointer to symbol table.
11260 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11261 parameter for a symbol table pointer.
11262 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11263 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11264 Ditto.
11265 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11266 parameter for a symbol table pointer.
11267
ca55d848
RÁE
112682009-12-03 Rafael Avila de Espindola <espindola@google.com>
11269
11270 * incremental.cc (Incremental_inputs_header)
11271 (Incremental_inputs_header_write, Incremental_inputs_entry)
11272 (Incremental_inputs_entry_write): Move ...
11273 * incremental.h (Incremental_inputs_header)
11274 (Incremental_inputs_header_write, Incremental_inputs_entry)
11275 (Incremental_inputs_entry_write): here.
11276
3aec4f9c
RÁE
112772009-12-02 Rafael Avila de Espindola <espindola@google.com>
11278
11279 * incremental.cc (make_sized_incremental_binary): Set the target.
11280 Error if it is incompatible.
11281 * output.h (Output_file): Add filename method.
11282
9c0ae74d
RÁE
112832009-12-02 Rafael Avila de Espindola <espindola@google.com>
11284
11285 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11286 from the get_* methods.
11287
a45500ae
RÁE
112882009-12-02 Rafael Avila de Espindola <espindola@google.com>
11289
11290 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11291 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11292 Write 0 for the data_offset of scripts.
11293
325e6408
RÁE
112942009-12-02 Rafael Avila de Espindola <espindola@google.com>
11295
11296 * testsuite/Makefile.am: Add the incremental_test.sh test.
11297 * testsuite/incremental_test.sh: New.
11298 * testsuite/incremental_test_1.c: New.
11299 * testsuite/incremental_test_2.c: New.
11300
954c3e2e
RÁE
113012009-12-01 Rafael Avila de Espindola <espindola@google.com>
11302
703d02da 11303 * incremental-dump.cc (main): Fix typos.
954c3e2e 11304
f8086623
RÁE
113052009-11-27 Rafael Avila de Espindola <espindola@google.com>
11306
11307 PR gold/11025
11308 * incremental-dump.cc (main): Use llu to print 64 bit values.
11309
3b0dd6ac
L
113102009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11311 H.J. Lu <hongjiu.lu@intel.com>
11312
11313 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11314 $(LIBDL).
11315 (incremental_dump_LDADD): Likewise.
11316 * Makefile.in: Regenerated.
11317
a6d1ef57 113182009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11319
a6d1ef57
DK
11320 Revert:
11321
11322 2009-11-25 Doug Kwan <dougkwan@google.com>
11323
11324 * arm.cc (Target_arm::Target_arm): Move method definition
11325 outside of class definition. Add code to handle
11326 --target1-rel, --target1-abs and --target2= options.
11327 (Target_arm::get_reloc_reloc_type): Change method to be
11328 non-static and const.
11329 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11330 New data member declaration.
11331 (Target_arm::Scan::local, Target_arm::Scan::global,
11332 Target_arm::Relocate::relocate,
11333 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11334 Adjust call to Target_arm::get_real_reloc_type.
11335 (Target_arm::get_real_reloc_type): Use command line options
11336 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11337 * options.h (--target1-rel, --target1-abs, --target2): New
11338 ARM-only options.
11339
50aeb7d4
DK
113402009-11-25 Doug Kwan <dougkwan@google.com>
11341
11342 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11343 class definition. Add code to handle --target1-rel, --target1-abs
11344 and --target2= options.
11345 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11346 and const.
11347 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11348 member declaration.
11349 (Target_arm::Scan::local, Target_arm::Scan::global,
11350 Target_arm::Relocate::relocate,
11351 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11352 call to Target_arm::get_real_reloc_type.
11353 (Target_arm::get_real_reloc_type): Use command line options to
11354 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11355 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11356 options.
11357
51938283
DK
113582009-11-25 Doug Kwan <dougkwan@google.com>
11359
11360 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11361 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11362 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11363 formatting.
11364 (Arm_relocate_functions::thm_call): Replace body with a call to
11365 Arm_relocate_functions::thumb_branch_common.
11366 (Arm_relocate_functions::thm_jump24,
11367 Arm_relocate_functions::thm_xpc22): New method definitions.
11368 (Arm_relocate_functions::thumb_branch_common): New method definition.
11369 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11370 operator.
11371 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11372 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11373
e2b8f3c4
RÁE
113742009-11-24 Rafael Avila de Espindola <espindola@google.com>
11375
11376 * Makefile.am: Build incremental-dump
11377 * Makefile.in: Regenerate.
11378 * incremental-dump.cc: New.
11379 * incremental.cc (Incremental_inputs_header_data,
11380 Incremental_inputs_entry_data): Move to incremental.h
11381 * incremental.h: (Incremental_inputs_header_data,
11382 Incremental_inputs_entry_data): Move from incremental.cc
11383
bcba9aec
RÁE
113842009-11-24 Rafael Avila de Espindola <espindola@google.com>
11385
11386 * incremental.cc (Incremental_inputs_header,
11387 Incremental_inputs_header_write, Incremental_inputs_entry,
11388 Incremental_inputs_entry_write): Add a typedef with the data type.
11389
7c3afe08
RÁE
113902009-11-24 Rafael Avila de Espindola <espindola@google.com>
11391
11392 * incremental.cc (Incremental_inputs_header,
11393 Incremental_inputs_header_write, Incremental_inputs_entry,
11394 Incremental_inputs_entry_write): Update comment about which
11395 type has the filed descriptions.
11396
d204b6e9
DK
113972009-11-15 Doug Kwan <dougkwan@google.com>
11398
11399 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11400 (Arm_relocate_functions::arm_branch_common): Change method defintion
11401 in class definition to a method declaration and update list of formal
11402 parameters.
11403 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11404 Arm_relocation_functions::jump24): Adjust call to
11405 Arm_relocate_functions::arm_branch_common. Update list of formal
11406 parameters.
11407 (Arm_relocate_functions::xpc25): New method definition.
11408 (Arm_relocate_functions::arm_branch_common): Move method defintion
11409 out from class definition. Use stubs for mode-switching and extending
11410 branch ranges.
11411 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11412 specially. Change code to enable use of stubs in ARM branches.
11413
43d12afe
DK
114142009-11-10 Doug Kwan <dougkwan@google.com>
11415
11416 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11417 in method declaration.
11418 (Target_arm::relocate_stub): New method declaration.
11419 (Target_arm::default_target): Change to return a pointer instead of
11420 a const reference.
11421 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11422 Target_arm::default_target.
11423 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11424 method definition.
11425 (Target_arm::relocate_section): Adjust view.
11426 (Target_arm::relocate_stub): New method definition.
11427
ac33a407
DK
114282009-11-10 Doug Kwan <dougkwan@google.com>
11429
11430 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11431 a format warning.
11432 * incremental.cc (open_incremental_binary): Initialized local
11433 variables to avoid warnings.
11434 * object.cc (make_elf_object): Ditto.
11435 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11436 a format warning.
e1df38aa 11437
88ee28e9
L
11438009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11439
11440 PR gold/10930
11441 * testsuite/plugin_test.c: Include "config.h".
11442
2daedcd6
DK
114432009-11-09 Doug Kwan <dougkwan@google.com>
11444
11445 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11446 (arm_symbol_value): Remove.
11447 (Arm_relocate_functions::arm_branch_common,
11448 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11449 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11450 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11451 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11452 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11453 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11454 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11455 Arm_relocate_functions::thm_mobw_abs_nc,
11456 Arm_relocate_functions::thm_mov_abs,
11457 Arm_relocate_functions::movw_prel_nc,
11458 Arm_relocate_functions::thm_movt_abs,
11459 Arm_relocate_functions::movt_prel,
11460 Arm_relocate_functions::thm_movw_prel_nc,
11461 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11462 (Target_arm::Relocate::relocate): Only decompose address into two
11463 parts if relocation type uses the thumb-bit and pass the actual
11464 bit instead of a flag indicating that the thumb-bit is used. Adjust
11465 calls to methods in Arm_relocate_functions for this change.
11466
1276bc89 114672009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
11468
11469 PR 10925
11470 * reloc.cc: Instantiate
11471 Sized_relobj::initialize_input_to_output_maps and
11472 Sized_relobj:free_input_to_output_maps.
11473
e53ad1b5
ILT
114742009-11-06 Ian Lance Taylor <iant@google.com>
11475
11476 PR 10876
11477 * defstd.cc (in_segment): Set only_if_ref true for "end".
11478
eb44217c
DK
114792009-11-06 Doug Kwan <dougkwan@google.com>
11480
11481 * arm.cc (class Reloc_stub): Correct a comment.
11482 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11483 (Target_arm::scan_section_for_stubs): New method declaration.
11484 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11485 Change methods from private to protected.
11486 (Target_arm::do_may_relax): New method definition.
11487 (Target_arm::do_relax, Target_arm::group_sections,
11488 Target_arm::scan_reloc_for_stub,
11489 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11490 (Target_arm::arm_input_section_map_): New data member declaration.
11491 (Target_arm::scan_reloc_for_stub,
11492 Target_arm::scan_reloc_section_for_stubs,
11493 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11494 Target_arm::do_relax): New method definitions.
11495
5d329b7d
ILT
114962009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11497
11498 * configure.ac: Check for (struct stat)::st_mtim
11499 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11500 * config.in: Regenerate.
11501 * configure: Regenerate.
11502
96a0d71b
ILT
115032009-11-05 Ian Lance Taylor <iant@google.com>
11504
11505 PR 10910
11506 * output.cc (Output_segment::add_output_section): Add missing
11507 return statement.
11508
594c8e5e
ILT
115092009-11-04 Ian Lance Taylor <iant@google.com>
11510
11511 PR 10880
11512 * object.h (class Object): Add is_needed and set_is_needed
11513 methods. Add is_needed_ field. Make bool fields into bitfields.
11514 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11515 defined in a dynamic object and referenced by a regular object,
11516 set is_needed for the dynamic object.
11517 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11518 if the file is marked with as_needed and it is not needed.
11519
22b127cc
ILT
115202009-11-04 Ian Lance Taylor <iant@google.com>
11521
11522 PR 10887
11523 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11524 tags if data is discarded by linker script.
11525 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11526 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11527 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11528 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11529
f5c870d2
ILT
115302009-11-04 Ian Lance Taylor <iant@google.com>
11531
11532 * layout.cc (Layout::get_output_section): Add is_interp and
11533 is_dynamic_linker_section parameters. Change all callers.
11534 (Layout::choose_output_section): Likewise.
11535 (Layout::make_output_section): Likewise.
11536 (Layout::add_output_section_data): Add is_dynamic_linker_section
11537 parameter. Change all callers.
11538 * layout.h (class Layout): Update declarations.
11539 * output.h (class Output_section): Add is_interp, set_is_interp,
11540 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11541 Add is_interp_, is_dynamic_linker_section_ fields. Change
11542 generate_code_fills_at_write_ to a bitfield.
11543 * output.cc (Output_section::Output_sections): Initialize new
11544 fields.
11545 (Output_segment::add_output_section): Add do_sort parameter.
11546 Change all callers.
11547
1ae4d23b
ILT
115482009-11-03 Ian Lance Taylor <iant@google.com>
11549
11550 PR 10860
11551 * options.h (class General_options): Add --warn-common.
11552 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11553 merging two common symbols.
11554 (Symbol_table::should_override): Handle --warn-common when merging
11555 a common symbol with a defined symbol. Use report_resolve_problem
11556 for multiple definitions.
11557 (Symbol_table::report_resolve_problem): New function.
11558 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11559
55da9579
DK
115602009-11-03 Doug Kwan <dougkwan@google.com>
11561
11562 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11563 stub_factory_.
11564 (Target_arm::stub_factory): New method definition.
11565 (Target_arm::new_arm_input_section,
11566 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11567 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 11568 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
11569 New type definitions.
11570 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11571 member declarations.
11572 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11573 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11574 New method definitions.
11575
37a9ac43
ILT
115762009-11-03 Ian Lance Taylor <iant@google.com>
11577
11578 * options.h (class General_options): Add --warn_constructors.
11579
b3d6a3d4
ILT
115802009-11-03 Ian Lance Taylor <iant@google.com>
11581
11582 PR 10893
11583 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11584 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11585
934b01dd
ILT
115862009-11-03 Ian Lance Taylor <iant@google.com>
11587
11588 PR 10895
11589 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11590 --msgid-bugs-address.
11591 (install-pdf): New target.
11592 (install-data_yes): Look up one directory to find mkinstalldirs.
11593
03c1939b
L
115942009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11595
11596 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11597 tree.
11598
ebd95253
DK
115992009-10-30 Doug Kwan <dougkwan@google.com>
11600
11601 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11602
e9bbb538
DK
116032009-10-30 Doug Kwan <dougkwan@google.com>
11604
11605 * arm.cc (Stub_addend_reader): New struct template definition
11606 and partial specializations.
11607 (Stub_addend_reader::operator()): New method definition for a
11608 partially specialized template.
11609
d5b40221
DK
116102009-10-30 Doug Kwan <dougkwan@google.com>
11611
11612 * arm.cc (Arm_relobj::processor_specific_flags): New method
11613 definition.
11614 (Arm_relobj::do_read_symbols): New method declaration.
11615 (Arm_relobj::processor_specific_flags_): New data member declaration.
11616 (Arm_dynobj): New class definition.
11617 (Target_arm::do_finalize_sections): Add input_objects parameter.
11618 (Target_arm::do_adjust_elf_header): New method declaration.
11619 (Target_arm::are_eabi_versions_compatible,
11620 (Target_arm::merge_processor_specific_flags): New method declaration.
11621 (Target_arm::do_make_elf_object): New overloaded method definitions
11622 and declaration.
11623 (Arm_relobj::do_read_symbols): New method definition.
11624 (Arm_dynobj::do_read_symbols): Ditto.
11625 (Target_arm::do_finalize_sections): Add input_objects parameters.
11626 Merge processor-specific flags from all input objects.
11627 (Target_arm::are_eabi_versions_compatible,
11628 Target_arm::merge_processor_specific_flags,
11629 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11630 New method definitions.
11631 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11632 Input_objects pointer type parameter.
11633 * layout.cc (Layout::finalize): Pass input objects to target's.
11634 finalize_sections function.
11635 * output.cc (Output_file_header::do_sized_write): Set ELF file
11636 header's processor-specific flags.
11637 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11638 Input_objects pointer type parameter.
11639 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11640 * target.h (Input_objects): New forward class declaration.
11641 (Target::processor_specific_flags,
11642 Target::are_processor_specific_flags_sect): New method definitions.
11643 (Target::finalize_sections): Add input_objects parameter.
11644 (Target::Target): Initialize processor_specific_flags_ and
11645 are_processor_specific_flags_set_.
11646 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11647 parameter.
11648 (Target::set_processor_specific_flags): New method definition.
11649 (Target::processor_specific_flags_,
11650 Target::are_processor_specific_flags_set_): New data member
11651 declarations.
11652 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11653 Input_objects pointer type parameter.
11654
ebabffbd
DK
116552009-10-30 Doug Kwan <dougkwan@google.com>
11656
11657 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11658
ad0f2072
ILT
116592009-10-28 Ian Lance Taylor <iant@google.com>
11660
11661 * object.h (class Relobj): Drop options parameter from
11662 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11663 do_scan_relocs, do_relocate. Change all callers.
11664 (class Sized_relobj): Drop options parameters from
11665 do_gc_process_relocs, do_scan_relocs, do_relocate,
11666 do_relocate_sections, relocate_sections, emit_relocs_scan,
11667 emit_relocs_scan_reltype. Change all callers.
11668 (struct Relocate_info): Remove options field and all references to
11669 it.
11670 * reloc.h (class Read_relocs): Remove options constructor
11671 parameter and options_ field. Change all callers.
11672 (class Gc_process_relocs, class Scan_relocs): Likewise.
11673 (class Relocate_task): Likewise.
11674 * target-reloc.h (scan_relocs): Remove options parameter. Change
11675 all callers.
11676 (scan_relocatable_relocs): Likewise.
11677 * target.h (class Sized_target): Remove options parameter from
11678 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11679 all callers.
11680 * gc.h (gc_process_relocs): Remove options parameter. Change all
11681 callers.
11682 * arm.cc: Update functions to remove options parameters.
11683 * i386.cc: Likewise.
11684 * powerpc.cc: Likewise.
11685 * sparc.cc: Likewise.
11686 * x86_64.cc: Likewise.
11687 * testsuite/testfile.cc: Likewise.
11688
8ffa3667
DK
116892009-10-28 Doug Kwan <dougkwan@google.com>
11690
11691 * arm.cc (Arm_relobj): New class definition.
e1df38aa 11692 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
11693 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11694 New method definitions.
11695
40f36857
CC
116962009-10-28 Cary Coutant <ccoutant@google.com>
11697
11698 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11699 (Plugin::cleanup_done_): New member.
11700 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11701 (Plugin_manager::cleanup_done_): Remove.
11702 (Plugin_manager::add_input_file): Edit error message.
11703 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11704 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11705
2c849493
ILT
117062009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11707
11708 * fileread.cc: (File_read::View::~View): Use the new
11709 data_ownership_ filed.
11710 (File_read::~File_read): Dispose the new whole_file_view_.
11711 (File_read::open): Mmap the whole file if needed.
11712 (File_read::open): Use whole_file_view_ instead of contents_.
11713 (File_read::find_view): Use whole_file_view_ if applicable.
11714 (File_read::do_read): Use whole_file_view_ instead of contents_.
11715 (File_read::make_view): Use whole_file_view_ instead of contents_,
11716 update File_read::View::View call.
11717 (File_read::find_or_make_view): Update File_read::View::View
11718 call.
11719 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11720 remove contents_
11721 (File_read::View::Data_ownership): New enum.
11722 (File_read::View::View): Replace bool mapped_ with Data_ownership
11723 argument.
11724 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11725 (File_read::View::data_ownership_): New field.
11726 (File_read::contents_): Remove (replaced by whole_file_view_).
11727 (File_read::whole_file_view_): New field.
11728 * options.h (class General_options): Add --keep-files-mapped.
11729
24998053
CC
117302009-10-27 Cary Coutant <ccoutant@google.com>
11731
11732 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11733 * testsuite/Makefile.am (plugin_test_5): New test case.
11734 * testsuite/Makefile.in: Regenerate.
11735
72adc4fa
DK
117362009-10-25 Doug Kwan <dougkwan@google.com>
11737
11738 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11739 from private to protected to allow access by child class.
11740 (Sized_relobj::do_relocate_sections): New method declaration.
11741 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 11742 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
11743 Sized_relobj::relocate_sections. Instantiate template explicitly
11744 for different target sizes and endianity.
11745
07f508a2
DK
117462009-10-24 Doug Kwan <dougkwan@google.com>
11747
11748 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11749 (Arm_input_section::as_arm_input_section): New method.
11750 (Arm_output_section): New class definition.
11751 (Arm_output_section::create_stub_group,
11752 Arm_output_section::group_sections): New method definitions.
11753
10ad9fe5
DK
117542009-10-22 Doug Kwan <dougkwan@google.com>
11755
11756 * arm.cc (Arm_input_section): New class definition.
11757 (Arm_input_section::init, Arm_input_section:do_write,
11758 Arm_input_section::set_final_data_size,
11759 Arm_input_section::do_reset_address_and_file_offset): New method
11760 definitions.
11761
56ee5e00
DK
117622009-10-21 Doug Kwan <dougkwan@google.com>
11763
11764 * arm.cc (Stub_table, Arm_input_section): New forward class
11765 declarations.
11766 (Stub_table): New class defintion.
11767 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11768 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11769 New method definition.
11770
b569affa
DK
117712009-10-21 Doug Kwan <dougkwan@google.com>
11772
11773 * arm.cc: Update copyright comments.
11774 (Target_arm): New forward class template declaration.
11775 (Arm_address): New type.
11776 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11777 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11778 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11779 constants.
11780 (Insn_template): Same.
11781 (DEF_STUBS): New macro.
11782 (Stub_type): New enum type.
11783 (Stub_template): New class definition.
11784 (Stub): Same.
11785 (Reloc_stub): Same.
11786 (Stub_factory): Same.
11787 (Target_arm::Target_arm): Initialize may_use_blx_ and
11788 should_force_pic_veneer_.
11789 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11790 Target_arm::should_force_pic_veneer,
11791 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11792 Target_arm::using_thumb_only, Target_arm:;default_target): New
11793 method defintions.
11794 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11795 New data member declarations.
11796 (Insn_template::size, Insn_template::alignment): New method defintions.
11797 (Stub_template::Stub_template): New method definition.
11798 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11799 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11800 (Stub_factory::Stub_factory): New method definition.
11801 * gold.h (string_hash): New template.
11802 * output.h (Input_section_specifier::hash_value): Use
11803 gold::string_hash.
11804 (Input_section_specifier::string_hash): Remove.
11805 * stringpool.cc (Stringpool_template::string_hash): Use
11806 gold::string_hash.
11807
6c172549
DK
118082009-10-20 Doug Kwan <dougkwan@google.com>
11809
11810 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11811 symbols of relaxed input sections.
11812 * output.h (Output_section::find_relaxed_input_section): Make
11813 method public.
11814
c5617f2f
DK
118152009-10-16 Doug Kwan <dougkwan@google.com>
11816
11817 * dynobj.cc (Versions::Versions): Initialize version_script_.
11818 Only insert base version symbol definition for a shared object
11819 if version script defines any version versions.
11820 (Versions::define_base_version): New method definition.
11821 (Versions::add_def): Check that base version is not needed.
11822 (Versions::add_need): Define base version lazily.
11823 * dynobj.h (Versions::define_base_version): New method declaration.
11824 (Versions::needs_base_version_): New data member declaration.
11825 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11826 (check_DATA): Add no_version_test.stdout.
11827 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11828 New make rules.
11829 * testsuite/Makefile.in: Regenerate.
11830 * testsuite/no_version_test.c: New file.
11831 * testsuite/no_version_test.sh: Ditto.
11832
3c12dcdb
DK
118332009-10-16 Doug Kwan <dougkwan@google.com>
11834
11835 * expression.cc (class Segment_start_expression): New class definition.
11836 (Segment_start_expression::value): New method definition.
11837 (script_exp_function_segment_start): Return a new
11838 Segment_start_expression.
11839 * gold/script-c.h (script_saw_segment_start_expression): New function
11840 prototype.
11841 * script-sections.cc (Script_sections::Script_sections): Initialize
11842 SAW_SEGMENT_START_EXPRESSION_ to false.
11843 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11844 and -Tbbs options to specify section addresses if given in
11845 command line and no SEGMENT_START expression is seen in a script.
11846 * script-sections.h (Script_sections::saw_segment_start_expression,
11847 Script_sections::set_saw_segment_start_expression): New method
11848 definition.
11849 (Script_sections::saw_segment_start_expression_): New data member
11850 declaration.
11851 * script.cc (script_saw_segment_start_expression): New function.
11852 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11853 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11854 script_test_7.sh and script_test_8.sh.
11855 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11856 script_test_8.stdout.
11857 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11858 (script_test_6, script_test_6.stdout, script_test_7,
11859 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11860 * Makefile.in: Regenerate.
11861 * testsuite/script_test_6.sh: New file.
11862 * testsuite/script_test_6.t: Same.
11863 * testsuite/script_test_7.sh: Same.
11864 * testsuite/script_test_7.t: Same.
11865 * testsuite/script_test_8.sh: Same.
11866
64b1ae37
DK
118672009-10-16 Doug Kwan <dougkwan@google.com>
11868
11869 * output.cc (Output_segment::set_section_list_address): Cast
11870 expressions to unsigned long long type to avoid format warnings.
11871
661be1e2
ILT
118722009-10-15 Ian Lance Taylor <iant@google.com>
11873
12edd763 11874 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 11875 dot assignment to script_sections_.
12edd763
ILT
11876 * script-sections.cc (Script_sections::add_dot_assignment):
11877 Initialize if necessary.
11878
68b6574b
ILT
11879 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11880 program headers with no load segment if there is a linker script.
11881
661be1e2
ILT
11882 * layout.cc (Layout::set_segment_offsets): Align the file offset
11883 to the segment aligment for -N or -n with no load segment.
11884 * output.cc (Output_segment::add_output_section): Don't crash if
11885 the first section is a TLS section.
11886 (Output_segment::set_section_list_addresses): Print an error
11887 message if the address moves backward in a linker script.
11888 * script-sections.cc
11889 (Output_section_element_input::set_section_addresses): Don't
11890 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11891 (Orphan_output_section::set_section_addresses): Likewise.
11892
f15f61a7
DK
118932009-10-15 Doug Kwan <dougkwan@google.com>
11894
11895 * layout.cc (Layout::finish_dynamic_section): Generate tags
11896 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
11897 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
11898 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
11899
82bb573a
ILT
119002009-10-14 Ian Lance Taylor <iant@google.com>
11901
11902 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
11903 fields.
11904 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
11905 data_shdr fields of relinfo.
11906 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
11907 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
11908 R_386_TLS_LDO_32, adjust based on section flags.
11909 (Target_i386::Relocate::fix_up_ldo): Remove.
11910
374ad285
ILT
119112009-10-13 Ian Lance Taylor <iant@google.com>
11912
11913 Add support for -pie.
11914 * options.h (class General_options): Add -pie and
11915 --pic-executable.
11916 (General_options::output_is_position_independent): Test -pie.
11917 (General_options::output_is_executable): Return true if not shared
11918 and not relocatable.
11919 (General_options::output_is_pie): Remove.
11920 * options.cc (General_options::finalize): Reject incompatible uses
11921 of -pie.
11922 * gold.cc (queue_middle_tasks): A -pie link is not static.
11923 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
11924 * symtab.cc (Symbol::final_value_is_known): Return false if
11925 output_is_position_independent.
11926 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
11927 output_is_position_independent.
11928 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
11929 output_is_position_independent.
11930 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
11931 output_is_position_independent.
11932 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
11933 two_file_pie_test.
11934 (basic_pie_test.o, basic_pie_test): New targets.
11935 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
11936 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
11937 (two_file_pie_test): New target.
11938 * testsuite/Makefile.in: Rebuild.
11939 * README: Remove note saying that -pie is not supported.
11940
c6585162
ILT
119412009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
11942
11943 * options.h (class General_options): Add -init and -fini.
11944 * layout.cc (Layout::finish_dynamic_section): Emit
11945 given init and fini functions.
11946
032ce4e9
ST
119472009-10-13 Sriraman Tallam <tmsriram@google.com>
11948
11949 * gc.h (gc_process_relocs): Check if icf is enabled using new
11950 function.
11951 * gold.cc (queue_initial_tasks): Likewise.
11952 (queue_middle_tasks): Likewise.
11953 * object.cc (do_layout): Likewise.
11954 * symtab.cc (is_section_folded): Likewise.
11955 * main.cc (main): Likewise.
11956 * reloc.cc (Read_relocs::run): Likewise.
11957 (Sized_relobj::do_scan_relocs): Likewise.
11958 * icf.cc (is_function_ctor_or_dtor): New function.
11959 (Icf::find_identical_sections): Check if function is ctor or dtor when
11960 safe icf is chosen.
11961 * options.h (General_options::icf): Change option to be an enum.
11962 (Icf_status): New enum.
11963 (icf_enabled): New method.
11964 (icf_safe_folding): New method.
11965 (set_icf_status): New method.
11966 (icf_status_): New variable.
11967 * (options.cc) (General_options::finalize): Set icf_status_.
11968 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
11969 icf_test and icf_keep_unique_test to use the --icf enum flag.
11970 * testsuite/icf_safe_test.sh: New file.
e1df38aa 11971 * testsuite/icf_safe_test.cc: New file.
032ce4e9 11972
f345227a
ST
119732009-10-12 Sriraman Tallam <tmsriram@google.com>
11974
11975 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
11976 includes to gc.h and icf.h.
11977 * arm.cc: Include gc.h.
11978 * gold.cc: Likewise.
11979 * i386.cc: Likewise.
11980 * powerpc.cc: Likewise.
11981 * sparc.cc: Likewise.
11982 * x86_64.cc: Likewise.
11983 * gc.h: Include icf.h.
11984
1c7814ed
ILT
119852009-10-11 Ian Lance Taylor <iant@google.com>
11986
11987 * plugin.cc: Include "gold.h" before other header files.
11988
ae3b5189
CD
119892009-10-10 Chris Demetriou <cgd@google.com>
11990
11991 * options.h (Input_file_argument::Input_file_type): New enum.
11992 (Input_file_argument::is_lib_): Replace with...
11993 (Input_file_argument::type_): New member.
11994 (Input_file_argument::Input_file_argument): Take Input_file_type
11995 'type' rather than boolean 'is_lib' as second argument.
11996 (Input_file_argument::is_lib): Use type_.
11997 (Input_file_argument::is_searched_file): New function.
11998 (Input_file_argument::may_need_search): Handle is_searched_file.
11999 * options.cc (General_options::parse_library): Support -l:filename.
12000 (General_options::parse_just_symbols): Update for Input_file_argument
12001 changes.
12002 (Command_line::process): Likewise.
12003 * archive.cc (Archive::get_file_and_offset): Likewise.
12004 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12005 * script.cc (read_script_file, script_add_file): Likewise.
12006 * fileread.cc (Input_file::Input_file): Likewise.
12007 (Input_file::will_search_for): Handle is_searched_file.
12008 (Input_file::open): Likewise.
12009 * readsyms.cc (Read_symbols::get_name): Likewise.
12010 * testsuite/Makefile.am (searched_file_test): New test.
12011 * testsuite/Makefile.in: Regenerate.
12012 * testsuite/searched_file_test.cc: New file.
12013 * testsuite/searched_file_test_lib.cc: New file.
12014
f3048a1d
ILT
120152009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12016 Ian Lance Taylor <iant@google.com>
12017
12018 * descriptor.cc: Include <cstdio> and "binary-io.h".
12019 (Descriptors::open): Open the files in binary mode always.
12020 * script.cc (Lex::get_token): Treat \r as whitespace.
12021
d4780e57
ILT
120222009-10-09 Ian Lance Taylor <iant@google.com>
12023
12024 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12025
d9a893b8
ILT
120262009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12027 Ian Lance Taylor <iant@google.com>
12028
12029 * configure.ac: Check for readv function also.
12030 * fileread.cc (readv): Define if not HAVE_READV.
12031 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12032 does not exist.
12033 * config.in: Regenerate.
12034 * configure: Regenerate.
12035
c0a62865
DK
120362009-10-09 Doug Kwan <dougkwan@google.com>
12037
12038 * layout.cc (Layout::make_output_section): Call target hook to make
12039 ordinary output section.
12040 (Layout::finalize): Adjust parameter list of call the
12041 Target::may_relax().
12042 * layout.h (class Layout::section_list): New method.
12043 * merge.h (Output_merge_base::entsize): Change visibility to public.
12044 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12045 New methods.
12046 (Output_merge_string::do_is_string): New method.
12047 * object.cc (Sized_relobj::do_setup): renamed from
12048 Sized_relobj::set_up.
12049 * object.h (Sized_relobj::adjust_shndx,
12050 Sized_relobj::initializ_input_to_output_maps,
12051 Sized_relobj::free_input_to_output_maps): Change visibilities to
12052 protected.
12053 (Sized_relobj::setup): Virtualize.
12054 (Sized_relobj::do_setup): New method declaration.
12055 (Sized_relobj::invalidate_section_offset,
12056 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12057 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12058 * options.cc (parse_int): New function.
12059 * options.h (parse_int): New declaration.
12060 (DEFINE_int): New macro.
12061 (stub_group_size): New option.
12062 * output.cc (Output_section::Output_section): Initialize memebers
12063 merge_section_map_, merge_section_by_properties_map_,
12064 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12065 (Output_section::add_input_section): Handled deferred code-fill
12066 generation and remove an old comment.
12067 (Output_section::add_relaxed_input_section): New method definition.
12068 (Output_section::add_merge_input_section): Use merge section by
12069 properties map to speed to search. Update merge section maps
12070 as appropriate.
12071 (Output_section::build_relaxation_map): New method definition.
12072 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12073 Same.
12074 (Output_section::relax_input_section): Renamed to
12075 Output_section::convert_input_sections_to_relaxed_sections and change
12076 interface to take a vector of pointers to relaxed sections.
12077 (Output_section::find_merge_section,
12078 Output_section::find_relaxed_input_section): New method definitions.
12079 (Output_section::is_input_address_mapped,
12080 Output_section::output_offset, Output_section::output_address):
12081 Use output section data maps to speed up searching.
12082 (Output_section::find_starting_output_address): Add comments.
12083 (Output_section::do_write,
12084 Output_section::write_to_postprocessing_buffer): Do code-fill
12085 generation as appropriate.
12086 (Output_section::get_input_sections): Invalidate relaxed input section
12087 map.
12088 (Output_section::restore_states): Adjust type of checkpoint .
12089 Invalidate relaxed input section map.
12090 * output.h (Output_merge_base): New class declaration.
12091 (Input_section_specifier): New class defintion.
12092 (class Output_relaxed_input_section) Change base class to
12093 Output_section_data_build.
12094 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12095 base class initializer.
12096 (Output_section::add_relaxed_input_section): New method declaration.
12097 (Output_section::Input_section): Change visibility to protected.
2e702c99 12098 (Output_section::Input_section::relobj,
c0a62865
DK
12099 Output_section::Input_section::shndx): Handle relaxed input sections.
12100 Output_section::input_sections) Change visibility to protected. Also
12101 define overload to return a non-const pointer.
12102 (Output_section::Merge_section_properties): New class defintion.
12103 (Output_section::Merge_section_by_properties_map,
12104 Output_section::Output_section_data_by_input_section_map,
12105 Output_section::Relaxation_map): New types.
12106 (Output_section::relax_input_section): Rename method to
12107 Output_section::convert_input_sections_to_relaxed_sections and change
12108 interface to take a vector of relaxed section pointers.
12109 (Output_section::find_merge_section,
12110 Output_section::find_relaxed_input_section,
12111 Output_section::build_relaxation_map,
12112 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12113 New method declarations.
12114 (Output_section::merge_section_map_
12115 Output_section::merge_section_by_properties_map_,
12116 Output_section::relaxed_input_section_map_,
12117 Output_section::is_relaxed_input_section_map_valid_,
12118 Output_section::generate_code_fills_at_write_): New data members.
12119 * script-sections.cc
12120 (Output_section_element_input::set_section_addresses): Call
12121 current_data_size and addralign methods of relaxed input sections.
12122 (Orphan_output_section::set_section_addresses): Call current_data_size
12123 and addralign methods of relaxed input sections.
12124 * symtab.cc (Symbol_table::compute_final_value): Extract template
12125 from the body of Symbol_table::sized_finalize_symbol.
12126 (Symbol_table::sized_finalized_symbol): Call
12127 Symbol_table::compute_final_value.
12128 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12129 (Symbol_table::compute_final_value): New templated method declaration.
12130 * target.cc (Target::do_make_output_section): New method defintion.
12131 * target.h (Target::make_output_section): New method declaration.
12132 (Target::relax): Add more parameters for input objects, symbol table
12133 and layout. Adjust call to do_relax.
12134 (Target::do_make_output_section): New method declaration.
12135 (Target::do_relax): Add parameters for input objects, symbol table
12136 and layout.
12137
d446d6c4
ILT
121382009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12139
12140 * pread.c: Include stdio.h.
12141
bc06c745
ILT
121422009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12143
12144 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12145 defined.
12146
75aea3d0
ILT
121472009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12148
12149 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12150 Change read_shndx type to unsigned int.
12151 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12152 int.
12153 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12154 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12155 Change read_shndx type to unsigned int.
12156 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12157 int.
12158 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12159 * layout.cc (Layout::create_symtab_sections): Cast the result of
12160 local_symcount * symsize to off_t in the gold_assert.
12161
be8fcb75
ILT
121622009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12163
12164 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12165 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12166 R_ARM_BASE_ABS.
12167 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12168 (Arm_relocate_functions::thm_abs5): New function.
12169 (Arm_relocate_functions::abs12): New function.
12170 (Arm_relocate_functions::abs16): New function.
12171 (Arm_relocate_functions::base_abs): New function.
12172 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12173 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12174 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12175 R_ARM_BASE_ABS.
12176 (Scan::global): Likewise.
12177 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12178 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12179 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12180 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12181 R_ARM_BASE_ABS.
12182
c2a122b6
ILT
121832009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12184
12185 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12186 (Arm_relocate_functions::movt_prel): New function.
12187 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12188 (Arm_relocate_functions::thm_movt_prel): New function.
12189 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12190 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12191 (Scan::global, Relocate::relocate): Likewise.
12192 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12193
c4aa1e2d
ILT
121942009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12195
12196 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12197 Incremental_checker.
12198 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12199 unsigned int.
12200 (class Incremental_inputs_header): New class.
12201 (Incremental_inputs_header_writer): Edit comment.
12202 (Incremental_inputs_entry): New class.
12203 (Incremental_inputs_entry_writer): Edit comment.
12204 (Sized_incremental_binary::do_find_incremental_inputs_section):
12205 Add *strtab_shndx parameter, fill it.
12206 (Sized_incremental_binary::do_check_inputs): New method.
12207 (Incremental_checker::can_incrementally_link_output_file): Use
12208 Sized_incremental_binary::check_inputs.
12209 (Incremental_inputs::report_command_line): Save command line in
12210 command_line_.
12211 * incremental.h:
12212 (Incremental_binary::find_incremental_inputs_section): New
12213 method.
12214 (Incremental_binary::do_find_incremental_inputs_section): Add
12215 strtab_shndx parameter.
12216 (Incremental_binary::do_check_inputs): New pure virtual method.
12217 (Sized_incremental_binary::do_check_inputs): Declare.
12218 (Incremental_checker::Incremental_checker): Add incremental_inputs
12219 parameter, use it to initialize incremental_inputs_.
12220 (Incremental_checker::incremental_inputs_): New field.
12221 (Incremental_checker::command_line): New method.
12222 (Incremental_checker::inputs): New method.
12223 (Incremental_checker::command_line_): New field.
12224
c549a694
ILT
122252009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12226
12227 * incremental.cc: Include <cstdarg> and "target-select.h".
12228 (vexplain_no_incremental): New function.
12229 (explain_no_incremental): New function.
12230 (Incremental_binary::error): New method.
12231 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12232 method.
12233 (make_sized_incremental_binary): New function.
12234 (open_incremental_binary): New function.
12235 (can_incrementally_link_file): Add checks if output is ELF and has
12236 inputs section.
12237 * incremental.h: Include "elfcpp_file.h" and "output.h".
12238 (Incremental_binary): New class.
12239 (Sized_incremental_binary): New class.
12240 (open_incremental_binary): Declare.
12241 * object.cc (is_elf_object): Use
12242 elfcpp::Elf_recognizer::is_elf_file.
12243 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12244 * output.h (Output_file::filesize): New method.
12245
fd3c5f0b
ILT
122462009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12247
12248 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12249 New function.
12250 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12251 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12252 function.
12253 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12254 function.
12255 (Arm_relocate_functions::movw_abs_nc): New function.
12256 (Arm_relocate_functions::movt_abs): New function.
12257 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12258 (Arm_relocate_functions::thm_movt_abs): New function.
12259 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12260 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12261 (Scan::global): Likewise.
12262 (Relocate::relocate): Likewise.
12263 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12264
7f5309a5
ILT
122652009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12266
12267 * arm.cc (Arm_relocate_functions::got_prel) New function.
12268 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12269 (Relocate::relocate): Likewise.
12270 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12271
364c7fa5
ILT
122722009-10-06 Ian Lance Taylor <iant@google.com>
12273
12274 * options.h (class General_options): Define
12275 split_stack_adjust_size parameter.
12276 * object.h (class Object): Add uses_split_stack_ and
12277 has_no_split_stack_ fields. Add uses_split_stack and
12278 has_no_split_stack accessor functions. Declare
12279 handle_split_stack_section.
12280 (class Reloc_symbol_changes): Define.
12281 (class Sized_relobj): Define Function_offsets. Declare
12282 split_stack_adjust, split_stack_adjust_reltype, and
12283 find_functions.
12284 * object.cc (Object::handle_split_stack_section): New function.
12285 (Sized_relobj::do_layout): Call handle_split_stack_section.
12286 * dynobj.cc (Sized_dynobj::do_layout): Call
12287 handle_split_stack_section.
12288 * reloc.cc (Sized_relobj::relocate_sections): Call
12289 split_stack_adjust for executable sections in split_stack
12290 objects. Pass reloc_map to relocate_section.
12291 (Sized_relobj::split_stack_adjust): New function.
12292 (Sized_relobj::split_stack_adjust_reltype): New function.
12293 (Sized_relobj::find_functions): New function.
12294 * target-reloc.h: Include "object.h".
12295 (relocate_section): Add reloc_symbol_changes parameter. Change
12296 all callers.
12297 * target.h (class Target): Add calls_non_split method. Declare
12298 do_calls_non_split virtual method. Declare match_view and
12299 set_view_to_nop.
12300 * target.cc: Include "elfcpp.h".
12301 (Target::do_calls_non_split): New function.
12302 (Target::match_view): New function.
12303 (Target::set_view_to_nop): New function.
12304 * gold.cc (queue_middle_tasks): Give an error if mixing
12305 split-stack and non-split-stack objects with -r.
12306 * i386.cc (Target_i386::relocate_section): Add
12307 reloc_symbol_changes parameter.
12308 (Target_i386::do_calls_non_split): New function.
12309 * x86_64.cc (Target_x86_64::relocate_section): Add
12310 reloc_symbol_changes parameter.
12311 (Target_x86_64::do_calls_non_split): New function.
12312 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12313 parameter.
12314 * powerpc.cc (Target_powerpc::relocate_section): Add
12315 reloc_symbol_changes parameter.
12316 * sparc.cc (Target_sparc::relocate_section): Add
12317 reloc_symbol_changes parameter.
12318 * configure.ac: Call AM_CONDITIONAL for the default target.
12319 * configure: Rebuild.
12320 * testsuite/Makefile.am (TEST_AS): New variable.
12321 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12322 (check_DATA): Add split_i386 and split_x86_64 files.
12323 (SPLIT_DEFSYMS): Define.
12324 (split_i386_[1234n].o): New targets.
12325 (split_i386_[124]): New targets.
12326 (split_i386_[1234r].stdout): New targets.
12327 (split_x86_64_[1234n].o): New targets.
12328 (split_x86_64_[124]): New targets.
12329 (split_x86_64_[1234r].stdout): New targets.
12330 (MOSTLYCLEANFILES): Add new executables.
12331 * testsuite/split_i386.sh: New file.
12332 * testsuite/split_x86_64.sh: New file.
12333 * testsuite/split_i386_1.s: New file.
12334 * testsuite/split_i386_2.s: New file.
12335 * testsuite/split_i386_3.s: New file.
12336 * testsuite/split_i386_4.s: New file.
12337 * testsuite/split_i386_n.s: New file.
12338 * testsuite/split_x86_64_1.s: New file.
12339 * testsuite/split_x86_64_2.s: New file.
12340 * testsuite/split_x86_64_3.s: New file.
12341 * testsuite/split_x86_64_4.s: New file.
12342 * testsuite/split_x86_64_n.s: New file.
12343 * testsuite/testfile.cc (Target_test): Update relocation_section
12344 function.
12345 * testsuite/Makefile.in: Rebuild.
12346
e8a9fcda
ILT
123472009-10-06 Ian Lance Taylor <iant@google.com>
12348
12349 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12350 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12351 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12352 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12353 the address on ldo_addrs_.
12354 (Target_i386::Relocate::fix_up_ldo): New function.
12355
e99daf92
ILT
123562009-10-06 Rafael Espindola <espindola@google.com>
12357
12358 * plugin.cc (add_input_library): New.
12359 (Plugin::load): Add add_input_library to tv.
12360 (Plugin_manager::add_input_file): Add the is_lib argument.
12361 (add_input_file): Update call to Plugin_manager::add_input_file.
12362 (add_input_library): New.
12363 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12364
966d4097
DK
123652009-09-30 Doug Kwan <dougkwan@google.com>
12366
12367 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12368 symbol and call Symbol::may_need_copy_reloc to determine if
12369 a copy reloc is needed.
12370 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12371 nocopyreloc is given in command line.
12372 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12373 given in command line.
12374 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12375 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12376 of the removed Target_i386::may_need_copy_reloc.
12377 * options.h (copyreloc): New option with default value false.
12378 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12379 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12380 instead of the removed Target_powerpc::may_need_copy_reloc.
12381 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12382 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12383 instead of the removed Target_sparc::may_need_copy_reloc.
12384 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12385 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12386 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12387 instead of the removed Target_x86_64::may_need_copy_reloc.
12388
029ba973
ILT
123892009-09-30 Ian Lance Taylor <iant@google.com>
12390
12391 * object.h (class Object): Remove target_ field, and target,
12392 sized_target, and set_target methods.
12393 (Object::sized_target): Remove.
12394 (class Sized_relobj): Update declarations. Remove sized_target.
12395 * object.cc (Sized_relobj::setup): Remove target parameter.
12396 Change all callers.
12397 (Input_objects::add_object): Don't do anything with the target.
12398 (make_elf_sized_object): Add punconfigured parameter. Change all
12399 callers. Set or test parameter target.
12400 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12401 Change all callers.
12402 * parameters.cc (Parameters::set_target): Change parameter type to
12403 be non-const.
12404 (Parameters::default_target): Remove.
12405 (set_parameters_target): Change parameter type to be non-const.
12406 (parameters_force_valid_target): New function.
12407 (parameters_clear_target): New function.
12408 * parameters.h (class Parameters): Update declarations. Remove
12409 default_target method. Add sized_target and clear_target
12410 methods. Change target_ to be non-const.
12411 (set_parameters_target): Update declaration.
12412 (parameters_force_valid_target): Declare.
12413 (parameters_clear_target): Declare.
12414 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12415 as NULL if we aren't searching.
12416 (Add_symbols::run): Don't check for compatible target.
12417 * fileread.cc (Input_file::open_binary): Call
12418 parameters_force_valid_target.
12419 * gold.cc (queue_middle_tasks): Likewise.
12420 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12421 set_target on object.
12422 * dynobj.h (class Sized_dynobj): Update declarations.
12423 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12424 make_elf_object returns NULL.
12425 (Archive::include_member): Don't check whether object target is
12426 compatible.
12427 * output.cc (Output_section::add_input_section): Get target from
12428 parameters.
12429 (Output_section::relax_input_section): Likewise.
12430 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12431 parameters.
12432 (Sized_relobj::do_scan_relocs): Likewise.
12433 (Sized_relobj::relocate_sections): Likewise.
12434 * resolve.cc (Symbol_table::resolve): Likewise.
12435 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12436 parameter. Change all callers.
12437 (Symbol_table::add_from_object): Get target from parameters.
12438 (Symbol_table::add_from_relobj): Don't check object target.
12439 (Symbol_table::add_from_dynobj): Likewise.
12440 (Symbol_table::define_special_symbol): Get target from
12441 parameters.
12442 * symtab.h (class Symbol_table): Update declaration.
12443 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12444 parameter. Change all callers. Clear parameter target.
12445 (Binary_test): Test target here.
12446 * testsuite/object_unittest.cc (gold_testsuite): Remove
12447 target_test_pointer parameter. Change all callers.
12448 (Object_test): Test target here.
12449
a6a22b83
ILT
124502009-09-26 Ian Lance Taylor <iant@google.com>
12451
12452 * testsuite/initpri1.c: Don't try to use constructor priorities if
12453 compiling with gcc before 4.3.
12454
6a8f49fe
ILT
124552009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12456
12457 * testsuite/retain_symbols_file_test.sh (check_present): Change
12458 output file name to retain_symbols_file_test.stdout.
12459 (check_absent): Likewise.
12460
8c604651
CS
124612009-09-18 Craig Silverstein <csilvers@google.com>
12462
12463 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12464 * options.cc: Include <cerrno> and <fstream>.
12465 (General_options::finalize): Parse -retain-symbols-file tag.
12466 * options.h: New flag.
12467 (General_options): New method should_retain_symbol, new
12468 variable symbols_to_retain.
12469 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12470 should_retain_symbol map.
12471 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12472 * testsuite/Makefile.in: Regenerate.
12473 * testsuite/retain_symbols_file_test.sh: New file.
12474
ca58b19f
NC
124752009-09-18 Nick Clifton <nickc@redhat.com>
12476
12477 * po/es.po: Updated Spanish translation.
12478
20e6d0d6
DK
124792009-09-17 Doug Kwan <dougkwan@google.com>
12480
12481 * debug.h (DEBUG_RELAXATION): New constant.
12482 (DEBUG_ALL): Add DEBUG_RELAXATION.
12483 (debug_string_to_enum): Add relaxation debug option.
12484 * layout.cc
12485 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12486 Layout::Relaxation_debug_check::read_sections,
12487 Layout::Relaxation_debug_check::read_sections): New method definitions.
12488 (Layout::Layout): Initialize data members
12489 record_output_section_data_from_scrips_,
12490 script_output_section_data_list_ and relaxation_debug_check_.
12491 (Layout::save_segments, Layout::restore_segments,
12492 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12493 Layout::relaxation_loop_body): New method definitions.
12494 (Layout::finalize): Support relaxation. Move section layout code to
12495 Layout::relaxation_loop_body.
12496 (Layout::set_asection_address_from_script): Move code for orphan
12497 section placement out.
12498 (Layout::place_orphan_sections_in_script): New method definition.
12499 * layout.h (Output_segment_headers, Output_file_header):
12500 New forward class declarations.
12501 (Layout::~Layout): Define.
12502 (Layout::new_output_section_data_from_script): New method definition.
12503 (Layout::place_orphan_sections_in_script): New method declaration.
12504 (Layout::Segment_states): New type declaration.
12505 (Layout::save_segments, Layout::restore_segments,
12506 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12507 Layout::relaxation_loop_body): New method declarations.
12508 (Layout::Output_section_data_list): New type declaration.
12509 (Layout::Relaxation_debug_check): New class definition.
12510 (Layout::record_output_section_data_from_script_,
12511 Layout::script_output_section_data_list_, Layout::segment_states_,
12512 Layout::relaxation_debug_check_): New data members.
12513 * output.cc: (Output_section_headers::do_size): New method definition.
12514 (Output_section_headers::Output_section_headers): Move size
12515 computation to Output_section_headers::do_size.
12516 (Output_segment_headers::do_size): New method definition.
e1df38aa 12517 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
12518 Output_file_header::do_size and call it.
12519 (Output_file_header::do_size): New method definition.
12520 (Output_data_group::Output_data_group): Adjust call to
12521 Output_section_data.
12522 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12523 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 12524 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
12525 RELAXED_INPUT_SECTION_CODE.
12526 (Output_section::Output_section): Initialize data member checkpoint_.
12527 (Output_section::~Output_section): Delete checkpoint object pointed
12528 by checkpoint_.
12529 (Output_section::add_input_section): Always add an Input_section if
12530 relaxing.
12531 (Output_section::add_merge_input_section): Add assert.
12532 (Output_section::relax_input_section): New method definition.
12533 (Output_section::set_final_data_size): Set load address to zero for
12534 an unallocated section.
12535 (Output_section::do_address_and_file_offset_have_reset_values):
12536 New method definition.
12537 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12538 Handle relaxed input section.
12539 (Output_section::sort_attached_input_sections): Checkpoint input
12540 section list lazily.
12541 (Output_section::get_input_sections): Change type of input_sections to
12542 list of Simple_input_section pointers. Checkpoint input section list
12543 lazily. Also handle relaxed input sections.
12544 (Output_section::add_input_section_for_script): Take a reference to
12545 a Simple_input_section object instead of Relobj pointer and section
12546 index as parameter. Handle relaxed input sections.
12547 (Output_section::save_states, Output_section::restore_states): New
12548 method definitions.
12549 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12550 (Output_data::is_data_size_fixed): New method definition.
12551 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12552 if it is fixed.
12553 (Output_data::address_and_file_offset_have_reset_values): New method
12554 definition.
12555 (Output_data::do_address_and_file_offset_have_reset_values): New method
12556 definition.
12557 (Output_data::set_data_size): Check that data size is not fixed.
12558 (Output_data::fix_data_size): New method definition.
12559 (Output_data::is_data_size_fixed_): New data member.
12560 (Output_section_headers::set_final_data_size): New method definition.
12561 (Output_section_headers::do_size): New method declaration.
12562 (Output_segment_headers::set_final_data_size): New method definition.
12563 (Output_segment_headers::do_size): New method declaration.
12564 (Output_file_header::set_final_data_size)::New method definition.
12565 (Output_file_header::do_size)::New method declaration.
12566 (Output_section_data::Output_section_data): Add new parameter
12567 is_data_size_fixed and use it to fix data size.
12568 (Output_data_const::Output_data_const): Adjust call to base class
12569 constructor and fix data size.
12570 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12571 base class constructor and fix data size.
12572 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12573 base class constructor and fix data size.
12574 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12575 class constructor and fix data size.
12576 (Output_data_group::set_final_data_size): New method definition.
12577 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12578 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12579 class constructor and fix data size.
12580 (Output_relaxed_input_section): New class definition.
12581 (Output_section::Simple_input_section): New class definition.
12582 (Output_section::get_input_sections): Adjust parameter list.
12583 (Output_section::add_input_section_for_script): Same.
12584 (Output_section::save_states, Output_section::restore_states,
12585 Output_section::do_address_and_file_offset_have_reset_values,
12586 (Output_section::Input_section::Input_section): Handle
12587 RELAXED_INPUT_SECTION_CODE. Add new overload for
12588 Output_relaxed_input_section.
12589 (Output_section::Input_section::is_input_section,
12590 Output_section::Input_section::set_output_section): Handle relaxed
12591 input section.
12592 (Output_section::Input_section::is_relaxed_input_section,
12593 Output_section::Input_section::output_section_data,
12594 Output_section::Input_section::relaxed_input_section): New method
12595 definitions.
12596 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12597 value.
12598 (Output_section::Input_section::u1_): Update comments.
12599 (Output_section::Input_section::u2_): Add new union member poris.
12600 (Output_section::Checkpoint_output_section): New classs definition.
12601 (Output_section::relax_input_section): New method declaration.
12602 (Output_section::checkpoint_): New data member.
12603 (Output_segment): Update comments.
12604 (Output_segment::Output_segment): Un-privatize copy constructor.
12605 (Output_segment::operator=): Un-privatize.
12606 * script-sections.cc (Output_section_element::Input_section_list):
12607 Change element type to Output_section::Simple_input_section.
12608 (Output_section_element_dot_assignment::set_section_addresses):
12609 Register output section data for relaxation clean up.
12610 (Output_data_exression::Output_data_expression): Adjust call to base
12611 constructor to fix data size.
12612 (Output_section_element_data::set_section_addresses): Register
12613 Output_data_expression object for relaxation clean up.
12614 (struct Input_section_info): Replace Relobj pointer and section index
12615 pair with Output_section::Simple_input_section and Convert struct to a
12616 class.
12617 (Input_section_sorter::operator()): Adjust access to
e1df38aa 12618 Input_section_info data member to use accessors.
20e6d0d6
DK
12619 (Output_section_element_input::set_section_addresses): Use layout
12620 parameter. Adjust code to use Output_section::Simple_input_section
12621 and Input_secction_info classes. Register filler for relaxation
12622 clean up.
12623 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12624 and section index pair with Output_section::Simple_input_section
12625 class. Adjust code accordingly.
12626 (Phdrs_element::release_segment): New method definition.
12627 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12628 segment list.
12629 (Script_sections::release_segments): New method definition.
12630 * gold/script-sections.h (Script_sections::release_segments): New
12631 method declaration.
12632 * gold/target.h (Target::may_relax, Target::relax,
12633 Target::do_may_relax, Target::do_relax): New method definitions.
12634
5e445df6
ILT
126352009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12636
12637 * arm.cc (has_signed_unsigned_overflow): New function.
12638 (Arm_relocate_functions::abs8): New function.
12639 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12640 (Target_arm::Scan::global): Likewise.
12641 (Target_arm::relocate::relocate): Likewise.
12642 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12643 Likewise.
12644
8c604651 126452009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
12646
12647 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12648 * testsuite/Makefile.in: Regenerate.
12649
1e9cc1c2
NC
126502009-09-11 Nick Clifton <nickc@redhat.com>
12651
12652 * po/gold.pot: Updated by the Translation project.
12653
6a89f575
CC
126542009-09-08 Cary Coutant <ccoutant@google.com>
12655
12656 * output.cc (Output_file::open): Add execute permission to empty file.
12657 * testsuite/Makefile.am (permission_test): New test.
12658 * testsuite/Makefile.in: Regenerate.
12659
fdcac5af
ILT
126602009-09-02 Ian Lance Taylor <iant@google.com>
12661
12662 * output.cc (Output_file::resize): Call map_no_anonymous rather
12663 than map.
12664
44453f85
ILT
126652009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12666
12667 * gold.cc: Include "incremental.h".
12668 (queue_initial_tasks): Call Incremental_checker methods.
12669 * incremental.cc: Include "output.h".
12670 (Incremental_checker::can_incrementally_link_output_file): New
12671 method.
12672 * incremental.h (Incremental_checker): New class.
12673
12674 * output.cc (Output_file::open_for_modification): New method.
12675 (Output_file::map_anonymous): Changed return type to bool. Record
12676 map in base_ field.
12677 (Output_file::map_no_anonymous): New method, broken out of map.
12678 (Output_file::map): Use map_no_anonymous and map_anonymous.
12679 * output.h (class Output_file): Update declarations.
12680
293c1386
CC
126812009-08-24 Cary Coutant <ccoutant@google.com>
12682
12683 * options.h (Command_line::Pre_options): New class.
12684 (Command_line::pre_options): New member.
12685 * options.cc (gold::options::ready_to_register): New variable.
12686 (One_option::register_option): Do nothing if not registering options.
12687 Assert if same short option registered twice.
12688 (General_options::General_options): Turn off option registration when
12689 done constructing.
12690 (Command_line::Pre_options::Pre_options): New constructor.
12691
f773f3d2
CC
126922009-08-24 Cary Coutant <ccoutant@google.com>
12693
06a73cfe
CC
12694 * options.h (General_options::no_keep_memory): Remove incorrect
12695 short option.
f773f3d2 12696
a15af8e2
RW
126972009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12698
12699 * Makefile.am (am__skiplex, am__skipyacc): New.
12700 * Makefile.in: Regenerate.
12701
c462b41b
RW
127022009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12703
14ec8efd
RW
12704 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12705 (INCLUDES): ... this.
12706 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12707 (AM_CPPFLAGS): Renamed from ...
12708 (INCLUDE): ... this.
12709 * Makefile.in, testsuite/Makefile.in: Regenerate.
12710
81ecdfbb
RW
12711 * Makefile.in: Regenerate.
12712 * aclocal.m4: Likewise.
12713 * config.in: Likewise.
12714 * configure: Likewise.
12715 * testsuite/Makefile.in: Likewise.
12716
c462b41b
RW
12717 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12718 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12719 * Makefile.in: Regenerate.
12720 * testsuite/Makefile.in: Regenerate.
12721
2da73f13
CC
127222009-08-19 Cary Coutant <ccoutant@google.com>
12723
12724 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12725 symbols in shared libraries overridden by hidden or internal symbols
12726 in the main program.
12727
2db70501
CD
127282009-08-19 Chris Demetriou <cgd@google.com>
12729
12730 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12731 checking source file names in error messages.
12732
f733487b
DK
127332009-08-18 Doug Kwan <dougkwan@google.com>
12734
12735 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12736 an elcpp::Ehdr as parameter. Adjust call to set_target.
12737 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12738 an elfcpp::Ehdr as parameter.
12739 * object.cc (Object::set_target): Remove the version that looks up
12740 a target and sets it.
12741 (Sized_relobj::setup): Take a Target object instead of
12742 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12743 (make_elf_sized_object): Find target and ask target to
12744 make an ELF object.
12745 * object.h: (Object::set_target): Remove the version that looks up
12746 a target and sets it.
12747 (Sized_relobj::setup): Take a Target object instead of
12748 an elfcpp:Ehdr as parameter.
12749 * target.cc: Include dynobj.h.
12750 (Target::do_make_elf_object_implementation): New.
2e702c99 12751 (Target::do_make_elf_object): New.
f733487b
DK
12752 * target.h (Target::make_elf_object): New template declaration.
12753 (Target::do_make_elf_object): New method declarations.
12754 (Target::do_make_elf_object_implementation): New template declaration.
12755
cc70f101
ILT
127562009-08-14 Ian Lance Taylor <iant@google.com>
12757
12758 * gold.h (FUNCTION_NAME): Define.
12759 (gold_unreachable): Use FUNCTION_NAME.
12760
ef5e0cb1
ST
127612009-08-12 Sriraman Tallam <tmsriram@google.com>
12762
12763 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12764 symbol in the --keep-unique list is not found.
12765
48c187ce
ST
127662009-08-12 Sriraman Tallam <tmsriram@google.com>
12767
12768 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12769 been maked as --keep-unique.
12770 (Icf::unfold_section): New function.
12771 * icf.h (Icf::unfold_section): New function.
12772 * options.h (General_options::keep_unique): New option.
12773 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12774 * testsuite/Makefile.in: Regenerate.
12775 * testsuite/icf_keep_unique_test.sh: New file.
12776 * testsuite/icf_keep_unique_test.cc: New file.
12777
645afe0c
CC
127782009-08-12 Cary Coutant <ccoutant@google.com>
12779
12780 PR 10471
12781 * resolve.cc (Symbol_table::resolve): Check for references from
12782 dynamic objects to hidden and internal symbols.
12783 * testsuite/Makefile.am (hidden_test.sh): New test.
12784 * testsuite/Makefile.in: Regenerate.
12785 * testsuite/hidden_test.sh: New script.
12786 * testsuite/hidden_test_1.c: New test source.
12787 * testsuite/hidden_test_main.c: New test source.
12788
11af873f
DK
127892009-08-11 Doug Kwan <dougkwan@google.com>
12790
12791 * arm.cc: Update comments.
12792 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12793 segment to locate the .ARM.exidx section if present.
12794
b9f7d72d
DK
127952009-08-09 Doug Kwan <dougkwan@google.com>
12796
12797 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12798 patch.
12799
ddd3c53c
ST
128002009-08-07 Sriraman Tallam <tmsriram@google.com>
12801 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12802 compiler warnings.
12803
27721062
ST
128042009-08-06 Sriraman Tallam <tmsriram@google.com>
12805
12806 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12807 valid tls_segment only for non-debug-section relocations.
12808 * testsuite/Makefile.am: Add gc_tls_test.
12809 * testsuite/Makefile.in: Regenerate.
12810 * testsuite/gc_tls_test.cc: New file.
12811 * testsuite/gc_tls_test.sh: New file.
12812
ef15dade 128132009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 12814
ef15dade
ST
12815 * icf.cc: New file.
12816 * icf.h: New file.
12817 * Makefile.am (CCFILES): Add icf.cc.
12818 (HFILES): Add icf.h
12819 * Makefile.in: Regenerate.
12820 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12821 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12822 section, symbol and addend information for the relocs.
12823 * gold.cc (queue_middle_tasks): Call identical code folding.
12824 * gold.h: Add defines for multimap.
12825 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12826 to the call of finalize_local_symbols.
12827 * main.cc (main): Create object of class Icf.
12828 * object.cc (Sized_relobj::do_layout): Allow this function to be
12829 called twice during icf.
12830 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12831 to sections marked as identical by icf.
12832 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12833 when available.
12834 (Sized_relobj::do_section_entsize): New function.
12835 * object.h (Object::section_entsize): New function.
12836 (Object::do_section_entsize): New pure virtual function.
12837 (Relobj::finalize_local_symbols): Add new parameter.
12838 (Relobj::do_section_entsize): New function.
12839 * options.h (General_options::icf): New option.
12840 (General_options::icf_iterations): New option.
12841 (General_options::print_icf_sections): New option.
12842 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12843 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12844 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12845 icf.
12846 * symtab.cc (Symbol_table::is_section_folded): New function.
12847 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12848 to sections marked as identical by icf.
12849 * symtab.h (Symbol_table::set_icf): New function.
12850 (Symbol_table::icf): New function.
12851 (Symbol_table::is_section_folded): New function.
12852 (Symbol_table::icf_): New data member.
12853 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12854 * testsuite/Makefile.am: Add commands to build icf_test.
12855 * testsuite/Makefile.in: Regenerate.
12856 * testsuite/icf_test.sh: New file.
12857 * testsuite/icf_test.cc: New file.
12858
c3b65ac4
CD
128592009-07-24 Chris Demetriou <cgd@google.com>
12860
12861 * layout.cc (is_compressible_debug_section): Fix incorrect
12862 comment about compressed section names.
12863
1caf2c51
ILT
128642009-07-20 Ian Lance Taylor <ian@airs.com>
12865
12866 PR 10419
12867 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12868
1ef4d87f
ILT
128692009-07-16 Ian Lance Taylor <iant@google.com>
12870
12871 PR 10400
12872 * layout.h: #include <map>.
12873 (class Kept_section): Change from struct to class. Add accessors
12874 and setters. Add section size to Comdat_group mapping. Change
12875 Comdat_group to std::map. Add is_comdat_ field. Add
12876 linkonce_size field in union.
12877 (class Layout): Update declaration of find_or_add_kept_section.
12878 Don't declare find_kept_object.
12879 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12880 parameter. Add object, shndx, is_comdat, and is_group_name
12881 parameters. Change all callers. Adjust for new Kept_section.
12882 (Layout::find_kept_object): Remove.
12883 * object.cc (Sized_relobj::include_section_group): Update use of
12884 Kept_section. Rename secnum to shndx. Only record
12885 Kept_comdat_section if sections are the same size.
12886 (Sized_relobj::include_linkonce_section): Update use of
12887 Kept_section. Only record Kept_comdat_section if sections are the
12888 same size. Set size of linkonce section.
12889 (Sized_relobj::map_to_kept_section): Update call to
12890 get_kept_comdat_section.
12891 * object.h (class Sized_relobj): Rename fields in
12892 Kept_comdat_section to drop trailing underscores; change object
12893 field to Relobj*. Change Kept_comdat_section_table to store
12894 struct rather than pointer.
12895 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
12896 Add kept_object and kept_shndx parameters. Change all callers.
12897 (Sized_relobj::get_kept_comdat_section): Change return type to
12898 bool. Add kept_object and kept_shndx parameters. Change all
12899 callers.
12900 * plugin.cc (Pluginobj::include_comdat_group): Update call to
12901 Layout::find_or_add_kept_section.
12902
37c3b7b0
ILT
129032009-07-09 Ian Lance Taylor <iant@google.com>
12904
12905 * merge.cc (Object_merge_map::initialize_input_to_output_map):
12906 Reserve space in the hash table.
12907
98fa85cb
ILT
129082009-07-06 Mikolaj Zalewski <mikolajz@google.com>
12909
12910 * fileread.cc (File_read::get_mtime): New method.
12911 * fileread.h (Timespec): New structure.
12912 (File_read::get_mtime): New method.
12913 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
12914 Renamed from timestamp_nsec.
12915 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
12916 Elf_Xword.
e1df38aa 12917 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 12918 timestamp_nsec.
e1df38aa 12919 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
12920 (Incremental_inputs::report_obejct): Save mtime; style fix.
12921 (Incremental_inputs::report_script): Save mtime; style fix.
12922 (Incremental_inputs::finalize_inputs): Style fix.
12923 (Incremental_inputs::finalize): Style fix.
12924 (Incremental_inputs::create_input_section_data): Store inputs
12925 mtime.
12926 * incremental.h (Incremental_inputs::report_script): Add mtime
12927 argument.
12928 (Incremental_inputs::Input_info::Input_info): Intialize only one
12929 union member.
12930 (Incremental_inputs::Input_info::archive): Move to nameless
12931 union.
12932 (Incremental_inputs::Input_info::obejct): Move to nameless union.
12933 (Incremental_inputs::Input_info::script): Move to nameless union.
12934 (Incremental_inputs::mtime): New field.
12935 * script.cc (read_input_script): Pass file mtime to
12936 Incremental_input.
12937 * script.h (Script_info::inputs): Style fix.
12938
c9d70757
ILT
129392009-07-01 Ian Lance Taylor <ian@airs.com>
12940
12941 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
12942 instead of 32.
12943
9c547ec3
ILT
129442009-06-24 Ian Lance Taylor <iant@google.com>
12945
12946 PR 10156
12947 * layout.cc (Layout::choose_output_section): If we find an
12948 existing section, update the flags.
12949 (Layout::create_notes): New function, broken out of
12950 Layout::finalize.
12951 (Layout::finalize): Don't create note sections.
12952 (Layout::create_note): Don't crash if linker script discards
12953 section.
12954 (Layout::create_gold_note): Likewise.
12955 (Layout::create_build_id): Likewise. Don't set
12956 after_input_sections on the section.
12957 (Layout::create_executable_stack_info): Remove target parameter.
12958 Change caller.
12959 * layout.h (class Layout): Declare create_notes. Update
12960 declaration of create_executable_stack_info.
12961 * gold.cc (queue_middle_tasks): Call create_notes.
12962 * output.cc (Output_section::update_flags_for_input_section): Move
12963 here from output.h. If SHF_ALLOC flag is newly set, mark address
12964 invalid.
12965 * output.h (Output_data::mark_address_invalid): New function.
12966 (class Output_section): Only declare, not define,
12967 update_flags_for_input_section. Remove set_flags.
12968
55458500
ILT
129692009-06-24 Ian Lance Taylor <iant@google.com>
12970
12971 * script-sections.cc (Output_section_definition::
12972 set_section_addresses): Rename shadowing local load_address to
12973 laddr.
12974
1307d6cd
ILT
129752009-06-24 Ian Lance Taylor <iant@google.com>
12976
12977 PR 10244
12978 * reloc.cc (relocate_sections): Skip empty relocation sections.
12979
ec3f783e
ILT
129802009-06-23 Ian Lance Taylor <iant@google.com>
12981
12982 PR 10156
12983 * layout.cc (Layout::create_note): Use choose_output_section
12984 rather than make_output_section.
12985
459c9f1c
ILT
129862009-06-23 Ian Lance Taylor <iant@google.com>
12987
12988 PR 10237
12989 * options.cc (General_options::parse_V): Set printed_version_.
12990 (General_options::General_options): Initialize printed_version_.
12991 * options.h (class General_options): Add printed_version_ field.
12992 * gold.cc (queue_initial_tasks): If there are no input files,
12993 don't give a fatal error if we printed the version information.
12994 (queue_middle_tasks): If using -r with a shared object, give a
12995 fatal error rather than an ordinary error.
12996
1518dc8f
ILT
129972009-06-23 Ian Lance Taylor <iant@google.com>
12998
12999 PR 10219
13000 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13001 (Layout::make_output_section): Set have_stabstr_section_ if we see
13002 a .stab*str section.
13003 (Layout::finalize): Call link_stabs_sections.
13004 (Layout::link_stabs_sections): New file.
13005 * layout.h (class Layout): Add have_stabstr_section_ field.
13006 Declare link_stabs_sections.
13007
3d857b98
DK
130082009-06-23 Doug Kwan <dougkwan@google.com>
13009
13010 * Makefile.am (libgold_a_LIBADD): New.
13011 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 13012 * Makefile.in: Regenerate.
3d857b98
DK
13013 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13014 * configure: Regenerate.
13015 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13016 * fileread.cc: Include sys/state.h
13017 * gold.h: Declare memmem and strndup if found missing.
13018 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13019
0639a6f6
ILT
130202009-06-23 Ian Lance Taylor <iant@google.com>
13021
13022 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13023 * configure: Rebuild.
13024
8d63875c
ILT
130252009-06-23 Ian Lance Taylor <iant@google.com>
13026
13027 PR 10147
13028 * object.cc (Object::section_contents): Don't try to get a view if
13029 the section has length zero.
13030 (Object::handle_gnu_warning_section): If the section is empty, use
13031 the name of the section as the warning.
13032
f7c8a183
ILT
130332009-06-23 Ian Lance Taylor <iant@google.com>
13034
13035 PR 10133
13036 * stringpool.h (class Stringpool_template): Add optimize_ field.
13037 (Stringpool_template::set_optimize): New function.
13038 * stringpool.cc (Stringpool_template::Stringpool_template):
13039 Initialize optimize_ field.
13040 (Stringpool_template::set_string_offsets): Test local optimize
13041 fild rather than parameter.
13042 * layout.cc (Layout::Layout): Call set_optimize on the section
13043 name stringpool.
13044
e6a307ba
ILT
130452009-06-22 Ian Lance Taylor <iant@google.com>
13046
13047 PR 10030
13048 * yyscript.y: Parse TARGET.
13049 * script.cc (script_set_target): New function.
13050 * script-c.h (script_set_target): Declare.
13051 * options.cc (General_options::string_to_object_format): Rename
13052 from string_to_object_format in anonymous namespace. Change
13053 callers.
13054 * options.h (class General_options): Declare
13055 string_to_object_format.
13056
3ee173de
ILT
130572009-06-22 Ian Lance Taylor <iant@google.com>
13058
13059 * script-sections.cc (Script_sections::create_segments): Don't put
13060 program headers in a PT_LOAD segment if -n or -N.
13061
130622009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
13063
13064 PR 10141
13065 * options.h (class General_options): Add -z lazy and -z now. Sort
13066 -z options into alphabetical order.
13067 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13068
cd6739a1 130692009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
13070
13071 * layout.cc (Layout::make_output_section): Call
13072 Target::new_output_section.
13073 (Layout::attach_allocated_section_to_segment): Put large section
13074 sections in a separate load segment with the large segment flag
13075 set.
13076 (Layout::segment_precedes): Sort large data segments after other
13077 load segments.
13078 (align_file_offset): New static function.
13079 (Layout::set_segment_offsets): Use align_file_offset.
13080 * output.h (class Output_section): Add is_small_section_ and
13081 is_large_section_ fields.
13082 (Output_section::is_small_section): New function.
13083 (Output_section::set_is_small_section): New function.
13084 (Output_section::is_large_section): New function.
13085 (Output_section::set_is_large_section): New function.
13086 (Output_section::is_large_data_section): New function.
13087 (class Output_segment): Add is_large_data_segment_ field.
13088 (Output_segment::is_large_data_segment): New function.
13089 (Output_segment::set_is_large_data_segment): New function.
13090 * output.cc (Output_section::Output_section): Initialize new
13091 fields.
13092 (Output_segment::Output_segment): Likewise.
13093 (Output_segment::add_output_section): Add assertion that large
13094 data sections always go in large data segments. Force small data
13095 sections to the end of the list of data sections. Force small BSS
13096 sections to the start of the list of BSS sections. For large BSS
13097 sections to the end of the list of BSS sections.
13098 * symtab.h (class Symbol): Declare is_common_shndx.
13099 (Symbol::is_defined): Check Symbol::is_common_shndx.
13100 (Symbol::is_common): Likewise.
13101 (class Symbol_table): Define enum Commons_section_type. Update
13102 declarations. Add small_commons_ and large_commons_ fields.
13103 * symtab.cc (Symbol::is_common_shndx): New function.
13104 (Symbol_table::Symbol_table): Initialize new fields.
13105 (Symbol_table::add_from_object): Put small and large common
13106 symbols in the right list.
13107 (Symbol_table::sized_finalized_symbol): Check
13108 Symbol::is_common_shndx.
13109 (Symbol_table::sized_write_globals): Likewise.
13110 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13111 common symbol lists. Don't call do_allocate_commons_list if the
13112 list is empty.
13113 (Symbol_table::do_allocate_commons_list): Remove is_tls
13114 parameter. Add comons_section_type parameter. Change all
13115 callers. Handle small and large common symbols.
13116 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13117 Symbol::is_common_shndx.
13118 * resolve.cc (symbol_to_bits): Likewise.
13119 * target.h (Target::small_common_shndx): New function.
13120 (Target::small_common_section_flags): New function.
13121 (Target::large_common_shndx): New function.
13122 (Target::large_common_section_flags): New function.
13123 (Target::new_output_section): New function.
13124 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13125 small_common_section_flags, and large_common_section_flags
13126 fields.
13127 (Target::do_new_output_section): New virtual function.
13128 * arm.cc (Target_arm::arm_info): Initialize new fields.
13129 * i386.cc (Target_i386::i386_info): Likewise.
13130 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13131 Likewise.
13132 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13133 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13134 (Target_x86_64::do_new_output_section): New function.
13135 * configure.ac: Define conditional MCMODEL_MEDIUM.
13136 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13137 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13138 (large_LDFLAGS): Define.
13139 * testsuite/large.c: New file.
13140 * testsuite/testfile.cc (Target_test::test_target_info):
13141 Initialize new fields.
13142 * configure, testsuite/Makefile.in: Rebuild.
13143
bb04269c
DK
131442009-06-05 Doug Kwan <dougkwan@google.com>
13145
13146 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13147 * Makefile.in: Regenerate.
bb04269c
DK
13148 * i386.cc (class Target_i386): Define new virtual method to
13149 override do_is_local_label_name in parent.
13150 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13151 local symbols if --discard-locals or -X is given.
13152 * options.h (class General_options): Declare new options
13153 '--discard-locals' and '-X' for discarding locals.
13154 * target.h (class Target): Define new methods is_local_label_name.
13155 Declare new virtual method do_is_local_label_name.
13156 * target.cc: New file.
13157 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13158 (check_SCRIPTS): Add discard_locals_test.sh.
13159 (check_DATA): Add discard_local_tests.syms.
13160 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13161 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13162 * testsuite/Makefile.in: Regenerate.
13163 * testsuite/discard_locals_test.c: New file.
13164 * testsuite/discard_locals_test.sh: Same.
13165
805bb01c
DK
131662009-06-05 Doug Kwan <dougkwan@google.com>
13167
13168 * object.cc (Sized_relobj::Sized_relobj): Initialize
13169 discarded_eh_frame_shndx_ to -1U.
13170 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13171 section.
13172 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13173 a discarded .eh_frame section.
13174 (Sized_relobj::do_finalize_local_symbols): Ditto.
13175 * object.h (class Sized_relobj): Declare new member
13176 discarded_eh_frame_shndx_.
13177 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13178 (local_labels_test.o, local_labels_test): New rules.
13179 * testsuite/Makefile.in: Regenerate.
13180
1dcd334d
DK
131812009-06-04 Doug Kwan <dougkwan@google.com>
13182
13183 * layout.cc (Layout::section_name_mapping): Add mapping for
13184 special ARM sections.
13185
96d49306
DK
131862009-06-03 Doug Kwan <dougkwan@google.com>
13187
13188 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13189 (utils::has_overflow): Same.
13190
dff16297
ILT
131912009-06-03 Ian Lance Taylor <iant@google.com>
13192
13193 * layout.cc (Layout::section_name_mapping): New array, replacing
13194 Layout::linkonce_mapping.
13195 (Layout::section_name_mapping_count): New variable, replacing
13196 Layout::linkonce_mapping_count.
13197 (Layout::linkonce_output_name): Remove.
13198 (Layout::output_section_name): Rewrite.
13199 * layout.h (class Layout): Rename Linkonce_mapping to
13200 Section_name_mapping, linkonce_mapping to section_name_mapping,
13201 linkonce_mapping_count to section_name_mapping_count. Don't
13202 declare linkonce_output_name.
13203
c121c671
DK
132042009-06-03 Doug Kwan <dougkwan@google.com>
13205
13206 * gold/arm.cc (namespace utils): New.
13207 (Target_arm::reloc_is_non_pic): Define new method.
13208 (class Arm_relocate_functions): New.
13209 (Target_arm::Relocate::relocate): Handle relocation types used by
13210 Android.
13211
07800fab
ILT
132122009-06-03 Ian Lance Taylor <iant@google.com>
13213
13214 * arm.cc (Target_arm::scan::global): Use || instead of |.
13215
c121c671
DK
132162009-06-02 Doug Kwan <dougkwan@google.com>
13217
13218 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13219 issued_non_pic_error_.
13220 (class Target_arm::Scan): Declare new method check_non_pic.
13221 Define new method symbol_needs_plt_entry.
13222 Declare new data member issued_non_pic_error_.
13223 (class Target_arm::Relocate): Declare new method
13224 should_apply_static_reloc.
13225 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13226 (Target_arm::Scan::check_non_pic): Define new method.
13227 (Target_arm::Scan::local): Handle a small subset of reloc types used
13228 by Android.
13229 (Target_arm::Scan::local): Same.
13230 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13231
b19b0c6d
ILT
132322009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13233
13234 * incremental.cc (Incremental_inputs::report_command_line): Filter
13235 out --incremental-* options.
13236
94cdfcff
DK
132372009-05-29 Doug Kwan <dougkwan@google.com>
13238
13239 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13240 template class.
13241 (class Target_arm): Update comment.
13242 (Target_arm::Target_arm): Initialize new data members GOT_,
13243 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13244 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13245 and Target_arm::rel_dyn_section.
13246 Declare new_enum Target_arm::Got_type.
13247 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13248 and DYNBSS_.
13249 Update commments for member do_dynsym_value.
13250 (Target_arm::got_size, Target_arm::plt_section,
13251 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13252 new methods inside class defintion.
13253 (Target_arm::got_section): Define new method.
13254 (Target_arm::rel_dyn_section): Same.
13255 (Output_data_plt_arm): New template class.
13256 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13257 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13258 (Output_data_plt_arm::add_entry): Same.
13259 (Output_data_plt_arm::first_plt_entry): Define new
13260 static data member for PLT instruction template.
13261 (Output_data_plt_arm::plt_entry): Same.
13262 (Output_data_plt_arm::do_write): Define new method.
13263 (Target_arm::make_plt_entry): Same.
13264 (Target_arm::do_finalize_sections): Same.
13265 (Target_arm::do_dynsym_value): Same.
13266
4a657b0d
DK
132672009-05-28 Doug Kwan <dougkwan@google.com>
13268
13269 * Makefile.am (TARGETSOURCES): Add arm.cc.
13270 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13271 * Makefile.in: Regenerate.
13272 * arm.cc: New file.
13273 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13274
e7ae8c36
DK
132752009-05-26 Doug Kwan <dougkwan@google.com>
13276
13277 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13278 (General_options::check_excluded_libs): Strip off directories in
13279 archive name before matching like GNU ld does.
13280 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13281 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13282 (exclude_libs_test_LDFLAGS): Add linker option
13283 -Wl,--exclude-libs,libexclude_libs_test_3
13284 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13285 an explicit archive without using -l.
13286 (alt/libexclude_libs_test_3.a): New make rule.
13287 * testsuite/Makefile.in: Regenerate.
13288 * testsuite/exclude_libs_test.c : Declare lib3_default().
13289 (main): Call it.
13290 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13291 * exclude_libs_test_3.c: New file.
13292
f12e7348
NC
132932009-05-26 Nick Clifton <nickc@redhat.com>
13294
13295 * po/id.po: New Indonesian translation.
13296 * po/gold.pot: Updated template file.
13297
4daadc0d
ST
132982009-05-22 Sriraman Tallam <tmsriram@google.com>
13299
e1df38aa 13300 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13301 gc_comdat_test files. Add -Wl,--gc-sections to build
13302 gc_comdat_test.
13303 * testsuite/Makefile.in: Regenerate.
13304 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13305
531813ad
ST
133062009-05-21 Sriraman Tallam <tmsriram@google.com>
13307
13308 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13309 kept comdat section was garbage collected.
13310 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13311 * testsuite/Makefile.in: Regenerate.
13312 * testsuite/gc_comdat_test.sh: New file.
13313 * testsuite/gc_comdat_test_1.cc: New file.
13314 * testsuite/gc_comdat_test_2.cc: New file.
13315
65514900
CC
133162009-05-19 Doug Kwan <dougkwan@google.com>
13317
13318 * archive.cc (Archive::Archive): Move constructor from archive.h
13319 to here. Initialize no_export_.
13320 (Archive::get_elf_object_for_member): Set no_export flag of object.
13321 * archive.h (Archive::Archive): Move constructor body to
13322 archive.cc.
13323 (Archive::no_export): New method.
13324 (Archive::no_export_): New field.
13325 * object.h (Object::Object): Initialize no_export_ to false.
13326 (Object::no_export, Object::set_no_export): New methods.
13327 (Object::no_export_): New field.
13328 * options.cc (General_options::parse_exclude_libs): New method.
13329 (General_options::check_excluded_libs) Same.
13330 * options.h (exclude_libs): New option.
13331 (General_options::check_excluded_libs): New method declaration.
13332 (General_options::excluded_libs_): New field.
13333 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13334 default or protected visibility if an object has no-export flag set.
13335 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13336 (check_SCRIPTS): Add exclude_libs_test.sh.
13337 (check_DATA): Add exclude_libs_test.syms.
13338 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13339 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13340 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13341 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13342 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13343 libexclude_libs_test_2.a): New rules.
13344 * testsuite/Makefile.in: Regenerate.
13345 * testsuite/exclude_libs_test.c: New file.
13346 * testsuite/exclude_libs_test.sh: Ditto.
13347 * testsuite/exclude_libs_test_1.c: Ditto.
13348 * testsuite/exclude_libs_test_2.c: Ditto.
13349
1b77ea50
ILT
133502009-05-15 Ian Lance Taylor <iant@google.com>
13351
13352 * configure.ac: Check for declarations for cases where libiberty.h
13353 checks HAVE_DECL_xxx.
13354 * configure, config.in: Rebuild.
13355
072fe7ce
ILT
133562009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13357
13358 * gold.h (Incremental_argument_list): Remove (invalid) forward
13359 declaration.
13360 * incremental.cc (Incremental_inputs::report_achive): New method.
13361 (Incremental_inputs::report_object): New method.
13362 (Incremental_inputs::report_script): New method.
13363 (Incremental_inputs::finalize_inputs): New method.
13364 (Incremental_inputs::finalize): Call finalize_inputs().
13365 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13366 Create inputs entries.
13367 * incremental.h (Incremental_input_type): New enum.
13368 (Incremental_inputs::Incremental_input): Initialize new fields.
13369 (Incremental_inputs::report_inputs): New method.
13370 (Incremental_inputs::report_achive): New method.
13371 (Incremental_inputs::report_object): New method.
13372 (Incremental_inputs::report_script): New method.
13373 (Incremental_inputs::finalize_inputs): New method.
13374 (Incremental_inputs::Input_info): New struct.
13375 (Incremental_inputs::Input_info_map): New typedef.
13376 (Incremental_inputs::lock_): New field.
13377 (Incremental_inputs::Inputs_): New field.
13378 (Incremental_inputs::Inputs_map): New field.
13379 * main.cc (main): Call Incremental_input::report_inputs.
13380 * options.h (Input_argument_list): Typedef moved from
13381 Input_arguments.
13382 (Input_file_group::Files): Remove, use ::Input_argument_list.
13383 (Input_file_group::Input_argument_list): Remove, use
13384 ::Input_argument_list.
13385 * plugin.cc (Plugin_manager::add_input_file): Add error in
13386 incremental build.
13387 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13388 functions.
13389 * script.cc (read_input_script): Call
13390 Incremental_input::report_script.
13391 * script.h (Script_info): New class.
13392
b0481b0b
ILT
133932009-04-27 Ian Lance Taylor <iant@google.com>
13394
13395 * x86_64.cc (do_adjust_output_section): Set entsize to
13396 plt_entry_size.
13397
b22a5a41 133982009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13399
13400 * output.cc (Output_file::close): After short writes, continue
13401 writing from the correct offset in the buffer being written.
13402
40fde488
CD
134032009-04-23 Chris Demetriou <cgd@google.com>
13404
13405 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13406 * configure: Regenerate.
13407 * config.in: Regenerate.
13408 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13409 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13410
3ce2c28e
ILT
134112009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13412
13413 * incremental.cc (Incremental_inputs_header_data): Renamed from
13414 Incremental_input_header_data.
13415 (Incremental_inputs_header_data::data_size): New field.
13416 (Incremental_inputs_header_data::put_input_file_count): Renamed
13417 from input_file_count.
13418 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13419 from command_line_offset.
13420 (Incremental_inputs_header_data::put_reserved): Renamed from
13421 put_reserved.
13422 (Incremental_inputs_entry_data): Renamed from
13423 Incremental_input_entry_data.
13424 (Incremental_inputs_entry_data::data_size): New field.
13425 (Incremental_inputs::report_command_line): New method.
13426 (Incremental_inputs::finalize): New method.
13427 (Incremental_inputs::create_incremental_inputs_data): New method.
13428 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13429 * incremental.h: New file.
13430 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13431 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13432 incremental builds.
703d02da 13433 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13434 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13435 (Layout::create_incremental_info_sections): New method.
13436 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13437 * main.cc (main): Notify Incremental_input of the command line.
13438
e55bde5e
ILT
134392009-04-01 Ian Lance Taylor <iant@google.com>
13440 Mikolaj Zalewski <mikolajz@google.com>
13441
13442 * gold.h (reserve_unordered_map): Define, three versions, one for
13443 each version of Unordered_map.
13444 * layout.cc (Layout::Layout): Remove options parameter. Add
13445 number_of_input_files parameter. Don't initialize options_.
13446 Initialize number_of_input_files_ and resized_signatures_. Move
13447 sections_are_attached_.
13448 (Layout::layout_group): Reserve space for group_signatures_.
13449 (Layout::find_or_add_kept_section): Change name parameter to be a
13450 reference. Resize signatures_ map when it gets large enough.
13451 (Layout::layout_eh_frame): Use parameters->options() instead of
13452 this->options_.
13453 (Layout::make_output_section): Likewise.
13454 (Layout::attach_allocated_section_to_segment): Likewise.
13455 (Layout::finalize, Layout::create_executable_stack): Likewise.
13456 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13457 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13458 * layout.h (class Layout): Update declarations. Remove options_
13459 field. Add number_of_input_files_ and resized_signatures_
13460 fields. Move sections_are_attached_ field.
13461 * main.cc (main): Pass number of input files to Layout
13462 constructor. Don't pass options.
13463
154b857c
ILT
134642009-03-30 Ian Lance Taylor <iant@google.com>
13465
13466 * ffsll.c (ffsll): Correct implementation.
13467
2f35ab9b
ILT
134682009-03-27 Ian Lance Taylor <iant@google.com>
13469
fd03461a
ILT
13470 * ffsll.c: New file.
13471 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13472 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13473 * ftruncate.c (ftruncate): Declare before definition.
13474 * mremap.c (mremap): Likewise.
13475 * pread.c (pread): Likewise.
13476 * configure, Makefile.in, config.in: Rebuild.
13477
2f35ab9b
ILT
13478 * mremap.c: New file.
13479 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13480 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13481 (mremap): Declare if HAVE_MREMAP is not defined.
13482 * configure, Makefile.in, config.in: Rebuild.
13483
33aea2fd
CC
134842009-03-27 Cary Coutant <ccoutant@google.com>
13485
13486 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13487 position independent.
13488 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13489 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13490
6d479619
CC
134912009-03-24 Cary Coutant <ccoutant@google.com>
13492
13493 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13494 an executable.
13495 (needs_dynamic_reloc): Likewise.
13496
afc06bb8
ILT
134972009-03-24 Ian Lance Taylor <iant@google.com>
13498
13499 * yyscript.y (file_cmd): Recognize EXTERN.
13500 (extern_name_list, extern_name_list_body): New nonterminals.
13501 * script.cc (script_add_extern): Define.
13502 * script-c.h (script_add_extern): Declare.
13503
f6060a4d
ILT
135042009-03-24 Rafael Avila de Espindola <espindola@google.com>
13505
13506 * object.cc (is_elf_object): Define.
13507 * object.h (is_elf_object): Declare.
13508 * archive.cc (Archive::get_elf_object_for_member): Call
13509 is_elf_object.
33aea2fd 13510 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 13511
26736d8e
ILT
135122009-03-24 Elliott Hughes <enh@google.com>
13513
13514 * output.cc (Output_file::map_anonymous): Define.
13515 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13516 try an anonymous one. Report the size if the mmap fails.
13517 * output.h (class Output_file): Declare map_anonymous.
13518
22fd9730
ILT
135192009-03-24 Ian Lance Taylor <iant@google.com>
13520
13521 * target-select.cc (instantiate_target): Don't acquire the lock if
13522 the instantiated_target_ field has already been set.
13523
cb010894
ILT
135242009-03-23 Ian Lance Taylor <iant@google.com>
13525
7f055c20
ILT
13526 * gold-threads.h (class Initialize_lock): Define.
13527 * gold-threads.cc (class Initialize_lock_once): Define.
13528 (initialize_lock_control): New static variable.
13529 (initialize_lock_pointer): New static variable.
13530 (initialize_lock_once): New static function.
13531 (Initialize_lock::Initialize_lock): Define.
13532 (Initialize_lock::initialize): Define.
13533 * target-select.h: Include "gold-threads.h".
13534 (class Target_selector): Add lock_ and initialize_lock_ fields.
13535 Don't define instantiate_target, just declare it.
13536 * target-select.cc (Target_selector::Target_selector): Initialize
13537 new fields.
13538 (Target_selector::instantiate_target): Define.
13539 * descriptors.h: Include "gold-threads.h".
13540 (class Descriptors): Add initialize_lock_ field.
13541 * descriptors.cc (Descriptors::Descriptors): Initialize new
13542 field.
13543 (Descriptors::open): Use initialize_lock_ field
13544 * errors.h (class Errors): Add initialize_lock_ field.
13545 * errors.cc (Errors::Errors): Initialize new field.
13546 (Errors::initialize_lock): Use initialize_lock_ field.
13547 * powerpc.cc (class Target_selector_powerpc): Remove
13548 instantiated_target_ field. In do_recognize call
13549 instantiate_target rather than do_instantiate_target. In
13550 do_instantiate_target just allocate a new target.
13551 * sparc.cc (class Target_selector_sparc): Likewise.
13552
36959681
ILT
13553 * freebsd.h: New file.
13554 * i386.cc: Include "freebsd.h".
13555 (Target_i386): Derive from Target_freebsd rather than
13556 Sized_target.
13557 (Target_selector_i386): Derive from Target_selector_freebsd rather
13558 than Target_selector.
13559 * x86_64.cc: Include "freebsd.h".
13560 (Target_x86_64): Derive from Target_freebsd rather than
13561 Sized_target.
13562 (Target_selector_x86_64): Derive from Target_selector_freebsd
13563 rather than Target_selector.
13564 * target.h (class Target): Add adjust_elf_header and
13565 do_adjust_elf_header.
13566 * output.cc (Output_file_header:: do_sized_write): Call target
13567 adjust_elf_header routine.
13568 * configure.tgt: Set targ_osabi.
13569 * configure.ac: Define GOLD_DEFAULT_OSABI.
13570 * parameters.cc (Parameters::default_target): Pass
13571 GOLD_DEFAULT_OSABI to select_target.
13572 * target-select.h (class Target_selector): Make instantiate_target
13573 protected rather than private.
13574 * Makefile.am (HFILES): Add freebsd.h.
13575 * configure, Makefile.in, config.in: Rebuild.
13576
cb010894
ILT
13577 * merge.cc (do_add_input_section): Correct pend value. Change
13578 message about last entry not being null terminated from error to
13579 warning.
13580
0e879927
ILT
135812009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13582
13583 * incremental.cc: New file.
13584 * Makefile.am (CCFILES): Add incremental.cc.
13585 * Makefile.in: Rebuild.
13586
41105937
PP
135872009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13588
13589 * layout.cc (Layout::output_section_name): Preserve names
13590 of '.note.' sections.
e1df38aa 13591
60439920
ILT
135922009-03-19 Ian Lance Taylor <iant@google.com>
13593
13594 * descriptors.cc (Descriptors::open): Check that the options are
13595 valid before using them.
13596
0d371ad3
ILT
135972009-03-18 Ian Lance Taylor <iant@google.com>
13598
13599 * script-sections.h: Include <list>.
13600 (class Script_sections): Change Sections_elements from std::vector
13601 to std::list. Typedef public Elements_iterator. Add
13602 orphan_section_placement_, data_segment_align_start_, and
13603 saw_data_segment_align_ fields. Remove data_segment_align_index_
13604 field.
13605 * script-sections.cc (class Orphan_section_placement): New class.
13606 (class Sections_element): Add virtual functions is_relro and
13607 orphan_section_init. Remove virtual function place_orphan_here.
13608 (class Output_section_definition): Add is_relro and
13609 orphan_section_init. Remove place_orphan_here.
13610 (class Orphan_output_section): Likewise.
13611 (Script_sections::Script_sections): Update for field changes.
13612 (Script_sections::data_segment_align): Set saw_data_segment_align_
13613 and data_segment_align_start_, not data_segment_align_index.
13614 (Script_sections::data_segment_relro_end): Check
13615 saw_data_segment_align_. Use data_segment_align_start_ rather
13616 than data_segment_align_index_.
13617 (Script_sections::place_orphan): Rewrite to use
13618 Orphan_section_placement.
13619
9201d894
ILT
136202009-03-17 Ian Lance Taylor <iant@google.com>
13621
9c5b8369
ILT
13622 * archive.cc (Archive::add_symbols): Check for a version attached
13623 to the symbol name in the archive map.
13624 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13625 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13626 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13627 (ver_test_11.a): New target.
13628 * testsuite/Makefile.in: Rebuild.
13629
9201d894
ILT
13630 * configure.ac: Check for chsize and posix_fallocate. Replace
13631 ftruncate.
13632 * ftruncate.c: New file, from gnulib.
13633 * output.cc (posix_fallocate): Define dummy version if not
13634 HAVE_POSIX_FALLOCATE.
13635 (Output_file::map): Call posix_fallocate rather than lseek and
13636 write.
13637 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13638 * configure, Makefile.in, config.in: Rebuild.
13639
ef4ab7a8 136402009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 13641
ef4ab7a8
PP
13642 * layout.h (Layout::create_note): Add section_name parameter.
13643 * layout.cc (Layout::create_note): Likewise.
13644 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 13645
8c500701
ILT
136462009-03-17 Ian Lance Taylor <iant@google.com>
13647
e85b18e1
ILT
13648 * descriptors.cc: Include "options.h".
13649 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13650 (Descriptors::open): Always use O_CLOEXEC when opening a new
13651 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13652 then set FD_CLOEXEC.
13653
9efe6174
ILT
13654 * sparc.cc (class Target_sparc): Add has_got_section.
13655 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13656 make sure we have a GOT section.
13657
13658 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13659 (Target_sparc::Scan::local): Likewise.
13660 (Target_sparc::Scan::global): Likewise.
13661 (Target_sparc::Relocate::relocate): Likewise.
13662 (Target_sparc::Relocate::relocate_tls): Likewise.
13663
8c500701
ILT
13664 * symtab.cc (Symbol_table::define_default_version): New function,
13665 broken out of add_from_object.
13666 (Symbol_table::add_from_object): Call define_default_version.
13667 (Symbol_table::define_special_symbol): Add resolve_oldsym
13668 parameter. Change all callers. If the version for a symbol comes
13669 from a version script, resolve it with the symbol with the same
13670 name with no version. Also add the symbol without a version if
13671 appropriate.
13672 (do_define_in_output_data): If resolving with oldsym, don't delete
13673 sym.
13674 (do_define_in_output_segment): Likewise.
13675 (do_define_as_constant): Likewise.
13676 * symtab.h (class Symbol_table): Update declarations.
13677
f1ed28fb
ILT
136782009-03-13 Ian Lance Taylor <iant@google.com>
13679
15f8229b
ILT
13680 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13681 (Read_symbols::requeue): New function.
13682 (Read_symbols::do_read_symbols): If make_elf_object fails because
13683 the target type is not configured, and the file was searched for,
13684 issue a warning and retry with the next directory.
13685 (Add_symbols::run): If the file has an incompatible format, and
13686 it was searched for, requeue the Read_symbols task. On error,
13687 release the object.
13688 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13689 dirindex parameter to constructor. Change all callers. Declare
13690 incompatible_warning and requeue.
13691 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13692 input_argument_ and input_group_ fields. Add them to
13693 constructor. Change all callers.
13694 (class Read_script): Add dirindex_ field. Add it to constructor.
13695 Change all callers.
13696 * archive.cc (Archive::setup): Remove input_objects parameter.
13697 Change all callers.
13698 (Archive::get_file_and_offset): Likewise.
13699 (Archive::read_all_symbols): Likewise.
13700 (Archive::read_symbols): Likewise.
13701 (Archive::get_elf_object_for_member): Remove input_objects
13702 parameter. Add punconfigured parameter. Change all callers.
13703 (Archive::add_symbols): Change return type to bool. Check return
13704 value of include_member.
13705 (Archive::include_all_members): Likewise.
13706 (Archive::include_member): Change return type to bool. Return
13707 false if first included object has incompatible target. Set
13708 included_member_ field.
13709 (Add_archive_symbols::run): If add_symbols returns false, requeue
13710 Read_symbols task.
13711 * archive.h (class Archive): Add included_member_ field.
13712 Initialize it in constructor. Add input_file and searched_for
13713 methods. Update declarations.
13714 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13715 input_argument_ fields. Add them to constructor. Change all
13716 callers.
13717 * script.cc: Include "target-select.h".
13718 (class Parser_closure): Add skip_on_incompatible_target_ and
13719 found_incompatible_target_ fields. Add
13720 skip_on_incompatible_target parameter to constructor. Change all
13721 callers. Add methods skip_on_incompatible_target,
13722 clear_skip_on_incompatible_target, found_incompatible_target, and
13723 set_found_incompatible_target.
13724 (read_input_script): Add dirindex parameter. Change all callers.
13725 If parser finds an incompatible target, requeue Read_symbols
13726 task.
13727 (script_set_symbol): Clear skip_on_incompatible_target in
13728 closure.
13729 (script_add_assertion, script_parse_option): Likewise.
13730 (script_start_sections, script_add_phdr): Likewise.
13731 (script_check_output_format): New function.
13732 * script.h (read_input_script): Update declaration.
13733 * script-c.h (script_check_output_format): Declare.
13734 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13735 (ignore_cmd): Remove OUTPUT_FORMAT.
13736 * fileread.cc (Input_file::Input_file): Add explicit this.
13737 (Input_file::will_search_for): New function.
13738 (Input_file::open): Add pindex parameter. Change all callers.
13739 * fileread.h (class Input_file): Add input_file_argument method.
13740 Declare will_search_for. Update declarations.
13741 * object.cc (make_elf_object): Add punconfigured parameter.
13742 Change all callers.
13743 * object.h (class Object): Make input_file public. Add
13744 searched_for method.
13745 (make_elf_object): Update declaration.
13746 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13747 restart search.
13748 * dirsearch.h (class Dirsearch): Update declaration.
13749 * options.h (class General_options): Add --warn-search-mismatch.
13750 * parameters.cc (Parameters::is_compatible_target): New function.
13751 * parameters.h (class Parameters): Declare is_compatible_target.
13752 * workqueue.cc (Workqueue::add_blocker): New function.
13753 * workqueue.h (class Workqueue): Declare add_blocker.
13754
f1ed28fb
ILT
13755 * fileread.cc (Input_file::open): Remove options parameter.
13756 Change all callers.
13757 (Input_file::open_binary): Likewise.
13758 * script.cc (read_input_script): Likewise.
13759 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13760 options parameter from constructor. Change all callers.
13761 (class Read_script): Likewise.
13762 * fileread.h (class Input_file): Update declarations.
13763 * script.h (read_input_script): Update declaration.
13764
34dd024a
NC
137652009-03-10 Nick Clifton <nickc@redhat.com>
13766
13767 * po/es.po: New Spanish translation.
13768
6d71b17c
CC
137692009-03-06 Cary Coutant <ccoutant@google.com>
13770
13771 * options.cc (parse_short_option): Keep dash_z from registering itself.
13772
031cdbed
ILT
137732009-03-03 Ian Lance Taylor <iant@google.com>
13774
13775 PR 9918
13776 * target-reloc.h (relocate_section): Pass output_section to
13777 relocate.
13778 * i386.cc (Target_i386::should_apply_static_reloc): Add
13779 output_section parameter. Change all callers.
13780 (Target_i386::Relocate::relocate): Add output_section parameter.
13781 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13782 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13783 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13784 * testsuite/two_file_shared.sh: New script.
13785 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13786 (check_DATA): Add two_file_shared.dbg.
13787 (two_file_shared.dbg): New target.
13788 * testsuite/Makefile.in: Rebuild.
13789
15d5fa16
ILT
137902009-03-01 Ian Lance Taylor <iant@google.com>
13791
13792 * configure.ac: Check for byteswap.h.
13793 * configure: Rebuild.
13794 * config.in: Rebuild.
13795
8a4c0b0d
ILT
137962009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13797
13798 * layout.cc (Layout::find_or_add_kept_section): New function.
13799 (Layout::add_comdat): Removed.
13800 * layout.h (struct Kept_section): Move out of class Layout.
13801 Remove trailing underscores from field names. Add group_sections
13802 field. Rename group_ field to is_group. Change all uses.
13803 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13804 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13805 comdat_groups_ field.
13806 (Sized_relobj::include_section_group): Use
13807 find_or_add_kept_section and Kept_section::group_sections.
13808 (Sized_relobj::include_linkonce_section): Likewise.
13809 * object.cc (class Sized_relobj): Don't define Comdat_group or
13810 Comdat_group_table. Remove find_comdat_group and
13811 add_comdat_group. Remove comdat_groups_ field.
13812 * plugin.cc (include_comdat_group): Use
13813 Layout::find_or_add_kept_section.
13814
b4ecf66b
ILT
138152009-02-28 Ian Lance Taylor <iant@google.com>
13816
14359ca0
ILT
13817 * README: --gc-sections and map files are now supported. Document
13818 some build requirements.
13819
b4ecf66b
ILT
13820 PR 6992
13821 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13822 relocatable link set the value of the section symbol to zero.
13823 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13824 relocatable link don't include the section address in the local
13825 symbol value.
13826
0602e05a
ILT
138272009-02-27 Ian Lance Taylor <iant@google.com>
13828
fd9d194f
ILT
13829 PR 6811
13830 * options.h (class Search_directory): Add is_system_directory.
13831 (class General_options): Declare is_in_system_directory.
13832 * options.cc (get_relative_sysroot): Make static.
13833 (get_default_sysroot): Make static.
13834 (General_optoins::is_in_system_directory): New function.
13835 * fileread.cc (Input_file::is_in_system_directory): New function.
13836 * fileread.h (class Input_file): Declare is_in_system_directory.
13837 * object.h (class Object): Add is_in_system_directory.
13838 (class Input_objects): Remove system_library_directory_ field.
13839 * object.cc (Input_objects::add_object): Don't set
13840 system_library_directory_.
13841 (input_objects::found_in_system_library_directory): Remove.
13842 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13843 parameter. Change all callers.
13844 (Symbol_table::sized_write_globals): Likewise.
13845 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13846 Call Object::is_in_system_directory.
13847 * symtab.h (class Symbol_table): Update declarations.
13848
61edd21f
ILT
13849 PR 5990
13850 * descriptors.h (Open_descriptor): Add is_on_stack field.
13851 * descriptors.cc (Descriptors::open): If the descriptor is on the
13852 top of the stack, remove it. Initialize is_on_stack field.
13853 (Descriptors::release): Only add pod to stack if it is not on the
13854 stack already.
13855 (Descriptors::close_some_descriptor): Clear stack_next and
13856 is_on_stack fields.
13857
e29e076a
ILT
13858 PR 7091
13859 * output.cc (Output_section::find_starting_output_address): Rename
13860 from starting_output_address; add PADDR parameter; change return
13861 type.
13862 * output.h (class Output_section): Declare
13863 find_starting_output_address instead of starting_output_address.
13864 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13865 section symbol for which we can't find a merge section.
13866
0602e05a
ILT
13867 PR 9836
13868 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13869 hidden or internal, force the symbol to be local.
13870 * resolve.cc (Symbol::override_visibility): Define.
13871 (Symbol::override_base): Use override_visibility.
13872 (Symbol_table::resolve): Likewise.
13873 (Symbol::override_base_with_special): Likewise.
13874 (Symbol_table::override_with_special): If the visibility is hidden
13875 or internal, force the symbol to be local.
13876 * symtab.h (class Symbol): Add set_visibility and
13877 override_visibility.
13878 * testsuite/ver_test_1.sh: New file.
13879 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13880 (check_DATA): Add ver_test_1.syms.
13881 (ver_test_1.syms): New target.
13882 * testsuite/Makefile.in: Rebuild.
13883
401a9a73
CC
138842009-02-25 Cary Coutant <ccoutant@google.com>
13885
13886 * layout.cc (Layout::choose_output_section): Don't rename sections
13887 when using a linker script that has a SECTIONS clause.
13888 * Makefile.in: Regenerate.
13889
13890 * testsuite/Makefile.am (script_test_5.sh): New test case.
13891 * testsuite/Makefile.in: Regenerate.
13892 * testsuite/script_test_5.cc: New file.
13893 * testsuite/script_test_5.sh: New file.
13894 * testsuite/script_test_5.t: New file.
13895
f488e4b0
CC
138962009-02-13 Rafael Avila de Espindola <espindola@google.com>
13897
13898 * archive.cc (Archive::include_member): Update calls to add_symbols.
13899 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
13900 the Layout argument.
13901 * dynobj.h (do_add_symbols): Add the Layout argument.
13902 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
13903 Layout argument.
13904 * object.h (Object::add_symbols): Add the Layout argument.
13905 (Object::do_add_symbols): Add the Layout argument.
13906 (Sized_relobj::do_add_symbols): Add the Layout argument.
13907 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
13908 Unify the two versions.
13909 (Add_plugin_symbols): Remove.
13910 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
13911 (Sized_pluginobj::do_add_symbols): Unify the two versions.
13912 (Add_plugin_symbols): Remove.
13913 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
13914 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
13915 (Add_symbols::run): Make it work with Pulginobj.
13916
89dd1680
ILT
139172009-02-06 Ian Lance Taylor <iant@google.com>
13918
13919 * object.cc (Sized_relobj::do_layout): Make info message start
13920 with lower case letter.
13921
266d0a74
ILT
139222009-02-06 Mikolaj Zalewski <mikolajz@google.com>
13923
602b464e
ILT
13924 * binary.cc: Fix file comment.
13925
266d0a74
ILT
13926 * options.h (enum Incremental_disposition): Define.
13927 (class General_options): Add new options: --incremental,
13928 --incremental_changed, --incremental_unchanged,
13929 --incremental_unknown. Add incremental_disposition_ and
13930 implicit_incremental_ fields.
13931 (General_options::incremental_disposition): New function.
13932 (class Position_dependent_options): Add incremental_disposition
13933 option.
13934 (Position_dependent_options::copy_from_options): Set incremental
13935 dispositions.
13936 * options.cc (General_options::parse_incremental_changed): New
13937 function.
2e702c99
RM
13938 (General_options::parse_incremental_unchanged): New function.
13939 (General_options::parse_incremental_unknown): New function.
13940 (General_options::General_options): Initialize new fields
266d0a74 13941 incremental_disposition_ and implicit_incremental_.
2e702c99 13942 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
13943 without --incremental.
13944
f073bbf7
CD
139452009-02-06 Chris Demetriou <cgd@google.com>
13946
13947 * gold.h (gold_undefined_symbol): Change to take only a Symbol
13948 pointer and to report location as the file name associated with
13949 the symbol.
13950 (gold_undefined_symbol_at_location): New function to replace the
13951 old gold_undefined_symbol functionality.
13952 * target-reloc.h (relocate_section): Update to use
13953 gold_undefined_symbol_at_location.
13954 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13955 Call gold_undefined_symbol function rather than gold_error.
13956 * errors.h (Errors::undefined_symbol): Take location as a
13957 string, rather than calculating it from a relocation.
13958 * errors.cc (Errors::fatal): Print "fatal error:" before the
13959 formatted message.
13960 (Errors::error, Errors::error_at_location): Print "error: "
13961 before the formatted message.
13962 (Errors::undefined_symbol): Take location as a string, rather
13963 than calculating it from a relocation.
13964 (gold_undefined_symbol_at_location): New function akin to
13965 old gold_undefined_symbol, calculates location from relocation.
13966 (gold_undefined_symbol): Change to take only a Symbol pointer
13967 and to report location as the file name associated with the symbol.
13968 * testsuite/debug_msg.sh: Update for changed error messages.
13969 * testsuite/undef_symbol.sh: Likewise.
13970
8e94a90c
ILT
139712009-02-04 Duncan Sands <baldrick@free.fr>
13972
13973 PR 9812
13974 * reduced_debug_output.h
13975 (Output_reduced_debug_abbrev_section::failed): Use format for
13976 gold_warning.
13977 (Output_reduced_debug_info_section::faild): Likewise.
13978
88a0e15b
ILT
139792009-01-31 Mikolaj Zalewski <mikolajz@google.com>
13980
13981 * script.cc (Lazy_demangler): New class.
2e702c99 13982 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
13983 symbol only once.
13984
5efc7cd2
CC
139852009-01-29 Cary Coutant <ccoutant@google.com>
13986
13987 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
13988 to __tls_get_addr.
13989 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13990
e0ebcf42
ILT
139912009-01-28 Ian Lance Taylor <iant@google.com>
13992
5efc7cd2 13993 * version.cc (version_string): Bump to 1.9.
75fe7426 13994
e0ebcf42
ILT
13995 * gold.h: Include <cstring> and <stdint.h>.
13996 * version.cc: Include <cstdio>.
13997 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
13998 warning.
13999 * reduced_debug_output.cc (insert_into_vector): Rename from
14000 Insert_into_vector; change all callers. Use Swap_unaligned to
14001 avoid aliasing issue; remove union since it is unnecessary.
14002
8e2813be 140032009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
14004
14005 * Makefile.am (CCFILES): Add gc.cc.
14006 (HFILES): Add gc.h.
14007 * Makefile.in: Regenerate.
14008 * gold.cc (Gc_runner): New class.
14009 (queue_initial_tasks): Call garbage collection related tasks
14010 when corresponding options are invoked.
14011 (queue_middle_gc_tasks): New function.
14012 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14013 processed early before laying out sections during garbage collection.
14014 * gold.h (queue_middle_gc_tasks): New function.
14015 (is_prefix_of): Move from "layout.cc".
14016 * i386.cc (Target_i386::gc_process_relocs): New function.
14017 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14018 * main.cc (main): Create object of class "Garbage_collection".
14019 * object.cc (Relobj::copy_symbols_data): New function.
14020 (Relobj::is_section_name_included): New function.
e1df38aa
NC
14021 (Sized_relobj::do_layout): Allow this function to be called twice
14022 during garbage collection and defer layout of section during the
6d03d481
ST
14023 first call.
14024 * object.h (Relobj::get_symbols_data): New function.
14025 (Relobj::is_section_name_included): New function.
14026 (Relobj::copy_symbols_data): New function.
14027 (Relobj::set_symbols_data): New function.
14028 (Relobj::get_relocs_data): New function.
14029 (Relobj::set_relocs_data): New function.
14030 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14031 (Relobj::gc_process_relocs): New function.
14032 (Relobj::do_gc_process_relocs): New pure virtual function.
14033 (Relobj::sd_): New data member.
14034 (Sized_relobj::is_output_section_offset_invalid): New function.
14035 (Sized_relobj::do_gc_process_relocs): New function.
14036 * options.h (General_options::gc_sections): Modify to not be a no-op.
14037 (General_options::print_gc_sections): New option.
14038 * plugin.cc (Plugin_finish::run): Remove function call to
14039 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14040 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14041 * reloc.cc (Read_relocs::run): Add task to process relocs and
14042 determine unreferenced sections when doing garbage collection.
14043 (Gc_process_relocs): New class.
14044 (Sized_relobj::do_gc_process_relocs): New function.
14045 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14046 sections that are garbage collected.
14047 * reloc.h (Gc_process_relocs): New class.
14048 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14049 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14050 symbols whose corresponding sections are garbage collected.
14051 (Symbol_table::Symbol_table): Add new parameter for the garbage
14052 collection object.
14053 (Symbol_table::gc_mark_undef_symbols): New function.
14054 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14055 (Symbol_table::gc_mark_dyn_syms): New function.
14056 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14057 as garbage.
14058 (Symbol_table::add_from_object): Likewise.
14059 (Symbol_table::add_from_relobj): When building shared objects, do not
14060 treat externally visible symbols as garbage.
14061 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14062 table information for static and relocatable links.
14063 * symtab.h (Symbol_table::set_gc): New function.
14064 (Symbol_table::gc): New function.
14065 (Symbol_table::gc_mark_undef_symbols): New function.
14066 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14067 (Symbol_table::gc_mark_dyn_syms): New function.
14068 (Symbol_table::gc_): New data member.
e1df38aa 14069 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
14070 function.
14071 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14072 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14073
3b293544
CF
140742009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14075
14076 * options.h (General_options::gc_sections): Define as a no-op for now.
14077 (General_options::no_keep_memory): Ditto.
14078 (General_options::Bshareable): Define.
14079 * options.cc (General_options::finalize): Honor -Bshareable.
14080
83d22aa8
AS
140812009-01-20 Andreas Schwab <schwab@suse.de>
14082
14083 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14084 read the value in the contents, since we don't use it. Use the
14085 template endianness when writing.
14086 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14087
cd536b21
AS
140882009-01-19 Andreas Schwab <schwab@suse.de>
14089
14090 * configure.tgt (powerpc64-*): Fix targ_obj.
14091
99e9a495
ILT
140922009-01-15 Ian Lance Taylor <iant@google.com>
14093
14094 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14095 local symbols when stripping all symbols.
14096
bbbfea06
CC
140972009-01-14 Cary Coutant <ccoutant@google.com>
14098
99e9a495 14099 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 14100
0f7c0701
CC
141012009-01-14 Cary Coutant <ccoutant@google.com>
14102
14103 * archive.cc (Archive::get_elf_object_for_member): Remove call
14104 to File_read::claim_for_plugin.
14105 * descriptors.cc (Descriptors::open): Remove reference to
14106 is_claimed.
14107 (Descriptors::claim_for_plugin): Remove.
14108 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14109 (Descriptors::is_claimed): Remove.
14110 (claim_descriptor_for_plugin): Remove.
14111 * fileread.cc (File_read::claim_for_plugin): Remove.
14112 * fileread.h (File_read::claim_for_plugin): Remove.
14113 (File_read::descriptor): Reopen descriptor if necessary.
14114 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14115 (Plugin_manager::all_symbols_read): Add task parameter. Change
14116 all callers.
14117 (Plugin_manager::get_input_file): New function.
14118 (Plugin_manager::release_input_file): New function.
14119 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14120 corresponding data member.
14121 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14122 and pass to base constructor. Change all callers.
14123 (get_input_file, release_input_file): New functions.
14124 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14125 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14126 (Plugin_manager::all_symbols_read): Add task parameter.
14127 (Plugin_manager::get_input_file): New function.
14128 (Plugin_manager::release_input_file): New function.
14129 (Plugin_manager::task_): New data member.
14130 (Pluginobj::Pluginobj): Add filesize parameter.
14131 (Pluginobj::filename): New function.
14132 (Pluginobj::descriptor): New function.
14133 (Pluginobj::filesize): New function.
14134 (Pluginobj::filesize_): New data member.
14135 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14136 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14137 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14138
14139 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14140 with archive libraries.
14141 * testsuite/Makefile.in: Regenerate.
14142 * testsuite/plugin_test.c (struct sym_info): New type.
14143 (get_input_file, release_input_file): New static variables.
14144 (onload): Capture new transfer vector entries.
14145 (claim_file_hook): Stop reading at end of file according to filesize.
14146 Factor out parsing of readelf output into separate function.
14147 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14148 APIs and get the source file name from the symbol table. Convert
14149 source file name to corresponding object file name. Print info
14150 message when adding new input files.
14151 (parse_readelf_line): New function.
14152 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14153 * testsuite/plugin_test_2.sh: Likewise.
14154 * testsuite/plugin_test_3.sh: Likewise.
14155 * testsuite/plugin_test_4.sh: New test case.
14156
62a6d109
ILT
141572009-01-07 Ian Lance Taylor <iant@google.com>
14158
14159 * version.cc (version_string): Bump to 1.8.
14160
483620e8
CC
141612008-12-23 Cary Coutant <ccoutant@google.com>
14162
14163 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14164 * plugin.cc (Plugin_manager::finish): Rename as
14165 layout_deferred_objects. Move cleanup to separate function.
14166 (Plugin_manager::cleanup): New function.
14167 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14168 separately.
14169 * plugin.h (Plugin_manager::finish): Rename as
14170 layout_deferred_objects.
14171 (Plugin_manager::cleanup): New function.
14172 (Plugin_manager::cleanup_done): New field.
14173
d66a9eb3
CC
141742008-12-23 Cary Coutant <ccoutant@google.com>
14175
14176 * plugin.cc (is_visible_from_outside): New function.
14177 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14178 so we don't return "IR only" status for exported symbols or -r links.
14179
14180 * testsuite/Makefile.am (plugin_test_3): New test case.
14181 * testsuite/Makefile.in: Regenerate.
14182 * testsuite/plugin_test_3.sh: New file.
14183
5995b570
CC
141842008-12-22 Cary Coutant <ccoutant@google.com>
14185
14186 * object.cc (Sized_relobj::layout_section): New function.
14187 (Sized_relobj::do_layout): Defer layout of input sections until after
14188 plugin has provided replacement files.
14189 (Sized_relobj::do_layout_deferred_sections): New function.
14190 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14191 (Relobj::layout_deferred_sections): New function.
14192 (Relobj::do_layout_deferred_sections): New function.
14193 (Sized_relobj::do_layout_deferred_sections): New function.
14194 (Sized_relobj::layout_section): New function.
14195 (Sized_relobj::Deferred_layout): New structure.
14196 (Sized_relobj::deferred_layout_): New field.
14197 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14198 Change all callers. Layout deferred sections.
14199 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14200 references.
14201 (Plugin_hook::run): Move code from do_plugin_hook inline.
14202 (Plugin_hook::do_plugin_hook): Remove.
14203 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14204 (Plugin_manager::finish): Renamed, was cleanup.
14205 (Plugin_manager::should_defer_layout): New function.
14206 (Plugin_manager::add_deferred_layout_object): New function.
14207 (Plugin_manager::Deferred_layout_list): New type.
14208 (Plugin_manager::deferred_layout_objects_): New field.
14209 (Plugin_hook::do_plugin_hook): Remove.
14210
ee769c88
ILT
142112008-12-17 Ian Lance Taylor <iant@google.com>
14212
14213 * options.h (class General_options): Add --no case for
14214 --export-dynamic.
14215
abc8dcba
CC
142162008-12-16 Cary Coutant <ccoutant@google.com>
14217
14218 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14219 vector.
14220 (Plugin_manager::claim_file): Create plugin object even if
14221 plugin did not call the add_symbols callback.
14222 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14223 asking for more symbols than were added.
14224 * testsuite/Makefile.am (plugin_test_1): Add test case with
14225 no global symbols.
14226 (empty.syms): New target.
14227 * testsuite/Makefile.in: Regenerate.
14228 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14229 message. Don't call add_symbols if no globals.
14230 (all_symbols_read_hook): Don't provide replacement for empty
14231 claimed file.
14232
b0074644
ILT
142332008-12-12 Ian Lance Taylor <iant@google.com>
14234
68943102
ILT
14235 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14236 r_type == 0 for a local symbol with r_sym == 0.
14237 (scan_relocatable_relocs): Pass r_sym to
14238 local_non_section_strategy.
14239 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14240 r_sym parameter.
14241
b0074644
ILT
14242 * configure.ac: Update test for TLS descriptors: they are
14243 supported as of glibc 2.9.
14244 * configure: Rebuild.
14245
c2508178
ILT
142462008-12-11 Ian Lance Taylor <iant@google.com>
14247
14248 PR 7091
14249 * target-reloc.h (Default_scan_relocatable_relocs): For each
14250 function, map r_type == 0 to RELOC_DISCARD.
14251
2756a258
CC
142522008-12-10 Cary Coutant <ccoutant@google.com>
14253
14254 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14255 object to override a kept COMDAT group from a plugin object.
14256
bb6f53d3
ILT
142572008-12-09 Ian Lance Taylor <iant@google.com>
14258
fbc558e1
ILT
14259 PR 7088
14260 * yyscript.y (file_cmd): Handle INPUT.
14261
bb6f53d3
ILT
14262 * testsuite/initpri1.c: Change all declarations to be full
14263 prototypes by adding void, to avoid compiler warnings.
14264
4674ecfc
CC
142652008-12-05 Rafael Avila de Espindola <espindola@google.com>
14266
14267 * options.cc (General_options::parse_plugin_opt): New.
14268 (General_options::add_plugin): The argument now is just the filename.
14269 (General_options::add_plugin_option): New.
14270 * options.h (plugin_opt): New.
14271 (add_plugin): Change argument name.
14272 (add_plugin_option): New.
14273 * plugin.cc (Plugin::load): Don't parse the plugin option.
14274 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14275 (Plugin::add_option): New.
14276 (Plugin::args_): Change type.
14277 (Plugin::filename_): New.
14278 (Plugin_manager::add_plugin_option): New.
14279 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14280 * testsuite/Makefile.in: Regenerate.
14281
fd06b4aa
CC
142822008-12-05 Cary Coutant <ccoutant@google.com>
14283
14284 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14285 Handle --strip-lto-sections option.
14286 * options.h (strip_lto_sections): New option.
14287
6c52134c
CC
142882008-12-01 Cary Coutant <ccoutant@google.com>
14289
14290 * plugin.cc (ld_plugin_message): Change format parameter to const.
14291 Fix mismatch between new[] and delete.
14292
a45248e0
CC
142932008-11-14 Cary Coutant <ccoutant@google.com>
14294
14295 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14296 instead of -1U.
14297
c82fbeee
CS
142982008-11-05 Craig Silverstein <csilvers@google.com>
14299
14300 * options.cc (General_options::parse_dynamic_list): New function.
14301 * options.h (General_options): New flags dynamic_list,
14302 dynamic_list_data, dynamic_list_cpp_new, and
14303 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14304 (General_options::in_dynamic_list): New function.
14305 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14306 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14307 (Lex::can_continue_name): Likewise.
14308 (yylex): Likewise.
14309 (read_script_file): New parameter script_options.
14310 (read_dynamic_list): New function.
14311 (Script_options::define_dynamic_list): New function.
14312 (dynamic_list_keyword_parsecodes): New variable.
14313 (dynamic_list_keywords): New variable.
14314 * script.h (Script_options::define_dynamic_list): New function
14315 prototype.
14316 (read_dynamic_list): New function prototype.
14317 * symtab.cc (strprefix): New macro.
14318 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14319 dynamic_list_data, dynamic_list_cpp_new, and
14320 dynamic_list_cpp_typeinfo.
14321 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14322 (dynamic_list_expr): New rule.
14323 (dynamic_list_nodes): Likewise.
14324 (dynamic_list_node): Likewise.
14325 * testsuite/Makefile.am (dynamic_list): New test.
14326 * testsuite/Makefile.in: Regenerated.
14327 * testsuite/dynamic_list.t: New file.
14328 * testsuite/dynamic_list.sh: New file.
14329
e0bb29a5
CS
143302008-11-05 Craig Silverstein <csilvers@google.com>
14331
14332 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14333 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14334 (t11_last): Likewise.
14335 * testsuite/ver_test_6.c (main): Likewise.
14336
4e1e25e0
CC
143372008-10-07 Cary Coutant <ccoutant@google.com>
14338
14339 * options.c (General_options::finalize): Add check for -static and
14340 -shared.
14341 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14342 is not empty.
14343
92f03fcb
CC
143442008-10-02 Cary Coutant <ccoutant@google.com>
14345
14346 * plugin.cc (make_sized_plugin_object): Fix conditional
14347 compilation to work when not all targets are enabled.
14348
fbd8a257
CC
143492008-09-29 Cary Coutant <ccoutant@google.com>
14350
14351 * archive.cc (Archive::get_file_and_offset): Use filename instead
14352 of name to get library path.
14353 (Archive::include_member): Unlock external member of a thin archive.
14354
14355 * testsuite/Makefile.am (TEST_AR): New variable.
14356 (thin_archive_test_1): New test.
14357 (thin_archive_test_2): New test.
81636b3f
CC
14358 * testsuite/Makefile.in: Regenerate.
14359 * testsuite/thin_archive_main.cc: New file.
14360 * testsuite/thin_archive_test_1.cc: New file.
14361 * testsuite/thin_archive_test_2.cc: New file.
14362 * testsuite/thin_archive_test_3.cc: New file.
14363 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14364
eff45813
CC
143652008-09-29 Cary Coutant <ccoutant@google.com>
14366
14367 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14368 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14369 instead of -1U.
14370 (Sized_relobj::do_finalize_local_symbols): Likewise.
14371 (Sized_relobj::map_to_kept_section): Likewise.
14372 * object.h (Sized_relobj::invalid_address): New constant.
14373 (Sized_relobj::do_output_section_offset): Check for invalid_address
14374 and return -1ULL.
14375 * output.cc (Output_reloc::local_section_offset): Use constant
14376 invalid_address instead of -1U.
14377 (Output_reloc::get_address): Likewise.
14378 (Output_section::output_address): Change -1U to -1ULL.
14379 * output.h (Output_reloc::invalid_address): New constant.
14380 * reloc.cc (Sized_relobj::write_sections): Use constant
14381 invalid_address instead of -1U.
14382 (Sized_relobj::relocate_sections): Likewise.
14383 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14384 values for merge sections.
14385 * target-reloc.h (relocate_for_relocatable): Use constant
14386 invalid_address instead of -1U.
14387
89fc3421
CC
143882008-09-19 Cary Coutant <ccoutant@google.com>
14389
14390 Add plugin functionality for link-time optimization (LTO).
14391 * configure.ac (plugins): Add --enable-plugins option.
14392 * configure: Regenerate.
14393 * config.in: Regenerate.
14394 * Makefile.am (LIBDL): New variable.
14395 (CCFILES): Add plugin.cc.
14396 (HFILES): Add plugin.h.
14397 (ldadd_var): Add LIBDL.
14398 * Makefile.in: Regenerate.
14399
14400 * archive.cc: Include "plugin.h".
14401 (Archive::setup): Don't preread archive symbols when using a plugin.
14402 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14403 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14404 files.
14405 (Archive::include_member): Add symbols from plugin objects.
14406 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14407 * descriptors.cc (Descriptors::open): Check for file descriptors
14408 abandoned by plugins.
14409 (Descriptors::claim_for_plugin): New function.
14410 * descriptors.h (Descriptors::claim_for_plugin): New function.
14411 (Open_descriptor::is_claimed): New field.
14412 (claim_descriptor_for_plugin): New function.
14413 * fileread.cc (File_read::claim_for_plugin): New function.
14414 * fileread.h (File_read::claim_for_plugin): New function.
14415 (File_read::descriptor): New function.
14416 * gold.cc: Include "plugin.h".
14417 (queue_initial_tasks): Add task to call plugin hooks for generating
14418 new object files.
14419 * main.cc: Include "plugin.h".
14420 (main): Load plugin libraries.
14421 * object.h (Pluginobj): Declare.
14422 (Object::pluginobj): New function.
14423 (Object::do_pluginobj): New function.
14424 (Object::set_target): New function.
14425 * options.cc: Include "plugin.h".
14426 (General_options::parse_plugin): New function.
14427 (General_options::General_options): Initialize plugins_ field.
14428 (General_options::add_plugin): New function.
14429 * options.h (Plugin_manager): Declare.
14430 (General_options): Add --plugin option.
14431 (General_options::has_plugins): New function.
14432 (General_options::plugins): New function.
14433 (General_options::add_plugin): New function.
14434 (General_options::plugins_): New field.
14435 * plugin.cc: New file.
14436 * plugin.h: New file.
14437 * readsyms.cc: Include "plugin.h".
14438 (Read_symbols::do_read_symbols): Check for archive before checking
14439 for ELF file. Call plugin hooks to claim files.
14440 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14441 from a real object file; force override when processing replacement
14442 files.
14443 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14444 (Symbol::init_base_object): Likewise.
14445 (Symbol::init_base_output_data): Likewise.
14446 (Symbol::init_base_output_segment): Likewise.
14447 (Symbol::init_base_constant): Likewise.
14448 (Symbol::init_base_undefined): Likewise.
14449 (Symbol::output_section): Assert that object is not a plugin.
14450 (Symbol_table::add_from_pluginobj): New function.
14451 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14452 undefined.
14453 (Symbol_table::sized_write_globals): Likewise.
14454 (Symbol_table::add_from_pluginobj): Instantiate template.
14455 * symtab.h (Sized_pluginobj): Declare.
14456 (Symbol::in_real_elf): New function.
14457 (Symbol::set_in_real_elf): New function.
14458 (Symbol::in_real_elf_): New field.
14459 (Symbol_table::add_from_pluginobj): New function.
14460
14461 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14462 (LIBDL): New variable.
14463 (LDADD): Add LIBDL.
14464 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14465 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14466 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14467 (MOSTLYCLEANFILES): Likewise.
14468 * testsuite/Makefile.in: Regenerate.
14469 * testsuite/plugin_test.c: New file.
14470 * testsuite/plugin_test_1.sh: New file.
14471 * testsuite/plugin_test_2.sh: New file.
14472
de31bda5
ILT
144732008-09-16 Ian Lance Taylor <iant@google.com>
14474
9c2d0ef9
ILT
14475 * target-reloc.h (relocate_section): Check whether a symbol is
14476 defined by the ABI before reporting an undefined symbol error.
14477 * target.h (Target::is_defined_by_abi): Make parameter const.
14478 (Target::do_is_defined_by_abi): Likewise.
14479 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14480 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14481 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14482 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14483 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14484 * testsuite/Makefile.in: Rebuild.
14485
de31bda5
ILT
14486 * fileread.cc (make_view): Add casts to avoid warning.
14487
9fa33bee
AO
144882008-09-16 Alexandre Oliva <aoliva@redhat.com>
14489
14490 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14491 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14492
183fd0e3
AO
144932008-09-16 Alexandre Oliva <aoliva@redhat.com>
14494
14495 * options.h (General_options::output_is_executable): New.
14496 (General_options::output_is_pie): New.
14497 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14498 for shared libraries.
14499 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14500
7be8330a
CD
145012008-09-11 Chris Demetriou <cgd@google.com>
14502
14503 * options.h (origin): New -z option.
14504 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14505 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14506 in DT_FLAGS_1.
14507
a9caad02
CC
145082008-09-05 Cary Coutant <ccoutant@google.com>
14509
14510 * fileread.cc (File_read::make_view): Add check for attempt to map
14511 beyond end of file.
14512
ae6dce4d
CC
145132008-09-05 Cary Coutant <ccoutant@google.com>
14514
14515 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14516 explicit instantiations.
14517
d7ab2a47
KVH
145182008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14519
14520 PR gold/6858
14521 * options.cc (General_options::finalize): Allow undefined symbols
14522 in shlibs if linking -shared.
14523
14524 PR gold/6859
14525 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14526 symbols as not needing a dynsym entry.
14527
1e52a9c1
CS
145282008-08-20 Craig Silverstein <csilvers@google.com>
14529
14530 * fileread.cc (File_read::open): Do not lock the file unless it
14531 was successfully opened.
14532
d85c80a3
CC
145332008-08-14 Cary Coutant <ccoutant@google.com>
14534
14535 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14536 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14537 * testsuite/tls_test.cc (struct int128): 128-bit struct
14538 for testing TLS relocs with non-zero addend.
14539 (v12): New TLS variable.
14540 (t12): New test.
14541 (t_last): Add check for v12.
14542 * testsuite/tls_test.h (t12): New function.
14543 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14544
2d924fd9
ILT
145452008-08-13 Ian Lance Taylor <iant@google.com>
14546
14547 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14548 set tls_segment_ or relro_segment_.
14549 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14550 when appropriate.
14551 * output.h (Output_section::clear_is_relro): New function.
14552 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14553 sections specially even when output_data_ is empty.
14554 (Output_segment::maximum_alignment): When first section is relro,
14555 only force alignment for PT_LOAD segments.
14556 * script.cc (script_data_segment_align): New function.
14557 (script_data_segment_relro_end): New function.
14558 * script-c.h (script_data_segment_align): Declare.
14559 (script_data_segment_relro_end): Declare.
14560 * script-sections.h (class Script_sections): Declare
14561 data_segment_align and data_segment_relro_end. Add fields
14562 segment_align_index_ and saw_relro_end_.
14563 * script-sections.cc (class Sections_element): Add set_is_relro
14564 virtual function. Add new bool* parameter to place_orphan_here.
14565 Add get_output_section virtual function.
14566 (class Output_section_definition): Add set_is_relro. Add new
14567 bool* parameter to place_orphan_here. Add get_output_section.
14568 Add is_relro_ field.
14569 (Output_section_definition::Output_section_definition): Initialize
14570 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14571 and is_relro_ fields.
14572 (Output_section_definition::place_orphan_here): Add is_relro
14573 parameter.
14574 (Output_section_definition::set_section_addresses): Set relro for
14575 output section.
14576 (Output_section_definition::alternate_constraint): Likewise.
14577 (class Orphan_output_section): Add new bool* parameter to
14578 place_orphan_here. Add get_output_section.
14579 (Orphan_output_section::place_orphan_here): Add is_relro
14580 parameter.
14581 (Script_sections::Script_sections): Initialize
14582 data_segment_align_index_ and saw_relro_end_.
14583 (Script_sections::data_segment_align): New function.
14584 (Script_sections::data_segment_relro_end): New function.
14585 (Script_sections::place_orphan): Set or clear is_relro.
14586 (Script_sections::set_section_addresses): Force alignment of first
14587 TLS section.
14588 * yyscript.y (exp): Call script_data_segment_align and
14589 script_data_segment_relro_end.
14590 * testsuite/relro_script_test.t: New file.
14591 * testsuite/relro_test.cc (using_script): Declare.
14592 (t1, t2): Test using_script.
14593 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14594 (relro_script_test_SOURCES): Define.
14595 (relro_script_test_DEPENDENCIES): Define.
14596 (relro_script_test_LDFLAGS): Define.
14597 (relro_script_test_LDADD): Define.
14598 (relro_script_test.so): New target.
14599 * testsuite/Makefile.in: Rebuild.
14600
f827c9a9
CC
146012008-08-06 Cary Coutant <ccoutant@google.com>
14602
14603 * archive.cc (Archive::total_archives, Archive::total_members)
14604 (Archive::total_members_loaded): New variables.
14605 (Archive::setup): Add parameter. Add option to preread
14606 archive symbols.
14607 (Archive::read_armap): Add counter.
14608 (Archive::get_file_and_offset): New function.
14609 (Archive::get_elf_object_for_member): New function.
14610 (Archive::read_all_symbols): New function.
14611 (Archive::read_symbols): New function.
14612 (Archive::add_symbols): Add counters.
14613 (Archive::include_all_members): Use armap to find members if it's
14614 already built.
14615 (Archive::include_member): Skip reading symbols if already read.
14616 Factored code into Archive::get_file_and_offset and
14617 Archive::get_elf_object_for_member. Changed call to
14618 Mapfile::report_include_archive_member.
14619 (Archive::print_stats): New function.
14620 * archive.h: Declare Object and Read_symbols_data classes.
14621 (Archive::Archive): Add initializers for new members.
14622 (Archive::setup): Add parameter.
14623 (Archive::print_stats): New function.
14624 (Archive::total_archives, Archive::total_members)
14625 (Archive::total_members_loaded): New variables.
14626 (Archive::get_file_and_offset): New function.
14627 (Archive::get_elf_object_for_member): New function.
14628 (Archive::read_all_symbols): New function.
14629 (Archive::read_symbols): New function.
14630 (Archive::Archive_member): New class.
14631 (Archive::members_): New member.
14632 (Archive::num_members_): New member.
14633 * main.cc: Include archive.h.
14634 (main): Call Archive::print_stats.
14635 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14636 archive parameter; member_name is now the fully-decorated name.
14637 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14638 * options.h: (General_options): Add --preread-archive-symbols option.
14639 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14640 Archive::setup.
14641
de4c45bd
ILT
146422008-08-04 Ian Lance Taylor <iant@google.com>
14643
14644 * symtab.h (Symbol::use_plt_offset): New function.
14645 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14646 * powerpc.cc (Relocate::relocate): Likewise.
14647 * sparc.cc (Relocate::relocate): Likewise.
14648 * x86_64.cc (Relocate::relocate): Likewise.
14649 * testsuite/weak_plt.sh: New test.
14650 * testsuite/weak_plt_main.cc: New test.
14651 * testsuite/weak_plt_shared.cc: New test.
14652 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14653 (check_PROGRAMS): Add weak_plt.
14654 (check_DATA): Add weak_plt_shared.so.
14655 (weak_plt_main_pic.o, weak_plt): New targets.
14656 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14657 * testsuite/Makefile.in: Rebuild.
14658
14659 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14660 gcctestdir/ld.
14661 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14662 * testsuite/Makefile.in: Rebuild.
14663
323ee3f4
AM
146642008-08-04 Alan Modra <amodra@bigpond.net.au>
14665
14666 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14667 * Makefile.in: Regenerate.
14668 * po/POTFILES.in: Regenerate.
14669
7c07ecec
ILT
146702008-07-29 Ian Lance Taylor <iant@google.com>
14671
14672 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14673 symbols before other symbols.
14674 * testsuite/script_test_2.cc (test_addr): Declare.
14675 (test_addr_alias): Declare.
14676 (main): Check that test_addr and test_addr_alias have the right
cd536b21 14677 values.
7c07ecec
ILT
14678 * testsuite/script_test_2.t: Define test_addr_alias and
14679 test_addr.
14680
5778530e
ILT
146812008-07-24 Ian Lance Taylor <iant@google.com>
14682
2a00e4fb
ILT
14683 PR 5990
14684 * descriptors.cc: New file.
14685 * descriptors.h: New file.
14686 * gold-threads.h (class Hold_optional_lock): New class.
14687 * fileread.cc: Include "descriptors.h".
14688 (File_read::~File_read): Release descriptor rather than closing
14689 it.
14690 (File_read::open) [file]: Call open_descriptor rather than open.
14691 Set is_descriptor_opened_.
14692 (File_read::open) [memory]: Assert that descriptor is not open.
14693 (File_read::reopen_descriptor): New function.
14694 (File_read::release): Release descriptor.
14695 (File_read::do_read): Make non-const. Reopen descriptor.
14696 (File_read::read): Make non-const.
14697 (File_read::make_view): Reopen descriptor.
14698 (File_read::do_readv): Likewise.
14699 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14700 Update declarations.
14701 * layout.cc: Include "descriptors.h".
14702 (Layout::create_build_id): Use open_descriptor rather than open.
14703 * output.cc: Include "descriptors.h".
14704 (Output_file::open): Use open_descriptor rather than open.
14705 * archive.cc (Archive::const_iterator): Change Archive to be
14706 non-const.
14707 (Archive::begin, Archive::end): Make non-const.
14708 (Archive::count_members): Likewise.
14709 * archive.h (class Archive): Update declarations.
14710 * object.h (Object::read): Make non-const.
14711 * Makefile.am (CCFILES): Add descriptors.cc.
14712 (HFILES): Add descriptors.h.
14713 * Makefile.in: Rebuild.
14714
801647d1
ILT
14715 PR 6716
14716 * gold.h: Always include <clocale>. Add Solaris workarounds
14717 following code in binutils/sysdep.h.
14718
5edd166e
ILT
14719 PR 6048
14720 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14721 this->eh_frame_hdr_ is NULL before using it.
14722
c89ad728
ILT
14723 * dynobj.cc (Versions::Versions): Update comment.
14724
aa86f06b
ILT
14725 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14726 the base version name.
14727
5778530e
ILT
14728 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14729 array size plus one.
14730 (Stringpool_template::set_string_offsets): Subtract one from key
14731 before using it as an array index.
14732 (Stringpool_template::get_offset_with_length): Likewise.
14733 (Stringpool_template::write_to_buffer): Likewise.
14734 * stringpool.h (Stringpool_template::get_offset_from_key):
14735 Likewise.
14736
057ead22
ILT
147372008-07-23 Ian Lance Taylor <iant@google.com>
14738
7f649c59
ILT
14739 PR 6658
14740 * object.h (Merged_symbol_value::value): Do our best to handle a
14741 negative addend.
14742
057ead22
ILT
14743 PR 6647
14744 * script.cc (Version_script_info::get_versions): Don't add empty
14745 version tag to return value.
14746 (Version_script_info::get_symbol_version_helper): Change return
14747 type to bool. Add pversion parameter. Change all callers.
14748 (script_register_vers_node): Don't require a non-NULL tag.
14749 * script.h (class Version_script_info): Update declarations.
14750 (Version_script_info::get_symbol_version): Change return type to
14751 bool. Add version parameter. Change all callers.
14752 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14753 handling. Handle an empty version from a version script.
14754 (Symbol_table::define_special_symbol): Likewise.
14755 * testsuite/ver_test_10.script: New file.
14756 * testsuite/ver_test_10.sh: New file.
14757 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14758 (check_DATA): Add ver_test_10.syms.
14759 (ver_test_10.syms, ver_test_10.so): New target.
14760 * testsuite/Makefile.in: Rebuild.
14761
58e54ac2
CD
147622008-07-23 Simon Baldwin <simonb@google.com>
14763
14764 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14765 to zero for undefined symbols from dynamic libraries.
14766
95d14cd3
ILT
147672008-07-23 Ian Lance Taylor <iant@google.com>
14768
14769 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14770 Change all callers.
14771 * symtab.h (class Symbol_table): Update declaration.
14772 * testsuite/ver_test_9.cc: New file.
14773 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14774 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14775 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14776 (ver_test_9.so, ver_test_9.o): New targets.
14777 * testsuite/Makefile.in: Rebuild.
14778
92de84a6
ILT
147792008-07-22 Ian Lance Taylor <iant@google.com>
14780
34810851
ILT
14781 * options.h (class General_options): Define --check-sections.
14782 * layout.cc (Layout::set_segment_offsets): Handle
14783 --check-sections.
14784
af6156ef
ILT
14785 * options.h (class General_options): Define -n/--nmagic and
14786 -N/--omagic.
14787 * options.cc (General_options::finalize): For -n/--nmagic or
14788 -N/--omagic, set -static.
14789 * layout.cc (Layout::attach_allocated_section_to_segment): If
14790 -N/--omagic, don't put read-only and read-write sections in
14791 different segments.
14792 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14793 finding a read-only segment.
14794 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14795 don't set the minimum segment alignment to the common page size,
14796 and don't set the file offset to the address modulo the page size.
14797 * script-sections.cc (Script_sections::create_segments): If
14798 -n/--omagic, don't put read-only and read-write sections in
14799 different segments.
14800
92de84a6
ILT
14801 * cref.cc: New file.
14802 * cref.h: New file.
14803 * options.h (class General_options): Add --print-symbol-counts.
14804 * main.cc (main): Issue defined symbol report if requested.
14805 * archive.cc (Archive::interpret_header): Make into a const member
14806 function.
14807 (Archive::add_symbols): Call Input_objects::archive_start and
14808 archive_stop.
14809 (Archive::const_iterator): Define new class.
14810 (Archive::begin, Archive::end): New functions.
14811 (Archive::include_all_members): Rewrite to use iterator.
14812 (Archive::count_members): New function.
14813 * archive.h (class Archive): Update declarations.
14814 (Archive::filename): New function.
14815 * object.cc: Include "cref.h".
14816 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14817 (Sized_relobj::do_get_global_symbol_counts): New function.
14818 (Input_objects::add_object): Add object to cross-referencer.
14819 (Input_objects::archive_start): New function.
14820 (Input_objects::archive_stop): New function.
14821 (Input_objects::print_symbol_counts): New function.
14822 * object.h: Declare Cref and Archive.
14823 (Object::get_global_symbol_counts): New function.
14824 (Object::do_get_global_symbol_counts): New pure virtual function.
14825 (class Sized_relobj): Add defined_count_ field. Update
14826 declarations.
14827 (class Input_objects): Add cref_ field. Update constructor.
14828 Update declarations.
14829 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14830 defined_count_.
14831 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14832 symbol counts.
14833 (Sized_dynobj::do_get_global_symbol_counts): New function.
14834 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14835 defined_count_. Update declarations. Define Symbols typedef.
14836 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14837 parameter. Change all callers.
14838 (Symbol_table::add_from_dynobj): Add sympointers and defined
14839 parameters. Change all callers.
14840 * symtab.h (class Symbol_table): Update declarations.
14841 * Makefile.am (CCFILES): Add cref.cc.
14842 (HFILES): Add cref.h.
14843 * Makefile.in: Rebuild.
14844
3f7c5e1d
CD
148452008-07-22 Simon Baldwin <simonb@google.com>
14846
14847 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14848 to zero when writing undefined symbols.
14849
e0b64032
ILT
148502008-07-22 Ian Lance Taylor <iant@google.com>
14851
14852 * output.cc (Output_section::add_input_section): Don't try to
14853 merge empty merge sections.
14854
096b02cf
CS
148552008-07-21 Craig Silverstein <csilvers@google.com>
14856
14857 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14858 Include symbol version in error message.
cd536b21 14859
1d1f116d
CD
148602008-07-20 Chris Demetriou <cgd@google.com>
14861
cd536b21 14862 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
14863 (RANDOM_SEED_CFLAGS): New substituted variable.
14864 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14865 * configure: Rebuild.
14866 * Makefile.in: Likewise.
14867 * testsuite/Makefile.in: Likewise.
14868
a18f591e
ILT
148692008-07-18 Ian Lance Taylor <iant@google.com>
14870
14871 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14872 where we see NAME/NULL and NAME/VERSION as separate symbols.
14873 * testsuite/ver_test_main.cc (main): Call t4.
14874 (t4, t4_2a): Define.
14875 * testsuite/ver_test_2.cc (t4_2): Define.
14876 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14877 * testsuite/ver_test_4.cc (t4_2a): Define.
14878 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14879 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14880
c6e3f6ed
ILT
148812008-07-17 Ian Lance Taylor <iant@google.com>
14882
14883 * dynobj.cc (Versions::add_def): If we give an error about a
14884 missing version, go ahead and create the version anyhow.
14885
ef9beddf
ILT
148862008-07-10 Ian Lance Taylor <iant@google.com>
14887
14888 Handle output sections with more than 0x7fffffff bytes.
14889 * object.h (class Relobj): Change map_to_output_ to
14890 output_sections_, and just keep a section pointer. Change all
14891 uses. Move comdat group support to Sized_relobj.
14892 (Relobj::is_section_specially_mapped): Remove.
14893 (Relobj::output_section): Remove poff parameter. Change all
14894 callers.
14895 (Relobj::output_section_offset): New function.
14896 (Relobj::set_section_offset): Rewrite.
14897 (Relobj::map_to_output): Remove.
14898 (Relobj::output_sections): New function.
14899 (Relobj::do_output_section_offset): New pure virtual function.
14900 (Relobj::do_set_section_offset): Likewise.
14901 (class Sized_relobj): Add section_offsets_ field. Add comdat
14902 group support from Relobj. Update declarations.
14903 (Sized_relobj::get_output_section_offset): New function.
14904 (Sized_relobj::do_output_section_offset): New function.
14905 (Sized_relobj::do_set_section_offset): New function.
14906 * object.cc (Relobj::output_section_address): Remove.
14907 (Sized_relobj::Sized_relobj): Initialize new fields.
14908 (Sized_relobj::include_section_group): Cast find_kept_object to
14909 Sized_relobj.
14910 (Sized_relobj::include_linkonce_section): Likewise.
14911 (Sized_relobj::do_layout): Use separate arrays for output section
14912 and output offset.
14913 (Sized_relobj::do_count_local_symbols): Change map_to_output to
14914 output_sections.
14915 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
14916 output_sections and section_offsets.
14917 (Sized_relobj::write_local_symbols): Likewise.
14918 (map_to_kept_section): Compute output address directly.
14919 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
14920 output_sections and section_offsets.
14921 (Sized_relobj::write_sections): Likewise.
14922 (Sized_relobj::relocate_sections): Likewise.
14923 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
14924 * output.h (class Output_reloc): Update declarations. Change
14925 u2_.relobj to Sized_relobj*.
14926 (class Output_data_reloc): Change add functions to use
14927 Sized_relobj*.
14928 * output.cc (Output_reloc::Output_reloc): Change relobj to
14929 Sized_relobj*.
14930 (Output_reloc::local_section_offset): Change return type to
14931 Elf_Addr. Use get_output_section_offset.
14932 (Output_reloc::get_address): Likewise.
14933 (Output_section::is_input_address_mapped): Don't call
14934 is_section_specially_mapped.
14935 (Output_section::output_offset): Likewise.
14936 (Output_section::output_address): Likewise.
14937 (Output_section::starting_output_address): Likewise.
14938 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
14939 parameter to Sized_relobj*.
14940 (Copy_relocs::need_copy_reloc): Likewise.
14941 (Copy_relocs::save): Likewise.
14942 * copy-relocs.h (class Copy_relocs): Update declarations.
14943 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
14944 Sized_relobj*. Change relobj_ field to Sized_relobj*.
14945 * target-reloc.h (relocate_for_relocatable): Change
14946 offset_in_output_section type to Elf_Addr. Change code that uses
14947 it as well.
14948 * layout.cc (Layout::layout): Always set *off.
14949 * mapfile.cc (Mapfile::print_input_section): Use
14950 output_section_offset.
14951 * i386.cc (Target_i386::copy_reloc): Change object parameter to
14952 Sized_relobj*.
14953 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
14954 * sparc.cc (Target_sparc::copy_reloc): Likewise.
14955 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
14956
5cb66f97
ILT
149572008-07-03 Ian Lance Taylor <iant@google.com>
14958
14959 * layout.cc (Layout::include_section): Do not discard unrecognized
14960 SHT_STRTAB sections.
14961
afe47622
CS
149622008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
14963
14964 * script.cc (Lex::can_continue_name): Make '?' allowable in
14965 version-script names.
14966 * testsuite/version_script.map: Change glob pattern to use '?'
14967
5adf9721
ILT
149682008-06-30 Manish Singh <yosh@gimp.org>
14969
14970 PR 6585
14971 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
14972 Correct typo.
14973
e6fde208
ILT
149742008-06-30 Ian Lance Taylor <iant@google.com>
14975
14976 PR 6660
14977 PR 6682
14978 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
14979 versions]: Don't try to read the value in the contents, since we
14980 don't use it. Use the template endianness when writing.
14981
3f2e6a2d
CC
149822008-06-25 Cary Coutant <ccoutant@google.com>
14983
14984 * fileread.cc (File_read::make_view): Assert on zero-length view.
14985 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
14986 symbol table when there are no symbols to read.
14987
c43d3a48
CS
149882008-06-23 Craig Silverstein <csilvers@google.com>
14989
14990 * version.cc (version_string): Bump to 1.7
14991
5f494ea0
CS
149922008-06-18 Craig Silverstein <csilvers@google.com>
14993
14994 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
14995 constant 0xFFFF to type Valtype.
14996 (Powerpc_relocate_functions::rel16_ha): Likewise.
14997
c42e122e
ILT
149982008-06-17 Ian Lance Taylor <iant@google.com>
14999
f34787f8
ILT
15000 * output.h (Output_section::Input_section): Initialize p2align_ to
15001 zero for Output_section_data constructors.
15002 (Output_section::Input_section::addralign): If not an input
15003 section, return the alignment of the Output_section_data.
15004 * testsuite/copy_test.cc: New file.
15005 * testsuite/copy_test_1.cc: New file.
15006 * testsuite/copy_test_2.cc: New file.
15007 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15008 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15009 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15010 (copy_test_1_pic.o, copy_test_1.so): New targets.
15011 (copy_test_2_pic.o, copy_test_2.so): New targets.
15012 * testsuite/Makefile.in: Rebuild.
15013
c42e122e
ILT
15014 * script-sections.cc (Script_sections::place_orphan): Initialize
15015 local variable exact.
15016
ce3ac18a
DE
150172008-06-13 David Edelsohn <edelsohn@gnu.org>
15018
15019 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15020
42cacb20
DE
150212008-06-12 David Edelsohn <edelsohn@gnu.org>
15022 David S. Miller <davem@davemloft.net>
15023
15024 * powerpc.cc: New file.
15025 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15026 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15027 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15028 * Makefile.in: Rebuild.
15029
7b308235
ILT
150302008-06-09 Ian Lance Taylor <iant@google.com>
15031
15032 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15033 <exception>.
15034 (throwing, orig_terminate): New static variables.
15035 (terminate_handler): New static function.
15036 (t2): Set terminate handler.
15037
f0b886e3
ILT
150382008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15039
15040 PR 6584
cd536b21 15041 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
15042 alignment.
15043
3e90f135
CC
150442008-05-30 Cary Coutant <ccoutant@google.com>
15045
15046 * archive.cc (Archive::include_all_members) Correct to step
15047 over symbol table and extended name table in thin archives.
15048
e09ad04a
ILT
150492008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15050
15051 PR 6407
15052 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15053 calculation.
15054
62b01cb5
ILT
150552008-05-28 Caleb Howe <cshowe@google.com>
15056
15057 * reduced_debug_output.cc: New file.
15058 * reduced_debug_output.h: New file.
92de84a6 15059 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
15060 * options.cc (General_options::finalize): Add strip_debug_non_line
15061 to the strip heirarchy.
15062 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15063 fields.
15064 * layout.cc: Include "reduced_debug_output.h".
15065 (Layout::Layout): Initialize new fields.
15066 (line_only_debug_sections): New static array.
15067 (is_lines_only_debug_sections): New static inline function.
15068 (Layout::include_section): Handle --strip-debug-non-line.
15069 (Layout::make_output_section): If --strip-debug-non-line, build
15070 new output sections for .debug_abbrev and .debug_info.
15071 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15072 gold. Warn about possible overflow.
15073 (read_signed_LEB_128): Likewise.
15074 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15075 (read_signed_LEB_128): Declare.
15076 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15077 (HFILES): Add reduced_debug_output.h.
15078 * Makefile.in: Rebuild.
15079
7d9e3d98
ILT
150802008-05-21 Ian Lance Taylor <iant@google.com>
15081
15082 * mapfile.cc: New file.
15083 * mapfile.h: New file.
15084 * options.h (class General_options): Add -M/--print-map and -Map.
15085 * options.cc (General_options::finalize): Make -M equivalent to
15086 -Map -.
15087 * main.cc: Include <cstdio> and "mapfile.h".
15088 (main): Open mapfile if requested.
15089 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15090 constructor. Change caller.
15091 (queue_initial_tasks): Add mapfile parameter. Change caller.
15092 (queue_middle_tasks): Likewise.
15093 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15094 declarations.
15095 * archive.cc: Include "mapfile.h".
15096 (Archive::add_symbols): Add mapfile parameter. Change all
15097 callers. Pass mapfile, symbol, and reason to include_member.
15098 (Archive::include_all_members): Add mapfile parameter. Change all
15099 callers.
15100 (Archive::include_member): Add mapfile, sym, and why parameters.
15101 Change all callers. Report inclusion to map file.
15102 * archive.h: Include "fileread.h".
15103 (class Archive): Update declarations.
15104 (Archive::file): New const method.
15105 (class Add_archive_symbols): Add mapfile_ field. Update
15106 constructor. Change all callers.
15107 * readsyms.h (class Read_symbols): Likewise.
15108 (class Finish_group): Likewise.
15109 (class Read_script): Likewise.
15110 * common.cc: Include "mapfile.h".
15111 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15112 all callers.
15113 (Symbol_table::do_allocate_commons): Likewise.
15114 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15115 symbol allocation to mapfile.
15116 * common.h (class Allocate_commons_task): Add mapfile_ field.
15117 Update constructor. Change all callers.
15118 * symtab.h (class Symbol_table): Update declarations.
15119 * layout.cc: Include "mapfile.h".
15120 (Layout_task_runner::run): Print information to mapfile.
15121 (Layout::create_gold_note): Change Output_data_fixed_space to
15122 Output_data_zero_fill.
15123 (Layout::create_build_id): Likewise.
15124 (Layout::print_to_mapfile): New function.
15125 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15126 constructor. Change caller.
15127 (class Layout): Declare print_to_mapfile.
15128 * output.cc (Output_section::Input_section::print_to_mapfile): New
15129 function.
15130 (Output_section::add_input_section): If producing a map, always
15131 add to input_sections_ list.
15132 (Output_section::do_print_to_mapfile): New function.
15133 (Output_segment::print_sections_to_mapfile): New function.
15134 (Output_segment::print_section_list_to_mapfile): New function.
15135 * output.h: Include "mapfile.h".
15136 (Output_data::print_to_mapfile): New function.
15137 (Output_data::do_print_to_mapfile): New virtual function.
15138 (Output_segment_headers::do_print_to_mapfile): New function.
15139 (Output_file_header::do_print_to_mapfile): New function.
15140 (Output_data_const::do_print_to_mapfile): New function.
15141 (class Output_data_const_buffer): Add map_name_ field. Update
15142 constructor. Change all callers. Add do_print_to_mapfile
15143 function.
15144 (class Output_data_fixed_space): Likewise.
15145 (class Output_data_space): Likewise.
15146 (class Output_data_zero_fill): New class.
15147 (Output_data_strtab::do_print_to_mapfile): New function.
15148 (Output_data_reloc_base::do_print_to_mapfile): New function.
15149 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15150 (Output_data_group::do_print_to_mapfile): New function.
15151 (Output_data_got::do_print_to_mapfile): New function.
15152 (Output_data_dynamic::do_print_to_mapfile): New function.
15153 (Output_symtab_xindex::do_print_to_mapfile): New function.
15154 (class Output_section): Declare do_print_to_mapflie. Declare
15155 print_to_mapfile in Input_section.
15156 (class Output_segment): Declare new functions.
15157 * object.h (Sized_relobj::symbol_count): New function.
15158 * script-sections.cc
15159 (Output_section_element_dot_assignment::set_section_addresses):
15160 Change Output_data_fixed_space to Output_data_zero_fill.
15161 (Output_data_expression::do_print_to_mapfile): New function.
15162 * script.cc (read_input_script): Add mapfile parameter. Change
15163 all callers.
15164 * script.h (read_input_script): Update declaration.
15165 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15166 (Eh_frame::do_print_to_mapfile): New function.
15167 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15168 (Output_merge_string::do_print_to_mapfile): New function.
15169 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15170 function.
15171 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15172 function.
15173 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15174 function.
15175 * Makefile.am (CCFILES): Add mapfile.cc.
15176 (HFILES): Add mapfile.h.
15177 * Makefile.in: Rebuild.
15178
9f1d377b
ILT
151792008-05-19 Ian Lance Taylor <iant@google.com>
15180
15181 * options.h (class General_options): Add -z relro.
15182 * layout.cc (Layout::Layout): Initialize relro_segment_.
15183 (Layout::add_output_section_data): Return the output section.
15184 (Layout::make_output_section): Rcognize relro sections and mark
15185 them appropriately.
15186 (Layout::attach_allocated_section_to_segment): Put relro sections
15187 in a PT_GNU_RELRO segment.
15188 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15189 section as relro.
15190 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15191 PT_TLS segments.
15192 (Layout::linkonce_mapping): Map d.rel.ro.local to
15193 .data.rel.ro.local.
15194 (Layout::output_section_name): Us .data.rel.ro.local for any
15195 section which begins with that.
15196 * layout.h (class Layout): Update add_output_section_data
15197 declaration. Add relro_segment_ field.
15198 * output.cc (Output_section::Output_section): Initialize is_relro_
15199 and is_relro_local_ fields.
15200 (Output_segment::add_output_section): Group relro sections.
15201 (Output_segment::is_first_section_relro): New function.
15202 (Output_segment::maximum_alignment): If there is a relro section,
15203 align the segment to the common page size.
15204 (Output_segment::set_section_addresses): Track whether we are
15205 looking at relro sections. If the last section is a relro
15206 section, align to the common page size.
15207 (Output_segment::set_section_list_addresses): Add in_relro
15208 parameter. Change all callers. Align to the page size when
15209 moving from relro to non-relro section.
15210 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15211 segment.
15212 * output.h (class Output_section): Add is_relro_ and
15213 is_relro_local_ fields.
15214 (Output_section::is_relro): New function.
15215 (Output_section::set_is_relro): New function.
15216 (Output_section::is_relro_local): New function.
15217 (Output_section::set_is_relro_local): New function.
15218 (class Output_segment): Update declarations.
15219 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15220 * sparc.cc (Target_sparc::got_section): Likewise.
15221 * x86_64.cc (Target_x86_64::got_section): Likewise.
15222 * testsuite/relro_test_main.cc: New file.
15223 * testsuite/relro_test.cc: New file.
15224 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15225 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15226 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15227 (relro_test.so, relro_test_pic.o): New targets.
15228 * testsuite/Makefile.in: Rebuild.
15229
a984ee1d
ILT
152302008-05-16 Ian Lance Taylor <iant@google.com>
15231
01676dcd
ILT
15232 * output.cc (Output_segment::add_output_section): Remove front
15233 parameter.
15234 * output.h (class Output_segment): Remove
15235 add_initial_output_section and overloaded add_output_section.
15236 Update declaration of remaining add_output_section.
15237 * layout.cc (Layout::create_interp): Call add_output_section
15238 rather than add_initial_output_section.
15239 (Layout::finish_dynamic_section): Likewise.
15240
497897f9
ILT
15241 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15242 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15243 know the dynamic type.
15244 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15245 field. Initialize it in constructor.
15246 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15247 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15248 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15249 reloc.
15250
a984ee1d
ILT
15251 * output.cc (Output_reloc::get_address): Change return type to
15252 Elf_Addr.
15253 * output.h (class Output_reloc): Update get_address declaration.
15254 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15255 for section addresses.
15256
55ba0940
ILT
152572008-05-09 Ian Lance Taylor <iant@google.com>
15258
15259 PR 6493
15260 * gold.cc (gold_nomem): Use return value of write.
15261
75517b77
ILT
152622008-05-08 Ian Lance Taylor <iant@google.com>
15263
15264 * symtab.c (Symbol::init_base_output_data): Add version
15265 parameter. Change all callers.
15266 (Symbol::init_base_output_segment): Likewise.
15267 (Symbol::init_base_constant): Likewise.
15268 (Symbol::init_base_undefined): Likewise.
15269 (Sized_symbol::init_output_data): Likewise.
15270 (Sized_symbol::init_output_segment): Likewise.
15271 (Sized_symbol::init_constant): Likewise.
15272 (Sized_symbol::init_undefined): Likewise.
15273 (Symbol_table::do_define_in_output_data): If the new symbol has a
15274 version, mark it as the default.
15275 (Symbol_table::do_define_in_output_segment): Likewise.
15276 (Symbol_table::do_define_as_constant): Likewise.
15277 * symtab.h (class Symbol): Update declarations.
15278 (class Sized_symbol): Likewise.
15279 * resolve.cc (Symbol::override_version): New function.
c42e122e 15280 (Symbol::override_base): Call override_version.
75517b77
ILT
15281 (Symbol::override_base_with_special): Likewise.
15282 * testsuite/ver_script_8.script: New file.
15283 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15284 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15285 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15286 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15287
f1f70eae
ILT
152882008-05-06 Ian Lance Taylor <iant@google.com>
15289
f3e9c5c5
ILT
15290 PR 6049
15291 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15292 functions.
15293 (class General_options): Remove existing --undefined, and add
15294 --no-undefined instead. Add new --undefined as synonym for -u.
15295 * archive.cc (Archive::add_symbols): Check whether symbol was
15296 named with -u.
15297 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15298 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15299 all uses. Add IS_UNDEFINED. Update declarations to split
15300 different versions of init_base. Declare init_base_undefined.
15301 (Symbol::is_defined): Handle IS_UNDEFINED.
15302 (Symbol::is_undefined): Likewise.
15303 (Symbol::is_weak_undefined): Call is_undefined.
15304 (Symbol::is_absolute): Handle IS_CONSTANT.
15305 (class Sized_symbol): Update declarations to split different
15306 versions of init. Declare init_undefined.
15307 (class Symbol_table): Declare new functions.
15308 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15309 Change all callers.
15310 (Symbol::init_base_output_data): Likewise.
15311 (Symbol::init_base_output_segment): Likewise.
15312 (Symbol::init_base_constant): Likewise.
15313 (Symbol::init_base_undefined): New function.
15314 (Sized_symbol::init_object): Rename from init. Change all
15315 callers.
15316 (Sized_symbol::init_output_data): Likewise.
15317 (Sized_symbol::init_output_segment): Likewise.
15318 (Sized_symbol::init_constant): Likewise.
15319 (Sized_symbol::init_undefined): New function.
15320 (Symbol_table::add_undefined_symbols_from_command_line): New
15321 function.
15322 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15323 function.
15324 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15325 (Symbol::output_section): Likewise.
15326 (Symbol::set_output_section): Likewise.
15327 (Symbol_table::sized_finalize_symbol): Likewise.
15328 (Symbol_table::sized_write_globals): Likewise.
15329 * resolve.cc (Symbol_table::should_override): Likewise.
15330 (Symbol::override_base_with_special): Likewise.
15331
8bdcdf2c
ILT
15332 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15333 symbol, change it to have default visibility.
15334 * testsuite/protected_1.cc: New file.
15335 * testsuite/protected_2.cc: New file.
15336 * testsuite/protected_3.cc: New file.
15337 * testsuite/protected_main_1.cc: New file.
15338 * testsuite/protected_main_2.cc: New file.
15339 * testsuite/protected_main_3.cc: New file.
15340 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15341 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15342 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15343 (protected_1.so): New target.
15344 (protected_1_pic.o, protected_2_pic.o): New targets.
15345 (protected_3_pic.o): New target.
15346 (check_PROGRAMS): Add protected_2.
15347 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15348 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15349 * testsuite/Makefile.in: Rebuild.
15350
2b706932
ILT
15351 * options.h (DEFINE_var): Add set_user_set_##varname__.
15352 (DEFINE_bool_alias): New macro.
15353 (class General_options): Define -Bstatic using DEFINE_bool_alias
15354 rather than DEFINE_special. Add --undefined as an alias for -z
15355 defs.
15356 * options.cc (General_options::parse_Bstatic): Remove.
15357
d82a5bcc
ILT
15358 * options.h (class General_options): Add --fatal-warnings.
15359 * main.cc (main): Implement --fatal-warnings.
15360 * errors.h (Errors::warning_count): New function.
15361
f1f70eae
ILT
15362 * options.h (class General_options): Add -Bsymbolic-functions.
15363 * symtab.h (Symbol::is_preemptible): Check for
15364 -Bsymbolic-functions.
15365
8825ac63
ILT
153662008-05-05 Ian Lance Taylor <iant@google.com>
15367
d98bc257
ILT
15368 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15369 as noVARNAME rather than no-VARNAME.
15370 (class General_options): Add option -z combreloc.
15371 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15372 get_address.
15373 (Output_reloc::sort_before) [SHT_REL]: New function.
15374 (Output_reloc::sort_before) [SHT_RELA]: New function.
15375 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15376 Sort_relocs_comparison.
15377 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15378 parameter. Change all callers.
15379 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15380 sort_relocs parameter. Change all callers.
15381 * output.cc (Output_reloc::get_address): New function, broken out
15382 of write_rel.
15383 (Output_reloc::write_rel): Call it.
15384 (Output_reloc::compare): New function.
15385 (Output_data_reloc_base::do_write): Optionally sort relocs.
15386
60b2b4e7
ILT
15387 * configure.ac: If targ_extra_obj is set, link it in.
15388 * configure.tgt: Initialize all variables.
15389 (x86_64*): Set targ_extra_obj and targ_extra_size.
15390 * configure: Rebuild.
15391
8825ac63
ILT
15392 * object.cc (Sized_relobj::include_section_group): Adjust section
15393 indexes read from group data. Build vector to pass to
15394 layout_group.
15395 * layout.cc (Layout::layout_group): Add flags and shndxes
15396 parameters. Remove contents parameter. Change caller. Update
15397 explicit instantiations.
15398 * layout.h (class Layout): Update layout_group declaration.
15399 * output.cc (Output_data_group::Output_data_group): Add flags and
15400 input_shndxes parameters. Remove contents parameter. Change
15401 caller.
15402 (Output_data_group::do_write): Change input_sections_ to
15403 input_shndxes_.
15404 * output.h (class Output_data_group): Update constructor
15405 declaration. Rename input_sections_ to input_shndxes_.
15406 * testsuite/many_sections_test.cc: Add template.
15407
e94cf127
CC
154082008-04-30 Cary Coutant <ccoutant@google.com>
15409
4418b2d5
CC
15410 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15411
e94cf127
CC
15412 * layout.cc (Layout::include_section): Refactored check for debug
15413 info section.
15414 (Layout::add_comdat): Add new parameters. Change type
15415 of signature parameter. Add object and shndx to signatures table.
15416 (Layout::find_kept_object): New function.
15417 * layout.h: Include <cstring>.
15418 (Layout::is_debug_info_section): New function.
15419 (Layout::add_comdat): Add new parameters.
15420 (Layout::find_kept_object): New function.
15421 (Layout::Kept_section): New struct.
15422 (Layout::Signatures): Change type of map range.
15423 * object.cc (Relobj::output_section_address): New function.
15424 (Sized_relobj::include_section_group): Add new parameters. Change
15425 calls to Layout::add_comdat. Change to build table of kept comdat
15426 groups and table mapping discarded sections to kept sections.
15427 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15428 (Sized_relobj::do_layout): Change calls to include_section_group and
15429 include_linkonce_section.
15430 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15431 value to zero when section is discarded.
15432 (Sized_relobj::map_to_kept_section): New function.
15433 * object.h (Relobj::output_section_address): New function.
15434 (Relobj::Comdat_group): New type.
15435 (Relobj::find_comdat_group): New function.
15436 (Relobj::Comdat_group_table): New type.
15437 (Relobj::Kept_comdat_section): New type.
15438 (Relobj::Kept_comdat_section_table): New type.
15439 (Relobj::add_comdat_group): New function.
15440 (Relobj::set_kept_comdat_section): New function.
15441 (Relobj::get_kept_comdat_section): New function.
15442 (Relobj::comdat_groups_): New field.
15443 (Relobj::kept_comdat_sections_): New field.
15444 (Symbol_value::input_value): Update comment.
15445 (Sized_relobj::map_to_kept_section) New function.
15446 (Sized_relobj::include_linkonce_section): Add new parameter.
15447 * target-reloc.h (Comdat_behavior): New type.
15448 (get_comdat_behavior): New function.
15449 (relocate_section): Add code to map a discarded section to the
15450 corresponding kept section when applying a relocation.
15451
e4e5049b
CS
154522008-04-30 Craig Silverstein <csilvers@google.com>
15453
15454 * dwarf_reader.cc (next_generation_count): New static var.
15455 (Addr2line_cache_entry): New struct.
15456 (addr2line_cache): New static var.
15457 (Dwarf_line_info::one_addr2line): Added caching.
15458 (Dwarf_line_info::clear_addr2line_cache): New function.
15459 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15460 cache-size parameter.
15461 (Dwarf_line_info::one_addr2line_cache): New function.
15462 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15463 new cache-size argument to one_addr2line(), and clear cache.
15464
d09e9154
CC
154652008-04-28 Cary Coutant <ccoutant@google.com>
15466
15467 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15468 R_386_PC8 relocations.
15469
7ef73768
ILT
154702008-04-23 Ian Lance Taylor <iant@google.com>
15471
55438702
ILT
15472 * object.cc (Sized_relobj::include_section_group): Check for
15473 invalid section group.
15474
c165fb93
ILT
15475 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15476 header size.
15477
7ef73768
ILT
15478 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15479 than read for file header.
15480 * archive.cc (Archive::include_member): Likewise.
15481
6194aaab
L
154822008-04-23 Paolo Bonzini <bonzini@gnu.org>
15483
15484 * aclocal.m4: Regenerate.
15485 * configure: Regenerate.
15486
d491d34e
ILT
154872008-04-19 Ian Lance Taylor <iant@google.com>
15488
5ea2bac6
ILT
15489 * version.cc (version_string): Bump to 1.6.
15490
7bc3e21a
ILT
15491 * testsuite/Makefile.am (many_sections_r_test): New target.
15492 (many_sections_r_test_SOURCES): Remove.
15493 (many_sections_r_test_DEPENDENCIES): Remove.
15494 (many_sections_r_test_LDFLAGS): Remove.
15495 (many_sections_r_test_LDADD): Remove.
15496
7fcd3aa9
ILT
15497 * object.cc (Sized_relobj::do_add_symbols): Always pass
15498 local_symbol_count_ to add_from_relobj.
15499
4c94d6ae
ILT
15500 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15501 every thousand variables.
15502 * testsuite/Makefile.in: Rebuild.
15503
d491d34e
ILT
15504 * object.cc (Xindex::initialize_symtab_xindex): New function.
15505 (Xindex::read_symtab_xindex): New function.
15506 (Xindex::sym_xindex_to_shndx): New function.
15507 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15508 available.
15509 (Sized_relobj::do_initialize_xindex): New function.
15510 (Sized_relobj::do_read_symbols): Adjust section links.
15511 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15512 parameter. Change all callers.
15513 (Sized_relobj::include_section_group): Adjust section links and
15514 symbol section indexes.
15515 (Sized_relobj::do_layout): Adjust section links.
15516 (Sized_relobj::do_count_local_symbols): Adjust section links and
15517 symbol section indexes.
15518 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15519 ordinary and special symbols.
15520 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15521 dynsym_xindex parameters. Change all callers. Adjust section
15522 links. Use SHN_XINDEX when needed.
15523 (Sized_relobj::get_symbol_location_info): Adjust section links.
15524 Don't get fooled by special symbols.
15525 * object.h (class Xindex): Define.
15526 (class Object): Add xindex_ parameter. Declare virtual functoin
15527 do_initialize_xindex.
15528 (Object::adjust_sym_shndx): New function.
15529 (Object::set_xindex): New protected function.
15530 (class Symbol_value): Add is_ordinary_shndx_ field.
15531 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15532 (Symbol_value::value): Assert ordinary section.
15533 (Symbol_value::initialize_input_to_output_map): Likewise.
15534 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15535 Change all callers.
15536 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15537 all callers.
15538 (class Sized_relobj): Update declarations.
15539 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15540 parameter. Change all callers.
15541 (Sized_relobj::adjust_shndx): New function.
15542 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15543 field.
15544 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15545 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15546 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15547 (Sized_dynobj::read_dynsym_section): Adjust section links.
15548 (Sized_dynobj::read_dynamic): Likewise.
15549 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15550 section links.
15551 (Sized_dynobj::do_initialize_xindex): New function.
15552 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15553 do_initialize_xindex.
15554 (Sized_dynobj::adjust_shndx): New function.
15555 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15556 dynsym_xindex_ fields.
15557 (Layout::finalize): Add a call to set_section_indexes before
15558 creating the symtab sections.
15559 (Layout::set_section_indexes): Don't do anything if the section
15560 already has a section index.
15561 (Layout::create_symtab_sections): Add shnum parameter. Change
15562 caller. Create .symtab_shndx section if needed.
15563 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15564 caller.
15565 (Layout::allocated_output_section_count): New function.
15566 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15567 needed.
15568 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15569 fields. Update declarations.
15570 (Layout::symtab_xindex): New function.
15571 (Layout::dynsym_xindex): New function.
15572 (class Write_symbols_task): Add layout_ field.
15573 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15574 Change caller.
15575 * output.cc (Output_section_headers::Output_section_headers): Add
15576 shstrtab_section parameter. Change all callers.
15577 (Output_section_headers::do_sized_write): Store overflow values
15578 for section count and section string table section index in
15579 section header zero.
15580 (Output_file_header::do_sized_write): Check for overflow of
15581 section count and section string table section index.
15582 (Output_symtab_xindex::do_write): New function.
15583 (Output_symtab_xindex::endian_do_write): New function.
15584 * output.h (class Output_section_headers): Add shstrtab_section_.
15585 Update declarations.
15586 (class Output_symtab_xindex): Define.
15587 (Output_section::has_out_shndx): New function.
15588 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15589 field.
15590 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15591 Change all callers.
15592 (Sized_symbol::init): Likewise.
15593 (Symbol::output_section): Check for ordinary symbol.
15594 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15595 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15596 callers.
15597 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15598 Change all callers. Simplify handling of symbols from sections
15599 not included in the link.
15600 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15601 distinction.
15602 (Weak_alias_sorter::operator()): Assert that symbols are
15603 ordinary.
15604 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15605 distinction.
15606 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15607 parameters. Change all callers.
15608 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15609 symbol distinction. Use SHN_XINDEX when needed.
15610 (Symbol_table::write_section_symbol): Add symtab_xindex
15611 parameter. Change all callers.
15612 (Symbol_table::sized_write_section_symbol): Likewise. Use
15613 SHN_XINDEX when needed.
15614 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15615 declarations.
15616 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15617 (Symbol::is_defined): Check is_ordinary.
15618 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15619 (Symbol::is_absolute, Symbol::is_common): Likewise.
15620 (class Sized_symbol): Update declarations.
15621 (class Symbol_table): Update declarations.
15622 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15623 parameters. Change all callers.
15624 (Sized_symbol::override): Likewise.
15625 (Symbol_table::override): Likewise.
15626 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15627 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15628 is_ordinary, and orig_st_shndx parameters. Change all callers.
15629 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15630 to be in an ordinary section.
15631 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15632 object and is_ordinary parameters. Change all callers.
15633 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15634 Change all callers. Don't add undefined or non-ordinary symbols
15635 to reloc_map_.
15636 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15637 Change all callers.
15638 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15639 declarations.
15640 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15641 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15642 (Sized_relobj::relocate_sections): Likewise.
15643 * target-reloc.h (scan_relocs): Adjust section symbol index.
15644 (scan_relocatable_relocs): Likewise.
15645 * i386.cc (Scan::local): Check for ordinary symbols.
15646 * sparc.cc (Scan::local): Likewise.
15647 * x86_64.cc (Scan::local): Likewise.
15648 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15649 to symbol_section_and_value.
15650 * testsuite/many_sections_test.cc: New file.
15651 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15652 (check_PROGRAMS): Add many_sections_test.
15653 (many_sections_test_SOURCES): Define.
15654 (many_sections_test_DEPENDENCIES): Define.
15655 (many_sections_test_LDFLAGS): Define.
15656 (BUILT_SOURCES): Add many_sections_define.h.
15657 (many_sections_define.h): New target.
15658 (BUILT_SOURCES): Add many_sections_check.h.
15659 (many_sections_check.h): New target.
15660 (check_PROGRAMS): Add many_sections_r_test.
15661 (many_sections_r_test_SOURCES): Define.
15662 (many_sections_r_test_DEPENDENCIES): Define.
15663 (many_sections_r_test_LDFLAGS): Define.
15664 (many_sections_r_test_LDADD): Define.
15665 (many_sections_r_test.o): New target.
15666 * testsuite/Makefile.in: Rebuild.
15667
c5818ff1
CC
156682008-04-17 Cary Coutant <ccoutant@google.com>
15669
15670 * errors.cc (Errors::info): New function.
15671 (gold_info): New function.
15672 * errors.h (Errors::info): New function.
15673 * gold.h (gold_info): New function.
15674 * object.cc (Input_objects::add_object): Print trace output.
15675 * options.cc (options::parse_set): New function.
15676 (General_options::parse_wrap): Deleted.
15677 (General_options::General_options): Deleted initializer.
15678 * options.h (options::String_set): New typedef.
15679 (options::parse_set): New function.
15680 (DEFINE_set): New macro.
15681 (General_options::wrap): Changed to use DEFINE_set. Changed
15682 callers of any_wrap_symbols and is_wrap_symbol.
15683 (General_options::trace, General_options::trace_symbol):
15684 New options.
15685 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15686 (General_options::wrap_symbols_): Deleted.
15687 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15688
b5be4a7c
DM
156892008-04-17 David S. Miller <davem@davemloft.net>
15690
15691 * options.cc (General_options::parse_V): New function.
15692 * options.h: Add entries for -V and -Qy.
15693
155a0dd7
ILT
156942008-04-17 Ian Lance Taylor <iant@google.com>
15695
15696 * common.cc (Symbol_table::allocate_commons): Remove options
15697 parameter. Change caller.
15698 (Symbol_table::do_allocate_commons): Remove options parameter.
15699 Change caller. Just call do_allocate_commons_list twice.
15700 (Symbol_table::do_allocate_commons_list): New function, broken out
15701 of do_allocate_commons.
15702 * common.h (class Allocate_commons_task): Remove options_ field.
15703 Update constructor.
15704 * symtab.cc (Symbol_table::Symbol_table): Initialize
15705 tls_commons_.
15706 (Symbol_table::add_from_object): Put TLS common symbols on
15707 tls_commons_ list.
15708 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15709 which are IN_OUTPUT_DATA.
15710 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15711 allocate_commons and do_allocate_commons declarations. Declare
15712 do_allocate_commons_list.
15713 * gold.cc (queue_middle_tasks): Update creation of
15714 Allocate_commons_task to not pass options.
15715 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15716 (TLS_TEST_C_FLAGS): New variable.
15717 (tls_test_c_pic.o): New target.
15718 (tls_test_shared.so): Link in tls_test_c_pic.o.
15719 (tls_test_c_pic_ie.o): New target.
15720 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15721 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15722 (tls_test_c.o): New target.
15723 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15724 (tls_pic_test_LDADD): Likewise.
15725 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15726 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15727 (tls_test_c_gnu2.o): New target.
15728 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15729 tls_test_c_gnu2.o.
15730 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15731 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15732 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15733 * testsuite/tls_test.cc: Include "config.h".
15734 (t_last): Call t11_last.
15735 * testsuite/tls_test.h (t11, t11_last): Declare.
15736 * testsuite/tls_test_c.c: New file.
15737 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15738 * configure.ac: Check for OpenMP support.
15739 * configure, config.in, Makefile.in: Rebuild.
15740 * testsuite/Makefile.in: Rebuild.
15741
edfbb029
CC
157422008-04-16 Cary Coutant <ccoutant@google.com>
15743
15744 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15745 (Target_i386::tls_base_symbol_defined_): New field.
15746 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15747 (Target_i386::Scan::global): Likewise.
15748 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15749 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15750 (Target_x86_64::tls_base_symbol_defined_): New field.
15751 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15752 (Target_x86_64::Scan::global): Likewise.
15753
f3c69fca
CC
157542008-04-16 Cary Coutant <ccoutant@google.com>
15755
15756 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15757 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15758 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15759 building shared libraries.
15760 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15761 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15762 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15763 * testsuite/Makefile.in: Rebuild.
15764 * testsuite/weak_undef.h: New file.
15765 * testsuite/weak_undef_file1.cc: Add extra test cases.
15766 * testsuite/weak_undef_file2.cc: Likewise.
15767 * testsuite/weak_undef_test.cc: Likewise.
15768
7c414435
DM
157692008-04-16 David S. Miller <davem@davemloft.net>
15770
32b769e1
DM
15771 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15772 Add issued_non_pic_error_ field. Declare check_non_pic.
15773 (Target_sparc::Scan::check_non_pic): New function.
15774 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15775 (Target_sparc::Scan::global): Likewise.
15776
11936fb1
DM
15777 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15778 * configure: Rebuild.
15779
7c414435
DM
15780 * options.h (DEFINE_enable): New macro.
15781 (new_dtags): New enable option.
15782 (initfirst, interpose, loadfltr, nodefaultlib,
15783 nodelete, nodlopen, nodump): New -z options.
15784 * layout.cc (Layout:finish_dynamic_section): If new
15785 dtags enabled, emit DT_RUNPATH. Also, emit a
15786 DT_FLAGS_1 containing any specified -z flags.
15787
85c7bf8b
ILT
157882008-04-16 Ian Lance Taylor <iant@google.com>
15789
12c0daef
ILT
15790 * copy-relocs.cc: New file.
15791 * copy-relocs.h: New file.
15792 * reloc.cc: Remove Copy_relocs code.
15793 * reloc.h: Likewise.
15794 * reloc-types.h (struct Reloc_types) [both versions]: Add
15795 get_reloc_addend_noerror.
15796 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15797 variants of add_global which take an addend which must be zero.
15798 * i386.cc: Include "copy-relocs.h".
15799 (class Target_i386): Change type of copy_relocs_ to variable,
15800 update initializer.
15801 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15802 Change all callers.
15803 (Target_i386::do_finalize_sections): Change handling of
15804 copy_relocs_.
15805 * sparc.cc: Include "copy-relocs.h".
15806 (class Target_sparc): Change type of copy_relocs_ to variable,
15807 update initializer.
15808 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15809 Change all callers.
15810 (Target_sparc::do_finalize_sections): Change handling of
15811 copy_relocs_.
15812 * x86_64.cc: Include "copy-relocs.h".
15813 (class Target_x86_64): Change type of copy_relocs_ to variable,
15814 update initializer.
15815 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15816 class. Change all callers.
15817 (Target_x86_64::do_finalize_sections): Change handling of
15818 copy_relocs_.
15819 * Makefile.am (CCFILES): Add copy-relocs.cc.
15820 (HFILES): Add copy-relocs.h.
15821
4f4995b6
ILT
15822 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15823
85c7bf8b
ILT
15824 * testsuite/script_test_4.sh: Permit leading zeroes.
15825
4f2a9edd
ILT
158262008-04-15 Ian Lance Taylor <iant@google.com>
15827
e6188289
ILT
15828 * script-sections.cc (Script_sections::create_segments): Use
15829 header_size_adjustment even when there is enough room for the
15830 headers.
15831 * testsuite/script_test_4.sh: New file.
15832 * testsuite/script_test_4.t: New file.
15833 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15834 (check_DATA): Add script_test_4.stdout.
15835 (MOSTLYCLEANFILES): Likewise.
15836 (script_test_4): New target.
15837 (script_test_4.stdout): New target.
15838 * testsuite/Makefile.in: Rebuild.
15839
4f2a9edd
ILT
15840 * sparc.cc: Add definitions for Output_data_plt_sparc class
15841 constants.
15842
f5314dd5
DM
158432008-04-14 David S. Miller <davem@davemloft.net>
15844
15845 * sparc.cc: New file.
15846 * Makefile.am (TARGETSOURCES): Add sparc.cc
15847 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15848 * configure.tgt: Document targ_extra_size and
15849 targ_extra_big_endian. Add entries for sparc-* and
15850 sparc64-*.
15851 * configure.ac: Handle targ_extra_size and
15852 targ_extra_big_endian.
15853 * Makefile.in: Rebuild.
15854 * configure: Likewise.
15855 * po/POTFILES.in: Likewise.
15856 * po/gold.pot: Likewise.
15857
154e0e9a
ILT
158582008-04-14 Ian Lance Taylor <iant@google.com>
15859
15860 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15861 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15862 in the name/type/flags to section mapping. Don't call
15863 allocate_output_section.
15864 (Layout::choose_output_section): Change parameter from adjust_name
15865 to is_input_section. Don't permit input sections after sections
15866 are attached to segments. Don't call allocate_output_section.
15867 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15868 not write_enable_output_section.
15869 (Layout::make_output_section): Don't push to
15870 unattached_section_list_ nor call attach_to_segment. Call
15871 attach_section_to_segment if sections are attached.
15872 (Layout::attach_sections_to_segments): New function.
15873 (Layout::attach_section_to_segment): New function.
15874 (Layout::attach_allocated_section_to_segment): Rename from
15875 attach_to_segment. Remove flags parameter.
15876 (Layout::allocate_output_section): Remove function.
15877 (Layout::write_enable_output_section): Remove function.
15878 * layout.h (class Layout): Update for above changes. Add new
15879 field sections_are_attached_.
15880 * output.h (Output_section::update_flags_for_input_section): New
15881 function.
15882 * output.cc (Output_section::add_input_section): Call
15883 update_flags_for_input_section.
15884 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15885
009a67a2
CC
158862008-04-11 Cary Coutant <ccoutant@google.com>
15887
15888 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15889 thought unnecessary.
15890 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15891
759b1a24
ILT
158922008-04-11 Ian Lance Taylor <iant@google.com>
15893
15894 * output.h (class Output_section_data): Remove inline definition
15895 of set_addralign.
15896 * output.cc (Output_section_data::set_addralign): New function.
15897
c2b45e22
CC
158982008-04-11 Cary Coutant <ccoutant@google.com>
15899
15900 Add support for TLS descriptors for i386 and x86_64.
15901 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
15902 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
15903 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
15904 GOT_TYPE_TLS_DESC.
15905 (Target_i386::got_mod_index_entry): Remove unnecessary code.
15906 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
15907 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
15908 relocations.
15909 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
15910 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
15911 Fix problem with initial-exec relocations.
15912 (Target_i386::Relocate::relocate_tls): Likewise.
15913 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
15914 relaxation.
15915 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
15916 support for section-plus-offset dynamic table entries.
15917 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
15918 (Output_data_dynamic::Dynamic_entry): Add support for
15919 section-plus-offset dynamic table entries.
15920 (Output_data_dynamic::Classification): Likewise.
15921 (Output_data_dynamic::classification_): Renamed offset_.
15922 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
15923 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
15924 (Target_x86_64::make_plt_section): New function.
15925 (Target_x86_64::reserve_tlsdesc_entries): New function.
15926 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
15927 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
15928 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
15929 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
15930 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
15931 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
15932 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
15933 add extra PLT entry for TLS descriptors.
15934 (Output_data_plt_x86_64::got_): New field.
15935 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
15936 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
15937 fields.
15938 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
15939 descriptors.
15940 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
15941 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
15942 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
15943 R_386_TLS_DESC_CALL relocations.
15944 (Target_x86_64::Scan::global): Likewise.
15945 (Target_x86_64::do_finalize_sections): Add dynamic table entries
15946 for TLS descriptors.
15947 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
15948 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
15949 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
15950 GD-to-IE relaxation.
15951 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
15952 and TLS_DESCRIPTORS.
15953 * Makefile.in: Rebuild.
15954 * configure: Rebuild.
15955 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
15956 (tls_test_shared2.so): New target.
15957 (tls_shared_gd_to_ie_test_SOURCES): New variable.
15958 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
15959 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
15960 (tls_shared_gd_to_ie_test_LDADD): New variable.
15961 (tls_shared_gnu2_gd_to_ie_test): New target.
15962 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
15963 New targets.
15964 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
15965 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
15966 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
15967 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
15968 (tls_shared_gnu2_test): New target.
15969 (tls_test_gnu2_shared.so): New target.
15970 (tls_shared_gnu2_test_SOURCES): New variable.
15971 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
15972 (tls_shared_gnu2_test_LDFLAGS): New variable.
15973 (tls_shared_gnu2_test_LDADD): New variable.
15974 * testsuite/Makefile.in: Rebuild.
15975 * testsuite/Makefile.
15976
83bfb6b7
ILT
159772008-04-11 Ian Lance Taylor <iant@google.com>
15978
15979 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
15980 justsyms.t.
15981 * testsuite/Makefile.in: Rebuild.
15982
15983 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
15984 long.
15985 * testsuite/script_test_2.cc (main): Adjust test.
15986
706e1f5e
ILT
159872008-04-11 David S. Miller <davem@davemloft.net>
15988 Ian Lance Taylor <iant@google.com>
15989
15990 * options.h (General_options): Add entries for '-Y' and
15991 '-relax'.
15992 * options.cc (General_options:finalize): If -Y was used, add those
15993 entries to the library path instead of the default "/lib" and
15994 "/usr/lib".
15995
7c98e6bb
DM
159962008-04-11 David S. Miller <davem@davemloft.net>
15997
15998 * testsuite/justsyms.t: Start at 0x100.
15999 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
16000 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16001 long.
16002 * testsuite/script_test_2.cc: Adjust string and section length
16003 checks.
7c98e6bb 16004
99a37bfd
ILT
160052008-04-09 Ian Lance Taylor <iant@google.com>
16006
2cefc357
ILT
16007 PR gold/5996
16008 * script-sections.cc (Sections_element::allocate_to_segment): Add
16009 orphan parameter.
16010 (Output_section_definition::allocate_to_segment): Likewise.
16011 (Orphan_output_section::allocate_to_segment): Likewise.
16012 (Script_sections::attach_sections_using_phdrs_clause): Don't
16013 propagate non-PT_LOAD segments to orphan sections.
16014 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16015 readelf rather than objdump.
16016 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16017 .interp section and PT_INTERP segment are the same size.
16018 * testsuite/Makefile.in: Rebuild.
16019
99a37bfd
ILT
16020 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16021 aliases for symbols defined in the same object.
16022 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16023 (weak_alias_test_SOURCES): New variable.
16024 (weak_alias_test_DEPENDENCIES): New variable.
16025 (weak_alias_test_LDFLAGS): New variable.
16026 (weak_alias_test_LDADD): New variable.
16027 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16028 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16029 (weak_alias_test_3.o): New target.
16030 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16031 * testsuite/weak_alias_test_main.cc: New file.
16032 * testsuite/weak_alias_test_1.cc: New file.
16033 * testsuite/weak_alias_test_2.cc: New file.
16034 * testsuite/weak_alias_test_3.cc: New file.
16035
780e49c5
ILT
160362008-04-08 Ian Lance Taylor <iant@google.com>
16037
cdb0b8f5
ILT
16038 * options.h (class General_options): Add --noinhibit-exec option.
16039 * main.cc (main): Check --noinhibit-exec.
16040
0864d551
ILT
16041 * options.h (class General_options): Define --wrap as a special
16042 option. Add wrap_symbols_ field.
16043 (General_options::any_wrap_symbols): New function.
16044 (General_options::is_wrap_symbol): New function.
16045 * options.cc (General_options::parse_wrap): New function.
16046 (General_options::General_options): Initialize wrap_symbols_.
16047 * symtab.cc (Symbol_table::wrap_symbol): New function.
16048 (Symbol_table::add_from_object): Handle --wrap.
16049 * symtab.h (class Symbol_table): Declare wrap_symbol.
16050 * target.h (Target::wrap_char): New function.
16051 (Target::Target_info): Add wrap_char field.
16052 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16053 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16054 * testsuite/testfile.cc (Target_test::test_target_info):
16055 Likewise.
16056
789aa6de
ILT
16057 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16058 there is one.
16059
2c38906f
ILT
16060 * layout.h (class Layout): Add added_eh_frame_data_ field.
16061 * layout.cc (Layout::Layout): Initialize new field.
16062 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16063 output section until we find a section we merged successfully.
16064 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16065 that the size be non-zero.
16066
780e49c5
ILT
16067 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16068 qualifier.
16069
7fcd0256
ILT
160702008-04-08 Craig Silverstein <csilvers@google.com>
16071
16072 * configure.ac: Export new conditional variable HAVE_ZLIB.
16073 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16074 on HAVE_ZLIB.
16075 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16076 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16077
6835af53
ILT
160782008-04-07 Ian Lance Taylor <iant@google.com>
16079
e24f324c
ILT
16080 * version.cc (version_string): Set to "1.5".
16081
a036edd8
ILT
16082 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16083 Add issued_non_pic_error_ field. Declare check_non_pic.
16084 (Target_x86_64::Scan::check_non_pic): New function.
16085 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16086 (Target_x86_64::Scan::global): Likewise.
16087
624f8810
ILT
16088 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16089 addend parameter. Change caller. Handle merge sections.
16090 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16091 Address to Addend. Don't add in the result of
16092 local_section_offset, pass down the addend and use the returned
16093 value.
16094 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16095 Update declarations of local_section_offset and symbol_value.
16096 * testsuite/two_file_test_1.cc (t18): New function.
16097 * testsuite/two_file_test_2.cc (f18): New function.
16098 * testsuite/two_file_test_main.cc (main): Call t18.
16099 * testsuite/two_file_test.h (t18, f18): Declare.
16100
6835af53
ILT
16101 * configure.ac: Don't test for objdump, c++filt, or readelf.
16102 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16103 conditionals.
16104 (TEST_READELF): New variable.
16105 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16106 (check_PROGRAMS): Add two_file_strip_test.
16107 (two_file_strip_test): New target.
16108 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16109 (two_file_same_shared_strip_test_SOURCES): New variable.
16110 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16111 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16112 (two_file_same_shared_strip_test_LDADD): New variable.
16113 (two_file_shared_strip.so): New target.
16114 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16115 (ver_test_5.syms, ver_test_7.syms): Likewise.
16116 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16117 (strip_test_3.stdout): Use TEST_OBJDUMP.
16118 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16119
86925eef
CC
161202008-04-04 Cary Coutant <ccoutant@google.com>
16121
16122 * symtab.h (Symbol::is_weak_undefined): New function.
16123 (Symbol::is_strong_undefined): New function.
16124 (Symbol::is_absolute): New function.
16125 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16126 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16127 absolute symbols.
16128 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16129 (weak_undef_test): New target.
16130 * testsuite/Makefile.in: Rebuild.
16131 * testsuite/weak_undef_file1.cc: New file.
16132 * testsuite/weak_undef_file2.cc: New file.
16133 * testsuite/weak_undef_test.cc: New file.
16134
126f3ece
ILT
161352008-04-03 Craig Silverstein <csilvers@google.com>
16136
16137 * compressed_output.h (class Output_compressed_section): Use
16138 unsigned buffer.
16139 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16140 add zlib header.
16141 (zlib_compressed_suffix): Removed.
16142 (Output_compressed_section::set_final_data_size): Use unsigned
16143 buffers.
16144 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16145 Fix linker invocation.
16146 (flagstest_o_specialfile_and_compress_debug_sections):
16147 Likewise.
16148 * testsuite/Makefile.in: Regenerated.
16149
deae2a14
DM
161502008-04-02 David S. Miller <davem@davemloft.net>
16151
16152 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16153 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16154
70752818
ILT
161552008-04-02 Craig Silverstein <csilvers@google.com>
16156
16157 * TODO: New file.
16158
39d0cb0e
ILT
161592008-04-02 Ian Lance Taylor <iant@google.com>
16160
16161 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16162 parameters. Update for new key type to views_. Change all
16163 callers.
16164 (File_read::read): Adjust for byteshift in returned view.
16165 (File_read::add_view): New function, broken out of
16166 find_and_make_view.
16167 (File_read::make_view): New function, broken out of
16168 find_and_make_view.
16169 (File_read::find_or_make_view): Add offset and aligned
16170 parameters. Rewrite accordingly. Change all callers.
16171 (File_read::get_view): Add offset and aligned parameters. Adjust
16172 for byteshift in return value.
16173 (File_read::get_lasting_view): Likewise.
16174 * fileread.h (class File_read): Update declarations.
16175 (class File_read::View): Add byteshift_ field. Add byteshift to
16176 constructor. Add byteshift method.
16177 * archive.h (Archive::clear_uncached_views): New function.
16178 (Archive::get_view): Add aligned parameter. Change all callers.
16179 * object.h (Object::get_view): Add aligned parameter. Change all
16180 callers.
16181 (Object::get_lasting_view): Likewise.
16182
16183 * fileread.cc (File_read::release): Don't call clear_views if
16184 there are multiple objects.
16185 * fileread.h (File_read::clear_uncached_views): New function.
16186 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16187 on the archive.
16188
a1207466
CC
161892008-03-31 Cary Coutant <ccoutant@google.com>
16190
16191 Add thin archive support.
16192 * archive.cc (Archive::armagt): New const.
16193 (Archive::setup): Remove task parameter and calls to unlock.
16194 (Archive::unlock_nested_archives): New function.
16195 (Archive::read_header): Add nested_off parameter. Change
16196 all callers.
16197 (Archive::interpret_header): Likewise.
16198 (Archive::include_all_members): Change to handle thin
16199 archives.
16200 (Archive::include_member): Likewise.
16201 * archive.h (Archive::Archive): Add new parameters and
16202 initializers.
16203 (Archive::armagt): New const.
16204 (Archive::setup): Remove task parameter.
16205 (Archive::unlock_nested_archives): New function.
16206 (Archive::read_header): Add nested_off parameter.
16207 (Archive::interpret_header): Likewise.
16208 (Archive::Nested_archive_table): New typedef.
16209 (Archive::is_thin_archive_): New field.
16210 (Archive::nested_archives_): New field.
16211 (Archive::options_): New field.
16212 (Archive::dirpath_): New field.
16213 (Archive::task_): New field.
16214 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16215 for thin archives. Pass additional parameters to
16216 Archive::Archive. Unlock the archive file after calling
16217 Archive::setup.
cd536b21 16218
479f6503
ILT
162192008-03-29 Ian Lance Taylor <iant@google.com>
16220
686c8caf
ILT
16221 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16222 version symbol to be local.
16223 * testsuite/ver_test_4.sh: New file.
16224 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16225 (check_DATA): Add ver_test_4.syms.
16226 (ver_test_4.syms): New target.
16227 * testsuite/Makefile.in: Rebuild.
16228
ab794b6b
ILT
16229 * output.cc
16230 (Output_section::Input_section_sort_entry::has_priority): New
16231 function.
16232 (Output_section::Input_section_sort_entry::match_file_name): New
16233 function.
16234 (Output_section::Input_section_sort_entry::match_section_name):
16235 Remove.
16236 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16237 Remove.
16238 (Output_section::Input_section_sort_entry::match_section_file):
16239 Remove.
16240 (Output_section::Input_section_sort_compare::operator()): Rewrite
16241 using new Input_section_sort_entry functions. Sort crtbegin and
16242 crtend first. Sort sections with no priority before sections with
16243 a priority.
16244 * testsuite/initpri1.c (d3): Check j != 4.
16245 (cd5): New constructor/destructor function.
16246 (main): Check j != 2.
16247
479f6503
ILT
16248 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16249 new symbol when resolving, don't call set_is_default.
16250 * testsuite/ver_test_7.cc: New file.
16251 * testsuite/ver_test_7.sh: New file.
16252 * testsuite/Makefile.am (ver_test_7.so): New target.
16253 (ver_test_7.o): New target.
16254 (check_SCRIPTS): Add ver_test_7.sh.
16255 (check_DATA): Add ver_test_7.syms.
16256 (ver_test_7.syms): New target.
16257
2fd32231
ILT
162582008-03-28 Ian Lance Taylor <iant@google.com>
16259
16260 * layout.cc (Layout::layout): If we see an input section with a
16261 name that needs sorting, set the must_sort flag for the output
16262 section.
16263 (Layout::make_output_section): If the name of the output section
16264 indicates that it might require sorting, set the may_sort flag.
16265 * output.h (Output_section::may_sort_attached_input_sections): New
16266 function.
16267 (Output_section::set_may_sort_attached_input_sections): New
16268 function.
16269 (Output_section::must_sort_attached_input_sections): New
16270 function.
16271 (Output_section::set_must_sort_attached_input_sections): New
16272 function.
16273 (class Output_section): Declare Input_section_sort_entry. Define
16274 Input_section_sort_compare. Declare
16275 sort_attached_input_sections. Add new fields:
16276 may_sort_attached_input_sections_,
16277 must_sort_attached_input_sections_,
16278 attached_input_sections_are_sorted_.
16279 * output.cc (Output_section::Output_section): Initialize new
16280 fields.
16281 (Output_section::add_input_section): Add an entry to
16282 input_sections_ if may_sort or must_sort are true.
16283 (Output_section::set_final_data_size): Call
16284 sort_attached_input_sections if necessary.
16285 (Output_section::Input_section_sort_entry): Define new class.
16286 (Output_section::Input_section_sort_compare::operator()): New
16287 function.
16288 (Output_section::sort_attached_input_sections): New function.
16289 * configure.ac: Check whether the compiler supports constructor
16290 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16291 * testsuite/initpri1.c: New file.
16292 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16293 CONSTRUCTOR_PRIORITY.
16294 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16295 (initpri1_LDFLAGS): New variable.
16296 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16297
18e6b24e
ILT
162982008-03-27 Ian Lance Taylor <iant@google.com>
16299
49bdd526
ILT
16300 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16301 * testsuite/common_test_1.c: New file.
16302 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16303 (common_test_1_SOURCES): New variable.
16304 (common_test_1_DEPENDENCIES): New variable.
16305 (common_test_1_LDFLAGS): New variable.
16306
18e6b24e
ILT
16307 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16308 and commons_ correctly when NAME/VERSION does not override
16309 NAME/NULL.
16310 * testsuite/ver_test_6.c: New file.
16311 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16312 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16313 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16314
04bf7072
ILT
163152008-03-26 Ian Lance Taylor <iant@google.com>
16316
5871526f
ILT
16317 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16318 of an undefined symbol from a version script.
16319 * testsuite/Makefile.am (ver_test_5.so): New target.
16320 (ver_test_5.o): New target.
16321 (check_SCRIPTS): Add ver_test_5.sh.
16322 (check_DATA): Add ver_test_5.syms.
16323 (ver_test_5.syms): New target.
16324 * testsuite/ver_test_5.cc: New file.
16325 * testsuite/ver_test_5.script: New file.
16326 * testsuite/ver_test_5.sh: New file.
16327 * Makefile.in, testsuite/Makefile.in: Rebuild.
16328
04bf7072
ILT
16329 PR gold/5986
16330 Fix problems building gold with gcc 4.3.0.
16331 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16332 (gold_error_at_location, gold_warning_at_location): Use it.
16333 * configure.ac: Check whether we can compile and use a template
16334 function with a printf attribute.
16335 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16336 when jumping over bytes.
16337 * object.cc: Instantiate Object::read_section_data.
16338 * debug.h: Include <cstring>
16339 * dwarf_reader.cc: Include <algorithm>
16340 * main.cc: Include <cstring>.
16341 * options.cc: Include <cstring>.
16342 * output.cc: Include <cstring>.
16343 * script.cc: Include <cstring>.
16344 * script.h: Include <string>.
16345 * symtab.cc: Include <cstring> and <algorithm>.
16346 * target-select.cc: Include <cstring>.
16347 * version.cc: Include <string>.
16348 * testsuite/testmain.cc: Include <cstdlib>.
16349 * configure, config.in: Rebuild.
16350
874c5b28
ILT
163512008-03-25 Ian Lance Taylor <iant@google.com>
16352
819d6c3a
ILT
16353 * options.cc: Include "../bfd/bfdver.h".
16354 (options::help): Print bug reporting address.
16355
f4b2c6f5
ILT
16356 * version.cc (print_version): Adjust output for current value of
16357 BFD_VERSION_STRING.
16358
16359 * NEWS: New file.
16360
e96caa79
ILT
16361 * options.cc (options::help): Print list of supported targets.
16362 * target-select.h: Include <vector>.
16363 (class Target_selector): Make machine_, size_, and is_big_endian_
16364 fields const. Add bfd_name_ and instantiated_target_ fields.
16365 (Target_selector::Target_selector): Add bfd_name parameter.
16366 (Target_selector::recognize): Make non-virtual, call
16367 do_recognize.
16368 (Target_selector::recognize_by_name): Make non-virtual, call
16369 do_recognize_by_name.
16370 (Target_selector::supported_names): New function.
16371 (Target_selector::bfd_name): New function.
16372 (Target_selector::do_instantiate_target): New pure virtual
16373 function.
16374 (Target_selector::do_recognize): New virtual function.
16375 (Target_selector::do_recognize_by_name): New virtual function.
16376 (Target_selector::instantiate_target): New private function.
16377 (supported_target_names): Declare.
16378 * target-select.cc (Target_selector::Target_selector): Update for
16379 new parameter and fields.
16380 (select_target_by_name): Check that the name matches before
16381 calling recognize_by_name.
16382 (supported_target_names): New function.
16383 * i386.cc (class Target_selector_i386): Update Target_selector
16384 constructor call. Remove recognize and recognize_by_name. Add
16385 do_instantiate_target.
16386 * x86_64.cc (class Target_selector_x86_64): Likewise.
16387 * testsuite/testfile.cc (class Target_selector_test): Update for
16388 changes to Target_selector.
16389
874c5b28
ILT
16390 * README: Rewrite, with some notes on unsupported features.
16391
0a65a3a7
CC
163922008-03-24 Cary Coutant <ccoutant@google.com>
16393
16394 * i386.cc (Target_i386::Got_type): New enum declaration.
16395 (Target_i386::Scan::local): Updated callers of Output_data_got
16396 member functions.
16397 (Target_i386::Scan::global): Likewise.
16398 (Target_i386::Relocate::relocate): Likewise.
16399 (Target_i386::Relocate::relocate_tls): Likewise.
16400 * object.h (Got_offset_list): New class.
16401 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16402 (Sized_relobj::local_got_offset): Likewise.
16403 (Sized_relobj::set_local_got_offset): Likewise.
16404 (Sized_relobj::local_has_tls_got_offset): Removed.
16405 (Sized_relobj::local_tls_got_offset): Removed.
16406 (Sized_relobj::set_local_tls_got_offset): Removed.
16407 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16408 * output.cc (Output_data_got::add_global): Added got_type parameter.
16409 (Output_data_got::add_global_with_rel): Likewise.
16410 (Output_data_got::add_global_with_rela): Likewise.
16411 (Output_data_got::add_global_pair_with_rel): New function.
16412 (Output_data_got::add_global_pair_with_rela): New function.
16413 (Output_data_got::add_local): Added got_type parameter.
16414 (Output_data_got::add_local_with_rel): Likewise.
16415 (Output_data_got::add_local_with_rela): Likewise.
16416 (Output_data_got::add_local_pair_with_rel): New function.
16417 (Output_data_got::add_local_pair_with_rela): New function.
16418 (Output_data_got::add_global_tls): Removed.
16419 (Output_data_got::add_global_tls_with_rel): Removed.
16420 (Output_data_got::add_global_tls_with_rela): Removed.
16421 (Output_data_got::add_local_tls): Removed.
16422 (Output_data_got::add_local_tls_with_rel): Removed.
16423 (Output_data_got::add_local_tls_with_rela): Removed.
16424 * output.h (Output_data_got::add_global): Added got_type parameter.
16425 (Output_data_got::add_global_with_rel): Likewise.
16426 (Output_data_got::add_global_with_rela): Likewise.
16427 (Output_data_got::add_global_pair_with_rel): New function.
16428 (Output_data_got::add_global_pair_with_rela): New function.
16429 (Output_data_got::add_local): Added got_type parameter.
16430 (Output_data_got::add_local_with_rel): Likewise.
16431 (Output_data_got::add_local_with_rela): Likewise.
16432 (Output_data_got::add_local_pair_with_rel): New function.
16433 (Output_data_got::add_local_pair_with_rela): New function.
16434 (Output_data_got::add_global_tls): Removed.
16435 (Output_data_got::add_global_tls_with_rel): Removed.
16436 (Output_data_got::add_global_tls_with_rela): Removed.
16437 (Output_data_got::add_local_tls): Removed.
16438 (Output_data_got::add_local_tls_with_rel): Removed.
16439 (Output_data_got::add_local_tls_with_rela): Removed.
16440 * resolve.cc (Symbol::override_base_with_special): Removed
16441 reference to has_got_offset_ field.
16442 * symtab.cc (Symbol::init_fields): Replaced initialization
16443 of got_offset_ with got_offsets_. Removed initialization
16444 of has_got_offset_
53fcba31 16445 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16446 (Symbol::got_offset): Likewise.
16447 (Symbol::set_got_offset): Likewise.
16448 (Symbol::has_tls_got_offset): Removed.
16449 (Symbol::tls_got_offset): Removed.
16450 (Symbol::set_tls_got_offset): Removed.
16451 (Symbol::got_offset_): Removed.
16452 (Symbol::tls_mod_got_offset_): Removed.
16453 (Symbol::tls_pair_got_offset_): Removed.
16454 (Symbol::got_offsets_): New field.
16455 (Symbol::has_got_offset): Removed.
16456 (Symbol::has_tls_mod_got_offset): Removed.
16457 (Symbol::has_tls_pair_got_offset): Removed.
16458 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16459 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16460 member functions.
16461 (Target_x86_64::Scan::global): Likewise.
16462 (Target_x86_64::Relocate::relocate): Likewise.
16463 (Target_x86_64::Relocate::relocate_tls): Likewise.
16464
bd52eafb
BE
164652008-03-25 Ben Elliston <bje@au.ibm.com>
16466
16467 * yyscript.y: Fix spelling error in comment.
16468
8b105e34
ILT
164692008-03-24 Ian Lance Taylor <iant@google.com>
16470
8ed814a9
ILT
16471 * options.h (class General_options): Define build_id option.
16472 * layout.h (class Layout): Declare write_build_id, create_note,
16473 create_build_id. Add build_id_note_ member.
16474 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16475 "libiberty.h", "md5.h", "sha1.h".
16476 (Layout::Layout): Initialize eh_frame_data_,
16477 eh_frame_hdr_section_, and build_id_note_.
16478 (Layout::finalize): Call create_build_id.
16479 (Layout::create_note): New function, broken out of
16480 Layout::create_gold_note.
16481 (Layout::create_gold_note): Call create_note.
16482 (Layout::create_build_id): New function.
16483 (Layout::write_build_id): New function.
16484 (Close_task_runner::run): Call write_build_id.
16485
8b105e34
ILT
16486 * x86_64.cc: Correct license to GPLv3.
16487
086a1841
ILT
164882008-03-23 Ian Lance Taylor <iant@google.com>
16489
16490 * options.cc: Include "demangle.h".
16491 (parse_optional_string): New function.
16492 (parse_long_option): Handle takes_optional_argument.
16493 (parse_short_option): Update dash_z initializer. Handle
16494 takes_optional_argument.
16495 (General_options::General_options): Initialize do_demangle_.
16496 (General_options::finalize): Set do_demangle_. Handle demangling
16497 style.
16498 * options.h (parse_optional_string): Declare.
16499 (struct One_option): Add optional_arg field. Update constructor.
16500 Update call constructor calls. Add takes_optional_argument
16501 function.
16502 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16503 (DEFINE_optional_string): Define.
16504 (General_options::demangle): Change from DEFINE_bool to
16505 DEFINE_optional_string.
16506 (General_options::no_demangle): New function.
16507 (General_options::do_demangle): New function.
16508 (General_options::set_do_demangle): New function.
16509 (General_options::execstack_status_): Move definition to end of
16510 class definition.
16511 (General_options::static_): Likewise.
16512 (General_options::do_demangle_): New field.
16513 * object.cc (big_endian>::get_symbol_location_info): Call
16514 Options::do_demangle, not Options::demangle.
16515 * symtab.cc (demangle): Likewise.
16516
cbb93e63
ILT
165172008-03-22 Ian Lance Taylor <iant@google.com>
16518
16519 * gold.h: Include <cstddef> and <sys/types.h>
16520 * options.h: Include <cstring>.
16521
ec531623
ILT
165222008-03-21 Ian Lance Taylor <iant@google.com>
16523
16524 * Added source code to GNU binutils.
752937aa 16525\f
b90efa5b 16526Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
16527
16528Copying and distribution of this file, with or without modification,
16529are permitted in any medium without royalty provided the copyright
16530notice and this notice are preserved.
16531
16532Local Variables:
16533mode: change-log
16534left-margin: 8
16535fill-column: 74
16536version-control: never
16537End:
This page took 1.053466 seconds and 4 git commands to generate.